common.h
1.65 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#pragma once
//common
#include <string>
#include <fstream>
#include <iostream>
#include <vector>
#include <ctime>
#include <cstdio>
#include <algorithm>
#include <stdlib.h>
#include <sstream>
#include <iomanip>
//eigen
#include <Eigen/Dense>
//boost
#include <boost/format.hpp>
#include <boost/filesystem.hpp>
#include <boost/thread/thread.hpp>
#include <boost/algorithm/string.hpp>
//opencv
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
//pcl
#include <pcl/point_types.h>
#include <pcl/point_cloud.h>
#include <pcl/io/io.h>
#include <pcl/io/pcd_io.h>
#include <pcl/io/vtk_io.h>
#include <pcl/io/vtk_lib_io.h>
#include <pcl/kdtree/kdtree_flann.h>
#include <pcl/filters/filter.h>
#include <pcl/filters/radius_outlier_removal.h>
#include <pcl/filters/voxel_grid.h>
#include <pcl/features/normal_3d.h>
#include <pcl/surface/mls.h>
#include <pcl/surface/poisson.h>
#include <pcl/surface/marching_cubes_hoppe.h>
#include <pcl/surface/gp3.h>
using namespace boost::filesystem;
struct camInfo
{
double fx;
double fy;
double cx;
double cy;
double k1;
double k2;
double p1;
double p2;
int width;
int height;
};
void realsenseSetUp(camInfo& cam)
{
cam.fx = 612.1810302745375;
cam.fy = 612.27685546875;
cam.cx = 323.64208984375;
cam.cy = 234.55838012695312;
cam.k1 = 0;
cam.k2 = 0;
cam.p1 = 0;
cam.p2 = 0;
cam.width = 640;
cam.height = 480;
}
Eigen::Vector3d coordinateRotation(double x, double y, double z)
{
Eigen::Vector3d coord;
coord << x, y, z;
Eigen::Matrix3d rot;
rot << 1, 0, 0, 0, 0, 1, 0, -1, 0;
coord = rot * coord;
return coord;
}