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 #ifndef PM_MCC_DISSIMILARITY_GETTER_H
00020 #define PM_MCC_DISSIMILARITY_GETTER_H
00021
00022 #include <algorithm>
00023 #include <limits>
00024 #include <cmath>
00025 #include <cassert>
00026
00027 #include <boost/numeric/ublas/matrix.hpp>
00028
00029 #include <lama_common/point.h>
00030 #include <lama_common/polygon_utils.h>
00031 #include <place_matcher_msgs/PolygonDissimilarity.h>
00032 #include <ros/ros.h>
00033 #include <std_msgs/String.h>
00034
00035 namespace place_matcher_mcc
00036 {
00037
00038 typedef boost::numeric::ublas::matrix<double> matrix;
00039 typedef std::vector<geometry_msgs::Polygon> polygon_list;
00040
00041 class DissimilarityGetter
00042 {
00043 public :
00044
00045 DissimilarityGetter();
00046
00047 double getDissimilarity(const geometry_msgs::Polygon& polygon1, const geometry_msgs::Polygon& polygon2);
00048 bool getDissimilarity(place_matcher_msgs::PolygonDissimilarityRequest& req, place_matcher_msgs::PolygonDissimilarityResponse& res);
00049
00050
00051 unsigned int scale_count;
00052
00053
00054 unsigned int sample_count;
00055
00056
00057 bool rotation_invariance;
00058
00059 private :
00060
00061 double compute_convexity(const polygon_list& polygons, matrix& m);
00062 matrix compare(const matrix& a, const matrix& b);
00063 };
00064
00065 }
00066
00067 #endif