Skip to content

Instantly share code, notes, and snippets.

@ritvikmath
Created January 22, 2020 02:27
Show Gist options
  • Save ritvikmath/3c482096ba78b9b3dc864b10a1a2216e to your computer and use it in GitHub Desktop.
Save ritvikmath/3c482096ba78b9b3dc864b10a1a2216e to your computer and use it in GitHub Desktop.
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
#define the vertical filter
vertical_filter = [[-1,-2,-1], [0,0,0], [1,2,1]]
#define the horizontal filter
horizontal_filter = [[-1,0,1], [-2,0,2], [-1,0,1]]
#read in the pinwheel image
img = plt.imread('pinwheel.jpg')
#get the dimensions of the image
n,m,d = img.shape
#initialize the edges image
edges_img = img.copy()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment