9、源程序和3D点云:
cloud_viewer_PointXYZ.cpp如下: #include
int user_data; void
viewerOneOff (pcl::visualization::PCLVisualizer& viewer) {
viewer.setBackgroundColor (1.0, 0.5, 1.0); pcl::PointXYZ o; o.x = 1.0; o.y = 0; o.z = 0;
viewer.addSphere (o, 0.25, \ std::cout << \ } void
viewerPsycho (pcl::visualization::PCLVisualizer& viewer) {
static unsigned count = 0; std::stringstream ss;
ss << \ viewer.removeShape (\
viewer.addText (ss.str(), 200, 300, \可¨|以°?注á?é释o¨a掉ì?这a行D,ê?此??时o?à不?会¨¢再¨′显?示o?图a?形?中D显?示o?Once per viewer loop:num一°?直?à增?加¨?
//FIXME: possible race condition here: user_data++; } int main () {
pcl::visualization::CloudViewer viewer(\
//blocks until the cloud is actually rendered viewer.showCloud(cloud);
//use the following functions to get access to the underlying more advanced/powerful //PCLVisualizer
//This will only get called once
viewer.runOnVisualizationThreadOnce (viewerOneOff);
//This will get called once per visualization iteration viewer.runOnVisualizationThread (viewerPsycho); while (!viewer.wasStopped ()) {
//you can also do cool processing here
//FIXME: Note that this is running in a separate thread from viewerPsycho //and you should guard against race conditions yourself... user_data++; } return 0; }
pcl::io::loadPCDFile (\
pcl::PointCloud
二、激光扫描仪;
立体摄像机和飞行摄像机获得的点云数据是有序点云数据,类似于图像或矩阵的结构,数据分为行和列;它相比于无序点云的优点在于预先了解相邻点的关系,邻域操作更加高效。
相关推荐: