-
Notifications
You must be signed in to change notification settings - Fork 0
/
Utilities.h
40 lines (35 loc) · 1.87 KB
/
Utilities.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
38
39
40
#ifndef SOURCE_DIRECTORY__UTILITIES_H_
#define SOURCE_DIRECTORY__UTILITIES_H_
#include <iostream>
#include <pcl/point_types.h>
#include <pcl/io/pcd_io.h>
#include <pcl/io/ply_io.h>
#include <boost/filesystem.hpp>
#include <boost/thread.hpp>
#include "Viewer.h"
class Utilities
{
public:
Utilities();
static void show(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud);
static void showColor(pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud);
static void getFiles(std::string path, std::vector<std::string>& output);
static void getFiles(char** argv, std::vector<int>& indices, std::vector<std::string>& output);
static void read(std::vector<std::string> paths, std::vector<pcl::PCLPointCloud2>& clouds_blob);
static void readPCDFile(std::string path, pcl::PCLPointCloud2& cloud);
static void readPLYFile(std::string path, pcl::PCLPointCloud2& cloud);
static void writePCDFile(const pcl::PointCloud<pcl::PointXYZ>::ConstPtr&, std::string path, int how_many_files);
static void writePCDFile(const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&, std::string path, int how_many_files);
static std::string getExtension(std::string file);
static int UniqueNumber();
static std::vector<int> getIndices(const unsigned int length);
static void convert2XYZ(std::vector<pcl::PCLPointCloud2>& input, pcl::PointCloud<pcl::PointXYZ>::Ptr& output);
static void convert2XYZRGB(std::vector<pcl::PCLPointCloud2>& input, pcl::PointCloud<pcl::PointXYZRGB>::Ptr& output);
static std::string mkdir(const std::string& dir);
static void print(const pcl::PointCloud<pcl::PointXYZ>::ConstPtr& cloud);
static void normalize_cloud (pcl::PointCloud<pcl::PointXYZ>::Ptr cloud);
static pcl::PointXYZ& mean_point (pcl::PointCloud<pcl::PointXYZ>::Ptr cloud);
static void FormatDateTime(std::string const& format, boost::posix_time::ptime const& date_time, std::string& result);
~Utilities();
};
#endif /* SOURCE_DIRECTORY__UTILITIES_H_ */