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;
135 computeCornerScore (
const float* im)
const = 0;
143 threshold_ = threshold;
160 nr_max_keypoints_ = nr_max_keypoints;
167 return (nr_max_keypoints_);
175 detect (
const unsigned char* im,
176 std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all)
const = 0;
183 detect (
const float* im,
184 std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &)
const = 0;
220 const std::vector<ScoreIndex>& scores,
229 computeCornerScores (
const unsigned char* im,
230 const std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > & corners_all,
231 std::vector<ScoreIndex> & scores);
239 computeCornerScores (
const float* im,
240 const std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > & corners_all,
241 std::vector<ScoreIndex> & scores);
269 typedef boost::shared_ptr<AgastDetector7_12s>
Ptr;
270 typedef boost::shared_ptr<const AgastDetector7_12s>
ConstPtr;
280 const double threshold,
281 const double bmax = 255)
294 computeCornerScore (
const unsigned char* im)
const;
300 computeCornerScore (
const float* im)
const;
307 detect (
const unsigned char* im, std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all)
const;
314 detect (
const float* im, std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all)
const;
323 static const int border_width_ = 2;
326 int_fast16_t s_offset0_;
327 int_fast16_t s_offset1_;
328 int_fast16_t s_offset2_;
329 int_fast16_t s_offset3_;
330 int_fast16_t s_offset4_;
331 int_fast16_t s_offset5_;
332 int_fast16_t s_offset6_;
333 int_fast16_t s_offset7_;
334 int_fast16_t s_offset8_;
335 int_fast16_t s_offset9_;
336 int_fast16_t s_offset10_;
337 int_fast16_t s_offset11_;
351 typedef boost::shared_ptr<AgastDetector5_8>
Ptr;
352 typedef boost::shared_ptr<const AgastDetector5_8>
ConstPtr;
362 const double threshold,
363 const double bmax = 255)
376 computeCornerScore (
const unsigned char* im)
const;
382 computeCornerScore (
const float* im)
const;
389 detect (
const unsigned char* im, std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all)
const;
396 detect (
const float* im, std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all)
const;
405 static const int border_width_ = 1;
408 int_fast16_t s_offset0_;
409 int_fast16_t s_offset1_;
410 int_fast16_t s_offset2_;
411 int_fast16_t s_offset3_;
412 int_fast16_t s_offset4_;
413 int_fast16_t s_offset5_;
414 int_fast16_t s_offset6_;
415 int_fast16_t s_offset7_;
429 typedef boost::shared_ptr<OastDetector9_16>
Ptr;
430 typedef boost::shared_ptr<const OastDetector9_16>
ConstPtr;
440 const double threshold,
441 const double bmax = 255)
454 computeCornerScore (
const unsigned char* im)
const;
460 computeCornerScore (
const float* im)
const;
467 detect (
const unsigned char* im, std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all)
const;
474 detect (
const float* im, std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all)
const;
483 static const int border_width_ = 3;
486 int_fast16_t s_offset0_;
487 int_fast16_t s_offset1_;
488 int_fast16_t s_offset2_;
489 int_fast16_t s_offset3_;
490 int_fast16_t s_offset4_;
491 int_fast16_t s_offset5_;
492 int_fast16_t s_offset6_;
493 int_fast16_t s_offset7_;
494 int_fast16_t s_offset8_;
495 int_fast16_t s_offset9_;
496 int_fast16_t s_offset10_;
497 int_fast16_t s_offset11_;
498 int_fast16_t s_offset12_;
499 int_fast16_t s_offset13_;
500 int_fast16_t s_offset14_;
501 int_fast16_t s_offset15_;
514 template <
typename Out>
518 const std::vector<unsigned char> &image_data,
524 detector->applyNonMaxSuppression (image_data, tmp_cloud, output_temp);
525 pcl::copyPointCloud<pcl::PointUV, Out> (output_temp, output);
534 const std::vector<unsigned char> &image_data,
539 detector->applyNonMaxSuppression (image_data, tmp_cloud, output);
543 template <
typename Out>
547 const std::vector<unsigned char> &image_data,
552 detector->detectKeypoints (image_data, output_temp);
553 pcl::copyPointCloud<pcl::PointUV, Out> (output_temp, output);
562 const std::vector<unsigned char> &image_data,
566 detector->detectKeypoints (image_data, output);
588 template <
typename Po
intInT,
typename Po
intOutT,
typename IntensityT = pcl::common::IntensityFieldAccessor<Po
intInT> >
691 inline AgastDetectorPtr
752 template <
typename Po
intInT,
typename Po
intOutT = pcl::Po
intUV>
772 name_ =
"AgastKeypoint2D";
816 :
public AgastKeypoint2DBase<pcl::PointXYZ, pcl::PointUV, pcl::common::IntensityFieldAccessor<pcl::PointXYZ> >
822 name_ =
"AgastKeypoint2D";
841 #include <pcl/keypoints/impl/agast_2d.hpp>
AgastDetector7_12s(const size_t width, const size_t height, const double threshold, const double bmax=255)
Constructor.
pcl::keypoints::agast::AbstractAgastDetector::Ptr AgastDetectorPtr
boost::shared_ptr< const AbstractAgastDetector > ConstPtr
double getMaxDataValue()
Get the bmax image value, as set by the user.
unsigned int getMaxKeypoints()
Get the maximum nuber of keypoints to return, as set by the user.
double threshold_
Threshold for corner detection.
AbstractAgastDetector(const size_t width, const size_t height, const double threshold, const double bmax)
Constructor.
Abstract detector class for AGAST corner point detectors.
IntensityT intensity_
Intensity field accessor.
AgastKeypoint2DBase()
Constructor.
unsigned int nr_max_keypoints_
The maximum number of keypoints to return.
void setMaxKeypoints(const unsigned int nr_max_keypoints)
Sets the maximum number of keypoints to return.
Keypoint< PointInT, PointOutT >::PointCloudOut PointCloudOut
boost::shared_ptr< AbstractAgastDetector > Ptr
Keypoint< PointInT, PointOutT >::PointCloudIn PointCloudIn
void setThreshold(const double threshold)
Sets the threshold for corner detection.
A 2D point structure representing pixel image coordinates.
virtual void detectKeypoints(PointCloudOut &output)
Detects the keypoints.
Keypoint< PointInT, PointOutT >::KdTree KdTree
virtual ~AgastKeypoint2DBase()
Destructor.
virtual ~AgastKeypoint2D()
Destructor.
double getThreshold()
Get the threshold for corner detection, as set by the user.
double bmax_
Max image value.
~OastDetector9_16()
Destructor.
bool apply_non_max_suppression_
Determines whether non-max-suppression is activated.
virtual ~AbstractAgastDetector()
Destructor.
unsigned int getMaxKeypoints()
Get the maximum nuber of keypoints to return, as set by the user.
virtual void detectKeypoints(PointCloudOut &output)=0
Detects the keypoints.
Detects 2D AGAST corner points.
void setAgastDetector(const AgastDetectorPtr &detector)
void setMaxKeypoints(const unsigned int nr_max_keypoints)
Sets the maximum number of keypoints to return.
Structure holding an index and the associated keypoint score.
unsigned int nr_max_keypoints_
The maximum number of keypoints to return.
AgastDetector(const std::vector< unsigned char > &image_data, const pcl::keypoints::agast::AbstractAgastDetector::Ptr &detector, pcl::PointCloud< pcl::PointUV > &output)
size_t width_
Width of the image to process.
boost::shared_ptr< AgastDetector7_12s > Ptr
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)
boost::shared_ptr< const PointCloud< PointInT > > ConstPtr
void setNonMaxSuppression(const bool enabled)
Sets whether non-max-suppression is applied or not.
Detector class for AGAST corner point detector (7_12s).
Detector class for AGAST corner point detector (OAST 9_16).
size_t height_
Height of the image to process.
double bmax_
Max image value.
boost::shared_ptr< OastDetector9_16 > Ptr
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)
boost::shared_ptr< AgastDetector5_8 > Ptr
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 represents the base class for key points.
boost::shared_ptr< const OastDetector9_16 > ConstPtr
int k_
The number of K nearest neighbors to use for each point.
double threshold_
Threshold for corner detection.
bool initCompute()
Initializes everything and checks whether input data is fine.
double getThreshold()
Get the threshold for corner detection, as set by the user.
void setThreshold(const double threshold)
Sets the threshold for corner detection.
virtual ~AgastKeypoint2D()
Destructor.
PointCloudIn::ConstPtr PointCloudInConstPtr
Detector class for AGAST corner point detector (5_8).
~AgastDetector7_12s()
Destructor.
AgastDetectorPtr getAgastDetector()
AgastDetectorPtr detector_
The Agast detector to use.
AgastDetector5_8(const size_t width, const size_t height, const double threshold, const double bmax=255)
Constructor.
OastDetector9_16(const size_t width, const size_t height, const double threshold, const double bmax=255)
Constructor.
AgastKeypoint2D()
Constructor.
void setMaxDataValue(const double bmax)
Sets the max image data value (affects how many iterations AGAST does)
std::string name_
The key point detection method's name.
A point structure representing Euclidean xyz coordinates.
AgastKeypoint2D()
Constructor.
PointCloud represents the base class in PCL for storing collections of 3D points. ...
Keypoint< PointInT, PointOutT >::PointCloudOut PointCloudOut
boost::shared_ptr< const AgastDetector5_8 > ConstPtr
bool getNonMaxSuppression()
Returns whether non-max-suppression is applied or not.
Detects 2D AGAST corner points.
~AgastDetector5_8()
Destructor.