Reputation: 87
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.
Upvotes: 1
Views: 962
Reputation: 18477
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/
Upvotes: 1