python opencv line

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)

  

 

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

posted @ 2023-04-07 21:03  西北逍遥  阅读(8)  评论(0编辑  收藏  举报