View source: R/rem_isolated_black_pixels.R
rem_isolated_black_pixels | R Documentation |
Replace single black pixels (FALSE
) that are fully surrounded by white
pixels (TRUE
) with white. Uses 8-connectivity.
rem_isolated_black_pixels(bin)
bin |
logical terra::SpatRaster with a single layer. |
Logical terra::SpatRaster of one layer.
## Not run:
caim <- read_caim()
r <- caim$Blue
z <- zenith_image(ncol(caim), lens())
a <- azimuth_image(z)
path <- system.file("external/example.txt", package = "rcaiman")
sky <- read_sky_cie(gsub(".txt", "", path), caim$Blue, z, a)
plot(sky$rr_raster)
sky <- sky$rr_raster * sky$model$rr$zenith_dn
bin <- binarize_with_thr(r / sky, 0.9)
plot(bin)
bin2 <- rem_isolated_black_pixels(bin)
plot(bin2)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.