local_fuzzy_thresholding | R Documentation |
This function was first presented in \insertCiteDiaz2015;textualrcaiman.
It uses a threshold value as the location parameter of a logistic membership
function whose scale parameter depends on a variable, here named mem
. This
dependence can be explained as follows: if the variable is equal to 1
, then
the membership function is same as a threshold function because the scale
parameter is 0
; lowering the variable increases the scale parameter, thus
blurring the threshold because it decreases the steepness of the curve. Since
the variable is defined pixel by pixel, this should be considered as a
local fuzzy thresholding method.
local_fuzzy_thresholding(lightness, m, mem, thr = NULL, fuzziness = NULL)
lightness |
SpatRaster. A normalized greyscale image (see
|
m |
SpatRaster. A mask. For hemispherical photographs,
check |
mem |
SpatRaster. It is the scale parameter of the logistic
membership function. Typically it is obtained with |
thr |
Numeric vector of length one. Location parameter of the logistic
membership function. Use |
fuzziness |
Numeric vector of length one. This number is a constant
value that scales |
Argument m
can be used to affect the automatic estimation of thr
and
fuzziness
.
If you use this function in your research, please cite
\insertCiteDiaz2015;textualrcaiman in addition to this package
(citation("rcaiman"
).
An object of class SpatRaster with same pixel dimensions than
caim
. Depending on mem
, changes could be subtle.
Other Pre-processing Functions:
enhance_caim()
,
gbc()
,
membership_to_color()
,
normalize()
## Not run:
caim <- read_caim()
z <- zenith_image(ncol(caim), lens())
a <- azimuth_image(z)
caim <- normalize(caim)
# ImageJ can be used to digitize points
path <- system.file("external/sky_points.csv",
package = "rcaiman")
img_points <- read.csv(path)
img_points <- img_points[c("Y", "X")]
colnames(img_points) <- c("row", "col")
head(img_points)
target_color <- extract_dn(caim, img_points, fun = median)
as(target_color, "HSV")
target_color <- HSV(240, 0.85, 0.5) #to increase saturation
mem <- membership_to_color(caim, target_color)
mem_thr <- local_fuzzy_thresholding(mean(caim), m, mem$membership_to_grey)
plot(mem_thr)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.