opencv/modules
_Ayaka 4dd54bbec9
Merge pull request #25898 from Octopus136:issue-25853
Add a check for src == dst in ocl warpTransform #25898

As mentioned in #25853, when doing WarpAffine with Mat and UMat respectively, if you force the use of the in-place operation (so that src and dst are passed the same variables), Mat produces the correct results, but UMat produces unexpected results.

Obviously in-place operations are not possible with this transformation. When Mat performs the operation, if dst and src are the same variable, the function inherently makes a copy of src without telling the user. 

74b50c7af0/modules/imgproc/src/imgwarp.cpp (L2831-L2834)

So I did the same check in UMat, but I'm not sure if it's appropriate, should we just do a copy operation without telling the user (even if the user thinks he's doing an in-place operation), or should we throw an exception to indicate that we shouldn't pass in two same variables here?

The possible reason for this problem is that there is a create function here, so it gives the developer the false impression that this create function has allocated new memory for dst, however it does not.

74b50c7af0/modules/imgproc/src/imgwarp.cpp (L2607-L2609)

Because by the time the check is done here, the function has returned back.

74b50c7af0/modules/core/src/umatrix.cpp (L668-L675)

### Pull Request Readiness Checklist

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
2024-07-19 09:08:19 +03:00
..
calib3d Use CV_LOG_DEBUG for debug logging in chessboard detector. 2024-07-15 16:11:27 +03:00
core throw() -> noexcept 2024-07-16 06:36:52 -07:00
dnn Merge pull request #25931 from zihaomu:clean_code 2024-07-18 17:18:37 +03:00
features2d Merge pull request #25424 from mshabunin:fix-features2d-test 2024-04-17 14:19:05 +03:00
flann Prevent signed integer overflow in LshTable 2024-05-24 23:47:36 +02:00
gapi Merge pull request #25817 from lamiayous:ly/extend_onnxrt_gapi_backend_handle_i32_i64_type 2024-07-12 11:38:43 +03:00
highgui Merge pull request #25822 from mqcmd196:gtk3-gl-support 2024-07-15 17:06:30 +03:00
imgcodecs Merge pull request #25931 from zihaomu:clean_code 2024-07-18 17:18:37 +03:00
imgproc Merge pull request #25898 from Octopus136:issue-25853 2024-07-19 09:08:19 +03:00
java Merge pull request #25856 from alexlyulkov:al/android-optional-kotlin 2024-07-04 13:26:37 +03:00
js Merge pull request #25757 from dkurt:d.kurtaev/opencv_js_tests_old_emsdk 2024-06-17 12:46:10 +03:00
ml Partially back-port #25075 to 4.x 2024-03-05 12:15:39 +03:00
objc fix: resolve Swift method name conflicts by adding missing namespace 2024-07-18 00:20:17 +08:00
objdetect Merge pull request #25722 from AleksandrPanov:update_testSeveralBoardsWithCustomIds 2024-06-06 20:01:33 +03:00
photo photo: doc: Fix window range for fastNlMeansDenoisingMulti 2024-06-21 21:04:22 +08:00
python Merge pull request #25792 from asmorkalov:as/HAL_fast_GaussianBlur 2024-07-12 15:03:33 +03:00
stitching Partially back-port #25075 to 4.x 2024-03-05 12:15:39 +03:00
ts Merge pull request #25792 from asmorkalov:as/HAL_fast_GaussianBlur 2024-07-12 15:03:33 +03:00
video Merge pull request #25771 from fengyuentau:vittrack_black_input 2024-06-18 12:48:28 +03:00
videoio throw() -> noexcept 2024-07-16 06:36:52 -07:00
world cmake: use /INCREMENTAL:NO with MSVS 2015 2023-12-07 19:46:27 +00:00