0% found this document useful (0 votes)
2 views1 page

Edge Detection with OpenCV in Python

This Python code uses OpenCV to read in an image, apply a Sobel edge detection filter to detect edges, and display the original image and edge image. It then reads in the same image again, applies a Canny edge detection algorithm and displays the original and Canny edge images.

Uploaded by

Yokanan Wigar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Edge Detection with OpenCV in Python

This Python code uses OpenCV to read in an image, apply a Sobel edge detection filter to detect edges, and display the original image and edge image. It then reads in the same image again, applies a Canny edge detection algorithm and displays the original and Canny edge images.

Uploaded by

Yokanan Wigar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1.

import cv2
2. path = 'pyBatik\\Teratur Training Set\\Parang\\[Link]'
3. original = [Link](path)
4. img = [Link](path,0)
5. sobeledges = [Link](img,cv2.CV_64F,1,1,ksize=3)
6.
7. [Link]('sobel', sobeledges )
8.
9. key = [Link]()
10. [Link]()

1. import cv2
2. path = 'pyBatik\\Teratur Training Set\\Parang\\[Link]'
3. original = [Link](path)
4. img = [Link](path,0)
5. cannyedges = [Link](img,100,200)
6.
7. [Link]('original', original)
8. [Link]('canny', cannyedges)
9.
10. key = [Link]()
11. [Link]()

You might also like