opencv/modules/imgproc/test
Maksim Shabunin a25132986a
Merge pull request #25146 from mshabunin:cpp-contours
Reworked findContours to reduce C-API usage #25146

What is done:
* rewritten `findContours` and `icvApproximateChainTC89` using C++ data structures
* extracted LINK_RUNS mode to separate new public functions - `findContoursLinkRuns` (it uses completely different algorithm)
* ~added new public `cv::approximateChainTC89`~ - ** decided to hide it**
* enabled chain code output (method = 0, no public enum value for this in C++ yet)
* kept old function as `findContours_old` (exported, but not exposed to user)
* added more tests for findContours (`test_contours_new.cpp`), some tests compare results of old function with new one. Following tests have been added:
  * contours of random rectangle
  * contours of many small (1-2px) blobs
  * contours of random noise
  * backport of old accuracy test
  * separate test for LINK RUNS variant

What is left to be done (can be done now or later):
* improve tests: 
  * some tests have limited verification (e.g. only verify contour sizes)
  * perhaps reference data can be collected and stored
  * maybe more test variants can be added (?)
* add enum value for chain code output and a method of returning starting points (e.g. first 8 elements of returned `vector<uchar>` can represent 2 int point coordinates)
* add documentation for new functions - **✔️ DONE**
* check and improve performance (my experiment showed 0.7x-1.1x some time ago)
* remove old functions completely (?)
* change contour return order (BFS) or allow to select it (?)
* return result tree as-is (?) (new data structures should be exposed, bindings should adapt)
2024-04-09 09:37:49 +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 Fix bug in maskBoundingRect 2024-03-08 03:25: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 Merge pull request #25146 from mshabunin:cpp-contours 2024-04-09 09:37:49 +03:00
test_contours.cpp Merge pull request #25146 from mshabunin:cpp-contours 2024-04-09 09:37:49 +03:00
test_convhull.cpp Partially backport C API removal in imgproc module to reduce conflicts with 5.x 2024-02-29 12:42:19 +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 Partially backport C API removal in imgproc module to reduce conflicts with 5.x 2024-02-29 12:42:19 +03:00
test_emd.cpp ts: refactor OpenCV tests 2018-02-03 19:39:47 +00:00
test_filter.cpp Partially back-port #25075 to 4.x 2024-03-05 12:15:39 +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 ts: refactor OpenCV tests 2018-02-03 19:39:47 +00: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 Partially backport C API removal in imgproc module to reduce conflicts with 5.x 2024-02-29 12:42:19 +03:00
test_watershed.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2023-01-23 00:11:12 +00:00