optim_normalize {rcaiman} | R Documentation |
Optimize normalize parameters
Description
Wrapper function for bbmle::mle2()
. Optimize normalize parameters by
maximizing colorfulness()
and minimizing saturation.
Usage
optim_normalize(caim, bin, method = "BFGS")
Arguments
caim |
SpatRaster. The return of a call to |
bin |
SpatRaster. This should be a preliminary binarization of
|
method |
Optimization method to use. See |
Value
Numeric vector of length one. The values for using as mx
argument
with normalize()
.
See Also
Other Tool Functions:
colorfulness()
,
correct_vignetting()
,
defuzzify()
,
extract_dn()
,
extract_feature()
,
extract_rl()
,
extract_sky_points_simple()
,
extract_sky_points()
,
extract_sun_coord()
,
find_sky_pixels_nonnull()
,
find_sky_pixels()
,
masking()
,
percentage_of_clipped_highlights()
,
read_bin()
,
read_caim_raw()
,
read_caim()
,
write_bin()
,
write_caim()
Examples
## Not run:
caim <- read_caim()
z <- zenith_image(ncol(caim), lens())
a <- azimuth_image(z)
m <- !is.na(z)
mn <- quantile(caim$Blue[m], 0.01)
mx <- quantile(caim$Blue[m], 0.99)
r <- normalize(caim$Blue, mn, mx, TRUE)
bin <- find_sky_pixels(r, z, a)
mblt <- ootb_mblt(r, z, a, bin)
plot(mblt$bin)
mx <- optim_normalize(caim, mblt$bin)
ncaim <- normalize(caim, mx = mx, force_range = TRUE)
plotRGB(ncaim*255)
plotRGB(normalize(caim)*255)
percentage_of_clipped_highlights(ncaim$Blue, m)
## End(Not run)