Point Cloud Library (PCL)  1.11.1-dev
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 #pragma once
40 
41 #include <array>
42 
43 #include <pcl/point_cloud.h>
44 #include <pcl/point_types.h>
45 #include <pcl/keypoints/keypoint.h>
46 #include <pcl/common/intensity.h>
47 #include <pcl/common/io.h> // for copyPointCloud
48 
49 namespace pcl
50 {
51  namespace keypoints
52  {
53  namespace agast
54  {
55 
56  /** \brief Abstract detector class for AGAST corner point detectors.
57  *
58  * Adapted from the C++ implementation of Elmar Mair
59  * (http://www6.in.tum.de/Main/ResearchAgast).
60  *
61  * \author Stefan Holzer
62  * \ingroup keypoints
63  */
65  {
66  public:
67  using Ptr = shared_ptr<AbstractAgastDetector>;
68  using ConstPtr = shared_ptr<const AbstractAgastDetector>;
69 
70  /** \brief Constructor.
71  * \param[in] width the width of the image to process
72  * \param[in] height the height of the image to process
73  * \param[in] threshold the corner detection threshold
74  * \param[in] bmax the max image value (default: 255)
75  */
76  AbstractAgastDetector (const std::size_t width,
77  const std::size_t height,
78  const double threshold,
79  const double bmax)
80  : width_ (width)
81  , height_ (height)
82  , threshold_ (threshold)
83  , nr_max_keypoints_ (std::numeric_limits<unsigned int>::max ())
84  , bmax_ (bmax)
85  {}
86 
87  /** \brief Destructor. */
88  virtual ~AbstractAgastDetector () {}
89 
90  /** \brief Detects corner points.
91  * \param intensity_data
92  * \param output
93  */
94  void
95  detectKeypoints (const std::vector<unsigned char> &intensity_data,
96  pcl::PointCloud<pcl::PointUV> &output) const;
97 
98  /** \brief Detects corner points.
99  * \param intensity_data
100  * \param output
101  */
102  void
103  detectKeypoints (const std::vector<float> &intensity_data,
104  pcl::PointCloud<pcl::PointUV> &output) const;
105 
106  /** \brief Applies non-max-suppression.
107  * \param[in] intensity_data the image data
108  * \param[in] input the keypoint positions
109  * \param[out] output the resultant keypoints after non-max-supression
110  */
111  void
112  applyNonMaxSuppression (const std::vector<unsigned char>& intensity_data,
113  const pcl::PointCloud<pcl::PointUV> &input,
115 
116  /** \brief Applies non-max-suppression.
117  * \param[in] intensity_data the image data
118  * \param[in] input the keypoint positions
119  * \param[out] output the resultant keypoints after non-max-supression
120  */
121  void
122  applyNonMaxSuppression (const std::vector<float>& intensity_data,
123  const pcl::PointCloud<pcl::PointUV> &input,
125 
126  /** \brief Computes corner score.
127  * \param[in] im the pixels to compute the score at
128  */
129  virtual int
130  computeCornerScore (const unsigned char* im) const = 0;
131 
132  /** \brief Computes corner score.
133  * \param[in] im the pixels to compute the score at
134  */
135  virtual int
136  computeCornerScore (const float* im) const = 0;
137 
138  /** \brief Sets the threshold for corner detection.
139  * \param[in] threshold the threshold used for corner detection.
140  */
141  inline void
142  setThreshold (const double threshold)
143  {
144  threshold_ = threshold;
145  }
146 
147  /** \brief Get the threshold for corner detection, as set by the user. */
148  inline double
150  {
151  return (threshold_);
152  }
153 
154  /** \brief Sets the maximum number of keypoints to return. The
155  * estimated keypoints are sorted by their internal score.
156  * \param[in] nr_max_keypoints set the maximum number of keypoints to return
157  */
158  inline void
159  setMaxKeypoints (const unsigned int nr_max_keypoints)
160  {
161  nr_max_keypoints_ = nr_max_keypoints;
162  }
163 
164  /** \brief Get the maximum number of keypoints to return, as set by the user. */
165  inline unsigned int
167  {
168  return (nr_max_keypoints_);
169  }
170 
171  /** \brief Detects points of interest (i.e., keypoints) in the given image
172  * \param[in] im the image to detect keypoints in
173  * \param[out] corners_all the resultant set of keypoints detected
174  */
175  virtual void
176  detect (const unsigned char* im,
177  std::vector<pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all) const = 0;
178 
179  /** \brief Detects points of interest (i.e., keypoints) in the given image
180  * \param[in] im the image to detect keypoints in
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[in] i1 the first score index
200  * \param[in] 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) const;
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) const;
242 
243  /** \brief Width of the image to process. */
244  std::size_t width_;
245  /** \brief Height of the image to process. */
246  std::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  */
267  {
268  public:
269  using Ptr = shared_ptr<AgastDetector7_12s>;
270  using ConstPtr = shared_ptr<const AgastDetector7_12s>;
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 std::size_t width,
279  const std::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 override;
295 
296  /** \brief Computes corner score.
297  * \param im
298  */
299  int
300  computeCornerScore (const float* im) const override;
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 override;
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 override;
315 
316  protected:
317  /** \brief Initializes the sample pattern. */
318  void
319  initPattern () override;
320 
321  private:
322  /** \brief Border width. */
323  static const int border_width_ = 2;
324 
325  // offsets defining the sample pattern
326  std::array<std::int_fast16_t, 12> offset_;
327  };
328 
329  /** \brief Detector class for AGAST corner point detector (5_8).
330  *
331  * Adapted from the C++ implementation of Elmar Mair
332  * (http://www6.in.tum.de/Main/ResearchAgast).
333  *
334  * \author Stefan Holzer
335  * \ingroup keypoints
336  */
338  {
339  public:
340  using Ptr = shared_ptr<AgastDetector5_8>;
341  using ConstPtr = shared_ptr<const AgastDetector5_8>;
342 
343  /** \brief Constructor.
344  * \param[in] width the width of the image to process
345  * \param[in] height the height of the image to process
346  * \param[in] threshold the corner detection threshold
347  * \param[in] bmax the max image value (default: 255)
348  */
349  AgastDetector5_8 (const std::size_t width,
350  const std::size_t height,
351  const double threshold,
352  const double bmax = 255)
353  : AbstractAgastDetector (width, height, threshold, bmax)
354  {
355  initPattern ();
356  }
357 
358  /** \brief Destructor. */
360 
361  /** \brief Computes corner score.
362  * \param im
363  */
364  int
365  computeCornerScore (const unsigned char* im) const override;
366 
367  /** \brief Computes corner score.
368  * \param im
369  */
370  int
371  computeCornerScore (const float* im) const override;
372 
373  /** \brief Detects points of interest (i.e., keypoints) in the given image
374  * \param[in] im the image to detect keypoints in
375  * \param[out] corners_all the resultant set of keypoints detected
376  */
377  void
378  detect (const unsigned char* im, std::vector<pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all) const override;
379 
380  /** \brief Detects points of interest (i.e., keypoints) in the given image
381  * \param[in] im the image to detect keypoints in
382  * \param[out] corners_all the resultant set of keypoints detected
383  */
384  void
385  detect (const float* im, std::vector<pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all) const override;
386 
387  protected:
388  /** \brief Initializes the sample pattern. */
389  void
390  initPattern () override;
391 
392  private:
393  /** \brief Border width. */
394  static const int border_width_ = 1;
395 
396  // offsets defining the sample pattern
397  std::array<std::int_fast16_t, 8> offset_;
398  };
399 
400  /** \brief Detector class for AGAST corner point detector (OAST 9_16).
401  *
402  * Adapted from the C++ implementation of Elmar Mair
403  * (http://www6.in.tum.de/Main/ResearchAgast).
404  *
405  * \author Stefan Holzer
406  * \ingroup keypoints
407  */
409  {
410  public:
411  using Ptr = shared_ptr<OastDetector9_16>;
412  using ConstPtr = shared_ptr<const OastDetector9_16>;
413 
414  /** \brief Constructor.
415  * \param[in] width the width of the image to process
416  * \param[in] height the height of the image to process
417  * \param[in] threshold the corner detection threshold
418  * \param[in] bmax the max image value (default: 255)
419  */
420  OastDetector9_16 (const std::size_t width,
421  const std::size_t height,
422  const double threshold,
423  const double bmax = 255)
424  : AbstractAgastDetector (width, height, threshold, bmax)
425  {
426  initPattern ();
427  }
428 
429  /** \brief Destructor. */
431 
432  /** \brief Computes corner score.
433  * \param im
434  */
435  int
436  computeCornerScore (const unsigned char* im) const override;
437 
438  /** \brief Computes corner score.
439  * \param im
440  */
441  int
442  computeCornerScore (const float* im) const override;
443 
444  /** \brief Detects points of interest (i.e., keypoints) in the given image
445  * \param[in] im the image to detect keypoints in
446  * \param[out] corners_all the resultant set of keypoints detected
447  */
448  void
449  detect (const unsigned char* im, std::vector<pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all) const override;
450 
451  /** \brief Detects points of interest (i.e., keypoints) in the given image
452  * \param[in] im the image to detect keypoints in
453  * \param[out] corners_all the resultant set of keypoints detected
454  */
455  void
456  detect (const float* im, std::vector<pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &corners_all) const override;
457 
458  protected:
459  /** \brief Initializes the sample pattern. */
460  void
461  initPattern () override;
462 
463  private:
464  /** \brief Border width. */
465  static const int border_width_ = 3;
466 
467  // offsets defining the sample pattern
468  std::array<std::int_fast16_t, 16> offset_;
469  };
470  } // namespace agast
471  } // namespace keypoints
472 
473  /////////////////////////////////////////////////////////////////////////////////////////
474  /////////////////////////////////////////////////////////////////////////////////////////
475  /////////////////////////////////////////////////////////////////////////////////////////
476  namespace keypoints
477  {
478  namespace internal
479  {
480  /////////////////////////////////////////////////////////////////////////////////////
481  template <typename Out>
483  {
485  const std::vector<unsigned char> &image_data,
486  const pcl::PointCloud<pcl::PointUV> &tmp_cloud,
488  pcl::PointCloud<Out> &output)
489  {
490  pcl::PointCloud<pcl::PointUV> output_temp;
491  detector->applyNonMaxSuppression (image_data, tmp_cloud, output_temp);
492  pcl::copyPointCloud (output_temp, output);
493  }
494  };
495 
496  /////////////////////////////////////////////////////////////////////////////////////
497  template <>
499  {
501  const std::vector<unsigned char> &image_data,
502  const pcl::PointCloud<pcl::PointUV> &tmp_cloud,
505  {
506  detector->applyNonMaxSuppression (image_data, tmp_cloud, output);
507  }
508  };
509  /////////////////////////////////////////////////////////////////////////////////////
510  template <typename Out>
512  {
514  const std::vector<unsigned char> &image_data,
516  pcl::PointCloud<Out> &output)
517  {
518  pcl::PointCloud<pcl::PointUV> output_temp;
519  detector->detectKeypoints (image_data, output_temp);
520  pcl::copyPointCloud (output_temp, output);
521  }
522  };
523 
524  /////////////////////////////////////////////////////////////////////////////////////
525  template <>
527  {
529  const std::vector<unsigned char> &image_data,
532  {
533  detector->detectKeypoints (image_data, output);
534  }
535  };
536  } // namespace agast
537  } // namespace keypoints
538 
539  /////////////////////////////////////////////////////////////////////////////////////////
540  /////////////////////////////////////////////////////////////////////////////////////////
541  /////////////////////////////////////////////////////////////////////////////////////////
542  /** \brief Detects 2D AGAST corner points. Based on the original work and
543  * paper reference by
544  *
545  * \par
546  * Elmar Mair, Gregory D. Hager, Darius Burschka, Michael Suppa, and Gerhard Hirzinger.
547  * Adaptive and generic corner detection based on the accelerated segment test.
548  * In Proceedings of the European Conference on Computer Vision (ECCV'10), September 2010.
549  *
550  * \note This is an abstract base class. All children must implement a detectKeypoints method, based on the type of AGAST keypoint to be used.
551  *
552  * \author Stefan Holzer, Radu B. Rusu
553  * \ingroup keypoints
554  */
555  template <typename PointInT, typename PointOutT, typename IntensityT = pcl::common::IntensityFieldAccessor<PointInT> >
556  class AgastKeypoint2DBase : public Keypoint<PointInT, PointOutT>
557  {
558  public:
563 
565 
570 
571  /** \brief Constructor */
573  : threshold_ (10)
575  , bmax_ (255)
576  , nr_max_keypoints_ (std::numeric_limits<unsigned int>::max ())
577  {
578  k_ = 1;
579  }
580 
581  /** \brief Destructor. */
583  {
584  }
585 
586  /** \brief Sets the threshold for corner detection.
587  * \param[in] threshold the threshold used for corner detection.
588  */
589  inline void
590  setThreshold (const double threshold)
591  {
592  threshold_ = threshold;
593  }
594 
595  /** \brief Get the threshold for corner detection, as set by the user. */
596  inline double
598  {
599  return (threshold_);
600  }
601 
602  /** \brief Sets the maximum number of keypoints to return. The
603  * estimated keypoints are sorted by their internal score.
604  * \param[in] nr_max_keypoints set the maximum number of keypoints to return
605  */
606  inline void
607  setMaxKeypoints (const unsigned int nr_max_keypoints)
608  {
609  nr_max_keypoints_ = nr_max_keypoints;
610  }
611 
612  /** \brief Get the maximum number of keypoints to return, as set by the user. */
613  inline unsigned int
615  {
616  return (nr_max_keypoints_);
617  }
618 
619  /** \brief Sets the max image data value (affects how many iterations AGAST does)
620  * \param[in] bmax the max image data value
621  */
622  inline void
623  setMaxDataValue (const double bmax)
624  {
625  bmax_ = bmax;
626  }
627 
628  /** \brief Get the bmax image value, as set by the user. */
629  inline double
631  {
632  return (bmax_);
633  }
634 
635  /** \brief Sets whether non-max-suppression is applied or not.
636  * \param[in] enabled determines whether non-max-suppression is enabled.
637  */
638  inline void
639  setNonMaxSuppression (const bool enabled)
640  {
641  apply_non_max_suppression_ = enabled;
642  }
643 
644  /** \brief Returns whether non-max-suppression is applied or not. */
645  inline bool
647  {
649  }
650 
651  inline void
653  {
654  detector_ = detector;
655  }
656 
657  inline AgastDetectorPtr
659  {
660  return (detector_);
661  }
662  protected:
663 
664  /** \brief Initializes everything and checks whether input data is fine. */
665  bool
666  initCompute () override;
667 
668  /** \brief Detects the keypoints.
669  * \param[out] output the resultant keypoints
670  */
671  void
672  detectKeypoints (PointCloudOut &output) override = 0;
673 
674  /** \brief Intensity field accessor. */
675  IntensityT intensity_;
676 
677  /** \brief Threshold for corner detection. */
678  double threshold_;
679 
680  /** \brief Determines whether non-max-suppression is activated. */
682 
683  /** \brief Max image value. */
684  double bmax_;
685 
686  /** \brief The Agast detector to use. */
688 
689  /** \brief The maximum number of keypoints to return. */
690  unsigned int nr_max_keypoints_;
691  };
692 
693  /** \brief Detects 2D AGAST corner points. Based on the original work and
694  * paper reference by
695  *
696  * \par
697  * Elmar Mair, Gregory D. Hager, Darius Burschka, Michael Suppa, and Gerhard Hirzinger.
698  * Adaptive and generic corner detection based on the accelerated segment test.
699  * In Proceedings of the European Conference on Computer Vision (ECCV'10), September 2010.
700  *
701  * Code example:
702  *
703  * \code
704  * pcl::PointCloud<pcl::PointXYZRGBA> cloud;
705  * pcl::AgastKeypoint2D<pcl::PointXYZRGBA> agast;
706  * agast.setThreshold (30);
707  * agast.setInputCloud (cloud);
708  *
709  * PointCloud<pcl::PointUV> keypoints;
710  * agast.compute (keypoints);
711  * \endcode
712  *
713  * \note The AGAST keypoint type used is 7_12s.
714  *
715  * \author Stefan Holzer, Radu B. Rusu
716  * \ingroup keypoints
717  */
718  template <typename PointInT, typename PointOutT = pcl::PointUV>
719  class AgastKeypoint2D : public AgastKeypoint2DBase<PointInT, PointOutT, pcl::common::IntensityFieldAccessor<PointInT> >
720  {
721  public:
723 
734 
735  /** \brief Constructor */
737  {
738  name_ = "AgastKeypoint2D";
739  }
740 
741  /** \brief Destructor. */
743  {
744  }
745 
746  protected:
747  /** \brief Detects the keypoints.
748  * \param[out] output the resultant keypoints
749  */
750  void
751  detectKeypoints (PointCloudOut &output) override;
752  };
753 
754  /** \brief Detects 2D AGAST corner points. Based on the original work and
755  * paper reference by
756  *
757  * \par
758  * Elmar Mair, Gregory D. Hager, Darius Burschka, Michael Suppa, and Gerhard Hirzinger.
759  * Adaptive and generic corner detection based on the accelerated segment test.
760  * In Proceedings of the European Conference on Computer Vision (ECCV'10), September 2010.
761  *
762  * Code example:
763  *
764  * \code
765  * pcl::PointCloud<pcl::PointXYZRGBA> cloud;
766  * pcl::AgastKeypoint2D<pcl::PointXYZRGBA> agast;
767  * agast.setThreshold (30);
768  * agast.setInputCloud (cloud);
769  *
770  * PointCloud<pcl::PointUV> keypoints;
771  * agast.compute (keypoints);
772  * \endcode
773  *
774  * \note This is a specialized version for PointXYZ clouds, and operates on depth (z) as float. The output keypoints are of the PointXY type.
775  * \note The AGAST keypoint type used is 7_12s.
776  *
777  * \author Stefan Holzer, Radu B. Rusu
778  * \ingroup keypoints
779  */
780  template <>
782  : public AgastKeypoint2DBase<pcl::PointXYZ, pcl::PointUV, pcl::common::IntensityFieldAccessor<pcl::PointXYZ> >
783  {
784  public:
785  /** \brief Constructor */
787  {
788  name_ = "AgastKeypoint2D";
789  bmax_ = 4; // max data value for an OpenNI camera
790  }
791 
792  /** \brief Destructor. */
794  {
795  }
796 
797  protected:
798  /** \brief Detects the keypoints.
799  * \param[out] output the resultant keypoints
800  */
801  void
803  };
804 
805 }
806 
807 #include <pcl/keypoints/impl/agast_2d.hpp>
pcl::PointUV
A 2D point structure representing pixel image coordinates.
Definition: point_types.hpp:761
pcl::search::Search< PointInT >
pcl::keypoints::internal::AgastApplyNonMaxSuppresion
Definition: agast_2d.h:482
pcl
Definition: convolution.h:46
pcl::keypoints::agast::AbstractAgastDetector::CompareScoreIndex
Score index comparator.
Definition: agast_2d.h:196
point_types.h
pcl::AgastKeypoint2D
Detects 2D AGAST corner points.
Definition: agast_2d.h:719
pcl::keypoints::agast::OastDetector9_16::~OastDetector9_16
~OastDetector9_16()
Destructor.
Definition: agast_2d.h:430
pcl::keypoints::agast::AbstractAgastDetector::getThreshold
double getThreshold()
Get the threshold for corner detection, as set by the user.
Definition: agast_2d.h:149
pcl::AgastKeypoint2D< pcl::PointXYZ, pcl::PointUV >::~AgastKeypoint2D
~AgastKeypoint2D()
Destructor.
Definition: agast_2d.h:793
pcl::AgastKeypoint2DBase::getThreshold
double getThreshold()
Get the threshold for corner detection, as set by the user.
Definition: agast_2d.h:597
pcl::keypoints::agast::AbstractAgastDetector
Abstract detector class for AGAST corner point detectors.
Definition: agast_2d.h:64
pcl::keypoints::agast::AbstractAgastDetector::~AbstractAgastDetector
virtual ~AbstractAgastDetector()
Destructor.
Definition: agast_2d.h:88
pcl::Keypoint< PointInT, PointOutT >::k_
int k_
The number of K nearest neighbors to use for each point.
Definition: keypoint.h:190
pcl::AgastKeypoint2DBase::setNonMaxSuppression
void setNonMaxSuppression(const bool enabled)
Sets whether non-max-suppression is applied or not.
Definition: agast_2d.h:639
pcl::AgastKeypoint2DBase< pcl::PointXYZ, pcl::PointUV, pcl::common::IntensityFieldAccessor< pcl::PointXYZ > >::AgastDetectorPtr
pcl::keypoints::agast::AbstractAgastDetector::Ptr AgastDetectorPtr
Definition: agast_2d.h:564
pcl::keypoints::agast::AbstractAgastDetector::bmax_
double bmax_
Max image value.
Definition: agast_2d.h:255
pcl::AgastKeypoint2D::AgastKeypoint2D
AgastKeypoint2D()
Constructor.
Definition: agast_2d.h:736
pcl::keypoints::agast::AbstractAgastDetector::height_
std::size_t height_
Height of the image to process.
Definition: agast_2d.h:246
pcl::PointCloud< pcl::PointUV >
pcl::keypoints::agast::AbstractAgastDetector::getMaxKeypoints
unsigned int getMaxKeypoints()
Get the maximum number of keypoints to return, as set by the user.
Definition: agast_2d.h:166
pcl::AgastKeypoint2DBase::apply_non_max_suppression_
bool apply_non_max_suppression_
Determines whether non-max-suppression is activated.
Definition: agast_2d.h:681
pcl::copyPointCloud
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.
Definition: io.hpp:121
pcl::AgastKeypoint2DBase::getMaxKeypoints
unsigned int getMaxKeypoints()
Get the maximum number of keypoints to return, as set by the user.
Definition: agast_2d.h:614
pcl::AgastKeypoint2DBase::getNonMaxSuppression
bool getNonMaxSuppression()
Returns whether non-max-suppression is applied or not.
Definition: agast_2d.h:646
pcl::keypoints::internal::AgastDetector::AgastDetector
AgastDetector(const std::vector< unsigned char > &image_data, const pcl::keypoints::agast::AbstractAgastDetector::Ptr &detector, pcl::PointCloud< Out > &output)
Definition: agast_2d.h:513
pcl::keypoints::agast::AbstractAgastDetector::setMaxKeypoints
void setMaxKeypoints(const unsigned int nr_max_keypoints)
Sets the maximum number of keypoints to return.
Definition: agast_2d.h:159
pcl::AgastKeypoint2D::detectKeypoints
void detectKeypoints(PointCloudOut &output) override
Detects the keypoints.
Definition: agast_2d.hpp:68
pcl::keypoints::agast::AbstractAgastDetector::ConstPtr
shared_ptr< const AbstractAgastDetector > ConstPtr
Definition: agast_2d.h:68
pcl::keypoints::agast::AgastDetector7_12s::~AgastDetector7_12s
~AgastDetector7_12s()
Destructor.
Definition: agast_2d.h:288
pcl::AgastKeypoint2DBase::getMaxDataValue
double getMaxDataValue()
Get the bmax image value, as set by the user.
Definition: agast_2d.h:630
pcl::AgastKeypoint2D< pcl::PointXYZ, pcl::PointUV >::AgastKeypoint2D
AgastKeypoint2D()
Constructor.
Definition: agast_2d.h:786
pcl::AgastKeypoint2D::~AgastKeypoint2D
~AgastKeypoint2D()
Destructor.
Definition: agast_2d.h:742
pcl::keypoints::agast::AgastDetector7_12s
Detector class for AGAST corner point detector (7_12s).
Definition: agast_2d.h:266
pcl::AgastKeypoint2DBase::setAgastDetector
void setAgastDetector(const AgastDetectorPtr &detector)
Definition: agast_2d.h:652
pcl::AgastKeypoint2DBase::AgastKeypoint2DBase
AgastKeypoint2DBase()
Constructor.
Definition: agast_2d.h:572
pcl::PointXYZ
A point structure representing Euclidean xyz coordinates.
Definition: point_types.hpp:300
pcl::keypoints::agast::AbstractAgastDetector::ScoreIndex
Structure holding an index and the associated keypoint score.
Definition: agast_2d.h:189
pcl::AgastKeypoint2DBase::detectKeypoints
void detectKeypoints(PointCloudOut &output) override=0
Detects the keypoints.
pcl::keypoints::agast::OastDetector9_16
Detector class for AGAST corner point detector (OAST 9_16).
Definition: agast_2d.h:408
pcl::keypoints::internal::AgastDetector
Definition: agast_2d.h:511
pcl::AgastKeypoint2DBase::~AgastKeypoint2DBase
~AgastKeypoint2DBase()
Destructor.
Definition: agast_2d.h:582
pcl::keypoints::agast::AbstractAgastDetector::Ptr
shared_ptr< AbstractAgastDetector > Ptr
Definition: agast_2d.h:67
pcl::AgastKeypoint2DBase::initCompute
bool initCompute() override
Initializes everything and checks whether input data is fine.
Definition: agast_2d.hpp:49
pcl::keypoints::agast::AbstractAgastDetector::ScoreIndex::idx
int idx
Definition: agast_2d.h:191
pcl::keypoints::internal::AgastApplyNonMaxSuppresion< pcl::PointUV >::AgastApplyNonMaxSuppresion
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)
Definition: agast_2d.h:500
pcl::keypoints::internal::AgastDetector< pcl::PointUV >::AgastDetector
AgastDetector(const std::vector< unsigned char > &image_data, const pcl::keypoints::agast::AbstractAgastDetector::Ptr &detector, pcl::PointCloud< pcl::PointUV > &output)
Definition: agast_2d.h:528
pcl::keypoints::agast::AbstractAgastDetector::width_
std::size_t width_
Width of the image to process.
Definition: agast_2d.h:244
pcl::keypoints::agast::AgastDetector5_8::AgastDetector5_8
AgastDetector5_8(const std::size_t width, const std::size_t height, const double threshold, const double bmax=255)
Constructor.
Definition: agast_2d.h:349
pcl::AgastKeypoint2DBase::bmax_
double bmax_
Max image value.
Definition: agast_2d.h:684
pcl::Keypoint< PointInT, pcl::PointUV >::name_
std::string name_
The key point detection method's name.
Definition: keypoint.h:169
pcl::AgastKeypoint2DBase::nr_max_keypoints_
unsigned int nr_max_keypoints_
The maximum number of keypoints to return.
Definition: agast_2d.h:690
pcl::AgastKeypoint2DBase::intensity_
IntensityT intensity_
Intensity field accessor.
Definition: agast_2d.h:675
pcl::AgastKeypoint2DBase::setMaxKeypoints
void setMaxKeypoints(const unsigned int nr_max_keypoints)
Sets the maximum number of keypoints to return.
Definition: agast_2d.h:607
pcl::AgastKeypoint2DBase
Detects 2D AGAST corner points.
Definition: agast_2d.h:556
pcl::AgastKeypoint2DBase::setMaxDataValue
void setMaxDataValue(const double bmax)
Sets the max image data value (affects how many iterations AGAST does)
Definition: agast_2d.h:623
pcl::AgastKeypoint2D::PointCloudOut
typename Keypoint< PointInT, PointOutT >::PointCloudOut PointCloudOut
Definition: agast_2d.h:722
pcl::keypoints::agast::AbstractAgastDetector::nr_max_keypoints_
unsigned int nr_max_keypoints_
The maximum number of keypoints to return.
Definition: agast_2d.h:252
pcl::AgastKeypoint2DBase::threshold_
double threshold_
Threshold for corner detection.
Definition: agast_2d.h:678
pcl::keypoints::agast::AbstractAgastDetector::AbstractAgastDetector
AbstractAgastDetector(const std::size_t width, const std::size_t height, const double threshold, const double bmax)
Constructor.
Definition: agast_2d.h:76
pcl::keypoints::agast::AbstractAgastDetector::ScoreIndex::score
int score
Definition: agast_2d.h:192
pcl::PointCloud< PointInT >::ConstPtr
shared_ptr< const PointCloud< PointInT > > ConstPtr
Definition: point_cloud.h:407
pcl::keypoints::agast::AgastDetector7_12s::AgastDetector7_12s
AgastDetector7_12s(const std::size_t width, const std::size_t height, const double threshold, const double bmax=255)
Constructor.
Definition: agast_2d.h:278
pcl::AgastKeypoint2DBase::getAgastDetector
AgastDetectorPtr getAgastDetector()
Definition: agast_2d.h:658
pcl::AgastKeypoint2DBase::setThreshold
void setThreshold(const double threshold)
Sets the threshold for corner detection.
Definition: agast_2d.h:590
pcl::Keypoint
Keypoint represents the base class for key points.
Definition: keypoint.h:49
pcl::keypoints::internal::AgastApplyNonMaxSuppresion::AgastApplyNonMaxSuppresion
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)
Definition: agast_2d.h:484
pcl::keypoints::agast::AbstractAgastDetector::threshold_
double threshold_
Threshold for corner detection.
Definition: agast_2d.h:249
pcl::keypoints::agast::AbstractAgastDetector::setThreshold
void setThreshold(const double threshold)
Sets the threshold for corner detection.
Definition: agast_2d.h:142
pcl::AgastKeypoint2DBase::PointCloudOut
typename Keypoint< PointInT, PointOutT >::PointCloudOut PointCloudOut
Definition: agast_2d.h:560
pcl::keypoints::agast::OastDetector9_16::OastDetector9_16
OastDetector9_16(const std::size_t width, const std::size_t height, const double threshold, const double bmax=255)
Constructor.
Definition: agast_2d.h:420
pcl::Keypoint< pcl::PointXYZ, pcl::PointUV >::PointCloudInConstPtr
typename PointCloudIn::ConstPtr PointCloudInConstPtr
Definition: keypoint.h:68
PCL_EXPORTS
#define PCL_EXPORTS
Definition: pcl_macros.h:323
pcl::keypoints::agast::AgastDetector5_8::~AgastDetector5_8
~AgastDetector5_8()
Destructor.
Definition: agast_2d.h:359
pcl::keypoints::agast::AgastDetector5_8
Detector class for AGAST corner point detector (5_8).
Definition: agast_2d.h:337
pcl::AgastKeypoint2DBase::detector_
AgastDetectorPtr detector_
The Agast detector to use.
Definition: agast_2d.h:687