• 大小: 954B
    文件类型: .py
    金币: 1
    下载: 0 次
    发布日期: 2021-06-03
  • 语言: Python
  • 标签: python  

资源简介

树莓派目标跟踪代码,加油,预祝学业有成,哦哦哦哦哦

资源截图

代码片段和文件信息

import cv2
import numpy as np

bs = cv2.createBackgroundSubtractorKNN(detectShadows = True)
camera = cv2.VideoCapture(0)

while True:
  ret frame = camera.read()
  fgmask = bs.apply(frame)
  th = cv2.threshold(fgmask.copy() 244 255 cv2.THRESH_BINARY)[1]
  th = cv2.erode(th cv2.getStructuringElement(cv2.MORPH_ELLIPSE (33)) iterations = 2)
  dilated = cv2.dilate(th cv2.getStructuringElement(cv2.MORPH_ELLIPSE (83)) iterations = 2)
  image contours hier = cv2.fin

评论

共有 条评论