masking: Image masking

maskingR Documentation

Image masking

Description

Image masking

Usage

masking(r, m, RGB = c(1, 0, 0))

Arguments

r

SpatRaster. The image. Values should be normalized, see normalize_minmax(). Only methods for images with one or three layers have been implemented.

m

SpatRaster. A mask. For hemispherical photographs, check select_sky_vault_region().

RGB

Numeric vector of length three. RGB color code. Red is the default color.

Value

An object of class SpatRaster that is r but with areas where m is equal to zero painted in a solid color. If r is a single layer image, then the layer is triplicated to allow the use of color.

See Also

select_sky_vault_region()

Other Tool Functions: calc_oor_index(), calc_spherical_distance(), colorfulness(), correct_vignetting(), defuzzify(), display_caim(), extract_dn(), extract_feature(), extract_rel_radiance(), extract_sky_points(), extract_sun_coord(), find_sky_pixels(), optim_dist_to_black(), optim_normalize(), percentage_of_clipped_highlights(), read_bin(), read_caim(), read_caim_raw(), read_ootb_sky_model(), sor_filter(), vicinity_filter(), write_bin(), write_caim(), write_ootb_sky_model()

Examples

## Not run: 
 r <- read_caim()
 z <- zenith_image(ncol(r), lens())
 a <- azimuth_image(z)
 m <- select_sky_vault_region(z, 20, 70) & select_sky_vault_region(a, 90, 180)

 masked_caim <-  masking(normalize_minmax(r), m)
 plotRGB(masked_caim * 255)

 masked_bin <- masking(apply_thr(r$Blue, 125), m)
 plotRGB(masked_bin * 255)
 
## End(Not run)


GastonMauroDiaz/rcaiman documentation built on April 14, 2025, 9:39 a.m.