1 | initial version |
Assert that your input image and mask are also numpy array, you can do this :
import numpy as np import cv2
imageAllBlurred = cv2.medianBlur(image,ksize) # with a kernel size value 'ksize' equals to 3 for example imageBlurredInMask = np.where(mask==0,imageAllBlurred,image)
2 | No.2 Revision |
Assert that your input image and mask are also numpy array, you can do this :
import numpy as np import cv2
imageAllBlurred = cv2.medianBlur(image,ksize) # with a kernel size value 'ksize' equals to 3 for example
imageBlurredInMask = np.where(mask==0,imageAllBlurred,image)np.where(mask!=0,imageAllBlurred,image)
3 | No.3 Revision |
Assert that your input image and mask are also numpy array, you can do this :
import numpy as np
import