Skip to content

Instantly share code, notes, and snippets.

@guissalustiano
Created October 11, 2020 00:40
Show Gist options
  • Save guissalustiano/7d6efc6a267608c17a6597f2319130f5 to your computer and use it in GitHub Desktop.
Save guissalustiano/7d6efc6a267608c17a6597f2319130f5 to your computer and use it in GitHub Desktop.
import cv2 as cv
import matplotlib.pyplot as plt
import numpy as np
img = cv.imread('passarinho.jpg',0)
sobel = cv.Sobel(img, -1, 1, 1)
fig, ax = plt.subplots(ncols=2,figsize=(15,5))
ax[0].imshow(img, cmap = 'gray')
ax[0].set_title('Original')
ax[0].axis('off')
ax[1].imshow(sobel, cmap = 'gray')
ax[1].set_title('Sobel Aplicado')
ax[1].axis('off')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment