Removes abnormalities (clipped/debris) from image.
objectCleanse(mat, msk, add_noise = TRUE, random_seed = NULL, bg = 0, sd = 0)
a numeric matrix (image).
a numeric matrix (mask identifying abnormalities).
if TRUE adds normal noise to background using rnorm(), from Rcpp. Default is TRUE.
a single value, interpreted as an integer, or NULL to be used with set.seed() from base when 'add_noise' is set to TRUE. Default is NULL.
mean value of the background added if add_noise is TRUE. Default is 0.
standard deviation of the background added if add_noise is TRUE. Default is 0.
According to msk, pixel values in mat are substituted by either bg [add_noise == FALSE] or rnorm(n = prod(dim(mat), mean=bg, sd=sd)) [add_noise == TRUE].