View source: R/optim_normalize.R
optim_normalize | R Documentation |
normalize_minmax()
Wrapper function for stats::optim()
. Optimize the mx
argument of the
function normalize_minmax()
by maximizing colorfulness()
and minimizing
saturation.
optim_normalize(caim, bin, method = "BFGS")
caim |
SpatRaster. The output of |
bin |
SpatRaster. This should be a preliminary binarization of
|
method |
The method to be used. See ‘Details’. Can be abbreviated. |
Numeric vector of length one. The values for using as mx
argument
with normalize_minmax()
.
Other Tool Functions:
calc_oor_index()
,
calc_spherical_distance()
,
colorfulness()
,
correct_vignetting()
,
defuzzify()
,
display_caim()
,
extract_dn()
,
extract_feature()
,
extract_rel_radiance()
,
extract_sky_points()
,
extract_sun_coord()
,
find_sky_pixels()
,
masking()
,
optim_dist_to_black()
,
percentage_of_clipped_highlights()
,
read_bin()
,
read_caim()
,
read_caim_raw()
,
read_ootb_sky_model()
,
sor_filter()
,
vicinity_filter()
,
write_bin()
,
write_caim()
,
write_ootb_sky_model()
## 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_minmax(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_minmax(caim, mx = mx, force_range = TRUE)
plotRGB(ncaim*255)
plotRGB(normalize_minmax(caim)*255)
percentage_of_clipped_highlights(ncaim$Blue, m)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.