title: Are there any way to find optical flow velocity from motion of real-world object without knowing depth Z?
body: <p>I am struggling and need help. </p>
  
  <p>I want to compute <strong>optical flow velocity</strong> from the known motion of real-world object (actually camera is moving). This is part of what I have asked in my previous question (<a href="https://stackoverflow.com/questions/13289578/determining-if-a-feature-is-part-of-a-moving-object-from-sparse-optical-flow-kl">Determining if a feature is part of a moving object from sparse optical flow (KLT)</a>).</p>
  
  <p>Anyway, I have done computing optical flow using <code>cvGoodFeaturesToTrack()</code> and <code>cvCalcOpticalFlowPyrLK()</code>.</p>
  
  <p>I just want to check if the flow I computed is theoretically correct (corresponding to the motion of camera).</p>
  
  <p>Let my camera move only in Z axis (simply ignore yaw-rate for now). Assume my camera move for Vz (in Z direction).</p>
  
  <p>I can find the optical flow by</p>
  
  <pre><code>vx = x * Vz / Z    
  vy = y * Vz / Z
  </code></pre>
  
  <p>(assume Vx,Vy = 0 --> no camera motion in x and y axis)</p>
  
  <p>This is what I have studied mainly from <a href="http://www.cse.psu.edu/~rcollins/CSE486/lecture22_6pp.pdf" rel="nofollow noreferrer">http://www.cse.psu.edu/~rcollins/CSE486/lecture22_6pp.pdf</a>. </p>
  
  <p>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.</p>
  
  <p>Please anyone help me answer the questions below:</p>
  
  <ol>
  <li>How can I get the depth of object Z value? Do I need additional technique?</li>
  <li>Or are there any way else that I can find the relationship between motion of camera and image optical flow?</li>
  <li>Have anyone tried the equation above? Is it valid when the camera moving just in one direction?</li>
  </ol>
  
  <p>Thank you very much.</p>
  
  <p>[If you find this question to be too vague, please let me know so that I can give more detail.]</p>