-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
executable file
·35 lines (32 loc) · 1.12 KB
/
main.cpp
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
#include "CommonHead.h"
#include "utils.h"
#include "CoordinateTransform.h"
int main() {
TEST_LINEARLEASTSQUARES();
TEST_COORDINATETRANSFORM();
//go!!
cv::Mat K,Pose;
TxtDataIO(K,Pose);
int NumberImage=Pose.rows;
//All 3D point and intenstity
vector<cv::Point3f> AllPoints;
vector<vector<float>> AllIntensity;
//the main loop deals with all pictures
for(int i=0;i<NumberImage;++i){
//get disparity map
cv::Mat DispImg;
GetDisparity(i,DispImg);
//calculate 3D point and intenstity
vector<cv::Point3f> Point3D;
vector<vector<float>> Intensity;
Recover3D(Point3D,DispImg,K,Pose,i,AllIntensity);
vector<cv::Point3f> wPoint3D=CameraToWorld(i,Point3D,Pose);
AllPoints.insert(AllPoints.end(),wPoint3D.begin(),wPoint3D.end());
}
#ifdef DEBUG_INFORMATION
cout<<"[DEBUG INFORMATION] the number of points:"<<AllPoints.size()<<endl;
cout<<"[DEBUG INFORMATION] waiting for writing data into points.ply file.Do not stop the programme!"<<AllPoints.size()<<endl;
#endif
Viusalization(AllPoints,AllIntensity);
return 0;
}