if (FALSE) {
caim <- read_caim()
r <- caim$Blue %>% normalize()
caim <- normalize(caim, 0, 20847, TRUE)
z <- zenith_image(ncol(caim), lens())
a <- azimuth_image(z)
m <- !is.na(z)
bin <- ootb_obia(caim, z, a, m, HSV(239, 0.85, 0.5), gamma = NULL)
g <- sky_grid_segmentation(z, a, 3)
sky_points <- extract_sky_points(r, bin, g,
dist_to_plant = 5,
min_raster_dist = 5)
rl <- extract_rl(r, z, a, sky_points)
model <- fit_coneshaped_model(rl$sky_points)
summary(model$model)
sky <- model$fun(z, a)
sky <- fit_trend_surface(sky, z, a, !is.na(z))$image
plot(r/sky)
x <- predict(model$model)
y <- predict(model$model) + model$model$residuals
mblt <- coefficients(lm(x~y))
g <- sky_grid_segmentation(z, a, 10)
bin <- find_sky_pixels_nonnull(r, sky, g, mblt[1], mblt[2], w = 0.1)
plot(bin)
}
Run the code above in your browser using DataLab