Skip to content

Fix self converTo.#23013

Merged
opencv-pushbot merged 1 commit intoopencv:4.xfrom
vrabaud:mertens_fix
Dec 21, 2022
Merged

Fix self converTo.#23013
opencv-pushbot merged 1 commit intoopencv:4.xfrom
vrabaud:mertens_fix

Conversation

@vrabaud
Copy link
Copy Markdown
Contributor

@vrabaud vrabaud commented Dec 21, 2022

We still need images[i] = img because it is used below in buildPyramid.

Pull Request Readiness Checklist

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

  • 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

We still need images[i] = img because it is used below in buildPyramid.
@vrabaud
Copy link
Copy Markdown
Contributor Author

vrabaud commented Dec 21, 2022

The breakage was introduced in https://github.com/opencv/opencv/pull/22959
The stack trace was something like

    @     0x7f1c43e73e0d  cv::Mat::create()
    @     0x7f1c43e74c53  cv::Mat::create()
    @     0x7f1c43d810d5  cv::Mat::convertTo()
    @     0x7f1c44f5f2f3  cv::MergeMertensImpl::process()::{lambda()#1}::operator()()

Copy link
Copy Markdown
Contributor

@feuerste feuerste left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the fix!

} else {
img.copyTo(gray);
}
images[i] = img;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: Moving this up to line 183 may make it a bit clearer, that we just want a shallow copy here.

@opencv-pushbot opencv-pushbot merged commit 2a884cc into opencv:4.x Dec 21, 2022
@vrabaud vrabaud deleted the mertens_fix branch December 28, 2022 12:16
@alalek alalek mentioned this pull request Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants