Point Cloud Library (PCL)
1.7.0
|
00001 #ifndef FEATURE_ESTIMATION_H 00002 #define FEATURE_ESTIMATION_H 00003 00004 #include "typedefs.h" 00005 00006 #include <pcl/io/io.h> 00007 #include <pcl/features/normal_3d.h> 00008 #include <pcl/keypoints/sift_keypoint.h> 00009 #include <pcl/features/fpfh.h> 00010 #include <pcl/features/vfh.h> 00011 00012 /* Use NormalEstimation to estimate a cloud's surface normals 00013 * Inputs: 00014 * input 00015 * The input point cloud 00016 * radius 00017 * The size of the local neighborhood used to estimate the surface 00018 * Return: A pointer to a SurfaceNormals point cloud 00019 */ 00020 SurfaceNormalsPtr 00021 estimateSurfaceNormals (const PointCloudPtr & input, float radius) 00022 { 00023 SurfaceNormalsPtr normals; 00024 return (normals); 00025 } 00026 00027 /* Use SIFTKeypoint to detect a set of keypoints 00028 * Inputs: 00029 * points 00030 * The input point cloud 00031 * normals 00032 * The input surface normals 00033 * min_scale 00034 * The smallest scale in the difference-of-Gaussians (DoG) scale-space 00035 * nr_octaves 00036 * The number of times the scale doubles in the DoG scale-space 00037 * nr_scales_per_octave 00038 * The number of scales computed for each doubling 00039 * min_contrast 00040 * The minimum local contrast that must be present for a keypoint to be detected 00041 * Return: A pointer to a point cloud of keypoints 00042 */ 00043 PointCloudPtr 00044 detectKeypoints (const PointCloudPtr & points, const SurfaceNormalsPtr & normals, 00045 float min_scale, int nr_octaves, int nr_scales_per_octave, float min_contrast) 00046 { 00047 PointCloudPtr keypoints; 00048 return (keypoints); 00049 } 00050 00051 /* Use FPFHEstimation to compute local feature descriptors around each keypoint 00052 * Inputs: 00053 * points 00054 * The input point cloud 00055 * normals 00056 * The input surface normals 00057 * keypoints 00058 * A cloud of keypoints specifying the positions at which the descriptors should be computed 00059 * feature_radius 00060 * The size of the neighborhood from which the local descriptors will be computed 00061 * Return: A pointer to a LocalDescriptors (a cloud of LocalDescriptorT points) 00062 */ 00063 LocalDescriptorsPtr 00064 computeLocalDescriptors (const PointCloudPtr & points, const SurfaceNormalsPtr & normals, 00065 const PointCloudPtr & keypoints, float feature_radius) 00066 { 00067 LocalDescriptorsPtr local_descriptors; 00068 return (local_descriptors); 00069 } 00070 00071 /* Use VFHEstimation to compute a single global descriptor for the entire input cloud 00072 * Inputs: 00073 * points 00074 * The input point cloud 00075 * normals 00076 * The input surface normals 00077 * Return: A pointer to a GlobalDescriptors point cloud (a cloud containing a single GlobalDescriptorT point) 00078 */ 00079 GlobalDescriptorsPtr 00080 computeGlobalDescriptor (const PointCloudPtr & points, const SurfaceNormalsPtr & normals) 00081 { 00082 GlobalDescriptorsPtr global_descriptor; 00083 return (global_descriptor); 00084 } 00085 00086 /* A simple structure for storing all of a cloud's features */ 00087 struct ObjectFeatures 00088 { 00089 PointCloudPtr points; 00090 SurfaceNormalsPtr normals; 00091 PointCloudPtr keypoints; 00092 LocalDescriptorsPtr local_descriptors; 00093 GlobalDescriptorsPtr global_descriptor; 00094 }; 00095 00096 /* Estimate normals, detect keypoints, and compute local and global descriptors 00097 * Return: An ObjectFeatures struct containing all the features 00098 */ 00099 ObjectFeatures 00100 computeFeatures (const PointCloudPtr & input) 00101 { 00102 ObjectFeatures features; 00103 features.points = input; 00104 features.normals = estimateSurfaceNormals (input, 0.05); 00105 features.keypoints = detectKeypoints (input, features.normals, 0.005, 10, 8, 1.5); 00106 features.local_descriptors = computeLocalDescriptors (input, features.normals, features.keypoints, 0.1); 00107 features.global_descriptor = computeGlobalDescriptor (input, features.normals); 00108 00109 return (features); 00110 } 00111 00112 #endif