import cv2
import numpy as np
img = cv2.imread("C:/my_pics/rahul.png")
blurred_img = cv2.GaussianBlur(img, (21, 21), 0)
mask = np.zeros((512, 512, 3), dtype=np.uint8)
mask = cv2.circle(mask, (258, 258), 100, np.array([255, 255, 255]), -1)
out = np.where(mask==np.array([255, 255, 255]), img, blurred_img)
cv2.imwrite("./out.png", out)
No comments:
Post a Comment