Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/3d_line_detection/HoughTransform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ template <typename POINT_CLOUD_TYPE> class HoughTransform

explicit HoughTransform(const Param& param);

LineSegment3Ds run(const PointCloudPtr& cloud);
LineSegment3Ds run(const PointCloudPtr& cloud, float maxNorm = 0);

private:
int getLine(pcl::ModelCoefficients& coeffs, const float minRange, const float deltaRange,
Expand Down
2 changes: 1 addition & 1 deletion include/3d_line_detection/LineSegment3D.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ template <typename POINT_CLOUD_TYPE> class LineSegment3D
}

private:
const PointCloudPtr& m_cloud;
const PointCloudPtr m_cloud;
pcl::ModelCoefficients m_coeffs;
std::vector<int> m_inlierIndices;
};
Expand Down
8 changes: 6 additions & 2 deletions include/3d_line_detection/impl/HoughTransform.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,17 @@ int HoughTransform<POINT_CLOUD_TYPE>::getLine(pcl::ModelCoefficients& coeffs, co

template <typename POINT_CLOUD_TYPE>
typename HoughTransform<POINT_CLOUD_TYPE>::LineSegment3Ds
HoughTransform<POINT_CLOUD_TYPE>::run(const PointCloudPtr& cloud)
HoughTransform<POINT_CLOUD_TYPE>::run(const PointCloudPtr& cloud, float maxNorm)
{
PointCloudType minBound;
PointCloudType maxBound;

pcl::getMinMax3D(*cloud, minBound, maxBound);
float maxNorm = std::max<float>(this->calcNorm(minBound), this->calcNorm(maxBound));

if (maxNorm == 0) {
maxNorm = std::max<float>(this->calcNorm(minBound), this->calcNorm(maxBound));
}

float range = 2 * maxNorm;
float minRange = -maxNorm;
float deltaRange = range / m_param.numRangeBin;
Expand Down