delete_rect: rectangular hole in image

View source: R/models.R

delete_rectR Documentation

rectangular hole in image

Description

creates a rectangular hole in the image with the specified dimensions

Usage

delete_rect(image,i,j,width,height)

Arguments

image

image to be modified, it has to be a 3D array proceed with readImage function from EBImage package

i

row index of the upper left corner of the rectangle

j

column index of the upper left corner of the rectangle

width

width of the rectangle

height

height of the rectangle

Details

delete_rect

Value

a 3D array with pixels in the hole set to -100 and the rest of the image pixels unchanged

Examples

image<-EBImage::readImage(system.file("extdata", "bird.jpg", package = "ProxReg"))
image_noise<-delete_rect(image,160,160,20,20)
image_noise<-EBImage::Image(image_noise,colormode = "Color")
EBImage::display(image_noise)

ProxReg documentation built on April 3, 2025, 9:21 p.m.