Class PairwiseGraphUtils


public class PairwiseGraphUtils
extends Object
Various utility functions for dealing with PairwiseImageGraph
  • Field Details

  • Constructor Details

  • 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.
      seed - (Input) The view which is used as the reference point
      connectIdx - (Input) Indexes of connections in the seed view that will be searched for common connections
      commonIdx - (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()
      Finds which features are common between all three views using the look up tables. Results are stored in commonIdx by index of feature in seed.
    • findFullyConnectedTriple

      public void findFullyConnectedTriple​(DogArray_I32 selectedIdxA)
      Same as findFullyConnectedTriple() but with a list that specified a subset of features in seed.
      selectedIdxA - List of feature indexes in A to consider
    • createTripleFromCommon

      public void createTripleFromCommon​(@Nullable @Nullable PrintStream verbose)
      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.
      inlierIdx - Which features in 'commonIdx' are inliers and should be added to the set
      view - 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
      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.
      viewA - (input) The view that is the src in the table
      edge - (input) Edge connect view A to B, this contains the dst in the table
      table_a_to_b - (output) The resulting lookup table