membership_to_color {rcaiman} | R Documentation |
Compute the membership to a target color
Description
This function was first presented in Díaz and Lencinas (2015). 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)
Arguments
caim |
SpatRaster. The return of a call to |
target_color |
|
sigma |
Numeric vector of length one. Use |
Details
If you use this function in your research, please cite
Díaz and Lencinas (2015) in addition to this package
(citation("rcaiman"
).
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
.
References
Díaz GM, Lencinas JD (2015). “Enhanced gap fraction extraction from hemispherical photography.” IEEE Geoscience and Remote Sensing Letters, 12(8), 1785–1789. doi:10.1109/lgrs.2015.2425931.
See Also
Other Pre-processing Functions:
enhance_caim()
,
gbc()
,
local_fuzzy_thresholding()
,
normalize()
Examples
## Not run:
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)
## End(Not run)