Class DetectCircleHexagonalGrid<T extends ImageGray<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.
- See Also:
-
Field Summary
Fields inherited from class boofcv.alg.fiducial.calib.circle.DetectCircleGrid
ellipseDetector, numCols, numRows
-
Constructor Summary
ConstructorDescriptionDetectCircleHexagonalGrid
(int numRows, int numCols, InputToBinary<T> inputToBinary, BinaryEllipseDetector<T> ellipseDetector, EllipsesIntoClusters clustering) Creates and configures the detector -
Method Summary
Modifier and TypeMethodDescriptionprotected void
configureContourDetector
(T gray) Configures the contour detector based on the image size.protected void
Puts the grid into a canonical orientationint
totalEllipses
(int numRows, int numCols) Computes the number of ellipses on the gridMethods inherited from class boofcv.alg.fiducial.calib.circle.DetectCircleGrid
getBinary, getClustering, getClusters, getClustersPruned, getColumns, getEllipseDetector, getGrider, getGrids, getRows, isVerbose, process, setVerbose
-
Constructor Details
-
DetectCircleHexagonalGrid
public DetectCircleHexagonalGrid(int numRows, int numCols, InputToBinary<T> inputToBinary, BinaryEllipseDetector<T> ellipseDetector, EllipsesIntoClusters clustering) Creates and configures the detector- Parameters:
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 ellipses
-
-
Method Details
-
configureContourDetector
Description copied from class:DetectCircleGrid
Configures the contour detector based on the image size. Setting a maximum contour and turning off recording of inner contours and improve speed and reduce the memory foot print significantly.- Specified by:
configureContourDetector
in classDetectCircleGrid<T extends ImageGray<T>>
-
totalEllipses
public int totalEllipses(int numRows, int numCols) Description copied from class:DetectCircleGrid
Computes the number of ellipses on the grid- Specified by:
totalEllipses
in classDetectCircleGrid<T extends ImageGray<T>>
-
putGridIntoCanonical
Puts the grid into a canonical orientation- Specified by:
putGridIntoCanonical
in classDetectCircleGrid<T extends ImageGray<T>>
-