Online Courses
Free Tutorials  Go to Your University  Placement Preparation 
Best Products for Students
0 like 0 dislike
728 views
in OpenCV (Open Source Computer Vision Library) by Goeduhub's Expert (8.3k points)

Goeduhub's Top Online Courses @Udemy

For Indian Students- INR 360/- || For International Students- $9.99/-

S.No.

Course Name

 Coupon

1.

Tensorflow 2 & Keras:Deep Learning & Artificial Intelligence || Labeled as Highest Rated Course by Udemy

Apply Coupon

2.

Complete Machine Learning & Data Science with Python| ML A-Z Apply Coupon

3.

Complete Python Programming from scratch | Python Projects Apply Coupon
    More Courses

1 Answer

0 like 0 dislike
by Goeduhub's Expert (8.3k points)
 
Best answer

Edge Detection using Canny edge detector
Edges are set of points(lines), where image brightness changes sharply

# Import Computer Vision package - cv2
import cv2

# Import Numerical Python package - numpy as np
import numpy as np

# Read the image using imread built-in function
image = cv2.imread('image_8.jpg')

# Display original image using imshow built-in function
cv2.imshow("Original", image)

# Wait until any key is pressed
cv2.waitKey(0)

# cv2.Canny is the built-in function used to detect edges


# cv2.Canny(image, threshold_1, threshold_2)
canny = cv2.Canny(image, 50, 200)

# Display edge detected output image using imshow built-in function
cv2.imshow('Canny Edge Detection', canny)

# Wait until any key is pressed
cv2.waitKey(0)

# Close all windows
cv2.destroyAllWindows()

3.3k questions

7.1k answers

394 comments

4.6k users

 Goeduhub:

About Us | Contact Us || Terms & Conditions | Privacy Policy || Youtube Channel || Telegram Channel © goeduhub.com Social::   |  | 
...