Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 ?

like image 362
Froyo Avatar asked May 28 '12 19:05

Froyo


People also ask

Is OpenCV and cv2 same?

cv2 (old interface in old OpenCV versions was named as cv ) is the name that OpenCV developers chose when they created the binding generators. This is kept as the import name to be consistent with different kind of tutorials around the internet.

What is the best OpenCV version?

If you're working with Image Processing,hands down OpenCV 3 is way better(The latest stable version 3.4 was released around Feb 2018). Significant differences that you will find between 3 and 2 are: T-API or Transparent API has been introduced in OpenCV 3. Only thing that you'll need to use is UMat instead of Mat.

What is cv2 library in Python?

OpenCV-Python is a library of Python bindings designed to solve computer vision problems. cv2. imread() method loads an image from the specified file. If the image cannot be read (because of missing file, improper permissions, unsupported or invalid format) then this method returns an empty matrix.


1 Answers

Is is just a tuple. For example:

(cv2.TERM_CRITERIA_EPS | cv2.TERM_CRITERIA_COUNT, 10, 0.03)
like image 167
Andrey Kamaev Avatar answered Oct 13 '22 17:10

Andrey Kamaev