tags: PCL learning Visualize c++ Video processing
Convearter from a click cloud.
#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/filters/conditional_removal.h>
#include <pcl/visualization/cloud_viewer.h>
#include <pcl/visualization/pcl_visualizer.h>
using namespace std;
typedef pcl::PointXYZRGBA PointType;
int main() {
pcl::PCDReader reader;
Pcl :: PointCloud <PCL :: Pointxyz> :: Ptr Cloud (New Pcl :: PointCloud <PCL :: Pointxyz>); // Point Cloud to Show
Boost :: Shared_Ptr <PCL :: Visualization :: PCLVISUALIZER> M_VIEWER; // Window
// read the file
reader.read("D:/ground_1.pcd", *cloud);
// Display window initialization
m_viewer.reset(new pcl::visualization::PCLVisualizer("viewer", false));
m_viewer-> setbackgroundcolor (0, 0, 0); // Set background color
m_viewer->initCameraParameters();
m_viewer-> addcoordinateSystem (); // Add red green blue coordinate axis
m_viewer->createInteractor();
while (!m_viewer->wasStopped()) {
m_viewer->spinOnce(1);
If (! m_viewer-> updatePointCloud (Cloud-> Makeshared (), "Cloud")) {// pointcloud_xyzrgba is a pointer type, cannot be used (.) operator
m_viewer->addPointCloud(cloud->makeShared(), "cloud");
}
}
system("pause");
return 0;
}

When the number of points in the point cloud is much longer, it takes a long time. You can first sample the point cloud and then display it.
The PCL visualization module provides the function of point cloud rendering.You can specify a field to render visualization. The default coordinate field minimum value is red, and the maximum value is...
canPCLVisualizerThe visualization class is the most complete visualization class in PCL. Compared with the CloudViewer visualization class,PCLVisualizerIt is more complex and has more comprehensive fu...
Attention to the left upper corner and in the lower right corner of each window, the maximum value of X, Y coordinates cannot exceed 1, otherwise the window cannot be displayed! If you want to display...
The code header file is as follows 1. Read point cloud The point cloud format is XYZRGB, and the background color can be changed 2. Read point cloud point cloud format is XYZ 3. Read point cloud point...
Depth in color To display point clouds more intuitively, different depth values are displayed as different colors. #include #include <pcl/point_types.h> #include <pcl/io/ply_io.h> #inclu...
First attach the visual code: The code segment in which the visualization is: There is also a way to write a PCLVisualizer module: It is also possible to implement the operation of the electric cloud ...
#include <iostream> #include <pcl/point_types.h> #include <pcl/point_cloud.h> #include <pcl/visualization/pcl_visualizer.h> int main(int argc, char** argv) { // define a point ...
When visualizing a point cloud, sometimes it is necessary to display a comparison, then it is necessary to display two or more point clouds at the same time. viewer->createViewPort(double Xmin,doub...
1.class pcl::visualization::Cloudviewer (simple function) 2.class pcl::visualization::PCLVisualizer (there are many member functions, the content is very rich, it is the most important class in point ...
I have compiled a piece of visual code by myself. It will be very convenient to use it directly in the future, but there are some problems, please pass by to help answer. . Realized function: If one p...