1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Computing the shape of the Earth as seen by a camera

  1. Feb 22, 2016 #1
    AS: If this is not the right place to ask this question, please let me know where I could try. Thanks.
    AS: I had to validate the fact I used the template to post my assignment, however I didn't (but it wouldn't post otherwise - btw it's not an "assignment").

    Hello everyone.
    I need help with a problem I have and couldn't find the error in made in it.

    The goal is to compute the shape of the Earth curvature as saw by a camera.
    First, I computed the shape of the horizon itself.
    Using the attached figure for notation.
    FBwvpNXVJiD_capture-d-%C3%A9cran2.png

    I found a circle of equation:

    \begin{equation}
    \left\{ \begin{array}{l}
    x^2 + z^2 = l^2\\
    y = h'
    \end{array} \right.
    \end{equation}

    With
    $$h' = \frac{rh}{r + h}$$
    and $$ l = r \frac{\sqrt{h (2 r + h)}}{r + h} $$

    Then I define an ideal pinhole camera:
    FBwvt7wnDYD_capture-d-%C3%A9cran6.png

    The hole is at $$P(0,h,0)$$ (yes, the projection plane is front, but apart of a sign, shouldnt change anything).

    I found:
    $$
    M (x, y, z) \Rightarrow M' \left\{ \begin{array}{l}
    x' = \varepsilon x / z\\
    y' = \frac{y - h}{z} \varepsilon + h\\
    z' = \varepsilon
    \end{array} \right. $$

    I rewrite it to be able to express the constraint for the circle:

    $$
    M' \left\{ \begin{array}{l}
    x = x' \frac{y - h}{y' - h}\\
    z = \varepsilon \frac{y - h}{y' - h}
    \end{array} \right.
    $$

    So, my projected circle should fulfill:

    $$
    \begin{array}{lll}
    M' & & \left\{ \begin{array}{l}
    x = x' \frac{y - h}{y' - h}\\
    z = \varepsilon \frac{y - h}{y' - h}\\
    z \in [\varepsilon, l]\\
    x^2 + z^2 = l^2\\
    y = h'
    \end{array} \right.
    \end{array}$$

    Posing
    $$H = h' - h$$ and $$Y' = y' - h$$:

    I get:
    $$ \frac{Y'^2}{\left( \frac{\varepsilon^{} H^{}}{l^{}} \right)^2} -
    \frac{x'^2}{\varepsilon^2} = 1 $$

    This is the equation of an hyperbole of parameters $$a = \frac{\varepsilon
    H}{l}$$ and $$b = \varepsilon$$

    So for now I'm happy (seems fine).

    Then I just rewrite it to plot:

    $$
    y' = \frac{H}{l} \sqrt{\varepsilon^2 + x'^2} + h
    $$

    And halas, gnuplot draw:
    FBwvFEX4DMD_capture-d-%C3%A9cran12.png
    Obviously wrong.

    If the math are fine, I'll post my gnuplot script.
    Buf first, did I made an error above?

    Thanks for any help!

    Thomas.
     
  2. jcsd
  3. Feb 22, 2016 #2

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    It's hard to tell, but the view in Figure 10 above seems to be really tiny, like looking at the horizon thru a keyhole.

    In such a small viewport, I wouldn't expect to see much curvature on the horizon.
     
  4. Feb 22, 2016 #3

    haruspex

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    Perhaps I've not understood the set-up. Let O be the centre of the Earth and P the pinhole. The projection of the Earth through the pinhole forms a cone with axis the continuation of OP. The image plane intersects this in a conic, the type of which depends on the angle between the plane and the axis (in relation to the angle of the cone).
    If the camera is a rectangular box, with P opposite to the centre of the image area, A, I do not see how this can produce a hyperbola. That would require O and A to be on the same side of the panel where P is located. I.e., the Earth is inside the camera. The only result I can imagine is an ellipse.
     
  5. Feb 23, 2016 #4
    Thanks for your answer.

    Numerical application used $$\epsilon=50mm$$ and viewport $$24 \times 36mm$$ which are pretty standard camera setting (default for any so called "full-frame" DSLD).

    That's what I want to simulate.

    NB: both axis should be in mm, would be nicer, but I didnt yet fixed that detail in gnuplot, so x axis is still in m.
     
    Last edited: Feb 23, 2016
  6. Feb 23, 2016 #5
    I'm not sure I understand the problem.
    Are you looking for the points of the sphere (earth) limited below by a horizontal plane and above by its tangent planes meeting ##A## ? Is it something like this ?
     
  7. Feb 23, 2016 #6
    Hi,

    Thanks, for your remark.

    Imagine you standing by the sea, holding a camera body straight, and taking a picture. You wont see an ellipse as horizon, but something that looks like a straight line, that is in fact a very large hyperbola.

    The higher you get, the more you'll see it curved. It will never form an ellipse in those conditions. But at some point, you'll tend to point your camera "down" (as the horizon lower) and then the plane of projection change, and you can get an ellipse or a circle. But I'm not there yet.

    Thanks.
     
  8. Feb 23, 2016 #7
    Hi,

    I'm trying to simulates how the horizon looks at different altitude, first using a camera hold "'straight" (plane of projection is vertical).
    So I first computed the horizon shape from a given altitude (it's a circle), and then trying to project that circle on my camera focal plane.

    Seems fine? Thanks.
     
  9. Feb 23, 2016 #8
    But explain what is to be understood by "horizon", in geometrical terms.
     
  10. Feb 23, 2016 #9
    I believe that's pretty standard, should be the same definition as the one you'll find on Wikipedia (https://en.wikipedia.org/wiki/Horizon) : horizon at point P is the union of points of intersections of the tangent to the Earth passing by P with the Earth (the Earth being assimilated to a perfect sphere here).
     
  11. Feb 23, 2016 #10
    So at this point we have an equation for this set of points, looking like :
    ## xx_A + yy_A + zz_A + \alpha (x + x_A) + \beta ( y + y_A) + \gamma (z+z_A) + \delta = 0##

    What are we supposed to do next ?
     
  12. Feb 23, 2016 #11
    I'm not sure about your general form above (shouldn't there be some squared terms somewhere?).
    Anyway, once you have this set (that I computed as being a circle as said above), you want to find it's image by a central projection defined by the point P and the plane as seen of figure above.
    And find the shape of this projection.

    I understand that all of this seems to be related to conics, and there are certainly better ways that what I'm doing to get there...
     
  13. Feb 23, 2016 #12

    haruspex

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    I don't think we're at odds here. If the image plane is vertical then the Earth's centre is in that plane, so the image is a parabola. If you tip the camera up slightly, the centre of the Earth is now on the 'inside' of the camera, giving a hyperbola. That's the set-up I had not considered.
     
  14. Feb 23, 2016 #13
    Well if you consider the the sphere
    ##S|x^2 + y^2 + z^2 + 2\alpha x + 2\beta y + 2\gamma z + \delta = 0##,
    center: ##(-\alpha,-\beta,-\gamma)##
    radius: ##\sqrt{\alpha ^2 + \beta ^2 + \gamma ^2 -\delta}##

    then its tangent planes are the ## T_{(x,y,z)} | xX+yY+zZ + \alpha (x+X) + \beta (y+Y) + \gamma (z+Z) + \delta = 0##.

    But if you are only interested by those planes passing through ##A##, you are left with two equations :

    ## x^2 + y^2 + z^2 + 2\alpha x + 2\beta y + 2\gamma z + \delta = 0 ## and ## xx_A+yy_A+zz_A+ \alpha (x+x_A) + \beta (y+y_A) + \gamma (z+z_A) + \delta = 0##

    How does it fit to your answer ?
     
  15. Feb 23, 2016 #14
    Yes, thanks.
     
  16. Feb 23, 2016 #15
    Would you suggest me to use this forme instead of the one I used above ? It's more general and flexible, I agree.
     
  17. Feb 24, 2016 #16
    I don't suggest anything at this point. We've just talked about some equations that must satisfy the horizon points (at A) according to the definition you wrote in post #9. The only thing I understand for the moment is that a subset of these points must appear on final screen.
    What do we need to determine this subset ? Some other equations missing ? I feel that there should be at least one more equation relating the camera position to the horizon points, am I right ?
    Once we have this subset of points that should appear on the screen, you have to explain how the scene is mapped to a TV screen, you talked about central projection, maybe you can start with this.
     
  18. Feb 24, 2016 #17
    I used that equation for the same thing, so I ask:


    \begin{equation}
    \left\{ \begin{array}{l}
    x^2 + z^2 = l^2\\
    y = h'
    \end{array} \right.
    \end{equation}

    With
    $$h' = \frac{rh}{r + h}$$
    and $$ l = r \frac{\sqrt{h (2 r + h)}}{r + h} $$



    Yes, I defined this centra projection in the document above:
    Then I define an ideal pinhole camera:
    FBwvt7wnDYD_capture-d-%C3%A9cran6.png

    The hole is at $$P(0,h,0)$$ (yes, the projection plane is front, but apart of a sign, shouldnt change anything).

    I found:
    $$
    M (x, y, z) \Rightarrow M' \left\{ \begin{array}{l}
    x' = \varepsilon x / z\\
    y' = \frac{y - h}{z} \varepsilon + h\\
    z' = \varepsilon
    \end{array} \right. $$

    I rewrite it to be able to express the constraint for the circle:

    $$
    M' \left\{ \begin{array}{l}
    x = x' \frac{y - h}{y' - h}\\
    z = \varepsilon \frac{y - h}{y' - h}
    \end{array} \right.
    $$

    So, my projected circle should fulfill:

    $$
    \begin{array}{lll}
    M' & & \left\{ \begin{array}{l}
    x = x' \frac{y - h}{y' - h}\\
    z = \varepsilon \frac{y - h}{y' - h}\\
    z \in [\varepsilon, l]\\
    x^2 + z^2 = l^2\\
    y = h'
    \end{array} \right.
    \end{array}$$

    Posing
    $$H = h' - h$$ and $$Y' = y' - h$$:

    I get:
    $$ \frac{Y'^2}{\left( \frac{\varepsilon^{} H^{}}{l^{}} \right)^2} -
    \frac{x'^2}{\varepsilon^2} = 1 $$

    This is the equation of an hyperbole of parameters $$a = \frac{\varepsilon
    H}{l}$$ and $$b = \varepsilon$$

    That's how I did it.
     
  19. Feb 24, 2016 #18
    Lol this is just a copy paste of your post #1!
    I think that since your camera can move vertically, if man holding the camera has position ##M_0(x_0,y_0,z_0)## at the surface of the earth, the position of the camera is ##M_c(t) = M_0 + t \begin{pmatrix} x_0 + \alpha \\ y_0 + \beta \\ z_0 + \gamma \end{pmatrix}##, ##t\ge 0##.
    Should the camera be aligned with ##A## ?
     
    Last edited: Feb 24, 2016
  20. Mar 6, 2016 #19
    Hi,
    Thanks again for your answer. Got some time again, so I'm back on the subject.

    Because I felt I answered already, seems I'm not clear enough.

    My camera position is fully described by the single parameter "h" that gives its altitude to the surface, as I'm only considering a camera hold "straight".

    Straight means that the projection plane is vertical. In he computation, I put the pinhole on the vertical axis considered, the projection plane being a bit front (so not exactly locally "vertical", it is at the same vertical than pinhole P).

    I dont think that anything is missing.

    Once I have defined what is the horizon at a given point P at an altitude h (this is a know set of points), I just want to project this set using a central projection of center P on a plane that is parallel to the vertical at P at a distance ##\epsilon## from that vertical.

    I wish I could be more precise...

    Hum, maybe like this:

    Let a sphere S of center O (0,0,0) and radius r.
    Let a point P(0,r+h,0) h>0
    Let H being the set of horizon points of the sphere as seen from P (that is the intersection between (the tangents to S that pass by P) and S).
    Let F be a plane parallel to OP at a distance ##\epsilon## of that line, ##\epsilon## < r (so you dont have ton consider cases
    when the plane would not intersect the sphere) F could be defined fully by a point F0(0,0,##\epsilon##), and two vectors: vx(1,0,0) and vy(0,1,0)
    Let C be the central projection of center P on the plane F

    The question is: what is the image of H by C?

    Maybe that's better now ?

    (of course, 0,x,y,z is an orthonormal referential in an euclidean space, etc.)
     
  21. Mar 6, 2016 #20
    Hi,

    Thanks everyone. I finally found my error. Now my result is compatible with Povray rendering of a similar scene and looks comparable to some ISS picts showing Earth shape from orbit.

    Thanks again.

    PS:
    Error is stupid: y=-h in the circle equation, not y=+h...
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Computing the shape of the Earth as seen by a camera
  1. Very Hard shape problem (Replies: 10)

  2. 6 sided shape drawing (Replies: 10)

Loading...