欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

基于顏色跟蹤Python腳本

系統(tǒng) 1768 0

寫在前面的話:文章內(nèi)容來源于但不限于網(wǎng)絡(luò)、書籍、個人心得體會等,意在總結(jié)和方便各位同行快速參考,共同學(xué)習(xí)進(jìn)步,記錄自己的問題。錯誤在所難免,有請各位批評斧正 如有侵權(quán),煩請第一時間通知,我會立即刪除相關(guān)內(nèi)容,萬分感謝!??

            
              import numpy as np 
import argparse
import time
import cv2 

# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-v", "--video",
	help = "path to the (optional) video file")
args = vars(ap.parse_args())

# define the upper and lower boundaries for a color
# to be considered "blue"
blueLower = np.array([100,67,0],dtype="uint8")
blueUpper = np.array([255,128,50],dtype="uint8")

# load the video
if not args.get("video"):
    camera = cv2.VideoCapture(0)
else:
    camera = cv2.VideoCapture(args["video"])

# keep looping 
while True:
    # grab the current frame 
    (grabbed,frame) = camera.read()

    # check to see if we have reached the end of the video
    if not grabbed:
        break 
    
    # determine which pixels fall within the blue boundaries
    # and then blur the binary image
    blue = cv2.inRange(frame,blueLower,blueUpper)
    blue = cv2.GaussianBlur(blue,(3,3),0)

    # find contours in the image 
    (_,cnts,_) = cv2.findContours(blue.copy(),cv2.RETR_EXTERNAL,
        cv2.CHAIN_APPROX_SIMPLE)
    
    # check to see if any contours were found
    if len(cnts) > 0:
        # sort the contours and find the largest one --
        # we will assume this contour coorespondes to the 
        # area of my phone 
        cnt = sorted(cnts,key=cv2.contourArea,reverse=True)[0]

        # compute the (rotated) bounding box around then 
        # contour and then draw it 
        rect = np.int32(cv2.boxPoints(cv2.minAreaRect(cnt)))
        cv2.drawContours(frame,[rect],-1,(0,255,0),2)
    
    # show the frame and the binary image
    cv2.imshow("Traccking",frame)
    cv2.imshow("Binary",blue)

    # if your machine is fast, it may display the frames in
	# what appears to be 'fast forward' since more than 32
	# frames per second are being displayed -- a simple hack
	# is just to sleep for a tiny bit in between frames;
	# however, if your computer is slow, you probably want to
	# comment out this line
    time.sleep(0.025)

	# if the 'q' key is pressed, stop the loop
    if cv2.waitKey(1) & 0xFF == ord("q"):
	    break

# cleanup the camera and close any open windows
camera.release()
cv2.destroyAllWindows()
            
          

?


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯(lián)系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 天干夜天天夜天干天 | 免费在线毛片 | 久久国产精品免费一区二区三区 | 欧美日韩视频一区三区二区 | 成人福利短视频 | 日日摸夜夜添夜夜添破第一 | 成人黄色在线 | 一级做a | 亚洲日韩欧洲无码av夜夜摸 | 亚洲一区二区视频在线观看 | 免费看一区二区三区 | 欧日韩在线视频 | 欧美精品亚洲一区二区在线播放 | 天天干天天在线 | 亚洲视频 欧美视频 | 日韩免费视频 | 国产目拍亚洲精品99久久精品 | 国产精品久久久爽爽爽麻豆色哟哟 | 男女www视频 | 黄片毛片一级 | 日韩中文网| 午夜在线免费视频 | 日出水了视频大全 | 日韩精品视频免费在线观看 | 青青草原综合网 | 亚洲精品久久久一区 | 青娱乐免费视频 | 波多野结衣中文在线播放 | 超级碰碰碰免费视频 | 91免费播放 | 亚州AV无码乱码色情 | 亚洲综合在线视频 | 日韩 欧美 中文 | 免费观看国产大片资源视频 | 日本国产欧美 | 日日爽天天操 | 中文字幕三区 | 青青草在线视频免费观看 | 欧美日韩国产精品 | 特一级毛片 | 日韩在线精品视频 |