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