PCL+Xtion 采集并显示点云图像
2014-07-28 14:57
253 查看
平台:PCL1.7.1 vs2010
硬件:华硕Xtion
显示采集的点云数据并保存为pcd格式:
代码如下:
硬件:华硕Xtion
显示采集的点云数据并保存为pcd格式:
代码如下:
#include <pcl/io/openni_grabber.h> #include <pcl/visualization/cloud_viewer.h> #include <pcl/io/pcd_io.h> #include <iostream> #include <string> #include <strstream> #include <pcl/common/time.h> #include <pcl/console/parse.h> class SimpleOpenNIViewer { public: SimpleOpenNIViewer () : viewer ("PCL OpenNI Viewer") {} void cloud_cb_ (const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr &cloud) { if (!viewer.wasStopped()) { viewer.showCloud (cloud); std::stringstream ss; ss << std::setprecision (12) << pcl::getTime () * 100 << ".pcd"; pcl::PCDWriter w; w.writeBinaryCompressed (ss.str (), *cloud); } } void run () { pcl::Grabber* interface = new pcl::OpenNIGrabber(); boost::function<void (const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&)> f = boost::bind (&SimpleOpenNIViewer::cloud_cb_, this, _1); interface->registerCallback (f); interface->start (); while (!viewer.wasStopped()) { boost::this_thread::sleep (boost::posix_time::seconds (1)); } interface->stop (); } pcl::visualization::CloudViewer viewer; }; int main () { SimpleOpenNIViewer v; v.run (); return 0; }
相关文章推荐
- 一个可用于实时采集的图像显示控件-用于数据采集的上位机显示中
- 嵌入式Linux的图像采集与显示
- 嵌入式Linux的图像采集与显示
- FPGA设计——CMOS图像采集与以太网传输显示(OV7670)
- FPGA设计——CMOS图像采集与以太网传输显示(MT9V011)
- VmodCAM图像采集 VGA显示
- VmodCAM图像采集 VGA显示
- 一个很好用的图形显示控件(可以用于实时采集的图像显示)
- ROS下订阅topic,显示并保存Kinect(Xtion pro live )深度摄像机的RGB图像
- Opencv学习手册(二)--- 图像采集与显示
- 嵌入式Linux的图像采集与显示
- Zedboard & Zynq 图像采集(五) 板端Linux下视频TCP发送 & Linux上位机QT视频显示
- opencv实现摄像头的实时图像采集与显示
- C#用basler相机sdk采集图像并用halcon显示的小程序
- OV7670摄像采集图像在VGA上显示的分析和实现,精确到每个时钟,每行代码。
- OpenCV + VTK + WebCam 采集和显示图像
- FPGA设计——全局曝光CMOS图像采集与USB2.0显示
- seed-dvs6467 encodedecode实例 采集的图像质量很差,只有隔行显示,而且每帧图像不断的往下移动?
- 基于NiosⅡ的图像采集和显示的实现
- Python+Opencv+Qt4编写Windows下摄像头图像采集显示程序