mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
Merge pull request #22754 from mshabunin:c-cleanup
C-API cleanup for OpenCV 5.x (imgproc, highgui) * imgproc: C-API cleanup * imgproc: increase cvtColor test diff threshold * imgproc: C-API cleanup pt.2 * imgproc: C-API cleanup pt.3 * imgproc: C-API cleanup pt.4 * imgproc: C-API cleanup pt.5 * imgproc: C-API cleanup pt.5 * imgproc: C-API cleanup pt.6 * highgui: C-API cleanup * highgui: C-API cleanup pt.2 * highgui: C-API cleanup pt.3 * highgui: C-API cleanup pt.3 * imgproc: C-API cleanup pt.7 * fixup! highgui: C-API cleanup pt.3 * fixup! imgproc: C-API cleanup pt.6 * imgproc: C-API cleanup pt.8 * imgproc: C-API cleanup pt.9 * fixup! imgproc: C-API cleanup pt.9 * fixup! imgproc: C-API cleanup pt.9 * fixup! imgproc: C-API cleanup pt.9 * fixup! imgproc: C-API cleanup pt.9 * fixup! imgproc: C-API cleanup pt.9 * fixup! imgproc: C-API cleanup pt.9
This commit is contained in:
@@ -131,7 +131,7 @@ void CV_DrawingTest_CPP::draw( Mat& img )
|
||||
|
||||
p2 = Point(3,imgSize.height+1000);
|
||||
if( clipLine(Rect(0,0,imgSize.width,imgSize.height), p1, p2) && clipLine(imgSize, p1, p2) )
|
||||
circle( img, Point(500,300), 50, cvColorToScalar(255,CV_8UC3), 5, 8, 1 ); // draw
|
||||
circle( img, Point(500,300), 50, Scalar(255, 0, 0), 5, 8, 1 ); // draw
|
||||
|
||||
p1 = Point(imgSize.width,1), p2 = Point(imgSize.width,3);
|
||||
if( clipLine(Rect(0,0,imgSize.width,imgSize.height), p1, p2) && clipLine(imgSize, p1, p2) )
|
||||
@@ -147,7 +147,7 @@ void CV_DrawingTest_CPP::draw( Mat& img )
|
||||
ellipse2Poly( Point(430,180), Size(100,150), 30, 0, 150, 20, polyline );
|
||||
pts = &polyline[0];
|
||||
n = (int)polyline.size();
|
||||
polylines( img, &pts, &n, 1, false, Scalar(0,0,150), 4, CV_AA );
|
||||
polylines( img, &pts, &n, 1, false, Scalar(0,0,150), 4, cv::LINE_AA );
|
||||
n = 0;
|
||||
for( vector<Point>::const_iterator it = polyline.begin(); n < (int)polyline.size()-1; ++it, n++ )
|
||||
{
|
||||
@@ -195,43 +195,43 @@ void CV_DrawingTest_CPP::draw( Mat& img )
|
||||
|
||||
textSize = getTextSize( text2, FONT_HERSHEY_SIMPLEX, fontScale, thickness, &baseline);
|
||||
textOrg = Point(5,5)+Point(0,textSize.height+dist);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_SIMPLEX, fontScale, color, thickness, CV_AA);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_SIMPLEX, fontScale, color, thickness, cv::LINE_AA);
|
||||
|
||||
fontScale = 1;
|
||||
textSize = getTextSize( text2, FONT_HERSHEY_PLAIN, fontScale, thickness, &baseline);
|
||||
textOrg += Point(0,textSize.height+dist);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_PLAIN, fontScale, color, thickness, CV_AA);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_PLAIN, fontScale, color, thickness, cv::LINE_AA);
|
||||
|
||||
fontScale = 0.5;
|
||||
textSize = getTextSize( text2, FONT_HERSHEY_DUPLEX, fontScale, thickness, &baseline);
|
||||
textOrg += Point(0,textSize.height+dist);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_DUPLEX, fontScale, color, thickness, CV_AA);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_DUPLEX, fontScale, color, thickness, cv::LINE_AA);
|
||||
|
||||
textSize = getTextSize( text2, FONT_HERSHEY_COMPLEX, fontScale, thickness, &baseline);
|
||||
textOrg += Point(0,textSize.height+dist);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_COMPLEX, fontScale, color, thickness, CV_AA);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_COMPLEX, fontScale, color, thickness, cv::LINE_AA);
|
||||
|
||||
textSize = getTextSize( text2, FONT_HERSHEY_TRIPLEX, fontScale, thickness, &baseline);
|
||||
textOrg += Point(0,textSize.height+dist);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_TRIPLEX, fontScale, color, thickness, CV_AA);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_TRIPLEX, fontScale, color, thickness, cv::LINE_AA);
|
||||
|
||||
fontScale = 1;
|
||||
textSize = getTextSize( text2, FONT_HERSHEY_COMPLEX_SMALL, fontScale, thickness, &baseline);
|
||||
textOrg += Point(0,180) + Point(0,textSize.height+dist);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_COMPLEX_SMALL, fontScale, color, thickness, CV_AA);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_COMPLEX_SMALL, fontScale, color, thickness, cv::LINE_AA);
|
||||
|
||||
textSize = getTextSize( text2, FONT_HERSHEY_SCRIPT_SIMPLEX, fontScale, thickness, &baseline);
|
||||
textOrg += Point(0,textSize.height+dist);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_SCRIPT_SIMPLEX, fontScale, color, thickness, CV_AA);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_SCRIPT_SIMPLEX, fontScale, color, thickness, cv::LINE_AA);
|
||||
|
||||
textSize = getTextSize( text2, FONT_HERSHEY_SCRIPT_COMPLEX, fontScale, thickness, &baseline);
|
||||
textOrg += Point(0,textSize.height+dist);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_SCRIPT_COMPLEX, fontScale, color, thickness, CV_AA);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_SCRIPT_COMPLEX, fontScale, color, thickness, cv::LINE_AA);
|
||||
|
||||
dist = 15, fontScale = 0.5;
|
||||
textSize = getTextSize( text2, FONT_ITALIC, fontScale, thickness, &baseline);
|
||||
textOrg += Point(0,textSize.height+dist);
|
||||
putText(img, text2, textOrg, FONT_ITALIC, fontScale, color, thickness, CV_AA);
|
||||
putText(img, text2, textOrg, FONT_ITALIC, fontScale, color, thickness, cv::LINE_AA);
|
||||
}
|
||||
|
||||
int CV_DrawingTest_CPP::checkLineIterator( Mat& img )
|
||||
@@ -324,7 +324,7 @@ void CV_DrawingTest_Far::draw(Mat& img)
|
||||
|
||||
p2 = Point(32768 + 3, imgSize.height + 1000);
|
||||
if (clipLine(Rect(32768 + 0, 0, imgSize.width, imgSize.height), p1, p2) && clipLine(imgSize, p1, p2))
|
||||
circle(img, Point(65536 + 500, 300), 50, cvColorToScalar(255, CV_8UC3), 5, 8, 1); // draw
|
||||
circle(img, Point(65536 + 500, 300), 50, Scalar(255, 0, 0), 5, 8, 1); // draw
|
||||
|
||||
p1 = Point(imgSize.width, 1), p2 = Point(imgSize.width, 3);
|
||||
if (clipLine(Rect(32768 + 0, 0, imgSize.width, imgSize.height), p1, p2) && clipLine(imgSize, p1, p2))
|
||||
@@ -340,7 +340,7 @@ void CV_DrawingTest_Far::draw(Mat& img)
|
||||
ellipse2Poly(Point(32768 + 430, 180), Size(100, 150), 30, 0, 150, 20, polyline);
|
||||
pts = &polyline[0];
|
||||
n = (int)polyline.size();
|
||||
polylines(img, &pts, &n, 1, false, Scalar(0, 0, 150), 4, CV_AA);
|
||||
polylines(img, &pts, &n, 1, false, Scalar(0, 0, 150), 4, cv::LINE_AA);
|
||||
n = 0;
|
||||
for (vector<Point>::const_iterator it = polyline.begin(); n < (int)polyline.size() - 1; ++it, n++)
|
||||
{
|
||||
@@ -388,43 +388,43 @@ void CV_DrawingTest_Far::draw(Mat& img)
|
||||
|
||||
textSize = getTextSize(text2, FONT_HERSHEY_SIMPLEX, fontScale, thickness, &baseline);
|
||||
textOrg = Point(32768 + 5, 5) + Point(0, textSize.height + dist);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_SIMPLEX, fontScale, color, thickness, CV_AA);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_SIMPLEX, fontScale, color, thickness, cv::LINE_AA);
|
||||
|
||||
fontScale = 1;
|
||||
textSize = getTextSize(text2, FONT_HERSHEY_PLAIN, fontScale, thickness, &baseline);
|
||||
textOrg += Point(0, textSize.height + dist);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_PLAIN, fontScale, color, thickness, CV_AA);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_PLAIN, fontScale, color, thickness, cv::LINE_AA);
|
||||
|
||||
fontScale = 0.5;
|
||||
textSize = getTextSize(text2, FONT_HERSHEY_DUPLEX, fontScale, thickness, &baseline);
|
||||
textOrg += Point(0, textSize.height + dist);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_DUPLEX, fontScale, color, thickness, CV_AA);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_DUPLEX, fontScale, color, thickness, cv::LINE_AA);
|
||||
|
||||
textSize = getTextSize(text2, FONT_HERSHEY_COMPLEX, fontScale, thickness, &baseline);
|
||||
textOrg += Point(0, textSize.height + dist);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_COMPLEX, fontScale, color, thickness, CV_AA);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_COMPLEX, fontScale, color, thickness, cv::LINE_AA);
|
||||
|
||||
textSize = getTextSize(text2, FONT_HERSHEY_TRIPLEX, fontScale, thickness, &baseline);
|
||||
textOrg += Point(0, textSize.height + dist);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_TRIPLEX, fontScale, color, thickness, CV_AA);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_TRIPLEX, fontScale, color, thickness, cv::LINE_AA);
|
||||
|
||||
fontScale = 1;
|
||||
textSize = getTextSize(text2, FONT_HERSHEY_COMPLEX_SMALL, fontScale, thickness, &baseline);
|
||||
textOrg += Point(0, 180) + Point(0, textSize.height + dist);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_COMPLEX_SMALL, fontScale, color, thickness, CV_AA);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_COMPLEX_SMALL, fontScale, color, thickness, cv::LINE_AA);
|
||||
|
||||
textSize = getTextSize(text2, FONT_HERSHEY_SCRIPT_SIMPLEX, fontScale, thickness, &baseline);
|
||||
textOrg += Point(0, textSize.height + dist);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_SCRIPT_SIMPLEX, fontScale, color, thickness, CV_AA);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_SCRIPT_SIMPLEX, fontScale, color, thickness, cv::LINE_AA);
|
||||
|
||||
textSize = getTextSize(text2, FONT_HERSHEY_SCRIPT_COMPLEX, fontScale, thickness, &baseline);
|
||||
textOrg += Point(0, textSize.height + dist);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_SCRIPT_COMPLEX, fontScale, color, thickness, CV_AA);
|
||||
putText(img, text2, textOrg, FONT_HERSHEY_SCRIPT_COMPLEX, fontScale, color, thickness, cv::LINE_AA);
|
||||
|
||||
dist = 15, fontScale = 0.5;
|
||||
textSize = getTextSize(text2, FONT_ITALIC, fontScale, thickness, &baseline);
|
||||
textOrg += Point(0, textSize.height + dist);
|
||||
putText(img, text2, textOrg, FONT_ITALIC, fontScale, color, thickness, CV_AA);
|
||||
putText(img, text2, textOrg, FONT_ITALIC, fontScale, color, thickness, cv::LINE_AA);
|
||||
|
||||
img = img(Rect(32768, 0, 600, 400)).clone();
|
||||
}
|
||||
@@ -520,7 +520,7 @@ protected:
|
||||
Size textSize = getTextSize(*line, *font | italic, fontScale, thickness, &baseline);
|
||||
Point textOrg(0, textSize.height + 2);
|
||||
Mat img(textSize + Size(0, baseline), CV_8UC3, Scalar(255, 255, 255));
|
||||
putText(img, *line, textOrg, *font | italic, fontScale, color, thickness, CV_AA);
|
||||
putText(img, *line, textOrg, *font | italic, fontScale, color, thickness, cv::LINE_AA);
|
||||
|
||||
results.push_back(img);
|
||||
bigSize.width = max(bigSize.width, img.size().width);
|
||||
|
||||
Reference in New Issue
Block a user