public class DetectCircleHexagonalGrid<T extends boofcv.struct.image.ImageGray<T>> extends DetectCircleGrid<T>
Detects a hexagonal circle grid. Circles are spaced such that center of each circle is the same distance from each of its five neighbors. Rows and columns are counted in a zig-zag pattern, see example below. When there is symmetric ambiguity the canonical orientation is used.
Canonical orientation is defined as having the rows/columns matched, element (0,0) being occupied. If there are multiple solution a solution will be selected which is in counter-clockwise order (image coordinates) and if there is still ambiguity the ellipse closest to the image origin will be selected as (0,0).
For each circle there is one control point. The control point is first found by detecting all the ellipses, which is what a circle appears to be under perspective distortion. The center the ellipse might not match the physical center of the circle. The intersection of lines does not change under perspective distortion. The outer common tangent lines between neighboring ellipses are found. Then the intersection of two such lines is found. This intersection will be the physical center of the circle.
KeyPointsCircleHexagonalGridellipseDetector, numCols, numRows| Constructor and Description |
|---|
DetectCircleHexagonalGrid(int numRows,
int numCols,
boofcv.abst.filter.binary.InputToBinary<T> inputToBinary,
boofcv.alg.shapes.ellipse.BinaryEllipseDetector<T> ellipseDetector,
EllipsesIntoClusters clustering)
Creates and configures the detector
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
configureContourDetector(T gray)
Configures the contour detector based on the image size.
|
protected void |
putGridIntoCanonical(EllipseClustersIntoGrid.Grid g)
Puts the grid into a canonical orientation
|
int |
totalEllipses(int numRows,
int numCols)
Computes the number of ellipses on the grid
|
getBinary, getCalibrationPoints, getClustering, getClusters, getClustersPruned, getColumns, getEllipseDetector, getGrider, getGrids, getRows, isVerbose, process, setVerbosepublic DetectCircleHexagonalGrid(int numRows,
int numCols,
boofcv.abst.filter.binary.InputToBinary<T> inputToBinary,
boofcv.alg.shapes.ellipse.BinaryEllipseDetector<T> ellipseDetector,
EllipsesIntoClusters clustering)
numRows - number of rows in gridnumCols - number of columns in gridinputToBinary - Converts the input image into a binary imageellipseDetector - Detects ellipses inside the imageclustering - Finds clusters of ellipsesprotected void configureContourDetector(T gray)
DetectCircleGridconfigureContourDetector in class DetectCircleGrid<T extends boofcv.struct.image.ImageGray<T>>public int totalEllipses(int numRows,
int numCols)
DetectCircleGridtotalEllipses in class DetectCircleGrid<T extends boofcv.struct.image.ImageGray<T>>protected void putGridIntoCanonical(EllipseClustersIntoGrid.Grid g)
putGridIntoCanonical in class DetectCircleGrid<T extends boofcv.struct.image.ImageGray<T>>