Skip to content

Commit

Permalink
Update sac_model_cylinder.hpp
Browse files Browse the repository at this point in the history
Refer to the relevant calculation codes in other functions. Multiplication here should be changed to division.

like
"projectPointToLine (const Eigen::Vector4f &pt,
                          const Eigen::Vector4f &line_pt,
                          const Eigen::Vector4f &line_dir,
                          Eigen::Vector4f &pt_proj) const
      {
        float k = (pt.dot (line_dir) - line_pt.dot (line_dir)) / line_dir.dot (line_dir);
        // Calculate the projection of the point on the line
        pt_proj = line_pt + k * line_dir;
      }

"
  • Loading branch information
gaishunhua authored Sep 22, 2023
1 parent b5ce8f5 commit 8662c13
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ pcl::SampleConsensusModelCylinder<PointT, PointNT>::projectPointToCylinder (
Eigen::Vector4f line_pt (model_coefficients[0], model_coefficients[1], model_coefficients[2], 0.0f);
Eigen::Vector4f line_dir (model_coefficients[3], model_coefficients[4], model_coefficients[5], 0.0f);

float k = (pt.dot (line_dir) - line_pt.dot (line_dir)) * line_dir.dot (line_dir);
float k = (pt.dot (line_dir) - line_pt.dot (line_dir)) / line_dir.dot (line_dir);
pt_proj = line_pt + k * line_dir;

Eigen::Vector4f dir = pt - pt_proj;
Expand Down

0 comments on commit 8662c13

Please sign in to comment.