bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / feature / corner / corner_orientations
function
skimage.feature.corner:corner_orientations
source: /dev/scikit-image/src/skimage/feature/corner.py :1295
Signature
def corner_orientations ( image , corners , mask ) Summary
Compute the orientation of corners.
Extended Summary
The orientation of corners is computed using the first order central moment i.e. the center of mass approach. The corner orientation is the angle of the vector from the corner coordinate to the intensity centroid in the local neighborhood around the corner calculated using first order central moment.
Parameters
image: (M, N) arrayInput grayscale image.
corners: (K, 2) arrayCorner coordinates as
(row, col).mask: 2D arrayMask defining the local neighborhood of the corner used for the calculation of the central moment.
Returns
orientations: (K, 1) arrayOrientations of corners in the range [-pi, pi].
Examples
from skimage.morphology import octagon from skimage.feature import (corner_fast, corner_peaks, corner_orientations) square = np.zeros((12, 12)) square[3:9, 3:9] = 1 square.astype(int) corners = corner_peaks(corner_fast(square, 9), min_distance=1) corners orientations = corner_orientations(square, corners, octagon(3, 2)) np.rad2deg(orientations)✓
Aliases
-
skimage.feature.corner_orientations