Median filter on optic flow vectors

asked 2015-12-30 22:28:12 -0600

Goutham gravatar image

Hi all, I want to track moving objects in video. I choose optical flow. I got the flow vectors using cv2.calcOpticalFlowFarneback. Then i classify moving objects based on the magnitude. But it is not showing accurate results. It is not segmenting the moving objects properly. Now i want to apply median filter on the flow vectors. Anybody can help me?

edit retag flag offensive close merge delete

Comments

"Then i classify moving objects based on the magnitude" - hmm, i'd rather group them by angle, and filter (out things too small) by magnitude.

can you show us some code ?

berak gravatar imageberak ( 2015-12-31 02:18:51 -0600 )edit

I color coded the vectors based on the angle. Now i have the hsv frames. Can you tell me how to convert hsv to binary. I think InRange is not possible because there are many hue values.

Goutham gravatar imageGoutham ( 2015-12-31 02:31:09 -0600 )edit

inRange is for filtering one special color region. can it be , you're looking for 'clustering' or similar ?

what would the median filter be good for here ?

(also, not sure, if i understand, what you're doing ...)

berak gravatar imageberak ( 2015-12-31 02:41:08 -0600 )edit

I am trying to track moving objects in video. Getting errors (showing non moving parts also as moving) when i follow the above mentioned procedure. So i thought of to remove those errors by filtering..

Goutham gravatar imageGoutham ( 2015-12-31 02:46:05 -0600 )edit