00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef PCL_NARF_KEYPOINT_H_
00039 #define PCL_NARF_KEYPOINT_H_
00040
00041 #include <pcl/pcl_macros.h>
00042 #include <pcl/point_cloud.h>
00043 #include <pcl/point_types.h>
00044 #include <pcl/keypoints/keypoint.h>
00045
00046 namespace pcl {
00047
00048
00049 class RangeImage;
00050 class RangeImageBorderExtractor;
00051
00056 class NarfKeypoint : public Keypoint<PointWithRange, int>
00057 {
00058 public:
00059
00060 typedef Keypoint<PointWithRange, int> BaseClass;
00061
00062 typedef Keypoint<PointWithRange, int>::PointCloudOut PointCloudOut;
00063
00064
00066 struct Parameters
00067 {
00068 Parameters() : support_size(-1.0f), min_distance_between_interest_points(0.25f),
00069 optimal_distance_to_high_surface_change(0.25), min_interest_value(0.4f),
00070 min_surface_change_score(0.2f), optimal_range_image_patch_size(10),
00071 distance_for_additional_points(0.0f), add_points_on_straight_edges(false),
00072 do_non_maximum_suppression(true), no_of_polynomial_approximations_per_point(1) {}
00073
00074 float support_size;
00075 float min_distance_between_interest_points;
00078 float optimal_distance_to_high_surface_change;
00082 float min_interest_value;
00083 float min_surface_change_score;
00084 int optimal_range_image_patch_size;
00088
00089 float distance_for_additional_points;
00093
00094 bool add_points_on_straight_edges;
00096 bool do_non_maximum_suppression;
00099 bool no_of_polynomial_approximations_per_point;
00102 };
00103
00104
00105 NarfKeypoint (RangeImageBorderExtractor* range_image_border_extractor=NULL, float support_size=-1.0f);
00106 ~NarfKeypoint ();
00107
00108
00110 void
00111 clearData ();
00112
00114 void
00115 setRangeImageBorderExtractor (RangeImageBorderExtractor* range_image_border_extractor);
00116
00118 RangeImageBorderExtractor*
00119 getRangeImageBorderExtractor () { return range_image_border_extractor_; }
00120
00122 void
00123 setRangeImage (const RangeImage* range_image);
00124
00126 float*
00127 getInterestImage () { calculateInterestImage(); return interest_image_;}
00128
00130 const ::pcl::PointCloud<InterestPoint>&
00131 getInterestPoints () { calculateInterestPoints(); return *interest_points_;}
00132
00134 const std::vector<bool>&
00135 getIsInterestPointImage () { calculateInterestPoints(); return is_interest_point_image_;}
00136
00138 Parameters&
00139 getParameters () { return parameters_;}
00140
00142 const RangeImage&
00143 getRangeImage ();
00144
00146 void
00147 compute (PointCloudOut& output);
00148
00149 protected:
00150
00151 void
00152 calculateScaleSpace ();
00153 void
00154 calculateInterestImage ();
00155 void
00156 calculateInterestPoints ();
00157
00158
00160 virtual void
00161 detectKeypoints (PointCloudOut& output);
00162
00163
00164 using BaseClass::name_;
00165 RangeImageBorderExtractor* range_image_border_extractor_;
00166 Parameters parameters_;
00167 float* interest_image_;
00168 ::pcl::PointCloud<InterestPoint>* interest_points_;
00169 std::vector<bool> is_interest_point_image_;
00170 std::vector<RangeImage*> range_image_scale_space_;
00171 std::vector<RangeImageBorderExtractor*> border_extractor_scale_space_;
00172 std::vector<float*> interest_image_scale_space_;
00173 };
00174
00175 inline std::ostream&
00176 operator << (std::ostream& os, const NarfKeypoint::Parameters& p)
00177 {
00178 os << PVARC(p.support_size) << PVARC(p.min_distance_between_interest_points)
00179 << PVARC(p.min_interest_value) << PVARN(p.distance_for_additional_points);
00180 return (os);
00181 }
00182
00183 }
00184
00185 #endif //#ifndef PCL_NARF_KEYPOINT_H_