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.
  • Field Details

    • description

      public final ConfigHammingMarker description
      Describes the marker it looks for
    • binaryInner

      protected final GrayU8 binaryInner
      converts the input image into a binary one
    • grayNoBorder

      protected final GrayF32 grayNoBorder
      storage for no border sub-image
    • ambiguousPenaltyFrac

      public double ambiguousPenaltyFrac
      How 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 image
      quadDetector - Detects quadrilaterals in the input image
      inputType - 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 class BaseDetectFiducialSquare<T extends ImageGray<T>>
      Parameters:
      square - Image of the undistorted square
      result - Which target and its orientation was found
      edgeInside - Average pixel value along edge inside
      edgeOutside - Average pixel value along edge outside
      Returns:
      true if the square matches a known target.
    • decodeDataBits

      protected int decodeDataBits(GrayF32 gray, double threshold)
      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.