rem_isolated_black_pixels: Remove isolated black pixels

View source: R/rem_isolated_black_pixels.R

rem_isolated_black_pixelsR Documentation

Remove isolated black pixels

Description

Remove isolated black pixels

Usage

rem_isolated_black_pixels(bin)

Arguments

bin

SpatRaster. Binarized canopy image.

Value

An object of class SpatRaster with values 0 and 1.

See Also

Other Binarization Functions: apply_thr(), obia(), ootb_mblt(), ootb_obia(), regional_thresholding(), thr_isodata(), thr_mblt()

Examples

## Not run: 
caim <- read_caim()
r <- caim$Blue
z <- zenith_image(ncol(caim), lens())
a <- azimuth_image(z)

path <- system.file("external/ootb_sky.txt", package = "rcaiman")
sky <- read_ootb_sky_model(gsub(".txt", "", path), z, a)

bin <- apply_thr(r/sky$sky, 0.9)
plot(bin)
bin2 <- rem_isolated_black_pixels(bin)
plot(bin2)
plot(bin2 - bin)

## End(Not run)

GastonMauroDiaz/rcaiman documentation built on April 14, 2025, 9:39 a.m.