Skip to main content

Module gradient

Module gradient 

Source
Expand description

Gradient computation for edge refinement. Gradient computation for edge-based quad detection.

Structs§

Gradient
Gradient data for a single pixel.
LineSegment
A detected line segment.

Functions§

compute_sobel
Compute Sobel gradients for the entire image. Returns a flat array of Gradient structs.
extract_line_segments
Extract line segments from gradient image using a simplified LSD approach. This is a greedy region-growing algorithm on gradient direction.
find_first_quad_from_segments
Find quads by grouping 4 line segments that form a closed quadrilateral.
fit_quad_from_component
Fit a quad from a small component using on-demand gradient computation.
fit_quad_from_gradients
Fit a quad from boundary pixels using gradient direction clustering.