Point Cloud Library (PCL)
1.11.1
|
43 #include <pcl/point_cloud.h>
45 #include <pcl/keypoints/keypoint.h>
46 #include <pcl/common/intensity.h>
66 using Ptr = shared_ptr<AbstractAgastDetector>;
67 using ConstPtr = shared_ptr<const AbstractAgastDetector>;
76 const std::size_t height,
77 const double threshold,
81 , threshold_ (threshold)
82 , nr_max_keypoints_ (std::numeric_limits<unsigned int>::max ())
143 threshold_ = threshold;
160 nr_max_keypoints_ = nr_max_keypoints;
167 return (nr_max_keypoints_);
176 std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all)
const = 0;
183 std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &)
const = 0;
219 const std::vector<ScoreIndex>& scores,
229 const std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > & corners_all,
230 std::vector<ScoreIndex> & scores)
const;
239 const std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > & corners_all,
240 std::vector<ScoreIndex> & scores)
const;
268 using Ptr = shared_ptr<AgastDetector7_12s>;
269 using ConstPtr = shared_ptr<const AgastDetector7_12s>;
278 const std::size_t height,
279 const double threshold,
280 const double bmax = 255)
306 detect (
const unsigned char* im, std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all)
const override;
313 detect (
const float* im, std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all)
const override;
322 static const int border_width_ = 2;
325 std::array<std::int_fast16_t, 12> offset_;
339 using Ptr = shared_ptr<AgastDetector5_8>;
340 using ConstPtr = shared_ptr<const AgastDetector5_8>;
349 const std::size_t height,
350 const double threshold,
351 const double bmax = 255)
377 detect (
const unsigned char* im, std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all)
const override;
384 detect (
const float* im, std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all)
const override;
393 static const int border_width_ = 1;
396 std::array<std::int_fast16_t, 8> offset_;
410 using Ptr = shared_ptr<OastDetector9_16>;
411 using ConstPtr = shared_ptr<const OastDetector9_16>;
420 const std::size_t height,
421 const double threshold,
422 const double bmax = 255)
448 detect (
const unsigned char* im, std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all)
const override;
455 detect (
const float* im, std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all)
const override;
464 static const int border_width_ = 3;
467 std::array<std::int_fast16_t, 16> offset_;
480 template <
typename Out>
484 const std::vector<unsigned char> &image_data,
490 detector->applyNonMaxSuppression (image_data, tmp_cloud, output_temp);
500 const std::vector<unsigned char> &image_data,
505 detector->applyNonMaxSuppression (image_data, tmp_cloud, output);
509 template <
typename Out>
513 const std::vector<unsigned char> &image_data,
518 detector->detectKeypoints (image_data, output_temp);
528 const std::vector<unsigned char> &image_data,
532 detector->detectKeypoints (image_data, output);
554 template <
typename Po
intInT,
typename Po
intOutT,
typename IntensityT = pcl::common::IntensityFieldAccessor<Po
intInT> >
717 template <
typename Po
intInT,
typename Po
intOutT = pcl::Po
intUV>
737 name_ =
"AgastKeypoint2D";
781 :
public AgastKeypoint2DBase<pcl::PointXYZ, pcl::PointUV, pcl::common::IntensityFieldAccessor<pcl::PointXYZ> >
787 name_ =
"AgastKeypoint2D";
806 #include <pcl/keypoints/impl/agast_2d.hpp>
A 2D point structure representing pixel image coordinates.
void detect(const float *im, std::vector< pcl::PointUV, Eigen::aligned_allocator< pcl::PointUV > > &corners_all) const override
Detects points of interest (i.e., keypoints) in the given image.
virtual void initPattern()=0
Initializes the sample pattern.
virtual int computeCornerScore(const unsigned char *im) const =0
Computes corner score.
void detect(const unsigned char *im, std::vector< pcl::PointUV, Eigen::aligned_allocator< pcl::PointUV > > &corners_all) const override
Detects points of interest (i.e., keypoints) in the given image.
Detects 2D AGAST corner points.
~OastDetector9_16()
Destructor.
void initPattern() override
Initializes the sample pattern.
double getThreshold()
Get the threshold for corner detection, as set by the user.
~AgastKeypoint2D()
Destructor.
double getThreshold()
Get the threshold for corner detection, as set by the user.
Abstract detector class for AGAST corner point detectors.
virtual ~AbstractAgastDetector()
Destructor.
int k_
The number of K nearest neighbors to use for each point.
int computeCornerScore(const float *im) const override
Computes corner score.
int computeCornerScore(const unsigned char *im) const override
Computes corner score.
void setNonMaxSuppression(const bool enabled)
Sets whether non-max-suppression is applied or not.
int computeCornerScore(const float *im) const override
Computes corner score.
pcl::keypoints::agast::AbstractAgastDetector::Ptr AgastDetectorPtr
void detect(const unsigned char *im, std::vector< pcl::PointUV, Eigen::aligned_allocator< pcl::PointUV > > &corners_all) const override
Detects points of interest (i.e., keypoints) in the given image.
double bmax_
Max image value.
AgastKeypoint2D()
Constructor.
void applyNonMaxSuppression(const std::vector< unsigned char > &intensity_data, const pcl::PointCloud< pcl::PointUV > &input, pcl::PointCloud< pcl::PointUV > &output)
Applies non-max-suppression.
std::size_t height_
Height of the image to process.
int computeCornerScore(const float *im) const override
Computes corner score.
void initPattern() override
Initializes the sample pattern.
virtual void detect(const float *im, std::vector< pcl::PointUV, Eigen::aligned_allocator< pcl::PointUV > > &) const =0
Detects points of interest (i.e., keypoints) in the given image.
unsigned int getMaxKeypoints()
Get the maximum number of keypoints to return, as set by the user.
bool apply_non_max_suppression_
Determines whether non-max-suppression is activated.
void copyPointCloud(const pcl::PointCloud< PointInT > &cloud_in, pcl::PointCloud< PointOutT > &cloud_out)
Copy all the fields from a given point cloud into a new point cloud.
unsigned int getMaxKeypoints()
Get the maximum number of keypoints to return, as set by the user.
bool getNonMaxSuppression()
Returns whether non-max-suppression is applied or not.
AgastDetector(const std::vector< unsigned char > &image_data, const pcl::keypoints::agast::AbstractAgastDetector::Ptr &detector, pcl::PointCloud< Out > &output)
void setMaxKeypoints(const unsigned int nr_max_keypoints)
Sets the maximum number of keypoints to return.
void detectKeypoints(PointCloudOut &output) override
Detects the keypoints.
shared_ptr< const AbstractAgastDetector > ConstPtr
virtual int computeCornerScore(const float *im) const =0
Computes corner score.
~AgastDetector7_12s()
Destructor.
double getMaxDataValue()
Get the bmax image value, as set by the user.
AgastKeypoint2D()
Constructor.
~AgastKeypoint2D()
Destructor.
Detector class for AGAST corner point detector (7_12s).
void setAgastDetector(const AgastDetectorPtr &detector)
int computeCornerScore(const unsigned char *im) const override
Computes corner score.
AgastKeypoint2DBase()
Constructor.
A point structure representing Euclidean xyz coordinates.
Structure holding an index and the associated keypoint score.
void detectKeypoints(PointCloudOut &output) override=0
Detects the keypoints.
Detector class for AGAST corner point detector (OAST 9_16).
~AgastKeypoint2DBase()
Destructor.
void applyNonMaxSuppression(const std::vector< float > &intensity_data, const pcl::PointCloud< pcl::PointUV > &input, pcl::PointCloud< pcl::PointUV > &output)
Applies non-max-suppression.
shared_ptr< AbstractAgastDetector > Ptr
bool initCompute() override
Initializes everything and checks whether input data is fine.
AgastApplyNonMaxSuppresion(const std::vector< unsigned char > &image_data, const pcl::PointCloud< pcl::PointUV > &tmp_cloud, const pcl::keypoints::agast::AbstractAgastDetector::Ptr &detector, pcl::PointCloud< pcl::PointUV > &output)
AgastDetector(const std::vector< unsigned char > &image_data, const pcl::keypoints::agast::AbstractAgastDetector::Ptr &detector, pcl::PointCloud< pcl::PointUV > &output)
void detect(const float *im, std::vector< pcl::PointUV, Eigen::aligned_allocator< pcl::PointUV > > &corners_all) const override
Detects points of interest (i.e., keypoints) in the given image.
void detectKeypoints(const std::vector< unsigned char > &intensity_data, pcl::PointCloud< pcl::PointUV > &output) const
Detects corner points.
void detectKeypoints(pcl::PointCloud< pcl::PointUV > &output) override
Detects the keypoints.
std::size_t width_
Width of the image to process.
virtual void detect(const unsigned char *im, std::vector< pcl::PointUV, Eigen::aligned_allocator< pcl::PointUV > > &corners_all) const =0
Detects points of interest (i.e., keypoints) in the given image.
AgastDetector5_8(const std::size_t width, const std::size_t height, const double threshold, const double bmax=255)
Constructor.
void applyNonMaxSuppression(const pcl::PointCloud< pcl::PointUV > &input, const std::vector< ScoreIndex > &scores, pcl::PointCloud< pcl::PointUV > &output)
Non-max-suppression helper method.
void initPattern() override
Initializes the sample pattern.
double bmax_
Max image value.
std::string name_
The key point detection method's name.
void computeCornerScores(const unsigned char *im, const std::vector< pcl::PointUV, Eigen::aligned_allocator< pcl::PointUV > > &corners_all, std::vector< ScoreIndex > &scores) const
Computes corner scores for the specified points.
unsigned int nr_max_keypoints_
The maximum number of keypoints to return.
IntensityT intensity_
Intensity field accessor.
void setMaxKeypoints(const unsigned int nr_max_keypoints)
Sets the maximum number of keypoints to return.
Detects 2D AGAST corner points.
int computeCornerScore(const unsigned char *im) const override
Computes corner score.
void detect(const float *im, std::vector< pcl::PointUV, Eigen::aligned_allocator< pcl::PointUV > > &corners_all) const override
Detects points of interest (i.e., keypoints) in the given image.
void setMaxDataValue(const double bmax)
Sets the max image data value (affects how many iterations AGAST does)
typename Keypoint< PointInT, PointOutT >::PointCloudOut PointCloudOut
unsigned int nr_max_keypoints_
The maximum number of keypoints to return.
double threshold_
Threshold for corner detection.
AbstractAgastDetector(const std::size_t width, const std::size_t height, const double threshold, const double bmax)
Constructor.
shared_ptr< const PointCloud< PointInT > > ConstPtr
AgastDetector7_12s(const std::size_t width, const std::size_t height, const double threshold, const double bmax=255)
Constructor.
AgastDetectorPtr getAgastDetector()
void setThreshold(const double threshold)
Sets the threshold for corner detection.
Keypoint represents the base class for key points.
AgastApplyNonMaxSuppresion(const std::vector< unsigned char > &image_data, const pcl::PointCloud< pcl::PointUV > &tmp_cloud, const pcl::keypoints::agast::AbstractAgastDetector::Ptr &detector, pcl::PointCloud< Out > &output)
double threshold_
Threshold for corner detection.
void setThreshold(const double threshold)
Sets the threshold for corner detection.
OastDetector9_16(const std::size_t width, const std::size_t height, const double threshold, const double bmax=255)
Constructor.
typename PointCloudIn::ConstPtr PointCloudInConstPtr
void computeCornerScores(const float *im, const std::vector< pcl::PointUV, Eigen::aligned_allocator< pcl::PointUV > > &corners_all, std::vector< ScoreIndex > &scores) const
Computes corner scores for the specified points.
~AgastDetector5_8()
Destructor.
Detector class for AGAST corner point detector (5_8).
void detect(const unsigned char *im, std::vector< pcl::PointUV, Eigen::aligned_allocator< pcl::PointUV > > &corners_all) const override
Detects points of interest (i.e., keypoints) in the given image.
AgastDetectorPtr detector_
The Agast detector to use.
void detectKeypoints(const std::vector< float > &intensity_data, pcl::PointCloud< pcl::PointUV > &output) const
Detects corner points.