

# https://www.globalsino.com/ICs/
# Smooth an image


import cv2
import numpy as np
import os

path = r"C:\GlobalSino2\ICs\images2"

theImagePath = os.path.join(path, "4032Marched.png")
SmoothedPath = os.path.join(path,'Smoothed.tif')
# Reading the image

image = cv2.imread(theImagePath)

# Applying the filter

averageBlur = cv2.blur(image, (5, 5))

# Showing the image

cv2.imshow('Original', image)
cv2.imshow('Average blur', averageBlur)
cv2.imwrite(SmoothedPath, averageBlur)

cv2.waitKey()
cv2.destroyAllWindows()
