opencv/modules/imgproc/test
Dmitry Kurtaev d752bac43f
Merge pull request #24234 from dkurt:distanceTransform_max_dist
Change max distance at distanceTransform #24234

### Pull Request Readiness Checklist

resolves https://github.com/opencv/opencv/issues/23895
related: https://github.com/opencv/opencv/pull/12278

* DIST_MASK_3 and DIST_MASK_5 maximal distance increased from 8192 to 65533 +/- 1
* Fix squares processing at DIST_MASK_PRECISE
* - [ ] TODO: Check with IPP

```cpp
    cv::Mat gray = cv::imread("opencv/samples/data/stuff.jpg", cv::ImreadModes::IMREAD_GRAYSCALE);

    cv::Mat gray_resize;
    cv::resize(gray, gray_resize, cv::Size(70000,70000), 0.0, 0.0, cv::INTER_LINEAR);

    gray_resize = gray_resize >= 100;

    cv::Mat dist;
    cv::distanceTransform(gray_resize, dist, cv::DIST_L2, cv::DIST_MASK_5, CV_32F);

    double minVal, maxVal;
    minMaxLoc(dist, &minVal, &maxVal);
    dist = 255 * (dist - minVal) / (maxVal - minVal);
    std::cout << minVal << " " << maxVal << std::endl;

    cv::Mat dist_resize;
    cv::resize(dist, dist_resize, cv::Size(1024,1024), 0.0, 0.0, cv::INTER_LINEAR);

    cv::String outfilePath = "test_mask_5.png";
    cv::imwrite(outfilePath, dist_resize);
```

mask | 4.x | PR |
----------|--------------|--------------
DIST_MASK_3 | <img src="https://github.com/opencv/opencv/assets/25801568/23e5de76-a8ba-4eb8-ab03-fa55672834be" width="128"> | <img src="https://github.com/opencv/opencv/assets/25801568/e1149f6a-49d6-47bd-a2a8-20bb7e4dafa4" width="128"> |
DIST_MASK_5 | <img src="https://github.com/opencv/opencv/assets/25801568/98aba29b-8865-4b9a-8066-669b16d175c9" width="128"> | <img src="https://github.com/opencv/opencv/assets/25801568/54f62ed2-9ef6-485f-bd63-48cc96accd7d" width="128"> |
DIST_MASK_PRECISE | <img src="https://github.com/opencv/opencv/assets/25801568/c4d79451-fd7a-461f-98fc-13060c63f473" width="128"> | <img src="https://github.com/opencv/opencv/assets/25801568/b5bfcaf5-bc48-40ba-b8e3-d000e5ab48db" width="128">|

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
2023-10-03 17:23:32 +03:00
..
ocl Backport C-API cleanup (imgproc) from 5.x 2023-01-16 23:29:50 +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 build: unreachable code after CV_Error() (part 2) 2018-04-24 16:03: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 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2023-01-23 00:11:12 +00:00
test_connectedcomponents.cpp Merge pull request #23108 from crackwitz:issue-23107 2023-01-09 09:55:31 +00:00
test_contours.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-12-03 12:32:49 +00:00
test_convhull.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2023-01-23 00:11:12 +00:00
test_cvtyuv.cpp Added check that YUYV input of cvtColor has even width. 2023-05-23 14:17:43 +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 #24042 from vrabaud:circle 2023-07-26 20:00:22 +03:00
test_emd.cpp ts: refactor OpenCV tests 2018-02-03 19:39:47 +00:00
test_filter.cpp Fix some clang 14 warnings 2023-02-07 01:19:00 +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 test_houghlines: Fix C++20 compatibility 2023-07-18 09:18:17 +02: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 Merge pull request #23922 from vrabaud:imgwarp 2023-07-12 15:20:01 +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 Backport C-API cleanup (imgproc) from 5.x 2023-01-16 23:29:50 +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 resolve #5788 2018-08-31 00:59:00 +09: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 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-12-18 16:19:06 +00:00
test_watershed.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2023-01-23 00:11:12 +00:00