d2ddd: Expand a 1-channel image to 3 channels

Description Usage Arguments Details Value See Also Examples

Description

This function converts a 1-channel image (binary, grayscale or numeric) to a 3-channels image (rgb or numeric) by triplicating the current channel. For instance, this function can be used to convert a 1-channel binary mask to a 3-channels mask.

Usage

1

Arguments

image

A 1-channel vpImage object to convert to 3 channels.

Details

The vpImage object created by the d2ddd function is not a persistent object, but a pointer to a C++ object that cannot be saved for reuse in a different session.

Value

This function returns a vpImage object.

See Also

ddd2d, vpImage

Examples

1
2
3
4
5
6
7
filename <- system.file("sample_img/SampleVideo_1080x720_5mb.png", package = "videoplayR")
img <- readImg(filename)
imshow(img)
mat <- matrix(0, nrow = img$dim[1], ncol = img$dim[2])
mat[80:640, 250:650] <- 1
mask <- d2ddd(r2img(mat))
imshow(blend(img, mask, "*"))

swarm-lab/videoplayR documentation built on May 30, 2019, 9:36 p.m.