defuzzify {rcaiman} | R Documentation |
Defuzzify a fuzzy classification
Description
This function translates degree of membership into Boolean logic using a
regional approach. The result will ensure that the fuzzy and Boolean version
will agree at the chosen level of aggregation (controlled by the argument
segmentation
). This method makes perfect sense to translate a subpixel
classification of gap fraction (or a linear ratio) into a binary product.
Usage
defuzzify(mem, segmentation)
Arguments
mem |
An object of the class SpatRaster. Degree of membership. |
segmentation |
An object of the class SpatRaster such as
the result of a call to |
Value
An object of the class SpatRaster containing binary information.
Note
This method is also available in the HSP software package (Lang et al. 2013).
References
Lang M, Kodar A, Arumäe T (2013). “Restoration of above canopy reference hemispherical image from below canopy measurements for plant area index estimation in forests.” Forestry Studies, 59(1), 13–27. doi:10.2478/fsmu-2013-0008.
See Also
Other Tool Functions:
colorfulness()
,
correct_vignetting()
,
extract_dn()
,
extract_feature()
,
extract_rl()
,
extract_sky_points_simple()
,
extract_sky_points()
,
extract_sun_coord()
,
find_sky_pixels_nonnull()
,
find_sky_pixels()
,
masking()
,
optim_normalize()
,
percentage_of_clipped_highlights()
,
read_bin()
,
read_caim_raw()
,
read_caim()
,
write_bin()
,
write_caim()
Examples
## Not run:
path <- system.file("external/DSCN4500.JPG", package = "rcaiman")
caim <- read_caim(path, c(1250, 1020) - 745, 745 * 2, 745 * 2)
z <- zenith_image(ncol(caim), lens("Nikon_FCE9"))
a <- azimuth_image(z)
r <- gbc(caim$Blue)
r <- correct_vignetting(r, z, c(0.0638, -0.101)) %>% normalize()
bin <- find_sky_pixels(r, z, a)
bin <- ootb_mblt(r, z, a, bin)
plot(bin$bin)
ratio <- r / bin$sky_s
ratio <- normalize(ratio, 0, 1, TRUE)
plot(ratio)
g <- sky_grid_segmentation(z, a, 10)
bin2 <- defuzzify(ratio, g)
plot(bin2)
plot(abs(bin$bin - bin2))
## End(Not run)