Go to the documentation of this file.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
00060 class PCL_EXPORTS NarfKeypoint : public Keypoint<PointWithRange, int>
00061 {
00062 public:
00063 typedef boost::shared_ptr<NarfKeypoint> Ptr;
00064 typedef boost::shared_ptr<const NarfKeypoint> ConstPtr;
00065
00066
00067 typedef Keypoint<PointWithRange, int> BaseClass;
00068
00069 typedef Keypoint<PointWithRange, int>::PointCloudOut PointCloudOut;
00070
00071
00073 struct Parameters
00074 {
00075 Parameters() : support_size(-1.0f), max_no_of_interest_points(-1), min_distance_between_interest_points(0.25f),
00076 optimal_distance_to_high_surface_change(0.25), min_interest_value(0.45f),
00077 min_surface_change_score(0.2f), optimal_range_image_patch_size(10),
00078 distance_for_additional_points(0.0f), add_points_on_straight_edges(false),
00079 do_non_maximum_suppression(true), no_of_polynomial_approximations_per_point(0),
00080 max_no_of_threads(1), use_recursive_scale_reduction(false),
00081 calculate_sparse_interest_image(true) {}
00082
00083 float support_size;
00084 int max_no_of_interest_points;
00085 float min_distance_between_interest_points;
00088 float optimal_distance_to_high_surface_change;
00092 float min_interest_value;
00093 float min_surface_change_score;
00094 int optimal_range_image_patch_size;
00098
00099 float distance_for_additional_points;
00103 bool add_points_on_straight_edges;
00105 bool do_non_maximum_suppression;
00108 bool no_of_polynomial_approximations_per_point;
00111 int max_no_of_threads;
00112 bool use_recursive_scale_reduction;
00114 bool calculate_sparse_interest_image;
00116 };
00117
00118
00119 NarfKeypoint (RangeImageBorderExtractor* range_image_border_extractor=NULL, float support_size=-1.0f);
00120 virtual ~NarfKeypoint ();
00121
00122
00124 void
00125 clearData ();
00126
00128 void
00129 setRangeImageBorderExtractor (RangeImageBorderExtractor* range_image_border_extractor);
00130
00132 RangeImageBorderExtractor*
00133 getRangeImageBorderExtractor () { return range_image_border_extractor_; }
00134
00136 void
00137 setRangeImage (const RangeImage* range_image);
00138
00140 float*
00141 getInterestImage () { calculateInterestImage(); return interest_image_;}
00142
00144 const ::pcl::PointCloud<InterestPoint>&
00145 getInterestPoints () { calculateInterestPoints(); return *interest_points_;}
00146
00148 const std::vector<bool>&
00149 getIsInterestPointImage () { calculateInterestPoints(); return is_interest_point_image_;}
00150
00152 Parameters&
00153 getParameters () { return parameters_;}
00154
00156 const RangeImage&
00157 getRangeImage ();
00158
00160 void
00161 compute (PointCloudOut& output);
00162
00163 protected:
00164
00165 void
00166 calculateScaleSpace ();
00167 void
00168 calculateInterestImage ();
00169 void
00170 calculateCompleteInterestImage ();
00171 void
00172 calculateSparseInterestImage ();
00173 void
00174 calculateInterestPoints ();
00175
00176
00178 virtual void
00179 detectKeypoints (PointCloudOut& output);
00180
00181
00182 using BaseClass::name_;
00183 RangeImageBorderExtractor* range_image_border_extractor_;
00184 Parameters parameters_;
00185 float* interest_image_;
00186 ::pcl::PointCloud<InterestPoint>* interest_points_;
00187 std::vector<bool> is_interest_point_image_;
00188 std::vector<RangeImage*> range_image_scale_space_;
00189 std::vector<RangeImageBorderExtractor*> border_extractor_scale_space_;
00190 std::vector<float*> interest_image_scale_space_;
00191 };
00192
00196 inline std::ostream&
00197 operator << (std::ostream& os, const NarfKeypoint::Parameters& p)
00198 {
00199 os << PVARC(p.support_size) << PVARC(p.min_distance_between_interest_points)
00200 << PVARC(p.min_interest_value) << PVARN(p.distance_for_additional_points);
00201 return (os);
00202 }
00203
00204 }
00205
00206 #endif //#ifndef PCL_NARF_KEYPOINT_H_