Python Opencv Tracker 无法正常初始化 ( tracker.init)
应该写成这样的形式(可以使用函数对象)
另外,需要注意安装对应版本的opencv-contrib-python
同时需要注意某些API已经不再支持
retval = cv.TrackerKCF_create( [, parameters] )
# initialize a dictionary that maps strings to their corresponding OpenCV object tracker implementations
OPENCV_OBJECT_TRACKERS = {
"csrt": cv2.TrackerCSRT_create,
"kcf": cv2.TrackerKCF_create,
"mil": cv2.TrackerMIL_create,
"goturn": cv2.TrackerGOTURN_create
}
# grab the appropriate object tracker using our dictionary of OpenCV object tracker objects
tracker = OPENCV_OBJECT_TRACKERS[args["tracker"]]()
本博文本意在于记录个人的思考与经验,部分博文采用英语写作,可能影响可读性,请见谅
本文来自博客园,作者:ZXYFrank,转载请注明原文链接:https://www.cnblogs.com/zxyfrank/p/14351060.html