Class ProjectiveInitializeAllCommon

java.lang.Object
boofcv.alg.structure.ProjectiveInitializeAllCommon
All Implemented Interfaces:
VerbosePrint

public class ProjectiveInitializeAllCommon
extends Object
implements VerbosePrint
Given a set of views and a set of features which are visible in all views, estimate their structure up to a projective transform. Summary of processing steps:
  1. Select initial set of 3 views
  2. Association between all 3 views
  3. RANSAC to find Trifocal Tensor
  4. 3 Projective from trifocal
  5. Triangulate features
  6. Find remaining projective camera matrices
  7. Refine with bundle adjustment
The output is contained in SBA structure. See getStructure() and getPairwiseGraphViewByStructureIndex(int)
  • Field Details

    • utils

      public PairwiseGraphUtils utils
      Common algorithms for reconstructing the projective scene
    • inlierIndexes

      protected final DogArray<DogArray_I32> inlierIndexes
      List of feature indexes for each view that are part of the inlier set. The seed view is at index 0. The other indexes are in order of 'seedConnIdx'.
    • viewsByStructureIndex

      protected final FastArray<PairwiseImageGraph.View> viewsByStructureIndex
    • selectedTriple

      protected final int[] selectedTriple
    • points3D

      protected final DogArray<Point4D_F64> points3D
    • assocPixel

      protected final DogArray<AssociatedPair> assocPixel
    • shape

      protected final ImageDimension shape
    • seedToStructure

      protected final DogArray_I32 seedToStructure
      lookup table from feature ID in seed view to structure index. There will only be 3D features for members of the inlier set.
  • Constructor Details

    • ProjectiveInitializeAllCommon

      public ProjectiveInitializeAllCommon​(ConfigProjectiveReconstruction configProjective)
    • ProjectiveInitializeAllCommon

      public ProjectiveInitializeAllCommon()
  • Method Details

    • projectiveSceneN

      public boolean projectiveSceneN​(LookUpSimilarImages dbSimilar, LookUpCameraInfo dbCams, PairwiseImageGraph.View seed, DogArray_I32 seedFeatsIdx, DogArray_I32 seedConnIdx)
      Computes a projective reconstruction. Reconstruction will be relative the 'seed' and only use features listed in 'common'. The list of views is taken from seed and is specified in 'motions'.
      Parameters:
      dbSimilar - (Input) Data based used to look up information on each image
      seed - (Input) The seed view that will act as the origin
      seedFeatsIdx - (Input) Indexes of common features in the seed view which are to be used.
      seedConnIdx - (Input) Indexes of motions in the seed view to use when initializing
      Returns:
      true is successful or false if it failed
    • createObservationsForBundleAdjustment

      protected void createObservationsForBundleAdjustment​(DogArray_I32 seedConnIdx)
      Convert observations into a format which bundle adjustment will understand
      Parameters:
      seedConnIdx - Which edges in seed to use
    • lookupInfoForMetricElevation

      public void lookupInfoForMetricElevation​(List<String> viewIds, DogArray<ElevateViewInfo> views, DogArray<DMatrixRMaj> cameraMatrices, DogArray<AssociatedTupleDN> observations)
      Copies results into a format that's useful for projective to metric conversion
      Parameters:
      viewIds - (Output) ID of each view
      views - (Output) Shape of images in each view
      cameraMatrices - (Output) Found camera matrices. view[0] is skipped since it is identity
      observations - (Output) Found observations shifted to have (0,0) center
    • getStructure

      public SceneStructureProjective getStructure()
      Returns the estimated scene structure
    • getPairwiseGraphViewByStructureIndex

      public PairwiseImageGraph.View getPairwiseGraphViewByStructureIndex​(int index)
      Returns the PairwiseImageGraph.View given the index of the view in structure
    • setVerbose

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