Check for a given mask pixel.idx-object if its edges are clean
Source:R/validate_mask_edges.R
validate_mask_edges.Rd
Check for a given spectrum's mask if the pixels on its edges are part of its masked spectrum. That would suggest that the bounding area was set too restrictively, cutting off pixels which are potentially valid for this mask.
Examples
if (FALSE) { # \dontrun{
# load a subset of an image
pixel.array <- duflor::load_image(image.path,
subset_only = T,
crop_left = 20,
crop_right = 20,
crop_bottom = 20,
crop_top = 20
)
# get pixels which belong to a given mask, and return the results for it
ret <- extract_pixels_HSV(pixel.array, lower_bound, upper_bound, F)
# check for each mask if its edges are valid.
for (mask in names(ret)) {
duflor:::validate_mask_edges(ret[[mask]]$pixel.idx,mask, dim(pixel.array)[1:2],image.path)
}
} # }