opencv/modules/imgproc/test
Maksim Shabunin 6350bfbf79
Merge pull request #25564 from mshabunin:cleanup-imgproc-2
imgproc: C-API cleanup, drawContours refactor #25564

Changes:
* moved several macros from types_c.h to cvdef.h (assuming we will continue using them)
* removed some cases of C-API usage in _imgproc_ module (`CV_TERMCRIT_*` and `CV_CMP_*`)
* refactored `drawContours` to use C++ API instead of calling `cvDrawContours` + test for filled contours with holes (case with non-filled contours is simpler and is covered in some other tests)

#### Note:
There is one case where old drawContours behavior doesn't match the new one - when `contourIdx == -1` (means "draw all contours") and `maxLevel == 0` (means draw only selected contours, but not what is inside).

From the docs:
> **contourIdx**	Parameter indicating a contour to draw. If it is negative, all the contours are drawn.

> **maxLevel**	Maximal level for drawn contours. If it is 0, only the specified contour is drawn. If it is 1, the function draws the contour(s) and all the nested contours. If it is 2, the function draws the contours, all the nested contours, all the nested-to-nested contours, and so on. This parameter is only taken into account when there is hierarchy available.


Old behavior - only one first contour is drawn:
![actual_screenshot_08 05 2024](https://github.com/opencv/opencv/assets/3304494/d0ae1d64-ddad-46bb-8acc-6f696874f71b)
a
New behavior (also expected by the test) - all contours are drawn:
![expected_screenshot_08 05 2024](https://github.com/opencv/opencv/assets/3304494/57ccd980-9dde-4006-90ee-19d6ce76912a)
2024-05-17 15:01:05 +03:00
..
ocl Merge pull request #24621 from chacha21:remap_relative 2024-02-28 17:20:33 +03:00
test_approxpoly.cpp Merge pull request #21937 from Kumataro:4.x-fix-21911 2022-05-13 17:32:05 +00:00
test_bilateral_filter.cpp Merge pull request #21107 from take1014:remove_assert_21038 2021-11-27 18:34:52 +00:00
test_boundingrect.cpp imgproc: fixed alignment issue and improved test for boundingRect 2024-05-03 21:26:40 +03:00
test_canny.cpp Backport C-API cleanup (imgproc) from 5.x 2023-01-16 23:29:50 +03:00
test_color.cpp Partially back-port #25075 to 4.x 2024-03-05 12:15:39 +03:00
test_connectedcomponents.cpp Merge pull request #23108 from crackwitz:issue-23107 2023-01-09 09:55:31 +00:00
test_contours_new.cpp Removed old C API usage in new findContours implementation. 2024-04-10 11:19:55 +03:00
test_contours.cpp Merge pull request #25564 from mshabunin:cleanup-imgproc-2 2024-05-17 15:01:05 +03:00
test_convhull.cpp Merge pull request #25564 from mshabunin:cleanup-imgproc-2 2024-05-17 15:01:05 +03:00
test_cornersubpix.cpp Merge pull request #24527 from MaximSmolskiy:fix-out-of-image-corners-in-cv-cornersubpix 2023-11-21 15:36:43 +03:00
test_cvtyuv.cpp Merge pull request #24333 from definitelyuncertain:CvtRGB2YUV422 2023-10-12 10:18:24 +03:00
test_distancetransform.cpp Merge pull request #24234 from dkurt:distanceTransform_max_dist 2023-10-03 17:23:32 +03:00
test_drawing.cpp Merge pull request #25564 from mshabunin:cleanup-imgproc-2 2024-05-17 15:01:05 +03:00
test_emd.cpp Merge pull request #25469 from mshabunin:cpp-emd 2024-04-24 14:28:31 +03:00
test_filter.cpp Added tests for adaptiveThreshold and sepFilter2D 2024-04-08 13:04:50 +03:00
test_fitellipse_ams.cpp ts: refactor OpenCV tests 2018-02-03 19:39:47 +00:00
test_fitellipse_direct.cpp ts: refactor OpenCV tests 2018-02-03 19:39:47 +00:00
test_fitellipse.cpp Merge pull request #17417 from vpisarev:fix_fitellipse 2020-06-01 18:01:20 +00:00
test_floodfill.cpp fix cv::floodfill() for calling it with an empty mask 2022-02-08 15:28:19 +03:00
test_goodfeaturetotrack.cpp Merge pull request #19392 from amirtu:OCV-165_finalize_goodFeaturesToTrack_returns_also_corner_value_PR 2021-02-15 19:55:57 +00:00
test_grabcut.cpp Check for empty Mat in compare, operator= and RNG::fill, fixed related tests 2018-07-17 17:50:50 +03:00
test_histograms.cpp Add missing std namespace qualifiers 2023-09-06 13:46:39 +03:00
test_houghcircles.cpp Backport C-API cleanup (imgproc) from 5.x 2023-01-16 23:29:50 +03:00
test_houghlines.cpp Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
test_imgproc_umat.cpp Merge pull request #23108 from crackwitz:issue-23107 2023-01-09 09:55:31 +00:00
test_imgwarp_strict.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2023-01-23 00:11:12 +00:00
test_imgwarp.cpp Partially backport C API removal in imgproc module to reduce conflicts with 5.x 2024-02-29 12:42:19 +03:00
test_intelligent_scissors.cpp Merge pull request #23688 from cpoerschke:4.x-pr-21959-prep 2023-06-07 11:32:17 +03:00
test_intersectconvexconvex.cpp imgproc: fixed bug from intersectConvexConvex 2019-05-01 11:06:30 +02:00
test_intersection.cpp Merge pull request #23690 from chacha21:rotatedRectangleIntersection_precision 2023-05-30 17:46:39 +03:00
test_lsd.cpp restore LSD 2021-10-01 16:23:16 +03:00
test_main.cpp Merge pull request #11897 from Jakub-Golinowski:hpx_backend 2018-08-31 16:23:26 +03:00
test_moments.cpp don't use constructors for C API structures 2018-09-06 14:34:16 +03:00
test_pc.cpp Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
test_precomp.hpp Merge pull request #25469 from mshabunin:cpp-emd 2024-04-24 14:28:31 +03:00
test_pyramid.cpp fix the right border 2022-07-20 17:03:09 +08:00
test_resize_bitexact.cpp Merge pull request #23634 from dkurt:fix_nearest_exact 2023-05-19 20:32:04 +03:00
test_smooth_bitexact.cpp suppress GaussianBlur to generate empty images 2021-10-01 23:17:02 +09:00
test_stackblur.cpp improve code style and Doc of stackblur. 2022-10-29 17:34:28 +08:00
test_subdivision2d.cpp Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
test_templmatch.cpp Backport C-API cleanup (imgproc) from 5.x 2023-01-16 23:29:50 +03:00
test_templmatchmask.cpp Backport C-API cleanup (imgproc) from 5.x 2023-01-16 23:29:50 +03:00
test_thresh.cpp Added tests for adaptiveThreshold and sepFilter2D 2024-04-08 13:04:50 +03:00
test_watershed.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2023-01-23 00:11:12 +00:00