From 0fd91f6d1403d6ad760f877dba80b9649543ee2f Mon Sep 17 00:00:00 2001 From: Rajkiran Natarajan Date: Thu, 25 Jul 2019 04:13:33 +0000 Subject: [PATCH] Correct the behaviour of inpainting mask usage --- modules/xphoto/src/inpainting.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/xphoto/src/inpainting.cpp b/modules/xphoto/src/inpainting.cpp index 6796254f0..ce4bc0654 100644 --- a/modules/xphoto/src/inpainting.cpp +++ b/modules/xphoto/src/inpainting.cpp @@ -83,7 +83,7 @@ namespace xphoto cv::resize(_src, src, _src.size()/ls, 0, 0, cv::INTER_AREA); src.convertTo( img, CV_32F ); - img.setTo(0, 255 - mask); + img.setTo(0, ~(mask > 0)); cv::erode( mask, dmask, cv::Mat(), cv::Point(-1,-1), 2); cv::erode(dmask, ddmask, cv::Mat(), cv::Point(-1,-1), 2);