Skip to content

Instantly share code, notes, and snippets.

Avatar

Let The Data Confess letthedataconfess

View GitHub Profile
View denoising2.py
img = cv2.imread("zebra.jpg")
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
denoised = cv2.fastNlMeansDenoisingColored(img, denoised, 15, 10, 50)
plt.imshow(denoised)
View denoising.py
img = cv2.imread("frag.png")
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
denoised = cv2.fastNlMeansDenoising(img, denoised, 15, 10, 50)
plt.imshow(denoised)
View rescaling1.py
img = cv2.imread("zebra.jpg")
#print(img.shape)
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
large = cv2.resize(img, (800, 500))
plt.imshow(large)
View rescaling.py
img = cv2.imread("zebra.jpg")
#print(img.shape)
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
half = cv2.resize(img, (0,0), fx = 0.5, fy = 0.5)
plt.imshow(half)
View bi_lat_filter.py
img = cv2.imread("zebra.jpg")
bi_lat = cv2.bilateralFilter(img,9,75,75)
cv2.imshow('Bi_lateral',bi_lat)
cv2.waitKey(0)
cv2.destroyAllWindows()
View gaussian_blur.py
img = cv2.imread("zebra.jpg")
gblur = cv2.GaussianBlur(img,(5,5),0)
cv2.imshow('Gaussian',gblur)
cv2.waitKey(0)
cv2.destroyAllWindows()
View median_blur.py
img = cv2.imread("zebra.jpg")
median = cv2.medianBlur(img,5)
cv2.imshow('median',median)
cv2.waitKey(0)
cv2.destroyAllWindows()
View avg.py
img = cv2.imread("zebra.jpg")
blur = cv2.blur(img,(5,5))
cv2.imshow('blur',blur)
cv2.waitKey(0)
cv2.destroyAllWindows()
View otsu.py
ret, thresh9 = cv2.threshold(img1,100 , 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)
cv2.imshow('otsu',thresh8)
cv2.waitKey(0)
cv2.destroyAllWindows()
View guassian_adaptive.py
thresh8 = cv2.adaptiveThreshold(img1, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY, 33,15)
cv2.imshow('text',thresh8)
cv2.waitKey(0)
cv2.destroyAllWindows()