39 #ifndef PCL_KEYPOINTS_AGAST_KEYPOINT_2D_H_
40 #define PCL_KEYPOINTS_AGAST_KEYPOINT_2D_H_
42 #include <pcl/point_cloud.h>
43 #include <pcl/point_types.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> >
689 inline AgastDetectorPtr
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>
size_t width_
Width of the image to process.
Keypoint< PointInT, PointOutT >::KdTree KdTree
AgastDetectorPtr getAgastDetector()
void setAgastDetector(const AgastDetectorPtr &detector)
Keypoint< PointInT, PointOutT >::PointCloudIn PointCloudIn
boost::shared_ptr< const OastDetector9_16 > ConstPtr
~AgastDetector5_8()
Destructor.
PointCloudIn::ConstPtr PointCloudInConstPtr
boost::shared_ptr< const AgastDetector7_12s > ConstPtr
AgastDetector(const std::vector< unsigned char > &image_data, const pcl::keypoints::agast::AbstractAgastDetector::Ptr &detector, pcl::PointCloud< Out > &output)
double bmax_
Max image value.
double getThreshold()
Get the threshold for corner detection, as set by the user.
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)
Detects 2D AGAST corner points.
size_t height_
Height of the image to process.
std::string name_
The key point detection method's name.
double getMaxDataValue()
Get the bmax image value, as set by the user.
double bmax_
Max image value.
OastDetector9_16(const size_t width, const size_t height, const double threshold, const double bmax=255)
Constructor.
Detector class for AGAST corner point detector (7_12s).
virtual ~AbstractAgastDetector()
Destructor.
virtual void detectKeypoints(PointCloudOut &output)
Detects the keypoints.
Detects 2D AGAST corner points.
~OastDetector9_16()
Destructor.
AgastKeypoint2D()
Constructor.
Keypoint< PointInT, PointOutT >::PointCloudOut PointCloudOut
AgastDetector7_12s(const size_t width, const size_t height, const double threshold, const double bmax=255)
Constructor.
AgastDetectorPtr detector_
The Agast detector to use.
bool getNonMaxSuppression()
Returns whether non-max-suppression is applied or not.
void setMaxDataValue(const double bmax)
Sets the max image data value (affects how many iterations AGAST does)
unsigned int getMaxKeypoints()
Get the maximum nuber of keypoints to return, as set by the user.
double threshold_
Threshold for corner detection.
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.
Keypoint represents the base class for key points.
boost::shared_ptr< AbstractAgastDetector > Ptr
void setMaxKeypoints(const unsigned int nr_max_keypoints)
Sets the maximum number of keypoints to return.
A 2D point structure representing pixel image coordinates.
int k_
The number of K nearest neighbors to use for each point.
A point structure representing Euclidean xyz coordinates.
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
virtual void detectKeypoints(PointCloudOut &output)=0
Detects the keypoints.
AgastKeypoint2D()
Constructor.
boost::shared_ptr< OastDetector9_16 > Ptr
boost::shared_ptr< const PointCloud< PointInT > > ConstPtr
boost::shared_ptr< const AbstractAgastDetector > ConstPtr
Detector class for AGAST corner point detector (OAST 9_16).
void setThreshold(const double threshold)
Sets the threshold for corner detection.
boost::shared_ptr< AgastDetector7_12s > Ptr
unsigned int nr_max_keypoints_
The maximum number of keypoints to return.
virtual ~AgastKeypoint2D()
Destructor.
bool apply_non_max_suppression_
Determines whether non-max-suppression is activated.
PointCloud represents the base class in PCL for storing collections of 3D points. ...
~AgastDetector7_12s()
Destructor.
AgastDetector(const std::vector< unsigned char > &image_data, const pcl::keypoints::agast::AbstractAgastDetector::Ptr &detector, pcl::PointCloud< pcl::PointUV > &output)
virtual ~AgastKeypoint2D()
Destructor.
unsigned int nr_max_keypoints_
The maximum number of keypoints to return.
bool initCompute()
Initializes everything and checks whether input data is fine.
unsigned int getMaxKeypoints()
Get the maximum nuber of keypoints to return, as set by the user.
boost::shared_ptr< AgastDetector5_8 > Ptr
double getThreshold()
Get the threshold for corner detection, as set by the user.
pcl::keypoints::agast::AbstractAgastDetector::Ptr AgastDetectorPtr
boost::shared_ptr< const AgastDetector5_8 > ConstPtr
Detector class for AGAST corner point detector (5_8).
virtual ~AgastKeypoint2DBase()
Destructor.
Abstract detector class for AGAST corner point detectors.
void setNonMaxSuppression(const bool enabled)
Sets whether non-max-suppression is applied or not.
AgastKeypoint2DBase()
Constructor.
double threshold_
Threshold for corner detection.
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.
IntensityT intensity_
Intensity field accessor.
void setMaxKeypoints(const unsigned int nr_max_keypoints)
Sets the maximum number of keypoints to return.