What is python equivalent of CvTermCriteria in OpenCV 2.3.1 and above?
Asked Answered
D

1

6

I am using python bindings of OpenCV 2.3.1 and I'm stuck. I'm trying to make an LK tracker. I'm using cv2.calcOpticalFlowPyrLK() http://opencv.willowgarage.com/documentation/python/video_motion_analysis_and_object_tracking.html?highlight=opticalflow#calcopticalflowpyrlk

It that one of the arguments is criteria. in C++ it's CvTermCriteria. But I am unable to find it's python equivalent. I guess they have discontinued it after OpenCV 2.0. What else can I use? It says criteria.maxCount or criteria.epsilon. But I can't find that either. Any suggestions ?

Dumbhead answered 28/5, 2012 at 19:46 Comment(0)
P
10

Is is just a tuple. For example:

(cv2.TERM_CRITERIA_EPS | cv2.TERM_CRITERIA_COUNT, 10, 0.03)
Pertinacious answered 28/5, 2012 at 20:0 Comment(2)
How is determined in which order "10" and "0.03" have to be, since they are in inverse order to the criteria before?Soughtafter
@Soughtafter The first argument, with the constants, is or'ing them together, so the order doesn't matter there. You can reverse them if you want. But the final two elements are in a specific required order of iterations,eps.Rainmaker

© 2022 - 2024 — McMap. All rights reserved.