opencv/modules/core
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
..
3rdparty/SoftFloat Add install component for 3rdparty libraries licenses 2018-03-06 16:32:30 +03:00
cmake/parallel core(parallel): plugins support 2021-02-15 17:07:36 +00:00
doc Merge pull request #23342 from n0099:#23335 2023-05-03 14:15:53 +03:00
include/opencv2 Merge pull request #25564 from mshabunin:cleanup-imgproc-2 2024-05-17 15:01:05 +03:00
misc Replace static numpy allocator by function containing static. 2024-04-26 14:38:18 +02:00
perf Merge pull request #25450 from savuor:rv/svd_perf 2024-04-27 14:33:13 +03:00
src Merge pull request #25598 from asmorkalov:as/tables_range_check_core 2024-05-17 10:48:40 +03:00
test Merge pull request #25563 from asmorkalov:as/HAL_min_max_idx 2024-05-08 18:57:02 +03:00
CMakeLists.txt build: first class cuda support 2023-12-26 09:39:18 +03:00