Package boofcv.alg.structure
Class PairwiseGraphUtils
java.lang.Object
boofcv.alg.structure.PairwiseGraphUtils
Various utility functions for dealing with
PairwiseImageGraph-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal DogArray_I32Converge tolerance for SBAbooleanToggles scaling inputs for SBAfinal DogArray<Point2D_F64>final DogArray<Point2D_F64>final DogArray<Point2D_F64>final DogArray_I32Which features the inliers correspond tofinal FastArray<AssociatedTriple>Inliers from robust fitting of trifocal tensor.final DogArray<AssociatedTriple>protected final SceneObservationsfinal DMatrixRMajProjective camera matrices for 3-View reconstruction.final DMatrixRMajfinal DMatrixRMajprotected PoseFromPairLinear6Prior calibration information for each view's cameraprotected ModelMatcher<TrifocalTensor,AssociatedTriple> protected BundleAdjustment<SceneStructureProjective>protected ScaleSceneStructureThe three views used in three view algorithmsprotected final SceneStructureProjectiveThe estimated scene structure.final DogArray_I32final DogArray_I32final DogArray_I32final DogArray_I32protected TriangulateNViewsProjectiveThe three views used in three view algorithmsThe three views used in three view algorithms -
Constructor Summary
ConstructorsConstructorDescriptionPairwiseGraphUtils(TriangulateNViewsProjective triangulator, ModelMatcher<TrifocalTensor, AssociatedTriple> ransac, BundleAdjustment<SceneStructureProjective> sba) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcreateTableViewAtoB(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.voidCreates three feature look up tables: A -> B, A -> C, and B -> CvoidcreateTripleFromCommon(@Nullable PrintStream verbose) Convert triple from indexes into coordinatesbooleanRobustly estimates the trifocal tensor and extracts canonical camera matricesvoidfindAllConnectedSeed(PairwiseImageGraph.View seed, DogArray_I32 connectIdx, DogArray_I32 commonIdx) Finds the indexes of tracks which are common to all views and are inliers.voidFinds which features are common between all three views using the look up tables.voidfindFullyConnectedTriple(DogArray_I32 selectedIdxA) Same asfindFullyConnectedTriple()but with a list that specified a subset of features inseed.voidConverts the set of inlier observations from the three view inliers into observations that bundle adjustment can understandvoidinitializeSbaSceneThreeView(boolean fixedSeed) Initializes projective reconstruction from 3-views.booleanLast step is to refine the current initial estimate with bundle adjustmentsaveRansacInliers(SceneWorkingGraph.View view, DogArray_I32 inlierIdx) Saves which features were used as inliers.protected voidTriangulates 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 -
structurePr
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
-