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
00039 #include <narf_recognition/object_model_list.h>
00040 #include <iostream>
00041 using std::cout;
00042 using std::cerr;
00043 using std::vector;
00044
00045 namespace pcl
00046 {
00047
00048 ObjectModelList::ObjectModelList () : BaseClass ()
00049 {
00050 }
00051
00052 ObjectModelList::~ObjectModelList ()
00053 {
00054 while (!empty ())
00055 {
00056 delete back ();
00057 pop_back ();
00058 }
00059 }
00060
00061 void ObjectModelList::extractNARFsForCompleteSurface (unsigned int descriptor_size, float size_in_world, bool rotation_invariant,
00062 vector<vector<vector<Narf*>*>*>& features) const
00063 {
00064
00065 freeFeatureListMemory (features);
00066 for (const_iterator it=begin (); it!=end (); ++it)
00067 {
00068 features.push_back (new vector<vector<Narf*>*>);
00069
00070 const ObjectModel& object_model = **it;
00071 vector<vector<Narf*>*>& features_for_current_model = *features.back ();
00072
00073 object_model.extractNARFsForCompleteSurface (descriptor_size, size_in_world, rotation_invariant, features_for_current_model);
00074 }
00075 }
00076
00077 void
00078 ObjectModelList::extractNARFsForInterestPoints (unsigned int descriptor_size, float size_in_world,
00079 bool rotation_invariant, NarfKeypoint& interest_point_detector,
00080 vector<vector<vector<Narf*>*>*>& features) const
00081 {
00082
00083 freeFeatureListMemory (features);
00084 for (const_iterator it=begin (); it!=end (); ++it)
00085 {
00086 features.push_back (new vector<vector<Narf*>*>);
00087
00088 const ObjectModel& object_model = **it;
00089 vector<vector<Narf*>*>& features_for_current_model = *features.back ();
00090
00091 object_model.extractNARFsForInterestPoints (descriptor_size, size_in_world, rotation_invariant, interest_point_detector, features_for_current_model);
00092
00093
00094
00095
00096 }
00097 }
00098
00099 float
00100 ObjectModelList::getAverageModelRadius () const
00101 {
00102 if (empty ())
00103 return 0.0f;
00104 float average_model_radius = 0.0f;
00105 for (size_t model_idx=0; model_idx<size (); ++model_idx)
00106 average_model_radius += at (model_idx)->getRadius ();
00107 average_model_radius /= float (size ());
00108 return average_model_radius;
00109 }
00110
00111 float
00112 ObjectModelList::getMaximumPlaneSize (float initial_max_plane_error) const
00113 {
00114 float maximum_plane_size = 0.0f;
00115 for (size_t model_idx=0; model_idx<size (); ++model_idx)
00116 maximum_plane_size = std::max (maximum_plane_size, at (model_idx)->getMaximumPlaneSize (initial_max_plane_error));
00117 return maximum_plane_size;
00118 }
00119
00120 }