python opencv line

python opencv line

 

import cv2

# Load the image
img = cv2.imread('path/to/image.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 with the line
cv2.imshow('Image with Line', img)
cv2.waitKey(0)
cv2.destroyAllWindows()

 

 

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

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