1

The lack of documentation on the opencv 2 is a bit hard to work with. I am trying to use kalman filter to track moving objects. I looked here for an example, but it uses a version before 2.x:

https://projects.developer.nokia.com/opencv/browser/opencv/opencv-2.3.1/samples/python/kalman.py

I know that the python bindings for opencv 2 uses numpy matrix. How does this translate from the old implementation? For example, in the link, a matrix is created this way:

state = cv.CreateMat(2, 1, cv.CV_32FC1)

But in numpy this doesn't seem correct:

state = numpy.zeros(shape=(2,1))

There are examples where one could create a cv Matrix by converting it from numpy, but I wish to use only functions provided by cv2.

Also, I cannot find the equivalent of some functions in opencv 2:

cv.RandArr(...)

Is there an equivalent function for RandArr in cv2? I don't quite understand how it works, so implementing it myself would take some time.

1 Answer 1

1

I am also facing the same problem. I am unable to use cv2.Kalman() properly. But as cv2 and cv are quite compatible, I worked my way around using cv.CreateKalman(). I think this might be useful. http://jayrambhia.wordpress.com/2012/07/26/kalman-filter/

Sign up to request clarification or add additional context in comments.

1 Comment

Yeah, I ended up just using cv2.cv. Kinda sucks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.