invalid result of GPU bitwise_and with mask (Bug #4315)


Added by Vasil Khalidov almost 10 years ago. Updated almost 10 years ago.


Status:Done Start date:2015-05-05
Priority:Normal Due date:
Assignee:Vladislav Vinogradov % Done:

0%

Category:gpu (cuda)
Target version:2.4.12
Affected version:2.4.9 (latest release) Operating System:Linux
Difficulty: HW Platform:x64
Pull request:https://github.com/Itseez/opencv/pull/3990

Description

Assume file "mask.png" contains a B&W mask (only 0 and 255 values).
If one performs cv::gpu::bitwise_and without a mask, everything works as expected:

using namespace cv;

gpu::GpuMat image(imread("image.png"));
gpu::GpuMat mask_3c(imread("mask.png"));
gpu::bitwise_and(image, mask_3c, image);
// produces: image &= mask_3c

However, performing cv::gpu::bitwise_and with a mask gives invalid results:

using namespace cv;

gpu::GpuMat image(imread("image.png"));
gpu::GpuMat mask_1c((imread("mask.png", CV_LOAD_IMAGE_GRAYSCALE) < 255));
gpu::GpuMat zero(image.rows, image.cols, CV_8UC3);
gpu::bitwise_and(image, zero, image, mask_1c);
// produces: image = zero, as if the mask was ignored

Associated revisions

Revision d87c30dc
Added by Vladislav Vinogradov almost 10 years ago

Bug #4315 : fix CUDA bitwise operations with mask

Revision 1d409469
Added by Vladislav Vinogradov almost 10 years ago

Bug #4315 : fix CUDA bitwise operations with mask
(cherry picked from commit d87c30dc8470e39048cc01f75f26eb7bd3d6ce9f)

History

Updated by Vladislav Vinogradov almost 10 years ago

  • Status changed from New to Open
  • Target version set to 2.4.12

Updated by Vladislav Vinogradov almost 10 years ago

  • Pull request set to https://github.com/Itseez/opencv/pull/3990

Updated by Vladislav Vinogradov almost 10 years ago

The pull request was merged.

  • Status changed from Open to Done

Also available in: Atom PDF