test_polygon_extraction.cpp
Go to the documentation of this file.
00001 
00059 /*
00060  * test_segmentation.cpp
00061  *
00062  *  Created on: 18.06.2012
00063  *      Author: josh
00064  */
00065 
00066 
00067 //includes needed for testing
00068 #include <gtest/gtest.h>
00069 
00070 
00071 //includes needed for segmentation (things to test)
00072 #include <cob_3d_segmentation/polygon_extraction/polygon_types.h>
00073 #include <cob_3d_segmentation/polygon_extraction/polygon_extraction.h>
00074 
00075 
00076 
00077 TEST(cob_3d_segmentation, polygon_extraction)
00078 {
00079   cob_3d_segmentation::PolygonExtraction pe;
00080 
00081   std::vector<cob_3d_segmentation::PolygonPoint> outs;
00082   for(int i=0; i<30; i++)
00083   {
00084     cob_3d_segmentation::PolygonPoint xy;
00085 
00086     xy.x=i+10;
00087     xy.y=10;
00088     outs.push_back(xy);
00089 
00090     xy.x=11+i;
00091     xy.y=40;
00092     outs.push_back(xy);
00093 
00094     xy.x=10;
00095     xy.y=11+i;
00096     outs.push_back(xy);
00097 
00098     xy.x=40;
00099     xy.y=10+i;
00100     outs.push_back(xy);
00101   }
00102 
00103   cob_3d_segmentation::PolygonContours<cob_3d_segmentation::PolygonPoint> poly;
00104   pe.outline(60,60, outs, poly);
00105 
00106   printf("%d polygons first with %d points\n", (int)poly.polys_.size(), (int)poly.polys_[0].size());
00107 }
00108 
00109 
00110 int main(int argc, char **argv){
00111   testing::InitGoogleTest(&argc, argv);
00112   return RUN_ALL_TESTS();
00113 }


cob_3d_segmentation
Author(s): Georg Arbeiter
autogenerated on Wed Aug 26 2015 11:03:03