Go to the documentation of this file.00001
00002 #include <gtest/gtest.h>
00003 #include "fitting.h"
00004
00005 TEST(Fitting,Ellipse)
00006 {
00007 cv::Mat points;
00008 cv::RotatedRect input, output;
00009 double noise = 0;
00010 double pixelerror = 0.5;
00011
00012 double fiterror = fitEllipse(points, output);
00013 ASSERT_NEAR(input.center.x,output.center.x,pixelerror);
00014
00015 EXPECT_NEAR(input.angle,output.angle,pixelerror);
00016 ASSERT_TRUE(fiterror <= noise*1.5);
00017 }
00018
00019 int main(int argc, char **argv)
00020 {
00021 testing::InitGoogleTest(&argc, argv);
00022 return RUN_ALL_TESTS();
00023 }