Class GridRansacLineDetector<D extends ImageGray<D>>
- Direct Known Subclasses:
ImplGridRansacLineDetector_F32
,ImplGridRansacLineDetector_S16
Line segment feature detector. The image is broken up into several regions of constant size.
Inside each region pixels that have been flaged as belonging to edges are connected into lines using RANSAC or
another ModelMatcher
. The output is a list of detected lines in a grid of lists. This algorithm
is inspired by [1], but has several differences in how the image is processed and how the output is produced.
The image is segmented into square regions of homogeneous size. Inside each region pixels which have been flagged as belonging to an edge are identified. Flagged edge pixels are referred to as "edgels" and have the image gradient at that point stored in their data structure. Gradient information is used to prune incompatible points from each other. RANSAC or similar algorithms are used to estimate and detect lines inside each region. Ones a line has been identified it is removed from the list of candidate points and more lines are searched for.
[1] J.C. Clarke, S. Carlsson, and A. Zisserman. "Detecting and tracking linear features efficiently" In. BMVC. British Machine Vision Association, 1996. 4,5,7.
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
protected int
protected int
-
Constructor Summary
ModifierConstructorDescriptionprotected
GridRansacLineDetector
(int regionSize, int maxDetectLines, ModelMatcher<LinePolar2D_F32, Edgel> robustMatcher) Specifies major configuration parameters. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
detectEdgels
(int index0, int x0, int y0, D derivX, D derivY, GrayU8 binaryEdges) Computes edgel information for pixels which have been flagged inside a regionReturns all the found line segments contained in a grid.void
Detects line segments through the image inside of grids.
-
Field Details
-
regionSize
protected int regionSize -
minInlierSize
protected int minInlierSize -
edgels
-
maxDetectLines
protected int maxDetectLines
-
-
Constructor Details
-
GridRansacLineDetector
protected GridRansacLineDetector(int regionSize, int maxDetectLines, ModelMatcher<LinePolar2D_F32, Edgel> robustMatcher) Specifies major configuration parameters.- Parameters:
regionSize
- Length of each side in a square region. Try 40.maxDetectLines
- Maximum number of lines which can be detected in a region. Try 10.robustMatcher
- Robust model matcher for line detection.
-
-
Method Details
-
process
Detects line segments through the image inside of grids.- Parameters:
derivX
- Image derivative along x-axis. Not modified.derivY
- Image derivative along x-axis. Not modified.binaryEdges
- True values indicate that a pixel is an edge pixel. Not modified.
-
getFoundLines
Returns all the found line segments contained in a grid.- Returns:
- Grid of detected lines.
-
detectEdgels
protected abstract void detectEdgels(int index0, int x0, int y0, D derivX, D derivY, GrayU8 binaryEdges) Computes edgel information for pixels which have been flagged inside a region- Parameters:
x0
- offset of region top left cornery0
- offset of region top left cornerderivX
- contains image derivative x-axisderivY
- contains image derivative y-axisbinaryEdges
- Mark indicting which pixels are edges along a line
-