opencv - How to extract velocity vectors of a pixels from calcOpticalFlowFarneback -


i have been looking extract velocity vectors of every pixels b/n 2 frames. used opencv function flows:

calcopticalflowfarneback(previous_gray, current_gray, optical_flow, 0.5, 3, 15, 3, 5, 1.2, 0);  previous_gray = previous frame  current_gray = current frame  

and gives me array in 3rd argument optical_flow can't tell how extract velocity vectors using array.

thanks in advance.

dawit

mat& flow: computed flow image; have same size previmg , type cv_32fc2

this type means have 2 float variables (presumed x , y) each pixel's motion. try this:

optical_flow.at<cv::point2f>(1023,767).x optical_flow.at<cv::point2f>(1023,767).y 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -