maxima_detection {lidaRtRee}R Documentation

Local maxima extraction on image

Description

Variable window size maxima detection is performed on the image to extract local maxima position and calculate the window size where they are global maxima. Gaussian white noise is added to the image to avoid adjacent maxima due to neighbor pixels with identical value.

Usage

maxima_detection(dem, dem.res = 1, max.width = 11, jitter = TRUE)

Arguments

dem

cimg object (e.g. as created by cimg) or SpatRaster object (e.g. obtained with rast)

dem.res

numeric. image resolution, in case dem is a SpatRaster object, dem.res is extracted from the object by res

max.width

numeric. maximum kernel width to check for local maximum, in pixels if dem is a cimg, in SpatRaster units otherwise

jitter

boolean. indicates if noise should be added to image values to avoid adjacent maxima due to the adjacent pixels with equal values

Value

A cimg object / SpatRaster object which values correspond to the radius (n) in pixels / meters of the square window (width 2n+1) where the center pixel is global maximum (tested up to the max.width parameter)

See Also

dem_filtering, maxima_selection, tree_segmentation

Examples

data(chm_chablais3)
chm_chablais3 <- terra::rast(chm_chablais3)

# maxima detection
maxi <- maxima_detection(chm_chablais3)

# plot original image
terra::plot(chm_chablais3, main = "Initial image")

# plot maxima image
terra::plot(maxi, main = "Local maxima")

[Package lidaRtRee version 4.0.5 Index]