Merge pull request #3646 from Dhanwanth1803:latch

Fixes #25081:Latch input corruption fix #3646

Fixes https://github.com/opencv/opencv/issues/25081

As mentioned by WennPaper making it `grayImage = image.clone();` will make a deep copy. It prevents the `InputArray` from being modified.

- [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
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake

---
Co-authored-by: Dhanwanth1803 <dhanwanthvarala@gmail,com>
Co-authored-by: Dmitry Kurtaev <dmitry.kurtaev@gmail.com>
pull/3592/head^2
Dhanwanth1803 1 year ago committed by GitHub
parent bbce2ef9d6
commit 1ad3ad5f85
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      modules/xfeatures2d/src/latch.cpp

@ -519,7 +519,7 @@ namespace cv
switch (image.type())
{
case CV_8UC1:
grayImage = image;
grayImage = sigma_ ? image.clone() : image;
break;
case CV_8UC3:
cvtColor(image, grayImage, COLOR_BGR2GRAY);

Loading…
Cancel
Save