Skip to content

Commit

Permalink
Fix regression in pcl::SACSegmentation line fitting
Browse files Browse the repository at this point in the history
pcl::SampleConsensusModelLine<PointT>::isSampleGood should check if the two sample points differ in one coordinate, not in all of them.
  • Loading branch information
Thorsten Harter committed Jan 10, 2019
1 parent a023a4f commit 36c2bd6
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,16 @@
template <typename PointT> bool
pcl::SampleConsensusModelLine<PointT>::isSampleGood (const std::vector<int> &samples) const
{
// Make sure that the two sample points are not identical
if (
(input_->points[samples[0]].x != input_->points[samples[1]].x)
&&
||
(input_->points[samples[0]].y != input_->points[samples[1]].y)
&&
||
(input_->points[samples[0]].z != input_->points[samples[1]].z))
{
return (true);
}

return (false);
}
Expand Down

0 comments on commit 36c2bd6

Please sign in to comment.