private boolean computeCameraMatrix ( View seed , Motion edge , FastQueue < Point2D_F64 > featsB , DMatrixRMaj cameraMatrix ) { boolean seedSrc = edge . src == seed ; int matched = 0 ; for ( int i = 0 ; i < edge . inliers . size ; i ++ ) { // need to go from i to index of detected features in view 'seed' to index index of feature in // the reconstruction AssociatedIndex a = edge . inliers . get ( i ) ; int featId = seedToStructure . data [ seedSrc ? a . src : a . dst ] ; if ( featId == - 1 ) continue ; assocPixel . get ( featId ) . p2 . set ( featsB . get ( seedSrc ? a . dst : a . src ) ) ; matched ++ ; } // All views should have matches for all features, simple sanity check if ( matched != assocPixel . size ) throw new RuntimeException ( "BUG! Didn't find all features in the view" ) ; // Estimate the camera matrix given homogenous pixel observations if ( poseEstimator . processHomogenous ( assocPixel . toList ( ) , points3D . toList ( ) ) ) { cameraMatrix . set ( poseEstimator . getProjective ( ) ) ; return true ; } else { return false ; } }
Computes camera matrix between the seed view and a connected view