OpenCV1_摄像头图像获取与编辑

在这里插入图片描述

import cv2 as cv
dispW=640
dispH=480
flip=0
camSet='nvarguscamerasrc !  video/x-raw(memory:NVMM), width=3264, height=2464, format=NV12, framerate=21/1 ! nvvidconv flip-method='+str(flip)+' ! video/x-raw, width='+str(dispW)+', height='+str(dispH)+', format=BGRx ! videoconvert ! video/x-raw, format=BGR ! appsink'
cam=cv.VideoCapture(camSet)
while True:
    ret , frame=cam.read()

    frame=cv.rectangle(frame, ( 0 , 0 ) , (20,140), ( 255,100,299 ),1 ) # 注意顺序是BGR不适RGB
    frame=cv.circle(frame, ( 100 , 100 ) , 50, ( 0,100,299 ),-1 ) #width为-1时,图形为实心
    
    fnt=cv.FONT_HERSHEY_COMPLEX
    frame=cv.putText(frame, 'I DONT NEED SLEEP',(30,300) ,fnt, 1, (255,0 ,0), 2 )
    frame=cv.line(frame,(10,10),(630,470),(0,0,0),4)

    frame=cv.arrowedLine(frame,(10,47),(63,10),(255,0,0),2)

    cv.imshow('piCam',frame)
    cv.moveWindow('piCam',0,0)
    if  cv.waitKey(1)==ord('q'):
        break
cam.release()
cv.destroyAllwindows()
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值