public abstract class GridRansacLineDetector<D extends boofcv.struct.image.ImageGray>
extends java.lang.Object
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.
| Modifier and Type | Field and Description |
|---|---|
protected org.ddogleg.struct.FastQueue<Edgel> |
edgels |
protected int |
maxDetectLines |
protected int |
minInlierSize |
protected int |
regionSize |
| Constructor and Description |
|---|
GridRansacLineDetector(int regionSize,
int maxDetectLines,
org.ddogleg.fitting.modelset.ModelMatcher<georegression.struct.line.LinePolar2D_F32,Edgel> robustMatcher)
Specifies major configuration parameters.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
detectEdgels(int index0,
int x0,
int y0,
D derivX,
D derivY,
boofcv.struct.image.GrayU8 binaryEdges)
Computes edgel information for pixels which have been flagged inside a region
|
MatrixOfList<georegression.struct.line.LineSegment2D_F32> |
getFoundLines()
Returns all the found line segments contained in a grid.
|
void |
process(D derivX,
D derivY,
boofcv.struct.image.GrayU8 binaryEdges)
Detects line segments through the image inside of grids.
|
protected int regionSize
protected int minInlierSize
protected org.ddogleg.struct.FastQueue<Edgel> edgels
protected int maxDetectLines
public GridRansacLineDetector(int regionSize,
int maxDetectLines,
org.ddogleg.fitting.modelset.ModelMatcher<georegression.struct.line.LinePolar2D_F32,Edgel> robustMatcher)
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.public void process(D derivX, D derivY, boofcv.struct.image.GrayU8 binaryEdges)
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.public MatrixOfList<georegression.struct.line.LineSegment2D_F32> getFoundLines()
protected abstract void detectEdgels(int index0,
int x0,
int y0,
D derivX,
D derivY,
boofcv.struct.image.GrayU8 binaryEdges)
index0 - 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