Learn R Programming

videoplayR (version 0.3.1)

blend: Element-wise operations on image objects

Description

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

Usage

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 "/"

Value

This function returns a vpImage object.

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.

See Also

vpImage

Examples

Run this code
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, "*"))

Run the code above in your browser using DataLab