Ask Your Question

anatoliy314's profile - activity

2019-08-28 07:50:23 -0500 received badge  Notable Question (source)
2016-07-20 08:10:24 -0500 received badge  Popular Question (source)
2013-08-28 17:21:41 -0500 received badge  Good Question (source)
2013-08-23 11:45:09 -0500 answered a question Is there any mature open source human detection and tracking system/algorithm?

Take a look at "Detection and Tracking of Multiple, Partially Occluded Humans by Bayesian Combination of Edgelet based Part Detectors" by Wu and Nevatia, here: http://iris.usc.edu/Outlines/papers/2007/wu-nevatia-ijcv07.pdf . This looks like the most practical, hands-on algorithm that I found. I do not know if it is ready to be used out of the box. The safest thing to do would be to take this algorithm as a goal, and make a roadmap of how you would evolve from the simplest detection and tracking algorithm towards that goal. Once you implement that simplest algorithm, take a look at the results, see where the failure modes are. Go on with your plan if it makes sense, or redo it given the new information you uncovered. I know it sounds risky, but the guys who wrote this are good, and with a bit of skill and luck you will get your algorithm soon enough.

HTH

2013-05-03 16:10:24 -0500 received badge  Nice Question (source)
2013-02-08 03:03:04 -0500 asked a question Python 3 support

When will OpenCV support Python 3? Ubuntu is planning to discontinue Python 2.x a year from now, and we will need time to port our own code.

2012-07-13 10:42:48 -0500 received badge  Nice Question (source)
2012-07-13 07:52:57 -0500 commented answer Can't use pyramids in calcOpticalFlowPyrLK - Python

You are correct, pyramids are not required, but I want to use them. Since we are tracking a point, the pyramid in img2 will be needed when the next frame is processed, and img2 becomes prevImg. I am using the cv2 syntax, where the documentation you linked to says I can use the output of buildOpticalFlowPyramid.

2012-07-13 06:18:53 -0500 received badge  Student (source)
2012-07-13 06:06:56 -0500 asked a question Can't use pyramids in calcOpticalFlowPyrLK - Python

Version 2.4.1 is advertised to allow you to pass pyramids into calcOpticalFlowPyrLK. However, this doesn't work for me in Python:

>>> import cv2
>>> cv2.__version__
'2.4.1'
>>> prev_features = np.array((10, 10))
>>> im = np.zeros((100, 100), dtype = np.uint8)
>>> im2 = im.copy()
>>> pyr2 = cv2.buildOpticalFlowPyramid(im2, (8, 8), 3)
>>> pyr1 = cv2.buildOpticalFlowPyramid(im, (8, 8), 3)
>>> pyr2 = pyr2[1]
>>> pyr1 = pyr1[1]
>>> prev_features = np.array((10, 10), dtype = np.int32)
>>> res = cv2.calcOpticalFlowPyrLK(pyr1, pyr2, prev_features)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: <unknown> is not a numpy array

Whereas using simple images passes that check:

>>> res = cv2.calcOpticalFlowPyrLK(im, im2, prev_features)
OpenCV Error: Assertion failed ((npoints = prevPtsMat.checkVector(2, CV_32F, true)) >= 0) in calcOpticalFlowPyrLK, file /home/anatoliy/Downloads/OpenCV-2.4.1/modules/video/src/lkpyramid.cpp, line 593
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
cv2.error: /home/anatoliy/Downloads/OpenCV-2.4.1/modules/video/src/lkpyramid.cpp:593: error: (-215) (npoints = prevPtsMat.checkVector(2, CV_32F, true)) >= 0 in function calcOpticalFlowPyrLK

Thanks!