Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Calculating heights from parallax effect

  1. Dec 22, 2014 #1
    I'm trying to calculate the heights of birds from a plane flying at a known altitude above them using the parallax effect. They're being recorded from the plane and the head and tail end coordinates marked on each frame they appear. The equation I'm using is from here:
    http://www.geog.ucsb.edu/~jeff/115a/lectures/stereoscopy_and_height_measurement.html
    specifically this part:
    http://www.geog.ucsb.edu/~jeff/115a/lectures/stereoscopy_and_height/displacement.jpg
    h = H*(dP/(P+dP))
    Which I think holds up if the object you're measuring is horizontal as well as vertical, it just produces two triangles to compare (in the case of birds at the head and the tail) instead of one. Am I right about that?

    The problem is the heights I'm calculating are a about 200m above what I'd expect. The speed of the birds is also a factor but I have a way to attempt to compensate for it. That's what I'll be looking into next if this height equation isn't correct in this case.

    Any insight would be welcome.
     
  2. jcsd
  3. Dec 22, 2014 #2

    Bystander

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    Which is what? Helps us help if we've got an order of magnitude for effects we're speculating on for you.
     
  4. Dec 22, 2014 #3
    Sorry, I'm getting heights largely between about 200-250m, but I'd expect them to be between about 0-50m, so it seems like something is just systematically shifting heights up.

    I'm try to fix a flaw in a program someone else made, and I think they got the height equation wrong. They used the equation h = H*(1 - (P/dP)) which I think they arrived at mixing up the heights in the initial geometry, and thinking that H / (H - h) = dP / P. The only problem is when I try to fix it I get results with birds flying over 200m up, rather than just more negative heights than I'd like which was the initial problem. I'm trying to figure out if they were wrong twice (with that equation and something else I need fix now) or I'm wrong about my equation.
     
  5. Dec 22, 2014 #4

    Bystander

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    Okay, that's a problem.
    "h" = bird height, and "H" = plane height? "dP" = how much longer bird image is than length at "H?" "P" = length of bird image at "H?" Then you want "dP/P," to give you distance from plane, using the original equation, or just dP/P to get height.
     
  6. Dec 22, 2014 #5
    "h" is the bird height, "H" is the plane height, "P" is the absolute parallax, the translation of a point on the ground between two frames, and "dP" is the bird parallax, how much the bird appears to move between frames (or specifically, the average translation of its head and tail).

    Of course, the birds are also moving, but the program tries to compensate for that. Their direction (based on the head and tail having been marked) is turned into a unit vector, and their motion perpendicular to the plane (basically x part of the translation) to the airplane is multiplied by dir(y)/dir(x). The result should be approximately the forward motion of the bird without the parallax effect, so this is subtracted from the forward bird translation.
     
  7. Dec 22, 2014 #6

    Bystander

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    So you get dP for head and a second dP for tail. "P" takes care of aircraft speed. What's bird speed?
     
  8. Dec 22, 2014 #7
    The exact equations used for bird speed are:
    Code (Text):
    av_dir = av_dir/sqrt(sum(av_dir.^2));
    P = Gr_int(2);
    bird_side = bird_int(1) - Gr_int(1);
    bird_forward = bird_side*av_dir(2)/av_dir(1);
    bird_parallax = bird_int(2) - bird_forward;
    height = plane_height*(bird_parallax/(P + bird_parallax));
    Where Gr_int and bird_int are their translations summed over a few frames, and (1) and (2) are x and y components respectively.
     
  9. Dec 22, 2014 #8

    Bystander

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    How are you distinguishing bird speed from altitude?
     
  10. Dec 22, 2014 #9
    I'm not sure what you mean. The images are taken from above, with the y-axis being in the airplane's line of flight. The bird movement perpendicular to the plane is assumed to be parallax free. Is that a bad assumption, could it be causing the problem?
     
  11. Dec 22, 2014 #10

    Bystander

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    I'm not seeing how one can spot the difference between a slow bird at high altitude and a fast bird at low altitude ---- ah, now I am, as long as there's pure x-translation of the bird. Adding a translational y-component I think adds a degree of freedom that might be screwing things up. Don't wager large sums of money on that assessment. Pure x-translation should be golden. Pure y-translation is going to be indeterminate between high and slow or low and fast.
     
  12. Dec 22, 2014 #11
    That's a shame, I'd hoped the way speed was compensated for could have been the source of the problem. Every calculation I check seems to be ok, but in practice the numbers just aren't adding up as they should. I've been working on this for weeks and can't seem to isolate any problem besides the height equation, which just causes a bigger problem when it's corrected. Either my geometry is wrong and the original height equation is correct, in which case the problems with accuracy are due to data, or mine is correct and there's a second problem inflating heights to about 4 times the size. These images are being taken over the sea which can naturally cause problems with the ground translation, and wind speed can mess with bird directions that are used to calculate their speed, but I wouldn't expect such a tight and uniform result from that as calculating everything about 200m too high.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook