Ransac for detecting the line

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Ransac for detecting the line

qnan1983
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Ransac for detecting the line

james
Administrator
Here is some code you will probably find useful:

// LineCoefficients is a float vector with 6 values:
// point_on_line.x  point_on_line.y  point_on_line.z  line_direction.x  line_direction.y  line_direction.z
// the direction values together make a unit vector
Eigen::Vector3f UnitVector(LineCoefficients->values[3],LineCoefficients->values[4],LineCoefficients->values[5]);
Eigen::Vector3f Coefficients(LineCoefficients->values[0],LineCoefficients->values[1],LineCoefficients->values[2]);

// convert unit vector to angle
double lineangle = pcl::rad2deg(atan2(LineCoefficients->values[4],LineCoefficients->values[3])); // atan2(j,i)