Class MetricMergeScenes

java.lang.Object
boofcv.alg.structure.MetricMergeScenes
All Implemented Interfaces:
VerbosePrint

public class MetricMergeScenes extends Object implements VerbosePrint
Merges two scenes together after their metric elevation. The 'src' scene will be merged in to the 'dst' scene. The dst scene is the dominant one and assumed to be "correct" when there's a conflict. A merge can fail if a physical constraint test fails ofter merging. If a merge fails then there's no modification to 'src' or 'dst' scenes.
 Procedure:
 1) Find common views between the two scenes
 2) Find a transform that relates the coordinate system in 'src' scene to the 'dst' scene.
 3) Create a working scene that's a copy of 'src' but with 'dst' coordinate system
 4) Copy inlier sets, view location, and camera intrinsics from 'dst' into common views
 5) Refine the working scene
 6) Check common views for violations of physical constraints. Accept merger, and fix minor issues, if none.
 
Only common views are checked for logical inconsistencies since we assume rest of the 'src' scene is consistent and not being modified as heavily by refinement. Only common views have their state forcibly changed. When copying inliers from 'dst' into the work scene, views in 'dst' that are not in 'src' are added. They will be considers to be known when refining the working scene. This will anchor the coordinate system. However, all other views will be optimized. The refined values for common views are not copied int to 'dst'. This is to reduce the influence of errors in 'src' becoming part of 'dst'.
  • Field Details

    • checks

      public final MetricSanityChecks checks
      Used to verify the correctness of the merger
    • mergingOps

      public final SceneMergingOperations mergingOps
      Helpful functions
    • fractionBadFeaturesRecover

      public double fractionBadFeaturesRecover
      If less than this number of features fail the physical constraint test, attempt to recover by removing them
  • Constructor Details

    • MetricMergeScenes

      public MetricMergeScenes()
  • Method Details

    • merge

      public boolean merge(LookUpSimilarImages dbSimilar, SceneWorkingGraph src, SceneWorkingGraph dst)
      Merges the 'src' scene into 'dst'. Both scenes are only modified if true is returned.
      Parameters:
      dbSimilar - Contains image related information
      src - The scene being merged into 'dst'
      dst - Where the combined scene will be stored. This is assumed to be the 'more correct' scene
      Returns:
      true if src was merged into dst or false if it failed and nothing has been modified
    • setVerbose

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