1)I wanted to get all the pixels with some motion and wanted to store the position and angle in some data structure(Which data structure to use and how?). Could anyone help me how I could do it.
2)Whether the below code is correct to extract the magnitude and direction of Optical Flow vector. If so how I can I do the operation mentioned in 1) from here on.
3)I find that the openCV manual could be supplemented with examples of the usage of different functions. I am not sure whether anyone else think the same.I think it will help new users. Now to write code I need to do lot of search on the net. :(. However community is having good response.
calcOpticalFlowFarneback(prevgray, gray, flow, 0.5, 3, 15, 3, 5, 1.2, 0);
Mat xy[2];
split(flow, xy);
//calculate angle and magnitude
Mat magnitude, angle;
cartToPolar(xy[0], xy[1], magnitude, angle, true);