blend: Element-wise operations on image objects

Description Usage Arguments Details Value See Also Examples

Description

This function performs element-wise operations on vpImage objects. Currently available operations are addition ("+"), subtraction ("-"), mutliplication ("*") and division ("/").

Usage

1
blend(image1, image2, operation)

Arguments

image1

First vpImage object.

image2

Second vpImage object.

operation

A character string describing the operation to be performed. Available operations are:

  • "addition" or "+"

  • "subtraction" or "-"

  • "multiplication" or "*"

  • "division" or "/"

Details

The vpImage object created by the thresholding 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

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.