Package boofcv.alg.fiducial.square
Class DetectFiducialSquareHamming<T extends ImageGray<T>>
java.lang.Object
boofcv.alg.fiducial.square.BaseDetectFiducialSquare<T>
boofcv.alg.fiducial.square.DetectFiducialSquareHamming<T>
- All Implemented Interfaces:
VerbosePrint
public class DetectFiducialSquareHamming<T extends ImageGray<T>>
extends BaseDetectFiducialSquare<T>
This detector decodes binary square fiducials where markers are indentified from a set of markers which is much
smaller than the number of possible numbers in the grid. The ID of each marker is designed to be orthogonal from
the others. Error correction is performed by taking the decoded value and finding the marker ID with the smallest
number of bit errors (hamming distance). Orientation is determined by rotating the decoded array while searching
for the best fit. Markers in this family include ArUco, AprilTag, ArToolKit+, and ARTAG.
-
Nested Class Summary
Nested classes/interfaces inherited from class boofcv.alg.fiducial.square.BaseDetectFiducialSquare
BaseDetectFiducialSquare.Result
-
Field Summary
Modifier and TypeFieldDescriptiondouble
How much ambiguous bits increase the error by.protected final GrayU8
converts the input image into a binary onefinal ConfigHammingMarker
Describes the marker it looks forprotected final GrayF32
storage for no border sub-imageprotected static final int
protected static final int
Fields inherited from class boofcv.alg.fiducial.square.BaseDetectFiducialSquare
borderWidthFraction
-
Constructor Summary
ConstructorDescriptionDetectFiducialSquareHamming
(ConfigHammingMarker description, double minimumBlackBorderFraction, InputToBinary<T> inputToBinary, DetectPolygonBinaryGrayRefine<T> quadDetector, Class<T> inputType) Configures the fiducial detector -
Method Summary
Modifier and TypeMethodDescriptionprotected int
decodeDataBits
(GrayF32 gray, double threshold) Converts the gray scale image into a binary number.protected boolean
processSquare
(GrayF32 square, BaseDetectFiducialSquare.Result result, double edgeInside, double edgeOutside) Processes the detected square and matches it to a known fiducial.Methods inherited from class boofcv.alg.fiducial.square.BaseDetectFiducialSquare
computeFractionBoundary, configure, getBinary, getFound, process, setVerbose
-
Field Details
-
description
Describes the marker it looks for -
binaryInner
converts the input image into a binary one -
grayNoBorder
storage for no border sub-image -
ambiguousPenaltyFrac
public double ambiguousPenaltyFracHow much ambiguous bits increase the error by. 0 = no penalty. 1=simple addition. -
w
protected static final int w- See Also:
-
N
protected static final int N- See Also:
-
-
Constructor Details
-
DetectFiducialSquareHamming
public DetectFiducialSquareHamming(ConfigHammingMarker description, double minimumBlackBorderFraction, InputToBinary<T> inputToBinary, DetectPolygonBinaryGrayRefine<T> quadDetector, Class<T> inputType) Configures the fiducial detector- Parameters:
inputToBinary
- Converts the input image into a binary imagequadDetector
- Detects quadrilaterals in the input imageinputType
- Type of image it's processing
-
-
Method Details
-
processSquare
protected boolean processSquare(GrayF32 square, BaseDetectFiducialSquare.Result result, double edgeInside, double edgeOutside) Description copied from class:BaseDetectFiducialSquare
Processes the detected square and matches it to a known fiducial. Black border is included.- Specified by:
processSquare
in classBaseDetectFiducialSquare<T extends ImageGray<T>>
- Parameters:
square
- Image of the undistorted squareresult
- Which target and its orientation was foundedgeInside
- Average pixel value along edge insideedgeOutside
- Average pixel value along edge outside- Returns:
- true if the square matches a known target.
-
decodeDataBits
Converts the gray scale image into a binary number. Skip the outer 1 pixel of each inner square. These tend to be incorrectly classified due to distortion.- Returns:
- The error relative to a pure white or black square. The best score must be able to beat this.
-