Skip to content

Instantly share code, notes, and snippets.

@THEFASHIONGEEK
Last active February 25, 2020 05:18
Show Gist options
  • Save THEFASHIONGEEK/c6fe1b8a4fc3720102106dc66d095fe3 to your computer and use it in GitHub Desktop.
Save THEFASHIONGEEK/c6fe1b8a4fc3720102106dc66d095fe3 to your computer and use it in GitHub Desktop.
# Box blur using OpenCV with normalized kernel => Normal Blur
import numpy as np
import cv2
from matplotlib import pyplot as plt
img = cv2.imread("imgs/chapter5/outdoor.jpg", -1)
# Used for even float type images
blurred_Normalized = np.uint8(cv2.boxFilter(img, cv2.CV_64F, ksize=(5, 5), normalize=True))
blurred_without_Normalized = np.uint8(cv2.boxFilter(img, cv2.CV_64F, ksize=(3, 3), normalize=False))
# data-types: http://ninghang.blogspot.com/2012/11/list-of-mat-type-in-opencv.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment