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 #ifndef PCL_RECOGNITION_HV_PAPAZOV_H_
00038 #define PCL_RECOGNITION_HV_PAPAZOV_H_
00039
00040 #include <pcl/recognition/boost.h>
00041 #include <pcl/pcl_macros.h>
00042 #include <pcl/common/common.h>
00043 #include <pcl/recognition/hv/hypotheses_verification.h>
00044 #include <boost/graph/adjacency_list.hpp>
00045
00046 namespace pcl
00047 {
00048
00054 template<typename ModelT, typename SceneT>
00055 class PCL_EXPORTS PapazovHV : public HypothesisVerification<ModelT, SceneT>
00056 {
00057 using HypothesisVerification<ModelT, SceneT>::mask_;
00058 using HypothesisVerification<ModelT, SceneT>::scene_cloud_downsampled_;
00059 using HypothesisVerification<ModelT, SceneT>::scene_downsampled_tree_;
00060 using HypothesisVerification<ModelT, SceneT>::visible_models_;
00061 using HypothesisVerification<ModelT, SceneT>::complete_models_;
00062 using HypothesisVerification<ModelT, SceneT>::resolution_;
00063 using HypothesisVerification<ModelT, SceneT>::inliers_threshold_;
00064
00065 float conflict_threshold_size_;
00066 float penalty_threshold_;
00067 float support_threshold_;
00068
00069 class RecognitionModel
00070 {
00071 public:
00072 std::vector<int> explained_;
00073 typename pcl::PointCloud<ModelT>::Ptr cloud_;
00074 typename pcl::PointCloud<ModelT>::Ptr complete_cloud_;
00075 int bad_information_;
00076 int id_;
00077 };
00078
00079 std::vector<int> explained_by_RM_;
00080 std::vector< boost::shared_ptr<RecognitionModel> > recognition_models_;
00081 std::vector< std::vector <boost::shared_ptr<RecognitionModel> > > points_explained_by_rm_;
00082 std::map<int, boost::shared_ptr<RecognitionModel> > graph_id_model_map_;
00083
00084 typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS, boost::shared_ptr<RecognitionModel> > Graph;
00085 Graph conflict_graph_;
00086
00087
00088 void buildConflictGraph();
00089
00090 void nonMaximaSuppresion();
00091
00092 void initialize();
00093
00094 public:
00095 PapazovHV() : HypothesisVerification<ModelT,SceneT>() {
00096 support_threshold_ = 0.1f;
00097 penalty_threshold_ = 0.1f;
00098 conflict_threshold_size_ = 0.02f;
00099 }
00100
00101 void setConflictThreshold(float t) {
00102 conflict_threshold_size_ = t;
00103 }
00104
00105 void setSupportThreshold(float t) {
00106 support_threshold_ = t;
00107 }
00108
00109 void setPenaltyThreshold(float t) {
00110 penalty_threshold_ = t;
00111 }
00112
00113
00114
00115 void verify();
00116 };
00117 }
00118
00119 #ifdef PCL_NO_PRECOMPILE
00120 #include <pcl/recognition/impl/hv/hv_papazov.hpp>
00121 #endif
00122
00123 #endif