Skip to content

imgproc: remove C-API usage from tests#25842

Merged
asmorkalov merged 3 commits intoopencv:4.xfrom
mshabunin:cpp-imgproc-test-4.x
Jul 4, 2024
Merged

imgproc: remove C-API usage from tests#25842
asmorkalov merged 3 commits intoopencv:4.xfrom
mshabunin:cpp-imgproc-test-4.x

Conversation

@mshabunin
Copy link
Copy Markdown
Contributor

Final cleanup will be done in 5.x after regular merge.

Some tests have been reworked, some required only slight modifications.

@asmorkalov
Copy link
Copy Markdown
Contributor

2024-07-01T22:53:31.1531859Z C:\GHA-OCV-6\_work\opencv\opencv\opencv\modules\imgproc\test\test_convhull.cpp(635): warning C4244: 'return': conversion from 'double' to 'float', possible loss of data
2024-07-01T22:53:31.1535228Z 
2024-07-01T22:53:31.1538993Z C:\GHA-OCV-6\_work\opencv\opencv\opencv\modules\imgproc\test\test_convhull.cpp(670): warning C4244: 'argument': conversion from 'double' to '_Tp', possible loss of data
2024-07-01T22:53:31.1542474Z 
2024-07-01T22:53:31.1545745Z C:\GHA-OCV-6\_work\opencv\opencv\opencv\modules\imgproc\test\test_convhull.cpp(670): warning C4244: 'argument': conversion from 'double' to '_Tp', possible loss of data
2024-07-01T22:53:31.1552559Z 
2024-07-01T22:53:31.1556072Z C:\GHA-OCV-6\_work\opencv\opencv\opencv\modules\imgproc\test\test_convhull.cpp(706): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data
2024-07-01T22:53:31.1559627Z 
2024-07-01T22:53:31.1563148Z C:\GHA-OCV-6\_work\opencv\opencv\opencv\modules\imgproc\test\test_convhull.cpp(706): warning C4244: 'initializing': conversion from 'double' to 'const float', possible loss of data
2024-07-01T22:53:31.1566618Z 
2024-07-01T22:53:31.1570212Z C:\GHA-OCV-6\_work\opencv\opencv\opencv\modules\imgproc\test\test_convhull.cpp(803): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
2024-07-01T22:53:31.1573546Z 
2024-07-01T22:53:31.1576961Z C:\GHA-OCV-6\_work\opencv\opencv\opencv\modules\imgproc\test\test_convhull.cpp(803): warning C4267: 'initializing': conversion from 'size_t' to 'const int', possible loss of data
2024-07-01T22:53:31.1580809Z 
2024-07-01T22:53:31.1584181Z C:\GHA-OCV-6\_work\opencv\opencv\opencv\modules\imgproc\test\test_templmatch.cpp(150): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
2024-07-01T22:53:31.1587835Z 
2024-07-01T22:53:31.1591221Z C:\GHA-OCV-6\_work\opencv\opencv\opencv\modules\imgproc\test\test_templmatch.cpp(151): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data

@asmorkalov asmorkalov added test category: imgproc cleanup Code cleanup (e.g, drop legacy C-API, legacy unmaintained code) labels Jul 2, 2024
@asmorkalov asmorkalov self-requested a review July 2, 2024 07:03
@asmorkalov asmorkalov added this to the 4.11.0 milestone Jul 2, 2024

void CV_ColorBayerTest::run_func()
{
if(!test_cpp)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The flag may be removed then.


void CV_GetRectSubPixTest::run_func()
{
if(!test_cpp)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_cpp could be removed then

Comment on lines +682 to +691
Mat pt = f0 + f1 * sin(i) + f2 * cos(i);
pt = pt.reshape(2);
pt.convertTo(points.row(i), CV_32SC2, int_scale);
}
else if (data_type == CV_32FC2)
{
Mat pt = f0 + f1 * sin(i) + f2 * cos(i);
pt = pt.reshape(2);
pt.copyTo(points.row(i));
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The branches are the same besides convertTo/copyTo. Let's extract common part.

Copy link
Copy Markdown
Contributor

@asmorkalov asmorkalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@asmorkalov asmorkalov self-assigned this Jul 4, 2024
@asmorkalov asmorkalov merged commit 94b7a2d into opencv:4.x Jul 4, 2024
@mshabunin mshabunin deleted the cpp-imgproc-test-4.x branch July 5, 2024 14:59
@asmorkalov asmorkalov mentioned this pull request Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: imgproc cleanup Code cleanup (e.g, drop legacy C-API, legacy unmaintained code) test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants