Removes abnormalities (clipped/debris) from image.
objectCleanse(mat, msk, add_noise = TRUE, random_seed = NULL, bg = 0, sd = 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].
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 list of elements to pass to set.seed or a single value, interpreted as an integer, or NULL to be used when 'add_noise' is set to TRUE. Default is NULL. Note that NA_integer_ or list(seed = NA_integer_) can be used to not call set.seed at all.
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.