python opencv line

发布时间 2023-04-07 21:08:08作者: 西北逍遥

python opencv line

 

import cv2

# Load an image
img = cv2.imread("image1.jpg")

# Draw a red line from (0, 0) to (100, 100) with a thickness of 5 pixels
cv2.line(img, (0, 0), (100, 100), (0, 0, 255), 5)

# Display the image
cv2.imshow("Image", img)
cv2.waitKey(0)

  

 

##################