title: Perspective Compensation when Measuring Distances on an Image with a known reference distance
body: <p>I am trying to calculate the real world distance of an arbitrary line drawn along the field of view from a one point perspective, single camera setup.   </p>
  
  <p>I will have a known distance running parallel. How can I find the compensation factor I need to apply to the pixel length of the measuring line?</p>
  
  <p><img src="https://i.stack.imgur.com/Wjp30.jpg" alt=""></p>
  
  <p>Do I have to take into account the distance from the vanishing point, as the length per pixel increases the nearer you get to the vanishing point? Do I need to use the gradient of the known line to give me a rate of change?</p>