-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
72 lines (53 loc) · 1.84 KB
/
main.cpp
File metadata and controls
72 lines (53 loc) · 1.84 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
#include <iostream>
#include <vector>
#include <string>
#include <tuple>
#include <typeinfo>
#include <math.h>
#include <pcl/io/pcd_io.h>
#include <pcl/common/io.h>
#include <pcl/point_types.h>
//my includes
#include "timedate.h"
#include "Functions.h"
#include "cloudoperations.h"
#include "constants.h"
#include "segmentor.h"
#include "projection.h"
#include <pcl/visualization/cloud_viewer.h>
using namespace std;
using namespace pcl;
int
main()
{
displayTime();
cout<<"Start\n"<< endl;
string filename = "../ptClouds/DeepSpace-CutDown";
PointCloud<PointXYZRGB>::Ptr origCloud = openCloud(filename + ".pcd");
cout<<"Calculating Normals...\n"<< endl;
PointCloud<Normal>::Ptr normals = normalCalc(origCloud);
cout<<"Normals Calculated...\n"<< endl;
displayTime();
cout<<"Segmentation Starting..."<< endl;
vector <PointIndices::Ptr> vector_of_segments;
PointCloud <PointXYZRGB>::Ptr segCloud(new PointCloud <PointXYZRGB>);
std::tie(vector_of_segments, segCloud) = segmentor(origCloud, normals);
PointCloud <PointXYZRGB>::Ptr extentCloud = vectorToCloud(vector_of_segments, segCloud);
cout<<"Segmentation Complete...\n"<< endl;
displayTime();
// Viewer(extentCloud);
vector < PointCloud<PointXYZRGB>::Ptr> Boundries = getBoundriesOfSegments(vector_of_segments, segCloud);
cout<<"Extracting corner points...\n"<<endl;
ExtractCornerPoints(vector_of_segments,Boundries, segCloud);
cout<<"Corner points extracted...\n"<<endl;
cout<<"Writing boundry to .obj file...\n"<<endl;
CreateCornerFile(Boundries,filename);
cout<<"Writing Cloud to File...\n"<<endl;
string outputFileName = filename + "-Segmented";
write(extentCloud,outputFileName + ".pcd");
displayTime();
cout<<"Displaying Cloud...\n"<< endl;
Viewer(extentCloud);
cout<<"End"<< endl;
return 0;
}