Scroll down to read
Scroll down to read
Common photos use normal lenses without special effects. This facilitates the estimation of the solar position at the time of the shot. However, a few conditions are needed for a precise enough evaluation. In this section, we will discuss the main principles used.
Before getting to the heart of the matter, it may be useful to recall certain photographic concepts. Let's take a screenshot of Google Maps® with a large FOV (Field of View).
Wide-angle photo generated by Google Maps® from a 360° panoramic photograph.
The concepts are easier to understand with a wide-angle photo. There are three vanishing points (VP's), i.e. points at which some receding parallel lines viewed in perspective, appear to converge at a large distance (assumed to be infinite):
the sun rays are almost parallel light rays, from the earth's perspective. The truck's shadows allow us to fix the center of the sun's VP;
the road vanishing lines point to the road VP (rVP) on the estimated Horizon Line;
the vertical lamp posts point to the estimated vertical VP (vVP).
Vanishing points (VP), Center of View (C), Horizon Line, and Field of View (FOV). The camera is rotated ~50° with respect to the traffic direction. In this planar projection, typical for common photos, the FOV < 180°, as FOV=180° would correspond to an infinitely wide photo. See the strong distortions (angles and distance) for views far from C. The estimated FOV is ~ 144° (giving an equivalent Focal Distance FD ~ 5.85 mm). The vertical's VP is out of the frame. When the sun is behind the camera, the light rays converge to an anti-sun or anti-solar VP (see example below).
The angular distance between the Horizon and vVP is 90°. The truck cab and the first lamp post are about in the perpendicular direction of the driving road direction, as we notice from the aligned two lamps at the top and the truck's viewed perspective (see the 90° turned camera view at the same place and time). This gives a 90° reference in the photo on the Horizon line. It allows evaluating FOV ~ 145° (*).
(*) However, this photo is not good enough for a precise evaluation. Analysis of the context is always necessary prior to calculations. The strong wide-angle makes the estimation sensitive to small errors. The actual Horizon Line is slightly above because the road goes down towards the horizon. The speedy moving camera and the interpolation process to reproduce a planar photo from a panoramic distorted shot, may introduce some positioning errors in the Center of View C and in the first lamp post and its verticality. See corrected simulation results below. FOV seems to be ~148° and vVP and the Horizon are a bit higher.
View when the camera is left-rotated 90 degrees with respect to the traffic direction at the same place and time.
We will use the following steps to estimate the angular position of the sun.
1) Take a sufficiently good photo (*). The best images exhibit sharp sun shadows, vertical and horizontal lines, vanishing directions, horizontal planes, etc. Get as much information as possible from the camera: focal distance or the field of view, pitch and roll angles, etc. Use normal lenses without special effects (like fisheye or strong wide-angle lenses, etc.).
(*) The example photo was computer-generated by Blender® with a focal length = 20 mm, a solar elevation of 30°, and an azimuth of 140° relative to the viewing direction.
2) Estimate the Vanishing Point VP of the solar rays from their reflections, shadows, or shades. The ideal would be to have some light probe in the photographed scene. If the sun is photographed in the frame, VP is simply the center of the sun. Otherwise, the simplest method is to analyze cast shadows. Best estimates come from sharp long and sufficiently separated shadows. In this example, VP is the anti-solar point.
3) Estimate the Horizon line H of the scene. If the camera is leveled this line will appear as horizontal i.e. parallel to the left/right axis. Vertical lines may help find the direction if the camera is right or left tilted (with some roll angle). If the camera is forward or backward tilted (with some pitch angle), the vertical lines are not parallel but converge to some vanishing point (In the figure vertical lines point to some far point below).
4) Estimate the Center of View C of the camera. It is the point in the photo where the camera is pointing to. Normally it is located at the center of the photograph if this has not been cropped, and if the lens is centered without artifacts (as with shift or tilt lenses). With a zero pitch angle, C is located on the Horizon line H. A forward tilt gives C below H as in the figure.
5) The value of the camera's Focal distance FD determines the angle of the camera's Field of view FOV. Knowing the positions of H and C it is possible to draw the spherical coordinate projections superimposed on the photo centered on Hc, the Horizon center. Set FD so that the projected vertical direction of the posts fits the verticals of the spherical frame. As FD = 18/tang(FOV/2), the horizontal of our example at C gives FOV=84° (from -42° to +42°), so FD=20 mm.
6) The solar elevation φ and relative azimuth AZ are given by the spherical coordinates (angular abscissa and ordinate) of the Vanishing Point VP. For the sun behind the camera, we get the opposite coordinates. In the example, values are α =-7° (pitch angle, the angular ordinate of C), φ=30°, AZ=140° (= 180° - 40°; see the Blender Implementation).
φ ≤ γ0(here γ0 ~42.3°): the actual elevation φ is always smaller than the apparent elevation γ0 at Hc, the Center of View. See our explanation at the end of the Math page.
Using these principles with the 3D Blender® Program, we created a Template applicable to any common photo. Here are the results of the estimation for the photo above.
Graphical Solution for the example photo generated by Google Maps®. The corrected positions of the Horizon Line, vVP, and C the Center of View result from the adjustment of FD to fit the spherical vertical frame to the lamp posts directions. This visual adjustment gives FD~5.15 mm (FOV~148°). The estimated elevation is about 52° and the relative azimuth 20°.