-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelper.h
37 lines (32 loc) · 1.27 KB
/
helper.h
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
#ifndef _HELPER_H_
#define _HELPER_H_
#include <string>
#include <fstream>
#include <sstream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/visualization/pcl_visualizer.h>
#include <pcl/segmentation/sac_segmentation.h>
#include <pcl/filters/extract_indices.h>
#include <pcl/common/centroid.h>
///
/// Helper class, contains all necessary methods
///
class Helper
{
friend class HelperTest;
public:
~Helper();
void setOutLog(std::string &filename);
void writeLog(std::stringstream &line);
bool is_integer(const std::string& s);
void extractMajorPlanesFromPointCloud(std::string &inputPath, int totalPlanes, std::ofstream &outfilePlanes, std::ofstream &outfileCloudWPlanes, double distanceThres, bool visualize);
private:
std::ofstream outlog;
pcl::PointCloud<pcl::PointXYZ>::Ptr readCloudFromFile(std::string inputPath);
pcl::PointCloud<pcl::PointXYZ>::Ptr xyz2CloudConverter(std::string filePath);
void visualizePointCloud(pcl::PointCloud<pcl::PointXYZ>::Ptr& cloud, std::string windowName);
void visualizePointCloud(pcl::PointCloud<pcl::PointXYZRGB>::Ptr& cloud, std::string windowName);
void writePointsWithPlaneToFile(std::ofstream& file, pcl::PointCloud<pcl::PointXYZ>::Ptr& cloud, int plane);
};
#endif // _HELPER_H_