파이썬인데 이게 뭐가 오류가 난거죠...

2021-06-12 (토) 00:03:55 2,712

import cv2
import numpy as np

# open video file
video_path = 'running.mp4'
cap = cv2.VideoCapture(video_path)

# check file is opened
if not cap.isOpened():
  exit()

tracker = cv2.TrackerCSRT_create()

ret, img = cap.read()

cv2.namedWindow('term project')
cv2.imshow('term project',img)

#select ROI
rect = cv2.selectROI('term project', img, fromCenter=False, showCrosshair=True)
cv2.destoryWindow('term project')

#intitialize tracker
tracker.init(img, rect) 

while True:
  ret, img = cap.read()

  if not ret:
    exit()

  success, box = tracker.update(img)

  left, top, w, h = [int(v) for v in box]

  cv2.rectangle(img, pt1=(left, top), pt2=(left + w, top + h), color=(255, 255, 255),
  thickness=3) 

  cv2.imshow('img', img)
  if cv2.waitKey(1) == ord('q'):
    break           

이거 돌리면

AttributeError: module 'cv2.cv2' has no attribute 'destoryWindow'

깔건 다 깔았는데 

|

답변을 작성하려면 로그인이 필요합니다.