Feature¶
geoops.feature wraps skimage.feature detectors as carrier-aware Operators. Inputs are
GeoArray; coordinate outputs (peaks, blobs, corners) are returned as GeoDataFrames in the input
CRS so they compose with the rest of the geospatial stack.
Operators in this module:
- Edges / corners:
Canny,CornerHarris - Blobs:
BlobDOG,BlobLoG,BlobDoH - Local features:
PeakLocalMax,StructureTensor,MultiscaleBasicFeatures,HOG - Hough transforms:
HoughLines,HoughCircles
Tier-A primitives for the dense maps: canny_edges, structure_tensor_eigvals,
multiscale_features. Blob detectors return the same row / col / sigma / radius columns
whether or not anything is detected.
Operators that emit vector coordinates use gt.transform to project pixel (row, col) into world
(x, y) before constructing the output GeoDataFrame.
geoops.feature
¶
Sparse feature, edge, texture, and Hough operators.
BlobDOG
¶
Bases: _BlobBase
Blob detection via Difference of Gaussian.
See :class:_BlobBase for the shared parameters and carrier
behavior (GeoArray-only).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma_ratio
|
float
|
Ratio between the sigmas of successive Gaussians. |
1.6
|
Source code in packages/geotoolz-ops/src/geoops/feature/_src/operators.py
BlobDoH
¶
Bases: _BlobBase
Blob detection via Determinant of Hessian.
Unlike LoG/DoG, blob_doh already returns sigma values that
approximate blob radii directly, so no sqrt(2) scaling is
applied when populating the radius column.
See :class:_BlobBase for the shared parameters and carrier
behavior (GeoArray-only).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_sigma
|
int
|
Number of sigma steps between |
10
|
Source code in packages/geotoolz-ops/src/geoops/feature/_src/operators.py
BlobLoG
¶
Bases: _BlobBase
Blob detection via Laplacian of Gaussian.
See :class:_BlobBase for the shared parameters and carrier
behavior (GeoArray-only).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_sigma
|
int
|
Number of sigma steps between |
10
|
Source code in packages/geotoolz-ops/src/geoops/feature/_src/operators.py
Canny
¶
Bases: Operator
Canny edge detection returning a boolean edge map.
Wraps :func:skimage.feature.canny over a single-band (H, W) or
(1, H, W) image. Accepts a GeoArray or a plain
np.ndarray and returns a boolean edge map in the same carrier
kind; nodata input pixels are False and a GeoArray output
declares fill_value=False.
The input is handed to skimage in its own dtype, so the result is
identical to skimage.feature.canny on the same array. skimage
rescales the image with img_as_float internally, which makes the
threshold units dtype-dependent:
- integer input (e.g.
uint16DN): explicit thresholds are in input units (DN), and theNonedefaults are 10 % / 20 % of the dtype maximum (6553.5/13107foruint16); - float input: thresholds are absolute gradient magnitudes and the
Nonedefaults are0.1/0.2— sensible for[0, 1]reflectance, too low for unscaled float DN.
int64 / uint64 input, which skimage rejects, is cast to
float64 first and so follows the float convention.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma
|
float
|
Width of the Gaussian smoothing kernel, in pixels. |
1.0
|
low_threshold
|
float | None
|
Lower hysteresis threshold, in the units above;
|
None
|
high_threshold
|
float | None
|
Upper hysteresis threshold, in the units above;
|
None
|
Source code in packages/geotoolz-ops/src/geoops/feature/_src/operators.py
CornerHarris
¶
Bases: Operator
Harris corner response plus peak selection as point features.
Runs :func:skimage.feature.corner_harris then
:func:skimage.feature.corner_peaks over a single-band (H, W)
or (1, H, W) image and returns a GeoDataFrame with
row/col pixel indices, the Harris response, and a
Point geometry in world coordinates. Geo-dependent: requires a
georeferenced GeoArray input (plain arrays raise TypeError).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
min_distance
|
int
|
Minimum pixel distance between reported corners. |
1
|
threshold_rel
|
float
|
Minimum response relative to the strongest corner. |
0.1
|
Raises:
| Type | Description |
|---|---|
TypeError
|
If the input is not a georeferenced GeoArray. |
Source code in packages/geotoolz-ops/src/geoops/feature/_src/operators.py
HOG
¶
Bases: Operator
Histogram of Oriented Gradients descriptor.
Wraps :func:skimage.feature.hog over a single-band (H, W) or
(1, H, W) image. The output is a flat 1-D feature vector (a
plain np.ndarray), so both GeoArray and plain-array
carriers are accepted.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
orientations
|
int
|
Number of orientation histogram bins. |
9
|
pixels_per_cell
|
tuple[int, int]
|
Cell size in pixels, |
(8, 8)
|
cells_per_block
|
tuple[int, int]
|
Block size in cells, |
(3, 3)
|
Source code in packages/geotoolz-ops/src/geoops/feature/_src/operators.py
HoughCircles
¶
Bases: Operator
Detect circles with the circular Hough transform.
Runs :func:skimage.transform.hough_circle /
:func:~skimage.transform.hough_circle_peaks over a single-band
(H, W) or (1, H, W) image and returns a GeoDataFrame
with row/col centre pixels, radius and accumulator
columns, and a Point geometry in world coordinates.
Geo-dependent: requires a georeferenced GeoArray input (plain
arrays raise TypeError).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radii
|
list[int]
|
Candidate circle radii, in pixels. |
required |
total_num_peaks
|
int
|
Maximum number of circles to return. |
10
|
Raises:
| Type | Description |
|---|---|
TypeError
|
If the input is not a georeferenced GeoArray. |
Source code in packages/geotoolz-ops/src/geoops/feature/_src/operators.py
HoughLines
¶
Bases: Operator
Detect prominent straight lines with the Hough transform.
Runs :func:skimage.transform.hough_line /
:func:~skimage.transform.hough_line_peaks over a single-band
(H, W) or (1, H, W) image. The output is a plain
pd.DataFrame of pixel-space line parameters (accumulator,
angle, distance), so both GeoArray and plain-array
carriers are accepted.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_peaks
|
int
|
Maximum number of line peaks to return. |
10
|
Source code in packages/geotoolz-ops/src/geoops/feature/_src/operators.py
MultiscaleBasicFeatures
¶
Bases: Operator
General-purpose multiscale feature stack.
Wraps :func:skimage.feature.multiscale_basic_features over a
single-band (H, W) or (1, H, W) image. Accepts a
GeoArray or a plain np.ndarray and returns the (F, H, W)
channel-first feature stack in the same carrier kind; nodata input
pixels are NaN (fill_value=NaN).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
intensity
|
bool
|
Include Gaussian-smoothed intensity features. |
True
|
edges
|
bool
|
Include gradient-magnitude (edge) features. |
True
|
texture
|
bool
|
Include Hessian-eigenvalue (texture) features. |
True
|
sigma_min
|
float
|
Smallest smoothing scale, in pixels. |
0.5
|
sigma_max
|
float
|
Largest smoothing scale, in pixels. |
16.0
|
Source code in packages/geotoolz-ops/src/geoops/feature/_src/operators.py
PeakLocalMax
¶
Bases: Operator
Find local maxima and return point features with pixel scores.
Wraps :func:skimage.feature.peak_local_max over a single-band
(H, W) or (1, H, W) image and returns a GeoDataFrame
with row/col pixel indices, the peak score, and a
Point geometry in world coordinates. Geo-dependent: requires a
georeferenced GeoArray input (plain arrays raise TypeError).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
min_distance
|
int
|
Minimum pixel distance between reported peaks. |
1
|
threshold_abs
|
float | None
|
Minimum absolute intensity of a peak. |
None
|
threshold_rel
|
float | None
|
Minimum intensity relative to the image maximum. |
None
|
exclude_border
|
bool | int
|
Exclude peaks within this distance of the border
( |
True
|
Raises:
| Type | Description |
|---|---|
TypeError
|
If the input is not a georeferenced GeoArray. |
Source code in packages/geotoolz-ops/src/geoops/feature/_src/operators.py
StructureTensor
¶
Bases: Operator
Local structure-tensor eigenvalue stack.
Runs :func:skimage.feature.structure_tensor then
:func:skimage.feature.structure_tensor_eigenvalues over a
single-band (H, W) or (1, H, W) image. Accepts a
GeoArray or a plain np.ndarray and returns the (2, H, W)
eigenvalue stack in the same carrier kind; nodata input pixels are
NaN (fill_value=NaN).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma
|
float
|
Width of the Gaussian window used to average the gradient products, in pixels. |
1.0
|
Source code in packages/geotoolz-ops/src/geoops/feature/_src/operators.py
spatial_reach()
¶
canny_edges(image, *, sigma=1.0, low_threshold=None, high_threshold=None)
¶
Canny edge map of a single-band image (:func:skimage.feature.canny).
The image is handed to skimage in its own dtype, so thresholds follow
skimage's dtype-relative convention (input units for integers, with
None defaults of 10 % / 20 % of the dtype maximum; absolute
gradient magnitudes, defaults 0.1 / 0.2, for floats).
int64 / uint64, which skimage rejects, is cast to float64
first and so follows the float convention.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
Num[ndarray, 'h w']
|
|
required |
sigma
|
float
|
Width of the Gaussian smoothing kernel, in pixels. |
1.0
|
low_threshold
|
float | None
|
Lower hysteresis threshold; |
None
|
high_threshold
|
float | None
|
Upper hysteresis threshold; |
None
|
Returns:
| Type | Description |
|---|---|
Bool[ndarray, 'h w']
|
Boolean |
Examples:
Source code in packages/geotoolz-ops/src/geoops/feature/_src/array.py
multiscale_features(image, *, intensity=True, edges=True, texture=True, sigma_min=0.5, sigma_max=16.0)
¶
Channel-first :func:skimage.feature.multiscale_basic_features stack.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
Num[ndarray, 'h w']
|
|
required |
intensity
|
bool
|
Include Gaussian-smoothed intensity features. |
True
|
edges
|
bool
|
Include gradient-magnitude (edge) features. |
True
|
texture
|
bool
|
Include Hessian-eigenvalue (texture) features. |
True
|
sigma_min
|
float
|
Smallest smoothing scale, in pixels. |
0.5
|
sigma_max
|
float
|
Largest smoothing scale, in pixels. |
16.0
|
Returns:
| Type | Description |
|---|---|
Float[ndarray, 'f h w']
|
|
Examples:
>>> multiscale_features(np.random.rand(8, 8), edges=False,
... texture=False, sigma_max=2.0).shape[1:]
(8, 8)
Source code in packages/geotoolz-ops/src/geoops/feature/_src/array.py
structure_tensor_eigvals(image, *, sigma=1.0)
¶
Eigenvalues of the local structure tensor, largest first.
A = G_sigma * [[Iy^2, Iy*Ix], [Iy*Ix, Ix^2]], l1 >= l2
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
Num[ndarray, 'h w']
|
|
required |
sigma
|
float
|
Width of the Gaussian window averaging the gradient products, in pixels. |
1.0
|
Returns:
| Type | Description |
|---|---|
Float[ndarray, '2 h w']
|
|
Examples: