You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
492 B
19 lines
492 B
import cv2
|
|
|
|
|
|
class spatial:
|
|
def __init__(self, img_path):
|
|
self.path = img_path
|
|
|
|
def average_blur(self, ksize):
|
|
ksize = int(ksize)
|
|
img = cv2.imread(self.path)
|
|
avg_blur = cv2.blur(img, (ksize, ksize))
|
|
cv2.imwrite("saved Img/avg_blur.bmp", avg_blur)
|
|
|
|
def mid_blur(self, ksize):
|
|
ksize = int(ksize)
|
|
img = cv2.imread(self.path)
|
|
mid_blur = cv2.medianBlur(img, ksize)
|
|
cv2.imwrite("saved Img/mid_blur.bmp", mid_blur)
|