-
Notifications
You must be signed in to change notification settings - Fork 0
/
bundler program procedures.txt
59 lines (48 loc) · 2.19 KB
/
bundler program procedures.txt
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
main()
bundler_app->OnInit();
ProcessOptions(argc - 1, argv + 1);
LoadImageNamesFromFile(f);//f="list.txt"//读取list.txt里的文件名
BundleAdjustFast();
ComputeGeometricConstraints();//读取constrains.txt里面的信息,构造track信息
LoadMatches();
LoadMatchTable(m_match_table);//读取matches.init.txt的内容
PruneDoubleMatches();//去掉一对多的匹配,保留最佳匹配
WriteMatchTable(".prune");
LoadKeys(false);//without descriptors
ReadKeyFile()
ComputeEpipolarGeometry(true, new_image_start);//通过外积几何约束去掉外点
ComputeTransforms(false, new_image_start);//只计算基础矩阵
MakeMatchListsSymmetric();
WriteMatchTable(".ransac");
ComputeTracks(new_image_start);
WriteGeometricConstraints(filename);
WriteMatchTable(".corresp");
InitializeBundleAdjust();
BundlePickInitialPair(i_best, j_best, true);//挑选出最好的两张图
GetNumTrackMatches(i, j);//得到两幅图片中共同点的数目
SetupInitialCameraPair()
SetMatchesFromTracks(i_best, j_best)//从初始的两幅图像中选出matches
SetTracks(i_best);
SetTracks(j_best);
InitializeCameraParams(m_image_data[i_best], cameras[0]);
InitializeCameraParams(m_image_data[j_best], cameras[1]);
SetCameraConstraints(i_best, cameras + 0);
SetCameraConstraints(j_best, cameras + 1);
EstimateRelativePose2(i_best, j_best, cameras[0], cameras[1]);
EstimatePose5Point();//知道内参数,用5点法估计姿态
compute_pose_ransac();
generate_Ematrix_hypotheses();
Triangulate();//知道内参数,两个相机的姿态,和匹配的特征点,可以开始三角化出三维点了
/* Find the point with the smallest squared projection error */
triangulate();
/* Find the least squares result */
dgelsy_driver(A, b, x, 4, 3, 1);
/* Run a non-linear optimization to refine the result */
lmdif_driver(triangulation_residual, 4, 3, x, 1.0e-10);
DumpOutputFile(..."bundle.init.out"...)
RunSFM();/* Run sfm for the first time */
DumpPointsToPly("points001.ply")
DumpOutputFile()
FindCameraWithMostMatches()/* Find the camera with the most matches to existing points */
FindCamerasWithNMatches()
BundleAdjustAddAllNewPoints()