Point Cloud Library (PCL)
1.9.1
|
39 #ifndef PCL_KEYPOINTS_AGAST_KEYPOINT_2D_H_
40 #define PCL_KEYPOINTS_AGAST_KEYPOINT_2D_H_
42 #include <pcl/point_cloud.h>
44 #include <pcl/keypoints/keypoint.h>
45 #include <pcl/common/intensity.h>
65 typedef boost::shared_ptr<AbstractAgastDetector>
Ptr;
66 typedef boost::shared_ptr<const AbstractAgastDetector>
ConstPtr;
76 const double threshold,
80 , threshold_ (threshold)
81 , nr_max_keypoints_ (
std::numeric_limits<unsigned int>::max ())
93 detectKeypoints (
const std::vector<unsigned char> &intensity_data,
101 detectKeypoints (
const std::vector<float> &intensity_data,
110 applyNonMaxSuppression (
const std::vector<unsigned char>& intensity_data,
120 applyNonMaxSuppression (
const std::vector<float>& intensity_data,
128 computeCornerScore (
const unsigned char* im)
const = 0;
134 computeCornerScore (
const float* im)
const = 0;
142 threshold_ = threshold;
159 nr_max_keypoints_ = nr_max_keypoints;
166 return (nr_max_keypoints_);
174 detect (
const unsigned char* im,
175 std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all)
const = 0;
181 detect (
const float* im,
182 std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &)
const = 0;
218 const std::vector<ScoreIndex>& scores,
227 computeCornerScores (
const unsigned char* im,
228 const std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > & corners_all,
229 std::vector<ScoreIndex> & scores);
237 computeCornerScores (
const float* im,
238 const std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > & corners_all,
239 std::vector<ScoreIndex> & scores);
267 typedef boost::shared_ptr<AgastDetector7_12s>
Ptr;
268 typedef boost::shared_ptr<const AgastDetector7_12s>
ConstPtr;
278 const double threshold,
279 const double bmax = 255)
292 computeCornerScore (
const unsigned char* im)
const;
298 computeCornerScore (
const float* im)
const;
305 detect (
const unsigned char* im, std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all)
const;
312 detect (
const float* im, std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all)
const;
321 static const int border_width_ = 2;
324 int_fast16_t s_offset0_;
325 int_fast16_t s_offset1_;
326 int_fast16_t s_offset2_;
327 int_fast16_t s_offset3_;
328 int_fast16_t s_offset4_;
329 int_fast16_t s_offset5_;
330 int_fast16_t s_offset6_;
331 int_fast16_t s_offset7_;
332 int_fast16_t s_offset8_;
333 int_fast16_t s_offset9_;
334 int_fast16_t s_offset10_;
335 int_fast16_t s_offset11_;
349 typedef boost::shared_ptr<AgastDetector5_8>
Ptr;
350 typedef boost::shared_ptr<const AgastDetector5_8>
ConstPtr;
360 const double threshold,
361 const double bmax = 255)
374 computeCornerScore (
const unsigned char* im)
const;
380 computeCornerScore (
const float* im)
const;
387 detect (
const unsigned char* im, std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all)
const;
394 detect (
const float* im, std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all)
const;
403 static const int border_width_ = 1;
406 int_fast16_t s_offset0_;
407 int_fast16_t s_offset1_;
408 int_fast16_t s_offset2_;
409 int_fast16_t s_offset3_;
410 int_fast16_t s_offset4_;
411 int_fast16_t s_offset5_;
412 int_fast16_t s_offset6_;
413 int_fast16_t s_offset7_;
427 typedef boost::shared_ptr<OastDetector9_16>
Ptr;
428 typedef boost::shared_ptr<const OastDetector9_16>
ConstPtr;
438 const double threshold,
439 const double bmax = 255)
452 computeCornerScore (
const unsigned char* im)
const;
458 computeCornerScore (
const float* im)
const;
465 detect (
const unsigned char* im, std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all)
const;
472 detect (
const float* im, std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all)
const;
481 static const int border_width_ = 3;
484 int_fast16_t s_offset0_;
485 int_fast16_t s_offset1_;
486 int_fast16_t s_offset2_;
487 int_fast16_t s_offset3_;
488 int_fast16_t s_offset4_;
489 int_fast16_t s_offset5_;
490 int_fast16_t s_offset6_;
491 int_fast16_t s_offset7_;
492 int_fast16_t s_offset8_;
493 int_fast16_t s_offset9_;
494 int_fast16_t s_offset10_;
495 int_fast16_t s_offset11_;
496 int_fast16_t s_offset12_;
497 int_fast16_t s_offset13_;
498 int_fast16_t s_offset14_;
499 int_fast16_t s_offset15_;
512 template <
typename Out>
516 const std::vector<unsigned char> &image_data,
522 detector->applyNonMaxSuppression (image_data, tmp_cloud, output_temp);
523 pcl::copyPointCloud<pcl::PointUV, Out> (output_temp, output);
532 const std::vector<unsigned char> &image_data,
537 detector->applyNonMaxSuppression (image_data, tmp_cloud, output);
541 template <
typename Out>
545 const std::vector<unsigned char> &image_data,
550 detector->detectKeypoints (image_data, output_temp);
551 pcl::copyPointCloud<pcl::PointUV, Out> (output_temp, output);
560 const std::vector<unsigned char> &image_data,
564 detector->detectKeypoints (image_data, output);
586 template <
typename Po
intInT,
typename Po
intOutT,
typename IntensityT = pcl::common::IntensityFieldAccessor<Po
intInT> >
750 template <
typename Po
intInT,
typename Po
intOutT = pcl::Po
intUV>
770 name_ =
"AgastKeypoint2D";
814 :
public AgastKeypoint2DBase<pcl::PointXYZ, pcl::PointUV, pcl::common::IntensityFieldAccessor<pcl::PointXYZ> >
820 name_ =
"AgastKeypoint2D";
839 #include <pcl/keypoints/impl/agast_2d.hpp>
A 2D point structure representing pixel image coordinates.
boost::shared_ptr< AgastDetector7_12s > Ptr
This file defines compatibility wrappers for low level I/O functions.
size_t width_
Width of the image to process.
Detects 2D AGAST corner points.
~OastDetector9_16()
Destructor.
double getThreshold()
Get the threshold for corner detection, as set by the user.
virtual ~AgastKeypoint2D()
Destructor.
double getThreshold()
Get the threshold for corner detection, as set by the user.
Abstract detector class for AGAST corner point detectors.
virtual ~AgastKeypoint2DBase()
Destructor.
virtual ~AbstractAgastDetector()
Destructor.
size_t height_
Height of the image to process.
void setNonMaxSuppression(const bool enabled)
Sets whether non-max-suppression is applied or not.
double bmax_
Max image value.
AgastKeypoint2D()
Constructor.
PointCloudIn::ConstPtr PointCloudInConstPtr
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.
unsigned int getMaxKeypoints()
Get the maximum number of keypoints to return, as set by the user.
boost::shared_ptr< AbstractAgastDetector > Ptr
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.
~AgastDetector7_12s()
Destructor.
double getMaxDataValue()
Get the bmax image value, as set by the user.
AgastKeypoint2D()
Constructor.
boost::shared_ptr< const OastDetector9_16 > ConstPtr
Detector class for AGAST corner point detector (7_12s).
pcl::keypoints::agast::AbstractAgastDetector::Ptr AgastDetectorPtr
void setAgastDetector(const AgastDetectorPtr &detector)
AgastKeypoint2DBase()
Constructor.
A point structure representing Euclidean xyz coordinates.
boost::shared_ptr< const AgastDetector7_12s > ConstPtr
AgastDetector5_8(const size_t width, const size_t height, const double threshold, const double bmax=255)
Constructor.
Structure holding an index and the associated keypoint score.
Detector class for AGAST corner point detector (OAST 9_16).
boost::shared_ptr< const AbstractAgastDetector > ConstPtr
virtual void detectKeypoints(PointCloudOut &output)
Detects the keypoints.
boost::shared_ptr< OastDetector9_16 > Ptr
boost::shared_ptr< AgastDetector5_8 > Ptr
virtual void detectKeypoints(PointCloudOut &output)=0
Detects the keypoints.
std::string name_
The key point detection method's name.
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)
double bmax_
Max image value.
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.
void setMaxDataValue(const double bmax)
Sets the max image data value (affects how many iterations AGAST does)
boost::shared_ptr< const PointCloud< pcl::PointXYZ > > ConstPtr
unsigned int nr_max_keypoints_
The maximum number of keypoints to return.
double threshold_
Threshold for corner detection.
bool initCompute()
Initializes everything and checks whether input data is fine.
AgastDetectorPtr getAgastDetector()
boost::shared_ptr< const AgastDetector5_8 > ConstPtr
OastDetector9_16(const size_t width, const size_t height, const double threshold, const double bmax=255)
Constructor.
void setThreshold(const double threshold)
Sets the threshold for corner detection.
Keypoint represents the base class for key points.
Keypoint< PointInT, PointOutT >::PointCloudIn PointCloudIn
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)
Keypoint< PointInT, PointOutT >::PointCloudOut PointCloudOut
double threshold_
Threshold for corner detection.
int k_
The number of K nearest neighbors to use for each point.
AgastDetector7_12s(const size_t width, const size_t height, const double threshold, const double bmax=255)
Constructor.
AbstractAgastDetector(const size_t width, const size_t height, const double threshold, const double bmax)
Constructor.
void setThreshold(const double threshold)
Sets the threshold for corner detection.
virtual ~AgastKeypoint2D()
Destructor.
Keypoint< PointInT, PointOutT >::PointCloudOut PointCloudOut
Keypoint< PointInT, PointOutT >::KdTree KdTree
~AgastDetector5_8()
Destructor.
Detector class for AGAST corner point detector (5_8).
AgastDetectorPtr detector_
The Agast detector to use.