欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

培训代码opencv

程序员文章站 2024-01-23 16:14:58
...
import cv2
img=cv2.imread("1.jpg")
cv2.imshow("image",img)
cv2.waitKey(0)
cv2.destroyAllWindows()
color=(255,0,0)
cv2.line(img,(10,10),(100,100),color,3)
cv2.imshow("image",img)
cv2.waitKey(0)
cv2.destroyAllWindows()

color=(255,0,0)
cv2.line(img,(10,10),(100,100),color,3)
cv2.rectangle(img,(50,50),(150,150),color)
cv2.circle(img,(50,50),50,color)
cv2.imshow("image",img)
cv2.waitKey(0)
cv2.destroyAllWindows()