Skip to content

Process InputOutputArray when BM3D_STEPALL is set #1709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 3, 2018

Conversation

LaurentBerger
Copy link
Contributor

@LaurentBerger LaurentBerger changed the base branch from master to 3.4 August 2, 2018 16:40
@LaurentBerger LaurentBerger reopened this Aug 2, 2018
@indr0
Copy link

indr0 commented Aug 3, 2018

certainly with my lack of experience & understanding, now should I rebuild opencv with opencv_contrib module ??

@@ -148,6 +148,7 @@ void bm3dDenoising(
_dst.create(srcSize, type);
break;
case BM3D_STEPALL:
_basic.create(srcSize, type);
_dst.create(srcSize, type);
Copy link
Member

Choose a reason for hiding this comment

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

Please take a look on line 159.

Perhaps this should be guarded: if (_basic.needed()) basic.create(...);

@@ -76,7 +76,7 @@ namespace opencv_test { namespace {

// BM3D: two different calls doing exactly the same thing
cv::Mat result, resultSec;
cv::xphoto::bm3dDenoising(original, cv::Mat(), resultSec, 10, 4, 16, 2500, 400, 8, 1, 0.0f, cv::NORM_L2, cv::xphoto::BM3D_STEPALL);
cv::xphoto::bm3dDenoising(original, result, resultSec, 10, 4, 16, 2500, 400, 8, 1, 0.0f, cv::NORM_L2, cv::xphoto::BM3D_STEPALL);
cv::xphoto::bm3dDenoising(original, result, 10, 4, 16, 2500, 400, 8, 1, 0.0f, cv::NORM_L2, cv::xphoto::BM3D_STEPALL);
Copy link
Member

Choose a reason for hiding this comment

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

You should not use "result" twice. It is not guaranteed that it is updated by second call.
Perhaps we should leave tests "as is" or replace Mat() to noArray().

Copy link
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

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

Thank you!

@alalek alalek merged commit a83b78e into opencv:3.4 Aug 3, 2018
@LaurentBerger LaurentBerger deleted the BM3D_STEPALL branch August 30, 2018 07:43
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.

3 participants