Point Cloud Library (PCL)  1.7.1
agast_2d.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2010-2011, Willow Garage, Inc.
6  * Copyright (c) 2012-, Open Perception, Inc.
7  *
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  *
14  * * Redistributions of source code must retain the above copyright
15  * notice, this list of conditions and the following disclaimer.
16  * * Redistributions in binary form must reproduce the above
17  * copyright notice, this list of conditions and the following
18  * disclaimer in the documentation and/or other materials provided
19  * with the distribution.
20  * * Neither the name of Willow Garage, Inc. nor the names of its
21  * contributors may be used to endorse or promote products derived
22  * from this software without specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
28  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
29  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
30  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
34  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35  * POSSIBILITY OF SUCH DAMAGE.
36  *
37  */
38 
39 #ifndef PCL_KEYPOINTS_AGAST_KEYPOINT_2D_H_
40 #define PCL_KEYPOINTS_AGAST_KEYPOINT_2D_H_
41 
42 #include <pcl/point_cloud.h>
43 #include <pcl/point_types.h>
44 #include <pcl/keypoints/keypoint.h>
45 #include <pcl/common/intensity.h>
46 
47 namespace pcl
48 {
49  namespace keypoints
50  {
51  namespace agast
52  {
53 
54  /** \brief Abstract detector class for AGAST corner point detectors.
55  *
56  * Adapted from the C++ implementation of Elmar Mair
57  * (http://www6.in.tum.de/Main/ResearchAgast).
58  *
59  * \author Stefan Holzer
60  * \ingroup keypoints
61  */
62  class PCL_EXPORTS AbstractAgastDetector
63  {
64  public:
65  typedef boost::shared_ptr<AbstractAgastDetector> Ptr;
66  typedef boost::shared_ptr<const AbstractAgastDetector> ConstPtr;
67 
68  /** \brief Constructor.
69  * \param[in] width the width of the image to process
70  * \param[in] height the height of the image to process
71  * \param[in] threshold the corner detection threshold
72  * \param[in] bmax the max image value (default: 255)
73  */
74  AbstractAgastDetector (const size_t width,
75  const size_t height,
76  const double threshold,
77  const double bmax)
78  : width_ (width)
79  , height_ (height)
80  , threshold_ (threshold)
81  , nr_max_keypoints_ (std::numeric_limits<unsigned int>::max ())
82  , bmax_ (bmax)
83  {}
84 
85  /** \brief Destructor. */
86  virtual ~AbstractAgastDetector () {}
87 
88  /** \brief Detects corner points.
89  * \param intensity_data
90  * \param output
91  */
92  void
93  detectKeypoints (const std::vector<unsigned char> &intensity_data,
95 
96  /** \brief Detects corner points.
97  * \param intensity_data
98  * \param output
99  */
100  void
101  detectKeypoints (const std::vector<float> &intensity_data,
103 
104  /** \brief Applies non-max-suppression.
105  * \param[in] intensity_data the image data
106  * \param[in] input the keypoint positions
107  * \param[out] output the resultant keypoints after non-max-supression
108  */
109  void
110  applyNonMaxSuppression (const std::vector<unsigned char>& intensity_data,
111  const pcl::PointCloud<pcl::PointUV> &input,
113 
114  /** \brief Applies non-max-suppression.
115  * \param[in] intensity_data the image data
116  * \param[in] input the keypoint positions
117  * \param[out] output the resultant keypoints after non-max-supression
118  */
119  void
120  applyNonMaxSuppression (const std::vector<float>& intensity_data,
121  const pcl::PointCloud<pcl::PointUV> &input,
123 
124  /** \brief Computes corner score.
125  * \param[in] im the pixels to compute the score at
126  */
127  virtual int
128  computeCornerScore (const unsigned char* im) const = 0;
129 
130  /** \brief Computes corner score.
131  * \param[in] im the pixels to compute the score at
132  * \param[in] bmax
133  */
134  virtual int
135  computeCornerScore (const float* im) const = 0;
136 
137  /** \brief Sets the threshold for corner detection.
138  * \param[in] threshold the threshold used for corner detection.
139  */
140  inline void
141  setThreshold (const double threshold)
142  {
143  threshold_ = threshold;
144  }
145 
146  /** \brief Get the threshold for corner detection, as set by the user. */
147  inline double
149  {
150  return (threshold_);
151  }
152 
153  /** \brief Sets the maximum number of keypoints to return. The
154  * estimated keypoints are sorted by their internal score.
155  * \param[in] nr_max_keypoints set the maximum number of keypoints to return
156  */
157  inline void
158  setMaxKeypoints (const unsigned int nr_max_keypoints)
159  {
160  nr_max_keypoints_ = nr_max_keypoints;
161  }
162 
163  /** \brief Get the maximum nuber of keypoints to return, as set by the user. */
164  inline unsigned int
166  {
167  return (nr_max_keypoints_);
168  }
169 
170  /** \brief Detects points of interest (i.e., keypoints) in the given image
171  * \param[in] im the image to detect keypoints in
172  * \param[out] corners_all the resultant set of keypoints detected
173  */
174  virtual void
175  detect (const unsigned char* im,
176  std::vector<pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all) const = 0;
177 
178  /** \brief Detects points of interest (i.e., keypoints) in the given image
179  * \param[in] im the image to detect keypoints in
180  * \param[out] corners_all the resultant set of keypoints detected
181  */
182  virtual void
183  detect (const float* im,
184  std::vector<pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &) const = 0;
185 
186  protected:
187 
188  /** \brief Structure holding an index and the associated keypoint score. */
189  struct ScoreIndex
190  {
191  int idx;
192  int score;
193  };
194 
195  /** \brief Score index comparator. */
197  {
198  /** \brief Comparator
199  * \param[i1] the first score index
200  * \param[i2] the second score index
201  */
202  inline bool
203  operator() (const ScoreIndex &i1, const ScoreIndex &i2)
204  {
205  return (i1.score > i2.score);
206  }
207  };
208 
209  /** \brief Initializes the sample pattern. */
210  virtual void
211  initPattern () = 0;
212 
213  /** \brief Non-max-suppression helper method.
214  * \param[in] input the keypoint positions
215  * \param[in] scores the keypoint scores computed on the image data
216  * \param[out] output the resultant keypoints after non-max-supression
217  */
218  void
219  applyNonMaxSuppression (const pcl::PointCloud<pcl::PointUV> &input,
220  const std::vector<ScoreIndex>& scores,
222 
223  /** \brief Computes corner scores for the specified points.
224  * \param im
225  * \param corners_all
226  * \param scores
227  */
228  void
229  computeCornerScores (const unsigned char* im,
230  const std::vector<pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > & corners_all,
231  std::vector<ScoreIndex> & scores);
232 
233  /** \brief Computes corner scores for the specified points.
234  * \param im
235  * \param corners_all
236  * \param scores
237  */
238  void
239  computeCornerScores (const float* im,
240  const std::vector<pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > & corners_all,
241  std::vector<ScoreIndex> & scores);
242 
243  /** \brief Width of the image to process. */
244  size_t width_;
245  /** \brief Height of the image to process. */
246  size_t height_;
247 
248  /** \brief Threshold for corner detection. */
249  double threshold_;
250 
251  /** \brief The maximum number of keypoints to return. */
252  unsigned int nr_max_keypoints_;
253 
254  /** \brief Max image value. */
255  double bmax_;
256  };
257 
258  /** \brief Detector class for AGAST corner point detector (7_12s).
259  *
260  * Adapted from the C++ implementation of Elmar Mair
261  * (http://www6.in.tum.de/Main/ResearchAgast).
262  *
263  * \author Stefan Holzer
264  * \ingroup keypoints
265  */
266  class PCL_EXPORTS AgastDetector7_12s : public AbstractAgastDetector
267  {
268  public:
269  typedef boost::shared_ptr<AgastDetector7_12s> Ptr;
270  typedef boost::shared_ptr<const AgastDetector7_12s> ConstPtr;
271 
272  /** \brief Constructor.
273  * \param[in] width the width of the image to process
274  * \param[in] height the height of the image to process
275  * \param[in] threshold the corner detection threshold
276  * \param[in] bmax the max image value (default: 255)
277  */
278  AgastDetector7_12s (const size_t width,
279  const size_t height,
280  const double threshold,
281  const double bmax = 255)
282  : AbstractAgastDetector (width, height, threshold, bmax)
283  {
284  initPattern ();
285  }
286 
287  /** \brief Destructor. */
289 
290  /** \brief Computes corner score.
291  * \param im
292  */
293  int
294  computeCornerScore (const unsigned char* im) const;
295 
296  /** \brief Computes corner score.
297  * \param im
298  */
299  int
300  computeCornerScore (const float* im) const;
301 
302  /** \brief Detects points of interest (i.e., keypoints) in the given image
303  * \param[in] im the image to detect keypoints in
304  * \param[out] corners_all the resultant set of keypoints detected
305  */
306  void
307  detect (const unsigned char* im, std::vector<pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all) const;
308 
309  /** \brief Detects points of interest (i.e., keypoints) in the given image
310  * \param[in] im the image to detect keypoints in
311  * \param[out] corners_all the resultant set of keypoints detected
312  */
313  void
314  detect (const float* im, std::vector<pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all) const;
315 
316  protected:
317  /** \brief Initializes the sample pattern. */
318  void
319  initPattern ();
320 
321  private:
322  /** \brief Border width. */
323  static const int border_width_ = 2;
324 
325  // offsets defining the sample pattern
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_;
338  };
339 
340  /** \brief Detector class for AGAST corner point detector (5_8).
341  *
342  * Adapted from the C++ implementation of Elmar Mair
343  * (http://www6.in.tum.de/Main/ResearchAgast).
344  *
345  * \author Stefan Holzer
346  * \ingroup keypoints
347  */
348  class PCL_EXPORTS AgastDetector5_8 : public AbstractAgastDetector
349  {
350  public:
351  typedef boost::shared_ptr<AgastDetector5_8> Ptr;
352  typedef boost::shared_ptr<const AgastDetector5_8> ConstPtr;
353 
354  /** \brief Constructor.
355  * \param[in] width the width of the image to process
356  * \param[in] height the height of the image to process
357  * \param[in] threshold the corner detection threshold
358  * \param[in] bmax the max image value (default: 255)
359  */
360  AgastDetector5_8 (const size_t width,
361  const size_t height,
362  const double threshold,
363  const double bmax = 255)
364  : AbstractAgastDetector (width, height, threshold, bmax)
365  {
366  initPattern ();
367  }
368 
369  /** \brief Destructor. */
371 
372  /** \brief Computes corner score.
373  * \param im
374  */
375  int
376  computeCornerScore (const unsigned char* im) const;
377 
378  /** \brief Computes corner score.
379  * \param im
380  */
381  int
382  computeCornerScore (const float* im) const;
383 
384  /** \brief Detects points of interest (i.e., keypoints) in the given image
385  * \param[in] im the image to detect keypoints in
386  * \param[out] corners_all the resultant set of keypoints detected
387  */
388  void
389  detect (const unsigned char* im, std::vector<pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all) const;
390 
391  /** \brief Detects points of interest (i.e., keypoints) in the given image
392  * \param[in] im the image to detect keypoints in
393  * \param[out] corners_all the resultant set of keypoints detected
394  */
395  void
396  detect (const float* im, std::vector<pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all) const;
397 
398  protected:
399  /** \brief Initializes the sample pattern. */
400  void
401  initPattern ();
402 
403  private:
404  /** \brief Border width. */
405  static const int border_width_ = 1;
406 
407  // offsets defining the sample pattern
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_;
416  };
417 
418  /** \brief Detector class for AGAST corner point detector (OAST 9_16).
419  *
420  * Adapted from the C++ implementation of Elmar Mair
421  * (http://www6.in.tum.de/Main/ResearchAgast).
422  *
423  * \author Stefan Holzer
424  * \ingroup keypoints
425  */
426  class PCL_EXPORTS OastDetector9_16 : public AbstractAgastDetector
427  {
428  public:
429  typedef boost::shared_ptr<OastDetector9_16> Ptr;
430  typedef boost::shared_ptr<const OastDetector9_16> ConstPtr;
431 
432  /** \brief Constructor.
433  * \param[in] width the width of the image to process
434  * \param[in] height the height of the image to process
435  * \param[in] threshold the corner detection threshold
436  * \param[in] bmax the max image value (default: 255)
437  */
438  OastDetector9_16 (const size_t width,
439  const size_t height,
440  const double threshold,
441  const double bmax = 255)
442  : AbstractAgastDetector (width, height, threshold, bmax)
443  {
444  initPattern ();
445  }
446 
447  /** \brief Destructor. */
449 
450  /** \brief Computes corner score.
451  * \param im
452  */
453  int
454  computeCornerScore (const unsigned char* im) const;
455 
456  /** \brief Computes corner score.
457  * \param im
458  */
459  int
460  computeCornerScore (const float* im) const;
461 
462  /** \brief Detects points of interest (i.e., keypoints) in the given image
463  * \param[in] im the image to detect keypoints in
464  * \param[out] corners_all the resultant set of keypoints detected
465  */
466  void
467  detect (const unsigned char* im, std::vector<pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all) const;
468 
469  /** \brief Detects points of interest (i.e., keypoints) in the given image
470  * \param[in] im the image to detect keypoints in
471  * \param[out] corners_all the resultant set of keypoints detected
472  */
473  void
474  detect (const float* im, std::vector<pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all) const;
475 
476  protected:
477  /** \brief Initializes the sample pattern. */
478  void
479  initPattern ();
480 
481  private:
482  /** \brief Border width. */
483  static const int border_width_ = 3;
484 
485  // offsets defining the sample pattern
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_;
502  };
503  } // namespace agast
504  } // namespace keypoints
505 
506  /////////////////////////////////////////////////////////////////////////////////////////
507  /////////////////////////////////////////////////////////////////////////////////////////
508  /////////////////////////////////////////////////////////////////////////////////////////
509  namespace keypoints
510  {
511  namespace internal
512  {
513  /////////////////////////////////////////////////////////////////////////////////////
514  template <typename Out>
516  {
518  const std::vector<unsigned char> &image_data,
519  const pcl::PointCloud<pcl::PointUV> &tmp_cloud,
521  pcl::PointCloud<Out> &output)
522  {
523  pcl::PointCloud<pcl::PointUV> output_temp;
524  detector->applyNonMaxSuppression (image_data, tmp_cloud, output_temp);
525  pcl::copyPointCloud<pcl::PointUV, Out> (output_temp, output);
526  }
527  };
528 
529  /////////////////////////////////////////////////////////////////////////////////////
530  template <>
532  {
534  const std::vector<unsigned char> &image_data,
535  const pcl::PointCloud<pcl::PointUV> &tmp_cloud,
538  {
539  detector->applyNonMaxSuppression (image_data, tmp_cloud, output);
540  }
541  };
542  /////////////////////////////////////////////////////////////////////////////////////
543  template <typename Out>
545  {
547  const std::vector<unsigned char> &image_data,
549  pcl::PointCloud<Out> &output)
550  {
551  pcl::PointCloud<pcl::PointUV> output_temp;
552  detector->detectKeypoints (image_data, output_temp);
553  pcl::copyPointCloud<pcl::PointUV, Out> (output_temp, output);
554  }
555  };
556 
557  /////////////////////////////////////////////////////////////////////////////////////
558  template <>
559  struct AgastDetector<pcl::PointUV>
560  {
562  const std::vector<unsigned char> &image_data,
565  {
566  detector->detectKeypoints (image_data, output);
567  }
568  };
569  } // namespace agast
570  } // namespace keypoints
571 
572  /////////////////////////////////////////////////////////////////////////////////////////
573  /////////////////////////////////////////////////////////////////////////////////////////
574  /////////////////////////////////////////////////////////////////////////////////////////
575  /** \brief Detects 2D AGAST corner points. Based on the original work and
576  * paper reference by
577  *
578  * \par
579  * Elmar Mair, Gregory D. Hager, Darius Burschka, Michael Suppa, and Gerhard Hirzinger.
580  * Adaptive and generic corner detection based on the accelerated segment test.
581  * In Proceedings of the European Conference on Computer Vision (ECCV'10), September 2010.
582  *
583  * \note This is an abstract base class. All children must implement a detectKeypoints method, based on the type of AGAST keypoint to be used.
584  *
585  * \author Stefan Holzer, Radu B. Rusu
586  * \ingroup keypoints
587  */
588  template <typename PointInT, typename PointOutT, typename IntensityT = pcl::common::IntensityFieldAccessor<PointInT> >
589  class AgastKeypoint2DBase : public Keypoint<PointInT, PointOutT>
590  {
591  public:
596 
598 
603 
604  /** \brief Constructor */
606  : threshold_ (10)
608  , bmax_ (255)
609  , detector_ ()
610  , nr_max_keypoints_ (std::numeric_limits<unsigned int>::max ())
611  {
612  k_ = 1;
613  }
614 
615  /** \brief Destructor. */
617  {
618  }
619 
620  /** \brief Sets the threshold for corner detection.
621  * \param[in] threshold the threshold used for corner detection.
622  */
623  inline void
624  setThreshold (const double threshold)
625  {
626  threshold_ = threshold;
627  }
628 
629  /** \brief Get the threshold for corner detection, as set by the user. */
630  inline double
632  {
633  return (threshold_);
634  }
635 
636  /** \brief Sets the maximum number of keypoints to return. The
637  * estimated keypoints are sorted by their internal score.
638  * \param[in] nr_max_keypoints set the maximum number of keypoints to return
639  */
640  inline void
641  setMaxKeypoints (const unsigned int nr_max_keypoints)
642  {
643  nr_max_keypoints_ = nr_max_keypoints;
644  }
645 
646  /** \brief Get the maximum nuber of keypoints to return, as set by the user. */
647  inline unsigned int
649  {
650  return (nr_max_keypoints_);
651  }
652 
653  /** \brief Sets the max image data value (affects how many iterations AGAST does)
654  * \param[in] bmax the max image data value
655  */
656  inline void
657  setMaxDataValue (const double bmax)
658  {
659  bmax_ = bmax;
660  }
661 
662  /** \brief Get the bmax image value, as set by the user. */
663  inline double
665  {
666  return (bmax_);
667  }
668 
669  /** \brief Sets whether non-max-suppression is applied or not.
670  * \param[in] enabled determines whether non-max-suppression is enabled.
671  */
672  inline void
673  setNonMaxSuppression (const bool enabled)
674  {
675  apply_non_max_suppression_ = enabled;
676  }
677 
678  /** \brief Returns whether non-max-suppression is applied or not. */
679  inline bool
681  {
683  }
684 
685  inline void
687  {
688  detector_ = detector;
689  }
690 
691  inline AgastDetectorPtr
693  {
694  return (detector_);
695  }
696  protected:
697 
698  /** \brief Initializes everything and checks whether input data is fine. */
699  bool
700  initCompute ();
701 
702  /** \brief Detects the keypoints.
703  * \param[out] output the resultant keypoints
704  */
705  virtual void
706  detectKeypoints (PointCloudOut &output) = 0;
707 
708  /** \brief Intensity field accessor. */
709  IntensityT intensity_;
710 
711  /** \brief Threshold for corner detection. */
712  double threshold_;
713 
714  /** \brief Determines whether non-max-suppression is activated. */
716 
717  /** \brief Max image value. */
718  double bmax_;
719 
720  /** \brief The Agast detector to use. */
722 
723  /** \brief The maximum number of keypoints to return. */
724  unsigned int nr_max_keypoints_;
725  };
726 
727  /** \brief Detects 2D AGAST corner points. Based on the original work and
728  * paper reference by
729  *
730  * \par
731  * Elmar Mair, Gregory D. Hager, Darius Burschka, Michael Suppa, and Gerhard Hirzinger.
732  * Adaptive and generic corner detection based on the accelerated segment test.
733  * In Proceedings of the European Conference on Computer Vision (ECCV'10), September 2010.
734  *
735  * Code example:
736  *
737  * \code
738  * pcl::PointCloud<pcl::PointXYZRGBA> cloud;
739  * pcl::AgastKeypoint2D<pcl::PointXYZRGBA> agast;
740  * agast.setThreshold (30);
741  * agast.setInputCloud (cloud);
742  *
743  * PointCloud<pcl::PointUV> keypoints;
744  * agast.compute (keypoints);
745  * \endcode
746  *
747  * \note The AGAST keypoint type used is 7_12s.
748  *
749  * \author Stefan Holzer, Radu B. Rusu
750  * \ingroup keypoints
751  */
752  template <typename PointInT, typename PointOutT = pcl::PointUV>
753  class AgastKeypoint2D : public AgastKeypoint2DBase<PointInT, PointOutT, pcl::common::IntensityFieldAccessor<PointInT> >
754  {
755  public:
757 
768 
769  /** \brief Constructor */
771  {
772  name_ = "AgastKeypoint2D";
773  }
774 
775  /** \brief Destructor. */
776  virtual ~AgastKeypoint2D ()
777  {
778  }
779 
780  protected:
781  /** \brief Detects the keypoints.
782  * \param[out] output the resultant keypoints
783  */
784  virtual void
785  detectKeypoints (PointCloudOut &output);
786  };
787 
788  /** \brief Detects 2D AGAST corner points. Based on the original work and
789  * paper reference by
790  *
791  * \par
792  * Elmar Mair, Gregory D. Hager, Darius Burschka, Michael Suppa, and Gerhard Hirzinger.
793  * Adaptive and generic corner detection based on the accelerated segment test.
794  * In Proceedings of the European Conference on Computer Vision (ECCV'10), September 2010.
795  *
796  * Code example:
797  *
798  * \code
799  * pcl::PointCloud<pcl::PointXYZRGBA> cloud;
800  * pcl::AgastKeypoint2D<pcl::PointXYZRGBA> agast;
801  * agast.setThreshold (30);
802  * agast.setInputCloud (cloud);
803  *
804  * PointCloud<pcl::PointUV> keypoints;
805  * agast.compute (keypoints);
806  * \endcode
807  *
808  * \note This is a specialized version for PointXYZ clouds, and operates on depth (z) as float. The output keypoints are of the PointXY type.
809  * \note The AGAST keypoint type used is 7_12s.
810  *
811  * \author Stefan Holzer, Radu B. Rusu
812  * \ingroup keypoints
813  */
814  template <>
816  : public AgastKeypoint2DBase<pcl::PointXYZ, pcl::PointUV, pcl::common::IntensityFieldAccessor<pcl::PointXYZ> >
817  {
818  public:
819  /** \brief Constructor */
821  {
822  name_ = "AgastKeypoint2D";
823  bmax_ = 4; // max data value for an OpenNI camera
824  }
825 
826  /** \brief Destructor. */
827  virtual ~AgastKeypoint2D ()
828  {
829  }
830 
831  protected:
832  /** \brief Detects the keypoints.
833  * \param[out] output the resultant keypoints
834  */
835  virtual void
837  };
838 
839 }
840 
841 #include <pcl/keypoints/impl/agast_2d.hpp>
842 
843 #endif
844