I am using OpenCV3 to blur and downsample an image, I just want to blur the region inside the area defined by a binary mask like:
After that region is blurred, I would like to downsample the image without blurring the whole image again, so pyrDown
is not useful for me.
Any idea?
Tricky way:
cv::Mat roi;
cv::blur(image & mask,roi,cv::Size(3,3));//Or whatever blurring you want
cv::Mat Result=(image & (~mask)) + roi;
cv::resize(result,result,cv::Size(New_Width,New_height)); // Or whatever downsampling you want