Merge pull request #3362 from mshabunin:fix-drawing-24

pull/3336/head
Vadim Pisarevsky 10 years ago
commit 67e50b4415
  1. 13
      modules/highgui/test/test_drawing.cpp

@ -75,11 +75,11 @@ void CV_DrawingTest::run( int )
} }
else else
{ {
float err = (float)norm( testImg, valImg, CV_RELATIVE_L1 ); float err = (float)norm( testImg, valImg, NORM_L1 );
float Eps = 0.9f; float Eps = 1;
if( err > Eps) if( err > Eps)
{ {
ts->printf( ts->LOG, "CV_RELATIVE_L1 between testImg and valImg is equal %f (larger than %f)\n", err, Eps ); ts->printf( ts->LOG, "NORM_L1 between testImg and valImg is equal %f (larger than %f)\n", err, Eps );
ts->set_failed_test_info(cvtest::TS::FAIL_BAD_ACCURACY); ts->set_failed_test_info(cvtest::TS::FAIL_BAD_ACCURACY);
} }
else else
@ -261,6 +261,7 @@ void CV_DrawingTest_C::draw( Mat& _img )
polyline[3] = cvPoint(0, imgSize.height); polyline[3] = cvPoint(0, imgSize.height);
CvPoint* pts = &polyline[0]; CvPoint* pts = &polyline[0];
int n = (int)polyline.size(); int n = (int)polyline.size();
int actualSize = 0;
cvFillPoly( &img, &pts, &n, 1, cvScalar(255,255,255) ); cvFillPoly( &img, &pts, &n, 1, cvScalar(255,255,255) );
CvPoint p1 = cvPoint(1,1), p2 = cvPoint(3,3); CvPoint p1 = cvPoint(1,1), p2 = cvPoint(3,3);
@ -290,7 +291,8 @@ void CV_DrawingTest_C::draw( Mat& _img )
polyline.resize(9); polyline.resize(9);
pts = &polyline[0]; pts = &polyline[0];
n = (int)polyline.size(); n = (int)polyline.size();
assert( cvEllipse2Poly( cvPoint(430,180), cvSize(100,150), 30, 0, 150, &polyline[0], 20 ) == n ); actualSize = cvEllipse2Poly( cvPoint(430,180), cvSize(100,150), 30, 0, 150, &polyline[0], 20 );
CV_Assert(actualSize == n);
cvPolyLine( &img, &pts, &n, 1, false, cvScalar(0,0,150), 4, CV_AA ); cvPolyLine( &img, &pts, &n, 1, false, cvScalar(0,0,150), 4, CV_AA );
n = 0; n = 0;
for( vector<CvPoint>::const_iterator it = polyline.begin(); n < (int)polyline.size()-1; ++it, n++ ) for( vector<CvPoint>::const_iterator it = polyline.begin(); n < (int)polyline.size()-1; ++it, n++ )
@ -301,7 +303,8 @@ void CV_DrawingTest_C::draw( Mat& _img )
polyline.resize(19); polyline.resize(19);
pts = &polyline[0]; pts = &polyline[0];
n = (int)polyline.size(); n = (int)polyline.size();
assert( cvEllipse2Poly( cvPoint(500,300), cvSize(50,80), 0, 0, 180, &polyline[0], 10 ) == n ); actualSize = cvEllipse2Poly( cvPoint(500,300), cvSize(50,80), 0, 0, 180, &polyline[0], 10 );
CV_Assert(actualSize == n);
cvPolyLine( &img, &pts, &n, 1, true, Scalar(100,200,100), 20 ); cvPolyLine( &img, &pts, &n, 1, true, Scalar(100,200,100), 20 );
cvFillConvexPoly( &img, pts, n, cvScalar(0, 80, 0) ); cvFillConvexPoly( &img, pts, n, cvScalar(0, 80, 0) );

Loading…
Cancel
Save