mirror of
https://github.com/opencv/opencv.git
synced 2024-11-30 22:40:17 +08:00
a25132986a
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) |
||
---|---|---|
.. | ||
ocl | ||
test_approxpoly.cpp | ||
test_bilateral_filter.cpp | ||
test_boundingrect.cpp | ||
test_canny.cpp | ||
test_color.cpp | ||
test_connectedcomponents.cpp | ||
test_contours_new.cpp | ||
test_contours.cpp | ||
test_convhull.cpp | ||
test_cornersubpix.cpp | ||
test_cvtyuv.cpp | ||
test_distancetransform.cpp | ||
test_drawing.cpp | ||
test_emd.cpp | ||
test_filter.cpp | ||
test_fitellipse_ams.cpp | ||
test_fitellipse_direct.cpp | ||
test_fitellipse.cpp | ||
test_floodfill.cpp | ||
test_goodfeaturetotrack.cpp | ||
test_grabcut.cpp | ||
test_histograms.cpp | ||
test_houghcircles.cpp | ||
test_houghlines.cpp | ||
test_imgproc_umat.cpp | ||
test_imgwarp_strict.cpp | ||
test_imgwarp.cpp | ||
test_intelligent_scissors.cpp | ||
test_intersectconvexconvex.cpp | ||
test_intersection.cpp | ||
test_lsd.cpp | ||
test_main.cpp | ||
test_moments.cpp | ||
test_pc.cpp | ||
test_precomp.hpp | ||
test_pyramid.cpp | ||
test_resize_bitexact.cpp | ||
test_smooth_bitexact.cpp | ||
test_stackblur.cpp | ||
test_subdivision2d.cpp | ||
test_templmatch.cpp | ||
test_templmatchmask.cpp | ||
test_thresh.cpp | ||
test_watershed.cpp |