forked from augcog/OpenARK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVisualizer.h
90 lines (76 loc) · 2.76 KB
/
Visualizer.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#pragma once
// OpenARK headers
#include "Hand.h"
/**
* Utility class containing various conversions and visualization techniques.
*/
class Visualizer
{
public:
/**
* Visualization for xyzMap.
* @param [in] xyzMap input point cloud matrix
* @return a CV_8UC3 representation of the xyzMap
*/
static cv::Mat visualizeXYZMap(cv::Mat &xyzMap);
/**
* Visualization for hand object.
* @param [in] xyzMap the base image to draw on
* @param [in] hand the hand object
* @return a CV_8UC3 matrix with the hand drawn on it
*/
static cv::Mat visualizeHand(cv::Mat xyzMap, const Hand hand);
/**
* Visualization for PCL point cloud.
* @param [in] cloud PCL point cloud to be visualized
*/
static void visualizeCloud(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud);
/**
* Visualization for polygon mesh.
* Visualize a PCL point cloud as a polygon mesh
* @param [in] cloud PCL point cloud to be visualized
*/
static void visulizePolygonMesh(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud);
/**
* Visualization for plane regression.
* @param [in] input_mat the base xyzMap on which to draw the visualization
* @param [in] equation equation of the plane
* @param threshold maximum error distance (mm) allowed for points to be considered covered by regression equation
* @param clicked whether the finger is currently current contacting the regression equation. Default is FALSE
* @return a CV_8UC3 representation of the matrix with the regression plane drawn
*/
static cv::Mat visualizePlaneRegression(cv::Mat &input_mat, std::vector<double> &equation, const double threshold, bool clicked = false);
/**
* Visualize points that lie on the plane.
* @param input_mat the input point cloud
* @param indicies (i,j) coordinates of the points belonging to the plane
*/
static void visualizePlanePoints(cv::Mat &input_mat, std::vector<cv::Point2i> indicies);
/**
* Visualize a depth map
* @param depthMap the depth map
* @returns visualization
*/
static cv::Mat visualizeDepthMap(cv::Mat &depthMap);
/**
* Initializes & opens the PCL visualizer
* @returns true on success, false if visualizer already open
*/
static bool initPCLViewer();
private:
/**
* Visualization for a generic matrix.
* @param [in] input matrix to be visualized
* @return a CV_8UC3 representation of the input matrix
*/
static cv::Mat visualizeMatrix(cv::Mat &input);
/**
* Visualization for a depth map matrix (i,j,z).
* @param [in] depthMap matrix to be visualized
* @return a CV_8UC3 representation of the input matrix
*/
/**
* PCL point cloud viewer
*/
static pcl::visualization::PCLVisualizer * viewer;
};