| polar_qtree | R Documentation |
Segment a hemispherical image into large circular trapezoids and recursively split them into four trapezoids of equal angular size whenever brightness heterogeneity exceeds a predefined threshold.
polar_qtree(r, z, a, scale_parameter, angle_width = 30, max_splittings = 6)
r |
numeric terra::SpatRaster. One or more layers used to drive heterogeneity. |
z |
terra::SpatRaster generated with |
a |
terra::SpatRaster generated with |
scale_parameter |
numeric vector of length one. Threshold on |
angle_width |
numeric vector of length one. Angle in deg that must
divide both 0–360 and 0–90 into an integer number of segments. Retrieve a
set of valid values by running
|
max_splittings |
numeric vector of length one. Maximum recursion depth. |
A circular trapezoid, hereafter referred to as a cell, is the
intersection of a ring (zenith‑angle band) and a sector (azimuth‑angle band).
Heterogeneity within a cell is measured as the standard deviation of pixel
values (a first‑order texture metric). The change in heterogeneity due to
splitting is delta, defined as the sum of the standard deviations of the
four subcells minus the standard deviation of the parent cell. A split is
kept where delta > scale_parameter. For multi‑layer r, delta is
computed per layer and averaged to decide splits. Angular resolution at level
i is angle_width / 2^i.
Single-layer terra::SpatRaster with integer values and the
same number of rows and columns as r.
## Not run:
# Find large patches of white ---------------------------------------------
caim <- read_caim()
r <- caim$Blue
z <- zenith_image(ncol(caim), lens())
a <- azimuth_image(z)
bin <- binarize_with_thr(r, thr_isodata(r[]))
plot(bin)
seg <- polar_qtree(bin, z, a, 0, 30, 3)
plot(extract_feature(bin, seg) == 1)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.