1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| openMVG::sfm::SfM_Data sfm_data; sfm_data.s_root_path = "/path/to/images/";
openMVG::matching::PairwiseMatches pairwise_matches;
openMVG::sfm::robust::RelativePose_Info relativePose_info; openMVG::sfm::robust::RobustRelativePose( vec_feats[0], vec_feats[1], openMVG::matching::IndMatchSet(), relativePose_info);
openMVG::sfm::Views& views = sfm_data.views; views.insert(std::make_pair(0, std::make_shared<openMVG::sfm::View>("", 0, openMVG::image::ImageSize(0, 0), 0))); views.insert(std::make_pair(1, std::make_shared<openMVG::sfm::View>("", 1, openMVG::image::ImageSize(0, 0), 0))); openMVG::sfm::intrinsics::Camera_Pinhole_Radial camera(0, 0, 0, 0, 0); sfm_data.intrinsics.insert(std::make_pair(0, std::make_shared<openMVG::sfm::Pinhole_Intrinsic_Radial_K3>(0, 0, 0))); sfm_data.intrinsics.insert(std::make_pair(1, std::make_shared<openMVG::sfm::Pinhole_Intrinsic_Radial_K3>(0, 0, 0))); sfm_data.poses[0] = openMVG::geometry::Pose3(openMVG::geometry::Mat3::Identity(), openMVG::geometry::Vec3::Zero()); sfm_data.poses[1] = relativePose_info.relativePose;
openMVG::sfm::Triangulation trianulation_functor; trianulation_functor(sfm_data, vec_feats, pairwise_matches);
openMVG::sfm::Save(sfm_data, "/path/to/output/pointcloud.ply", openMVG::sfm::ESfM_Data(openMVG::sfm::ALL));
|