Package boofcv.alg.structure
Class PairwiseGraphUtils
java.lang.Object
boofcv.alg.structure.PairwiseGraphUtils
public class PairwiseGraphUtils extends Object
Various utility functions for dealing with
PairwiseImageGraph
-
Field Summary
-
Constructor Summary
Constructors Constructor Description PairwiseGraphUtils()
PairwiseGraphUtils(TriangulateNViewsProjective triangulator, ModelMatcher<TrifocalTensor,AssociatedTriple> ransac, BundleAdjustment<SceneStructureProjective> sba)
PairwiseGraphUtils(ConfigProjectiveReconstruction config)
-
Method Summary
Modifier and Type Method Description static void
createTableViewAtoB(PairwiseImageGraph.View viewA, PairwiseImageGraph.Motion edge, DogArray_I32 table_a_to_b)
Creates a look up table for converting features indexes from view A to view B from the list of inliers.void
createThreeViewLookUpTables()
Creates three feature look up tables: A -> B, A -> C, and B -> Cvoid
createTripleFromCommon(@Nullable PrintStream verbose)
Convert triple from indexes into coordinatesboolean
estimateProjectiveCamerasRobustly()
Robustly estimates the trifocal tensor and extracts canonical camera matricesvoid
findAllConnectedSeed(PairwiseImageGraph.View seed, DogArray_I32 connectIdx, DogArray_I32 commonIdx)
Finds the indexes of tracks which are common to all views and are inliers.void
findFullyConnectedTriple()
Finds which features are common between all three views using the look up tables.void
findFullyConnectedTriple(DogArray_I32 selectedIdxA)
Same asfindFullyConnectedTriple()
but with a list that specified a subset of features inseed
.void
initializeSbaObservationsThreeView()
Converts the set of inlier observations from the three view inliers into observations that bundle adjustment can understandvoid
initializeSbaSceneThreeView(boolean fixedSeed)
Initializes projective reconstruction from 3-views.boolean
refineWithBundleAdjustment()
Last step is to refine the current initial estimate with bundle adjustmentSceneWorkingGraph.InlierInfo
saveRansacInliers(SceneWorkingGraph.View view, DogArray_I32 inlierIdx)
Saves which features were used as inliers.protected void
triangulateFeatures()
Triangulates the location of each features in homogenous space and save to bundle adjustment scene
-
Field Details
-
dbSimilar
-
dbCams
-
visibleAll
-
visibleMotion
-
configConvergeSBA
Converge tolerance for SBA -
configScaleSBA
public boolean configScaleSBAToggles scaling inputs for SBA -
structure
The estimated scene structure. This the final estimated scene state -
observations
-
ransac
-
triangulator
-
poseEstimator
-
sba
-
scaler
-
seed
The three views used in three view algorithms -
viewB
The three views used in three view algorithms -
viewC
The three views used in three view algorithms -
priorCamA
Prior calibration information for each view's camera -
priorCamB
-
priorCamC
-
matchesTriple
-
inliersThreeView
Inliers from robust fitting of trifocal tensor. Pixels -
inlierIdx
Which features the inliers correspond to -
P1
Projective camera matrices for 3-View reconstruction. P1 is always identity -
P2
-
P3
-
featsA
-
featsB
-
featsC
-
table_A_to_B
-
table_A_to_C
-
table_B_to_C
-
table_C_to_A
-
commonIdx
-
-
Constructor Details
-
PairwiseGraphUtils
public PairwiseGraphUtils(TriangulateNViewsProjective triangulator, ModelMatcher<TrifocalTensor,AssociatedTriple> ransac, BundleAdjustment<SceneStructureProjective> sba) -
PairwiseGraphUtils
-
PairwiseGraphUtils
public PairwiseGraphUtils()
-
-
Method Details
-
findAllConnectedSeed
public void findAllConnectedSeed(PairwiseImageGraph.View seed, DogArray_I32 connectIdx, DogArray_I32 commonIdx)Finds the indexes of tracks which are common to all views and are inliers.- Parameters:
seed
- (Input) The view which is used as the reference pointconnectIdx
- (Input) Indexes of connections in the seed view that will be searched for common connectionscommonIdx
- (Output) Indexes of observation in seed that are visible in connected views
-
createThreeViewLookUpTables
public void createThreeViewLookUpTables()Creates three feature look up tables: A -> B, A -> C, and B -> C -
findFullyConnectedTriple
public void findFullyConnectedTriple() -
findFullyConnectedTriple
Same asfindFullyConnectedTriple()
but with a list that specified a subset of features inseed
.- Parameters:
selectedIdxA
- List of feature indexes in A to consider
-
createTripleFromCommon
Convert triple from indexes into coordinates -
estimateProjectiveCamerasRobustly
public boolean estimateProjectiveCamerasRobustly()Robustly estimates the trifocal tensor and extracts canonical camera matrices -
saveRansacInliers
public SceneWorkingGraph.InlierInfo saveRansacInliers(SceneWorkingGraph.View view, DogArray_I32 inlierIdx)Saves which features were used as inliers.- Parameters:
inlierIdx
- Which features in 'commonIdx' are inliers and should be added to the setview
- Which view should be the first view in the list and have its inliers updated.
-
initializeSbaSceneThreeView
public void initializeSbaSceneThreeView(boolean fixedSeed)Initializes projective reconstruction from 3-views. 1) RANSAC to fit a trifocal tensor 2) Extract camera matrices that have a common projective space 3) Triangulate location of 3D homogenous points- Parameters:
fixedSeed
- if true the seed is fixed and other views are not. If false then the inverse happens.
-
triangulateFeatures
protected void triangulateFeatures()Triangulates the location of each features in homogenous space and save to bundle adjustment scene -
initializeSbaObservationsThreeView
public void initializeSbaObservationsThreeView()Converts the set of inlier observations from the three view inliers into observations that bundle adjustment can understand -
refineWithBundleAdjustment
public boolean refineWithBundleAdjustment()Last step is to refine the current initial estimate with bundle adjustment -
createTableViewAtoB
public static void createTableViewAtoB(PairwiseImageGraph.View viewA, PairwiseImageGraph.Motion edge, DogArray_I32 table_a_to_b)Creates a look up table for converting features indexes from view A to view B from the list of inliers.- Parameters:
viewA
- (input) The view that is the src in the tableedge
- (input) Edge connect view A to B, this contains the dst in the tabletable_a_to_b
- (output) The resulting lookup table
-