public static void triangulatePoints(SceneStructureMetric structure , SceneObservations observations )
	{
		TriangulateNViewsMetric triangulation = FactoryMultiView.
				triangulateNViewCalibrated(ConfigTriangulation.GEOMETRIC);

		List<RemoveBrownPtoN_F64> list_p_to_n = new ArrayList<>();
		for (int i = 0; i < structure.cameras.length; i++) {
			RemoveBrownPtoN_F64 p2n = new RemoveBrownPtoN_F64();
			if( structure.cameras[i].model instanceof BundlePinholeSimplified ) {
				BundlePinholeSimplified cam = (BundlePinholeSimplified) structure.cameras[i].model;
				p2n.setK(cam.f, cam.f, 0, 0, 0).setDistortion(new double[]{cam.k1, cam.k2}, 0, 0);
			} else if( structure.cameras[i].model instanceof BundlePinhole) {
				BundlePinhole cam = (BundlePinhole) structure.cameras[i].model;
				p2n.setK(cam.fx, cam.fy, cam.skew, cam.cx, cam.cy).setDistortion(new double[]{0,0}, 0,0);
			} else if( structure.cameras[i].model instanceof BundlePinholeBrown) {
				BundlePinholeBrown cam = (BundlePinholeBrown) structure.cameras[i].model;
				p2n.setK(cam.fx, cam.fy, cam.skew, cam.cx, cam.cy).setDistortion(cam.radial, cam.t1, cam.t2);
			} else {
				throw new RuntimeException("Unknown camera model!");
			}
			list_p_to_n.add(p2n);
		}

		FastQueue<Point2D_F64> normObs = new FastQueue<>(Point2D_F64.class,true);
		normObs.resize(3);

		Point3D_F64 X = new Point3D_F64();

		List<Se3_F64> worldToViews = new ArrayList<>();
		for (int i = 0; i < structure.points.length; i++) {
			normObs.reset();
			worldToViews.clear();
			SceneStructureMetric.Point sp = structure.points[i];
			for (int j = 0; j < sp.views.size; j++) {
				int viewIdx = sp.views.get(j);
				SceneStructureMetric.View v = structure.views[viewIdx];
				worldToViews.add(v.worldToView);

				// get the observation in pixels
				Point2D_F64 n = normObs.grow();
				int pointidx = observations.views[viewIdx].point.indexOf(i);
				observations.views[viewIdx].get(pointidx,n);
				// convert to normalized image coordinates
				list_p_to_n.get(v.camera).compute(n.x,n.y,n);
			}

			triangulation.triangulate(normObs.toList(),worldToViews,X);
			sp.set(X.x,X.y,X.z);
		}
	}
public static void triangulatePoints ( SceneStructureMetric structure , SceneObservations observations ) { TriangulateNViewsMetric triangulation = FactoryMultiView . triangulateNViewCalibrated ( ConfigTriangulation . GEOMETRIC ) ; List < RemoveBrownPtoN_F64 > list_p_to_n = new ArrayList < > ( ) ; for ( int i = 0 ; i < structure . cameras . length ; i ++ ) { RemoveBrownPtoN_F64 p2n = new RemoveBrownPtoN_F64 ( ) ; if ( structure . cameras [ i ] . model instanceof BundlePinholeSimplified ) { BundlePinholeSimplified cam = ( BundlePinholeSimplified ) structure . cameras [ i ] . model ; p2n . setK ( cam . f , cam . f , 0 , 0 , 0 ) . setDistortion ( new double [ ] { cam . k1 , cam . k2 } , 0 , 0 ) ; } else if ( structure . cameras [ i ] . model instanceof BundlePinhole ) { BundlePinhole cam = ( BundlePinhole ) structure . cameras [ i ] . model ; p2n . setK ( cam . fx , cam . fy , cam . skew , cam . cx , cam . cy ) . setDistortion ( new double [ ] { 0 , 0 } , 0 , 0 ) ; } else if ( structure . cameras [ i ] . model instanceof BundlePinholeBrown ) { BundlePinholeBrown cam = ( BundlePinholeBrown ) structure . cameras [ i ] . model ; p2n . setK ( cam . fx , cam . fy , cam . skew , cam . cx , cam . cy ) . setDistortion ( cam . radial , cam . t1 , cam . t2 ) ; } else { throw new RuntimeException ( "Unknown camera model!" ) ; } list_p_to_n . add ( p2n ) ; } FastQueue < Point2D_F64 > normObs = new FastQueue < > ( Point2D_F64 . class , true ) ; normObs . resize ( 3 ) ; Point3D_F64 X = new Point3D_F64 ( ) ; List < Se3_F64 > worldToViews = new ArrayList < > ( ) ; for ( int i = 0 ; i < structure . points . length ; i ++ ) { normObs . reset ( ) ; worldToViews . clear ( ) ; SceneStructureMetric . Point sp = structure . points [ i ] ; for ( int j = 0 ; j < sp . views . size ; j ++ ) { int viewIdx = sp . views . get ( j ) ; SceneStructureMetric . View v = structure . views [ viewIdx ] ; worldToViews . add ( v . worldToView ) ; Point2D_F64 n = normObs . grow ( ) ; int pointidx = observations . views [ viewIdx ] . point . indexOf ( i ) ; observations . views [ viewIdx ] . get ( pointidx , n ) ; list_p_to_n . get ( v . camera ) . compute ( n . x , n . y , n ) ; } triangulation . triangulate ( normObs . toList ( ) , worldToViews , X ) ; sp . set ( X . x , X . y , X . z ) ; } }
Convience function for initializing bundle adjustment parameters. Triangulates points using camera
position and pixel observations.

@param structure
@param observations