opencv/modules
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
..
calib3d Merge pull request #24301 from hanliutong:rewrite-stereo-sift 2023-09-25 13:03:25 +03:00
core Merge pull request #24343 from mshabunin:fix-test-writes 2023-10-03 16:34:25 +03:00
dnn Merge pull request #24353 from alexlyulkov:al/fixed-cumsum-layer 2023-10-03 13:58:25 +03:00
features2d Merge pull request #24323 from georgthegreat:akaze-variadic 2023-10-03 16:16:41 +03:00
flann Merge pull request #24028 from VadimLevin:dev/vlevin/fix-flann-python-bindings 2023-07-21 12:44:56 +03:00
gapi Merge pull request #23904 from kai-waang:removing-unreachable 2023-09-04 17:06:45 +03:00
highgui style: remove extraneous std::cout 2023-08-14 19:11:14 -04:00
imgcodecs Merge pull request #24343 from mshabunin:fix-test-writes 2023-10-03 16:34:25 +03:00
imgproc Merge pull request #24234 from dkurt:distanceTransform_max_dist 2023-10-03 17:23:32 +03:00
java Fail Java test suite, execution, if one of test failed. 2023-10-01 18:31:04 +03:00
js Merge pull request #24288 from tailsu:sd/emscripten-3.1.45-fixes 2023-09-19 08:09:18 +03:00
ml Merge remote-tracking branch 'origin/3.4' into merge-3.4 2023-04-21 10:55:04 +03:00
objc Backport 5.x: Support for module names that start from digit in ObjC bindings generator. 2023-05-25 11:45:59 +03:00
objdetect Added ArUco marker size check for Aruco and Charuco boards. 2023-10-03 09:16:07 +03:00
photo Deprecated convertTypeStr and made new variant that also takes the buffer size 2023-04-26 09:48:15 -04:00
python Merge pull request #24074 from Kumataro/fix24057 2023-09-19 10:32:47 +03:00
stitching Merge pull request #23740 from Peekabooc:4.x 2023-06-09 13:40:02 +03:00
ts Skip test cases in case of SkipTestException in SetUp 2023-09-20 13:27:06 +03:00
video Warnings fix on Windows. 2023-09-20 16:53:40 +03:00
videoio Merge pull request #24239 from asmorkalov:as/msmf_returned_fourcc 2023-09-11 11:00:54 +03:00
world cmake: VERSION_GREATER_EQUAL is not supported in CMake 3.5.1 2022-12-26 17:41:53 +00:00