opencv/modules/imgproc/include/opencv2/imgproc
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
..
detail Merge pull request #25146 from mshabunin:cpp-contours 2024-04-09 09:37:49 +03:00
hal Merge pull request #24333 from definitelyuncertain:CvtRGB2YUV422 2023-10-12 10:18:24 +03:00
bindings.hpp Merge pull request #19423 from LaurentBerger:houg_acc 2021-02-01 21:22:10 +00:00
imgproc_c.h Disable warning C5054 in VS 2022 C++20 2023-07-26 09:23:32 +03:00
imgproc.hpp Cleaned up adaptive bilateral filtering, added support for gaussian interpolation, updated sample and docs 2013-11-06 16:48:50 +04:00
segmentation.hpp imgproc: fix two typos (imput, magnutude) 2022-05-01 19:59:55 +01:00
types_c.h Merge pull request #24621 from chacha21:remap_relative 2024-02-28 17:20:33 +03:00