Package boofcv.alg.structure
Class SceneMergingOperations
java.lang.Object
boofcv.alg.structure.SceneMergingOperations
- All Implemented Interfaces:
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.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
Specifies which two scenes should be merged togetherstatic class
-
Field Summary
Modifier and TypeFieldDescriptionfinal List<SceneWorkingGraph.View>
Views which were both src and dstfinal List<SceneWorkingGraph.View>
Views that were in src but were either added or already existed in dst -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
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.boolean
decideFirstIntoSecond
(SceneWorkingGraph scene1, SceneWorkingGraph scene2) Returns true if the first scene should be merged into the second scene or the reverse.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.boolean
isMergedBlocked
(int indexSrc, int indexDst) Checks to see if the two scenes can be merged togethervoid
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.void
sanityCheckTable
(List<SceneWorkingGraph> scenes) Debugging tool to make sure the feature count table isn't messed up using brute forceboolean
Selects the two scenes with the most common views to merge together.void
setVerbose
(@Nullable PrintStream out, @Nullable Set<String> configuration) void
toggleViewEnabled
(SceneWorkingGraph target, MetricFromUncalibratedPairwiseGraph.PairwiseViewScenes scenesInEachView) Toggles the enabled state of a view and update its counts accordingly
-
Field Details
-
mergedViews
Views that were in src but were either added or already existed in dst -
duplicateViews
Views which were both src and dst
-
-
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.- Parameters:
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- Parameters:
target
- Scene that will have its counts modified.scenesInEachView
- List of views + scenes that views them
-
selectScenesToMerge
Selects the two scenes with the most common views to merge together.- Parameters:
selected
- (Output) Selected scenes to merge- Returns:
- 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- Returns:
- true means they are NOT allowed to merge. I.e. they are blocked
-
decideFirstIntoSecond
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
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 interfaceVerbosePrint
-
markAsFailed
Mark merging these two scenes as illegal until one of them has been merged with another scene or modified in some way.
-