PCL 1.2中的绘制线

时间:2015-05-12 17:03:53

标签: point-cloud-library

有没有人知道如何在pcl 1.2中的两个定义点之间画一条线? 我知道有一些像" addline" pcl 1.8中的说明但是pcl 1.2怎么样?

1 个答案:

答案 0 :(得分:1)

addline函数显示在PCL 1.2的文档中(参见下面的链接)。 addLine有两种方法。一个使用模型系数,另一个使用点。下面的代码示例是从该文档中复制的模型系数。

 // The following are given (or computed using sample consensus techniques)
 // See SampleConsensusModelLine for more information
 // Eigen::Vector3f point_on_line, line_direction;

 pcl::ModelCoefficients line_coeff;
 line_coeff.values.resize (6);    // We need 6 values
 line_coeff.values[0] = point_on_line.x ();
 line_coeff.values[1] = point_on_line.y ();
 line_coeff.values[2] = point_on_line.z ();

 line_coeff.values[3] = line_direction.x ();
 line_coeff.values[4] = line_direction.y ();
 line_coeff.values[5] = line_direction.z ();

 addLine (line_coeff);

这是用于点

的语法

bool pcl :: visualization :: PCLVisualizer :: addLine(const P1& pt1,const P2& pt2,const std :: string& id =“line”,int viewport = 0)

文件pcl_visualizer.hpp的第577行定义。

http://docs.pointclouds.org/1.2.0/classpcl_1_1visualization_1_1_p_c_l_visualizer.html#a5fd2b99b85da61df8b58980bdb6b0f41