python opencv canny
python opencv canny
import cv2 # Load the image img = cv2.imread('path/to/image.jpg') # Convert the image to grayscale gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # Apply the Canny algorithm to detect edges edges = cv2.Canny(gray, 100, 200) # Display the edges cv2.imshow('Edges', edges) cv2.waitKey(0) cv2.destroyAllWindows()
#################
QQ 3087438119

浙公网安备 33010602011771号