Class MetricSanityChecks

All Implemented Interfaces:

public class MetricSanityChecks
extends Object
implements VerbosePrint
Performs various checks to see if a scene is physically possible. These constraints include: 1) objects appear in front of the camera, 2) objects appear inside the image. 3) Reprojection error isn't massive. 4) focal length isn't negative. A negative focal length is considered a fatal error and processing is aborted early on. Multiple functions are provided to enable these checks when the scene is represented using different data structures.
  • Field Details

    • triangulator

      public TriangulateNViewsMetricH triangulator
      Used to triangulate a feature's 3D coordinate
    • maxReprojectionErrorSq

      public double maxReprojectionErrorSq
      If this value is exceeded then the point is considered to have a bad reprojection. Pixels squared.
    • badFeatures

      public DogArray_B badFeatures
      Bit field which indicates if a specific 3D feature was found to have passed (true) or failed (false) the consistency checks.
  • Constructor Details

    • MetricSanityChecks

      public MetricSanityChecks()
  • Method Details

    • checkPhysicalConstraints

      public boolean checkPhysicalConstraints​(LookUpSimilarImages dbSimilar, SceneWorkingGraph scene, SceneWorkingGraph.View wview, int setIdx)
      Checks physical constraints for one inlier set in a SceneWorkingGraph. Features are triangulated directly from observations. Raw counts for each type of error can be found for this function.
      dbSimilar - Use to get feature locations in the image
      scene - The scene
      wview - The view to check
      setIdx - Which inlier set in the view
      true if nothing went wrong or false if a very nasty error was detected
    • checkPhysicalConstraints

      public boolean checkPhysicalConstraints​(MetricBundleAdjustmentUtils bundle, List<CameraPinholeBrown> listDimensions)
      Checks that every points passes the physical constraints in every view it is seen from. If a point fails then it is marked as false in a badFeatures.
      bundle - Scene in bundle adjustment format
      listDimensions - Shape of every image
      true if a fatal catastrophic error is detected. E.g. negative focal length.
    • checkPhysicalConstraints

      public boolean checkPhysicalConstraints​(SceneStructureMetric structure, SceneObservations observations, List<CameraPinholeBrown> listPriors)
    • setVerbose

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