I Gede Andi Utama Giri - L - Tugas Deteksi Tepi
I Gede Andi Utama Giri - L - Tugas Deteksi Tepi
I Gede Andi Utama Giri - L - Tugas Deteksi Tepi
Oleh:
import cv2
import numpy as np
from matplotlib import pyplot as plt
# Sobel
sobelx = cv2.Sobel(image, cv2.CV_64F, 1, 0, ksize=3)
sobely = cv2.Sobel(image, cv2.CV_64F, 0, 1, ksize=3)
sobel = np.sqrt(sobelx*2 + sobely*2)
# Prewitt
kernelx = np.array([[1, 0, -1], [1, 0, -1], [1, 0, -1]])
kernely = np.array([[1, 1, 1], [0, 0, 0], [-1, -1, -1]])
# Laplacian
laplacian = cv2.Laplacian(image, cv2.CV_64F)
plt.show()
Hasil: