4/17/2023

python opencv canny edge source code

 refer to code:


.

import cv2

# Load an image
img = cv2.imread('input_image.jpg', cv2.IMREAD_GRAYSCALE)

# Apply Canny edge detection algorithm
edges = cv2.Canny(img, 100, 200)

# Display the input image and the edge map
cv2.imshow('Input Image', img)
cv2.imshow('Canny Edges', edges)
cv2.waitKey(0)
cv2.destroyAllWindows()


..






Thank you.

πŸ™‡πŸ»‍♂️

No comments:

Post a Comment