-
-
Notifications
You must be signed in to change notification settings - Fork 91
/
viewer.h
74 lines (62 loc) · 1.71 KB
/
viewer.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
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
73
74
#ifndef VIEWER_H
#define VIEWER_H
// C++
#include <iostream>
// Qt
#include <QMainWindow>
#include <QFileDialog>
#include <QListWidgetItem>
#include <QProcess>
#include <QDirIterator>
// Point Cloud Library
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/filters/voxel_grid.h>
#include <pcl/filters/extract_indices.h>
#include <pcl/filters/statistical_outlier_removal.h>
#include <pcl/segmentation/sac_segmentation.h>
#include <pcl/segmentation/extract_clusters.h>
#include <pcl/common/centroid.h>
#include <pcl/common/common.h>
#include <pcl/visualization/pcl_visualizer.h>
// Visualization Toolkit (VTK)
#include <vtkRenderWindow.h>
typedef struct feature {
int id;
Eigen::Vector4f centroid;
Eigen::Vector4f min;
Eigen::Vector4f max;
} Feature;
namespace Ui {
class CloudViewer;
}
class CloudViewer: public QMainWindow {
Q_OBJECT
public:
explicit CloudViewer(QWidget *parent = 0);
~CloudViewer();
public slots:
void loadButtonClicked();
void labelButtonClicked();
void reloadButtonClicked();
void nextBoxChecked();
void fileItemChanged();
protected:
boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer;
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud, cloud_tmp;
void clustering(std::string file_name);
void featureExtraction(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud);
private:
Ui::CloudViewer *ui;
QString load_file_path, current_label_path;
bool file_labeled;
bool auto_next;
bool remove_top_bottom;
bool down_sampling;
bool remove_outliers;
bool remove_planes;
std::vector<Feature> features;
std::vector< std::vector<std::string> > labels;
std::fstream label_file;
};
#endif // VIEWER_H