Class ChessboardCornerClusterFinder<T extends ImageGray<T>>

All Implemented Interfaces:

public class ChessboardCornerClusterFinder<T extends ImageGray<T>>
extends Object
implements VerbosePrint
From a set of ChessboardCorners find all the chessboard grids in view. Assumptions about the grids size are not made at this stage. Algorithmic Steps:
  1. Nearest neighbor search for each corners. For each corner, matches are put into parallel and perpendicular sets
  2. Identify ambiguous corners that are close to each other and pick be most intense corner
  3. Prune corners from each nodes parallel and perpendicular sets if they are not mutual
  4. Select 2 to 4 connections for each corner using projective invariant properties
  5. Prune non mutual connections and save a list of modified vertexes
  6. Use known graph to find better edges for modified vertexes
  7. Find connected sets of vertexes and convert into output format
At a high level, a graph is formed where each vertex (a corner) can have at most 4 edges (connections) that describe the relationship between two vertexes. If there is no distortion then each edge will be 90 degrees apart radially. "Error" functions are use through out the code to decide which edge or vertex is best to select. Error functions are not always true errors and just means they are functions where the best value is a minimum. Whenever possible, errors are computed using projective invariant properties, which is how it can handle large amounts of distortion. Hard thresholds are used to reduce computational complexity and weird edge cases, thus are typically very generous. Lens distortion is not explicitly modeled. Instead fuzzy thresholds and error functions are used to account for it. Chessboard and geometric properties used:
  • Orientation of corners alternates by 90 degrees
  • A corner can only be connected to a corner with an orientation perpendicular to it
  • Between any two adjacent connections there must lie a corner with an orientation that is parallel.
  • Without perspective distortion, corners are laid out in a grid pattern
  • Assume projective transform, with fuzzy parameters to account for lens distortion
  • Straight lines are straight
  • Order of vector angles from a point to another point does not change
  • Order of intersections along a line does not change
  • Constructor Details

    • ChessboardCornerClusterFinder

      public ChessboardCornerClusterFinder​(Class<T> imageType)
    • ChessboardCornerClusterFinder

      public ChessboardCornerClusterFinder​(ChessboardCornerEdgeIntensity<T> computeConnInten)
  • Method Details

    • process

      public void process​(T image, List<ChessboardCorner> corners, int numLevels)
      Processes corners and finds clusters of chessboard patterns
      corners - Detected chessboard patterns. Not modified.
    • pruneConnectionsByIntensity

      protected void pruneConnectionsByIntensity​(List<ChessboardCorner> corners)
      Computes edge intensity and prunes connections if it's too low relative
    • printDualGraph

      public void printDualGraph()
      Prints the graph. Used for debugging the code.
    • printConnectionGraph

      public void printConnectionGraph()
    • setVerbose

      public void setVerbose​(@Nullable @Nullable PrintStream out, @Nullable @Nullable Set<String> configuration)
      Specified by:
      setVerbose in interface VerbosePrint