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
how did you install it ? (most pre-built cv2's don't have contrib modules)
I'm install and nothing happen
goto comment 1 (please answer my question)
I tried use the exe file in oficial site, https://opencv.org, i tried using pip , pip3 and conda to.
I saw a lot of videos in youtube but te same erro happening in all cases
ok, the prebuilt opencv package does not have any contrib modules. try again with:
or go all the way, checkout latest opencv & contrib repos & build from src.
I already have italled the opencv-contrib-python, i use the lest version for opencv 3.4
do you have more than 1 python installed ? (are you using the right one ?)
I have only one istallation of python