I am struggling and need help.
I want to compute optical flow velocity from the known motion of real-world object (actually camera is moving). This is part of what I have asked in my previous question (Determining if a feature is part of a moving object from sparse optical flow (KLT)).
Anyway, I have done computing optical flow using cvGoodFeaturesToTrack()
and cvCalcOpticalFlowPyrLK()
.
I just want to check if the flow I computed is theoretically correct (corresponding to the motion of camera).
Let my camera move only in Z axis (simply ignore yaw-rate for now). Assume my camera move for Vz (in Z direction).
I can find the optical flow by
vx = x * Vz / Z
vy = y * Vz / Z
(assume Vx,Vy = 0 --> no camera motion in x and y axis)
This is what I have studied mainly from http://www.cse.psu.edu/~rcollins/CSE486/lecture22_6pp.pdf.
The problem is to solve this I have to have Z. In my case, I cannot assume surface Z to be flat or known. Camera is moving on road and directing perpendicular to the ground.
Please anyone help me answer the questions below:
- How can I get the depth of object Z value? Do I need additional technique?
- Or are there any way else that I can find the relationship between motion of camera and image optical flow?
- Have anyone tried the equation above? Is it valid when the camera moving just in one direction?
Thank you very much.
[If you find this question to be too vague, please let me know so that I can give more detail.]