invalid result of GPU bitwise_and with mask (Bug #4315)
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
Bug #4315 : fix CUDA bitwise operations with mask
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