Class SceneMergingOperations

All Implemented Interfaces:

public class SceneMergingOperations
extends Object
implements VerbosePrint

Contains operations used to merge all the connected spawned scenes in MetricFromUncalibratedPairwiseGraph into a single scene. Scale ambiguity is resolved by selecting a single view with the "best" geometric information and then feeding that to ResolveSceneScaleAmbiguity.

First call initializeViewCounts(boofcv.alg.structure.MetricFromUncalibratedPairwiseGraph.PairwiseViewScenes, int) as it will initialize all data structures. Then all the other operations can be called.
  • Field Details

  • Constructor Details

    • SceneMergingOperations

      public SceneMergingOperations()
  • Method Details

    • initializeViewCounts

      public void initializeViewCounts​(MetricFromUncalibratedPairwiseGraph.PairwiseViewScenes scenesInEachView, int numScenes)
      Creates a sparse data structure that stores the number of views that each scene shares with all the other scenes.
      scenesInEachView - (Input) List of all the views and the scenes that reference them
    • toggleViewEnabled

      public void toggleViewEnabled​(SceneWorkingGraph target, MetricFromUncalibratedPairwiseGraph.PairwiseViewScenes scenesInEachView)
      Toggles the enabled state of a view and update its counts accordingly
      target - Scene that will have its counts modified.
      scenesInEachView - List of views + scenes that views them
    • selectScenesToMerge

      public boolean selectScenesToMerge​(SceneMergingOperations.SelectedScenes selected)
      Selects the two scenes with the most common views to merge together.
      selected - (Output) Selected scenes to merge
      true if it could find two valid scenes to merge
    • isMergedBlocked

      public boolean isMergedBlocked​(int indexSrc, int indexDst)
      Checks to see if the two scenes can be merged together
      true means they are NOT allowed to merge. I.e. they are blocked
    • decideFirstIntoSecond

      public boolean decideFirstIntoSecond​(SceneWorkingGraph scene1, SceneWorkingGraph scene2)
      Returns true if the first scene should be merged into the second scene or the reverse. For now this simply looks at the number of views in each scene.
    • computeSceneTransform

      public boolean computeSceneTransform​(LookUpSimilarImages dbSimilar, SceneWorkingGraph src, SceneWorkingGraph dst, SceneWorkingGraph.View selectedSrc, SceneWorkingGraph.View selectedDst, ScaleSe3_F64 src_to_dst)
      Computes the transform between the two views in different scenes. This is done by computing the depth for all common image features. The depth is used to estimate the scale difference between the scenes. After that finding the SE3 transform is trivial.
    • sanityCheckTable

      public void sanityCheckTable​(List<SceneWorkingGraph> scenes)
      Debugging tool to make sure the feature count table isn't messed up using brute force
    • setVerbose

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

      public void markAsFailed​(SceneWorkingGraph src, SceneWorkingGraph dst)
      Mark merging these two scenes as illegal until one of them has been merged with another scene or modified in some way.