Ask Your Question

Revision history [back]

Error 'module' object has no attribute 'TrackerMIL_create'

OpenCV 3.4

Python 2.7

My code:

import cv2

import numpy as np

from datetime import datetime

import time

now = datetime.now()

i=0

cap= cv2.VideoCapture(0);

fourcc = cv2.VideoWriter_fourcc(*'XVID')

out= cv2.VideoWriter('videos/'+str(now)+'.avi', fourcc,20.0,(480,640))

tracker=cv2.TrackerMIL_create()

bbox = (100,100,200,200)

ret, frame = cap.read()

ok=tracker.init(frame,bbox)

My error:

Traceback (most recent call last): File "test.py", line 17, in <module> tracker=cv2.TrackerMIL_create() AttributeError: 'module' object has no attribute 'TrackerMIL_create'

hellp me plese.

i'm use python 2.7 because others versions not work in my windows 7

Error 'module' object has no attribute 'TrackerMIL_create'

OpenCV 3.4

Python 2.7

My code:

import cv2

cv2 import numpy as np

np from datetime import datetime

datetime import time

import time

now = datetime.now()

datetime.now() i=0

i=0

cap= cv2.VideoCapture(0);

cv2.VideoCapture(0); fourcc = cv2.VideoWriter_fourcc(*'XVID')

cv2.VideoWriter_fourcc(*'XVID') out= cv2.VideoWriter('videos/'+str(now)+'.avi', fourcc,20.0,(480,640))

fourcc,20.0,(480,640)) tracker=cv2.TrackerMIL_create()

tracker=cv2.TrackerMIL_create()

bbox = (100,100,200,200)

(100,100,200,200)

ret, frame = cap.read()

cap.read()

ok=tracker.init(frame,bbox)

ok=tracker.init(frame,bbox)

My error:

Traceback (most recent call last):
  File "test.py", line 17, in <module>
    tracker=cv2.TrackerMIL_create()
AttributeError: 'module' object has no attribute 'TrackerMIL_create'

'TrackerMIL_create'

hellp me plese.

i'm use python 2.7 because others versions not work in my windows 7 7