Skip to content

Conversation

@Dhanwanth1803
Copy link
Contributor

@Dhanwanth1803 Dhanwanth1803 commented Mar 3, 2024

Fixes opencv/opencv#25081

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

  • I agree to contribute to the project under Apache 2 License.
  • 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
  • The PR is proposed to the proper branch
  • 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

@dkurt
Copy link
Member

dkurt commented Mar 4, 2024

add a link to the issue

@asmorkalov asmorkalov changed the title fixes #25081:Latch bug fix fixes #25081:Latch input corruption fix Mar 4, 2024
@asmorkalov asmorkalov self-requested a review March 4, 2024 12:56
Copy link
Contributor

@asmorkalov asmorkalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

dkurt
dkurt previously approved these changes Mar 4, 2024
@dkurt dkurt dismissed their stale review March 4, 2024 13:57

memory can be optimized

Copy link
Member

@dkurt dkurt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GaussianBlur is called only for sigma != 0.0. So clone only then.

@Dhanwanth1803
Copy link
Contributor Author

Dhanwanth1803 commented Mar 4, 2024

GaussianBlur is called only for sigma != 0.0. So clone only then.

Sir, In that case will this work?
case CV_8UC1:
if (sigma_ != 0.) grayImage = image.clone();
break;

Co-authored-by: Dmitry Kurtaev <dmitry.kurtaev@gmail.com>
@asmorkalov asmorkalov merged commit 1ad3ad5 into opencv:4.x Mar 5, 2024
@asmorkalov asmorkalov mentioned this pull request Mar 6, 2024
@asmorkalov asmorkalov mentioned this pull request Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cv2.xfeatures2d.LATCH bug

3 participants