Learn R Programming

rcaiman (version 1.2.2)

membership_to_color: Compute the membership to a target color

Description

This function was first presented in Diaz2015;textualrcaiman. It computes the degree of membership to a color using two Gaussian membership functions and the axes A and B from the CIE LAB color space. The lightness dimension is not considered in the calculations.

Usage

membership_to_color(caim, target_color, sigma = NULL)

Value

It returns an object from the class SpatRaster. First layer is the membership to the target color. Second layer is the membership to grey. Both memberships are calculated with same sigma.

Arguments

caim

SpatRaster. The return of a call to read_caim() or read_caim_raw().

target_color

color.

sigma

Numeric vector of length one. Use NULL (default) to estimate it automatically as the euclidean distance between target_color and grey in the CIE LAB color space.

Details

If you use this function in your research, please cite Diaz2015;textualrcaiman in addition to this package (citation("rcaiman").

References

See Also

Other Pre-processing Functions: enhance_caim(), gbc(), local_fuzzy_thresholding(), normalize()

Examples

Run this code
if (FALSE) {
caim <- read_caim() %>% normalize
z <- zenith_image(ncol(caim), lens())
a <- azimuth_image(z)
m <- !is.na(z)

sky_blue <- HSV(239, 0.85, 0.5)
mem <- membership_to_color(caim, sky_blue)
plot(mem)
}

Run the code above in your browser using DataLab