2021
05-23
05-23
Python OpenCV实现基本图形绘制
1.导入模块importcv2ascvimportnumpyasnp2.OpenCV绘图大致步骤OpenCV图形绘制步骤(1)先定义基础画布canvas=np.zeros((400,600,3),dtype=np.uint8)+255(2)画布分界,(300,0)分别是宽、高cv.line(canvas,(300,0),(300,399),(0,0,0,),2)(3)在画布上绘制图形,如画圆cv.circle(canvas,(150,300),88,(0,0,255),5)#(80,300),100是圆心、半径(4)展示图形,cv.namedWindow('窗口名称',cv.WINDOW_NORMAL),cv.imsh...
继续阅读 >