Outliers.cpp
Go to the documentation of this file.
00001 #include "../utest.h"
00002 
00003 using namespace std;
00004 using namespace PointMatcherSupport;
00005 
00006 //---------------------------
00007 // Outlier modules
00008 //---------------------------
00009 
00010 // Utility classes
00011 class OutlierFilterTest: public IcpHelper
00012 {
00013 public:
00014         PM::OutlierFilter* testedOutlierFilter;
00015 
00016         // Will be called for every tests
00017         virtual void SetUp()
00018         {
00019                 icp.setDefault();
00020                 // Uncomment for consol outputs
00021                 //setLogger(PM::get().LoggerRegistrar.create("FileLogger"));
00022                 
00023                 icp.outlierFilters.clear();
00024         }
00025 
00026         // Will be called for every tests
00027         virtual void TearDown(){}
00028 
00029         void addFilter(string name, PM::Parameters params)
00030         {
00031                 testedOutlierFilter = 
00032                         PM::get().OutlierFilterRegistrar.create(name, params);
00033                 icp.outlierFilters.push_back(testedOutlierFilter);
00034         }
00035 
00036 };
00037 
00038 //No commun parameters were found for 2D and 3D, tests are splited
00039 TEST_F(OutlierFilterTest, MaxDistOutlierFilter2D)
00040 {
00041         addFilter("MaxDistOutlierFilter", map_list_of
00042                 ("maxDist", toParam(0.015))
00043         );
00044         validate2dTransformation();
00045 }
00046 
00047 TEST_F(OutlierFilterTest, MaxDistOutlierFilter3D)
00048 {
00049         addFilter("MaxDistOutlierFilter", map_list_of
00050                 ("maxDist", toParam(0.1))
00051         );
00052         validate3dTransformation();
00053 }
00054 
00055 //No commun parameters were found for 2D and 3D, tests are splited
00056 TEST_F(OutlierFilterTest, MinDistOutlierFilter2D)
00057 {
00058         // Since not sure how useful is that filter, we keep the 
00059         // MaxDistOutlierFilter with it
00060         PM::OutlierFilter* extraOutlierFilter;
00061         
00062         extraOutlierFilter = 
00063                 PM::get().OutlierFilterRegistrar.create(
00064                         "MaxDistOutlierFilter", map_list_of 
00065                                 ("maxDist", toParam(0.015))
00066                 )
00067         ;
00068         icp.outlierFilters.push_back(extraOutlierFilter);
00069         
00070         addFilter("MinDistOutlierFilter", map_list_of ("minDist", toParam(0.0002)) );
00071         
00072         validate2dTransformation();
00073 }
00074 
00075 TEST_F(OutlierFilterTest, MinDistOutlierFilter3D)
00076 {
00077         // Since not sure how useful is that filter, we keep the 
00078         // MaxDistOutlierFilter with it
00079         PM::OutlierFilter* extraOutlierFilter;
00080         
00081         extraOutlierFilter = 
00082                 PM::get().OutlierFilterRegistrar.create(
00083                         "MaxDistOutlierFilter", map_list_of 
00084                                 ("maxDist", toParam(0.1))
00085                 )
00086         ;
00087         icp.outlierFilters.push_back(extraOutlierFilter);
00088         
00089         addFilter("MinDistOutlierFilter", map_list_of ("minDist", toParam(0.0002)) );
00090         
00091         validate3dTransformation();
00092 }
00093 
00094 TEST_F(OutlierFilterTest, MedianDistOutlierFilter)
00095 {
00096         addFilter("MedianDistOutlierFilter", map_list_of ("factor", toParam(3.5)));
00097         validate2dTransformation();
00098         validate3dTransformation();
00099 }
00100 
00101 
00102 TEST_F(OutlierFilterTest, TrimmedDistOutlierFilter)
00103 {
00104         addFilter("TrimmedDistOutlierFilter", map_list_of ("ratio", toParam(0.85)) );
00105         validate2dTransformation();
00106         validate3dTransformation();
00107 }
00108 
00109 
00110 TEST_F(OutlierFilterTest, VarTrimmedDistOutlierFilter)
00111 {
00112         addFilter("VarTrimmedDistOutlierFilter", map_list_of
00113                 ("minRatio", toParam(0.60))
00114                 ("maxRatio", toParam(0.80))
00115                 ("lambda", toParam(0.9))
00116         );
00117         validate2dTransformation();
00118         validate3dTransformation();
00119 }


upstream_src
Author(s):
autogenerated on Mon Oct 6 2014 10:27:42