Ask Your Question

Revision history [back]

assuming mask where 255 = valid pixel, 0 = invalid pixel pseudo-code written for Python - OpenCV

image[mask == 0] = 0 blurred_image = cv2.blur(image) blurred_mask = cv2.blur(mask) result = blurred_image / blurred_mask

assuming mask where 255 = valid pixel, 0 = invalid pixel pixel

pseudo-code written for Python - OpenCV

image[mask == 0] = 0
blurred_image = cv2.blur(image)
blurred_mask = cv2.blur(mask)
result = blurred_image / blurred_mask

blurred_mask