Equirectangular projection

Wiki2Reveal edit

This learning resource can be used as Wiki2Reveal slides in mathematics courses as introduction to projective geometry.


Introduction edit

In this learning resource the generation of an equirectangular projection is the objective. The learning resource is use-case driven, AFrame Example Durlach is the first use-case of equirectangular projection. Look around by dragging the direction of view with the mouse with left mouse button pressed.

 
Equirectangular image used in spheric image in a browser

Preview of the equirectangular projection in AFrame - Drag the preview of the equirectangular image with your mouse button pressed.

Example of the equirectangular image edit

Preview the equirectangular JPG-image and explore the distortion of the image at the top and the bottom of the rectangular JPEG image.

Navigation with multiple equirectangular images edit

The AFrame Navigation example from the river Rhine in Germany allows to jump from one location at the river rhine to another location at to the equirectangular preview.

 
- Use case of equirectangular projection - River Rhine example with multiple locations

Equirectangular Projection for Maps edit

The following image shows an equirectangular projection of the world. The standard parallel is the equator (plate carrée projection)

 
Equirectangular projection of the world; the standard parallel is the equator (plate carrée projection).

Distortion edit

Equirectangular projection with Tissot's indicatrix of deformation and with the standard parallels lying on the equator. The deformation of a circle into an ellipse is visible on different location the world map.

Deformation of a Circle - Distortion Indicator edit

The deformation of the circle is an indicator for the distortion of the image.

 
Equirectangular projection with Tissot's indicatrix of deformation and with the standard parallels lying on the equator

Areas of Interest edit

In the image above the distortion in the planar projection is

  • minimal close to the equator and
  • maximal at the south pole and north pole.

Rotating circle over the equator (e.g. intersecting with North and South Pole) can be used to have projections with minimal distortion in the area of interest.

North Pole and South Pole edit

The strongest distortion can be found at the north pole and south pole in the following true-colour satellite image of the earth. In the equirectangular projection the top horizontal line of pixels represent the single pixel for the north pole on the sphere model of the earth. Similar to that the south pole as one pixel is stretched out bottom line of pixels in the equirectangular projection.

Use-Case edit

From a set of standard images of the camera covering a full the from center point of view. In general you cover 360 degree circle with rectangular standard images and you take image with camera for the sky and the floor (preferred without seeing the tripod that might be used for the other images). These set of images are aggregate in one equirectangular image representing a full spheric panorama image, that be be viewed e.g. in Aframe or other panoramic OpenSource viewes, that support equirectangular images.

EQUI2SPH Projection edit

The underlying type of projection is an equirectangular projection EQUI2SPH, that is used e.g in geographical context, where a sphere is projected to rectangular plane on the map. First of all we explore the use-case in 3D Modelling about the spherical use of an spherical panorama image.

Distortion edit

The projection creates especially at the "North Pole" and the "South Pole" the heaviest distortion in comparison to distances measured on the surface of the sphere. For panoramic views the distortion is just a matter of storage of the spheric pixel information in a rectangular format. On the image of a market place you will see that the panoramic viewes transfer the rectangular images into a natural view where you can look around and explore the location from different angles and with multiple equirectangular images from many locations (see river Rhine example Cologne).

Origin of Terminology and History edit

The equirectangular projection (also called the equidistant cylindrical projection), and which includes the special case of the plate carrée projection (also called the geographic projection, lat/lon projection, or plane chart), is a simple map projection attributed to Marinus of Tyre, who Ptolemy claims invented the projection about AD 100.[1] The projection maps meridians to vertical straight lines of constant spacing (for meridional intervals of constant spacing), and circles of latitude to horizontal straight lines of constant spacing (for constant intervals of parallels). The projection is neither equal area nor conformal.

Implications of Distortion for Navigation edit

Because of the distortions introduced by this projection, it has little use in navigation or cadastral mapping and finds its main use in thematic mapping.

Application in global Raster Datasets edit

In particular, the plate carrée has become a standard for global raster datasets, such as Celestia, NASA World Wind, the USGS Astrogeology Research Program, and Natural Earth, because of the particularly simple relationship between the position of an image pixel on the map and its corresponding geographic location on Earth or other spherical solar system bodies.

Application in panoramic photography edit

In addition it is frequently used in panoramic photography to represent a spherical panoramic image.[2]

Definition - Equirectangular Projection edit

  • (SPH2EQUI) The forward projection transforms spherical coordinates into planar coordinates of the equirectangular projection.
  • (EQUI2SPH) The reverse projection transforms equirectangular coordinates from the plane back onto the sphere. The formulae presume a spherical model

Spherical - Longitude and Latitude - SPH edit

  • Longitude  
  • Latitude  

Visualization edit

A perspective view of the Earth showing how latitude ( ) and longitude ( ) are defined on a spherical model. The graticule spacing is 10 degrees.

 
A perspective view of the Earth showing how latitude and longitude

Longitude - SPH edit

Longitude is given as an angular measurement referring to the 0° Greenich Meridian as the Prime Meridian and is ranging to   eastward and   westward. The Greek letter   (lambda)[3][4] is used to denote the location of a place on Earth east or west of the Prime Meridian

Latitude - SPH edit

Latitude is given as an angular measurement referring to the 0° Equator and is ranging to   towards the North Pole and   towards the South Pole. The Greek letter   or   (phi) denotes that angle.

Mnemonic - Greek Letter - Phi edit

There are two different notations of the greek letter   and  . In this learning resource the notation   is used to indicate that it denotes the angle at circle that intersects with the North Pole and the South Pole.

Definition of Spherical Variables edit

The projections are mathematical function/mappings. For definition of these projections the following variables are defined:

  •   is the longitude of the location to project;
  •   is the latitude of the location to project;
  •   are the standard parallels (north and south of the equator) where the scale of the projection is true;
  •   is the central parallel of the map (e.g.   equator);
  •   is the central meridian of the map;
  •   is the radius of the globe.

Longitude and latitude variables are defined here in terms of radians.

Definition of Equirectangular Planar Variables - EQUI edit

  •   is the horizontal coordinate of the projected location on the map;
  •   is the vertical coordinate of the projected location on the map;

Forward Projection - Spherical to Planar - SPH2EQUI edit

 

Special Case - Forward Projection edit

The plate carrée (French, for flat square),[5] is the special case where   is zero. This projection maps x to be the value of the longitude and y to be the value of the latitude,[6] and therefore is sometimes called the latitude/longitude or lat/lon(g) projection.

When the   is not zero, such as Marinus's  ,[7] or Ronald Miller's  ,[8] the projection can portray particular latitudes of interest at true scale.

Remarks - Ellipsoidal Model edit

While a projection with equally spaced parallels is possible for an ellipsoidal model, it would no longer be equidistant because the distance between parallels on an ellipsoid is not constant. More complex formulae can be used to create an equidistant map whose parallels reflect the true spacing.

Reverse - Planar to Spherical - EQUI2SPH edit

 

Alternative names edit

In spherical panorama viewers, usually:

  •   is called "yaw";[9]
  •   is called "pitch";[10]

where both are defined in degrees.

Learning Activities edit

The following learning activities address Projective Geometry from a standard snapshot taken with your camera onto an area on the sphere according to the equirectangular projection. Keep in mind to distinguish between the following projective converters:

  • (SPH2EQUI / EQUI2SPH): (Latitude,Longitude) coordinates sphere     coordinates of an equirectangular image
  • (SPH2IMG / IMG2SPH):   equirectangular coordinates     coordinates standard image of your smartphone or camera.
  • (EQUI2IMG / IMG2EQUI): (Latitude,Longitude) coordinates sphere     coordinates standard image of your smartphone or camera.

Angle of View edit

For the learning activities it is important to understand the

  • (HAV) Horizontal Angle of View in landscape format and
  • (VAV) Vertical Angle of View in landscape format.

Learning Task - Angle of View edit

The HAV and VAV differ from camera to camera. Explain why the HAV and VAV are relevant for the calculation of IMG2EQUI projection. Use the following figure to explain the requirements for projection.

Visualization of Angle of View edit

The following figure depicts besides the Horizontal (HAV) and Vertical Angle of View (VAV) also the Diagonal Angle of View (DAV).

 
Horizontal, vertical and diagonal angle of view

Remark - IMG2EQUI Projection edit

The current projection type of the learning activities is the (IMG2EQUI) projection between the   coordinates of a standard image and the distorted   coordinates of an equirectangular image and vice verca.

HAV and VAV as camera specifc properties edit

Due to the fact that different cameras have different angles of view (HAV and VAV) the visible area of the standard image (taken with your smartphone) might vary. The following animation shows different horizontal angles of view (HAV) e.g. for taking a snapshot vertically upwards towards the sky or blue ceiling.

 
dynamic visualization of the Horizontal Angle of View

IMG2EQUI Projection - Polar Regions edit

In this learning step we take pictures with a standard camera or smartphone and want to calculate the (Latitude,Longitude) coordinates of the sphere from (x,y) coordinates of standard image created with your smartphone or camera. In the first learning step we consider the sphere at the polar regions. These regions are the most distorted areas in the equirectangular projections.


IMG2SPH Projection - Take Snapshots for Learning Task edit

  • Take your mobile phone and take two snapshots vertical down and vertical up from your floor and from the ceiling. Select an position in your room where the top and the floor has some visible elements (e.g. a lamp, wooden decorative elements, ...). Alternatively you can create the two images outside with a cloudy sky and objects lying on the ground.
  • select a center of a circle and a radius that fits into both images (maximize the radius of the circle,
  • in this module we will project these two images to the polar regions of the sphere within the rectangular coordinate system of the image.

Initial State - Image Sky edit

The following image shows the initial state taking a picture from the sky. The camera is located in the center of the red sphere and takes an image of the blue sky or the ceiling in a room. The ceiling is visualized as a blue plane. The learning task is to calculate the angles for the corresponding point on the sphere.

 

Snapshot with a Camera edit

The first image is snapshot with a camera taking a picture vertically upwards to the ceiling (into the sky). The red circle is the projected area from the image (sky/ceiling) onto a part of the equirectangular image visualized in the next section of the learning resource.

 

Equirectangular Projection of Circle - Rectangle edit

Explain, why the circle in the source image of the polar region (North Pole) is a rectangle after projection in the equirectangular image.

 

Learning Task - Function for Coordinate Transformation IMG2EQUI edit

We denote by   the color information of a pixel in the source image (IMG) and with   the color information of the pixel in the image in the destination format (EQUI). Define the function   by calculating the corresponding   coordinates in the IMG source image. This calculation is used to set pixels in the destination format EQUI by setting

 

Remark: You need basic knowledge in trigonometry to perform this learning task.

Coordinate System of Graphics edit

 
Coordinate system in Graphics

The coordinate system of an image has a different orientation in y-axis. This is shown in the diagram.

  •   is the maximal value of the on the x-axis of the image
  •   is the maximal value of the on the y-axis the of the image
  • The origin of the coordinate system is on the top left.

Keep this in mind, when you use the coordinate system for your experiments with projections (see also equirectangular projection.

Rectangular to Sphere - Projection edit

 
Equirectangular projection with marked ceiling and floor

Now we use a the standard rectangular image on the right as in input for the equirectangular projection on the sphere and we view the image in panoramic preview on the sphere. What can be observed, if you analyze the projected area of red ceiling and a marked green rectangle on the floor.

Screenshots - Projection on Sphere of the standard Image edit

Screenshot of projection
Ceiling/Sky Floor
   

Learning Task - Projection of Sky in Graphics Coordinate System edit

 
Equirectangular coordinate system sky / ceiling

Graphics have an own coordinate system to display points in pixel graphics or geometric objects like lines, polygons and circles in the coordinate system. The diagram shows the coordinate system of the image. Keep in mind that the coordinate of the y-axis has a different orientation than the y-axis in the standard 2D Cartesian coordinate system. This information is relevant if you experiment with equirectangular projections in Projective Geometry Playground.

Calculate the   for a specific angle of view of your camera.

Learning Task - Calculation edit

Calculate the equirectangular projection for any   point in the red circle of the source image IMG into the destination format EQUI with:

Select an implementation of your choice. LibreOffice has the minimal requirements on programming skill but only coordinate transformation can be performed without a visual output.

Learning Task - Sky - North Pole edit

 
Sky - equirectangular projection - north pole

A sky image can be used to project a circular area in the source image to the rectangular part at the top of the generated equirectangular image.

Import the equirectangular projection in Aframe to preview the result.

Learning Task - Floor - South Pole edit

 
Floor Image - sand as demo input for equirectangular projection

Transfer the lesson learned from north pole to the south pole and project the beach image as floor to the south pole.

  • What are differences and similarities between both projections?


Final Result edit

 
Equirectangular Image from Wikiversity used for Aframe 360 Degree Image (see Hugin)
 
Dining Hall 360-degree view - with PanoViewer Template
(view as a 360° interactive panorama)

See also edit

References edit

  1. Flattening the Earth: Two Thousand Years of Map Projections, John P. Snyder, 1993, pp. 5–8, ISBN 0-226-76747-7.
  2. "Equirectangular Projection - PanoTools.org Wiki". wiki.panotools.org. Retrieved 2021-05-04.
  3. "Coordinate Conversion". colorado.edu. Archived from the original on 29 September 2009. Retrieved 14 March 2018.
  4. "  = Longitude east of Greenwich (for longitude west of Greenwich, use a minus sign)."
    John P. Snyder, Map Projections, A Working Manual Archived 2010-07-01 at the Wayback Machine, USGS Professional Paper 1395, page ix
  5. Farkas, Gábor. "Plate Carrée - a simple example". O’Reilly Online Learning. Retrieved 31 December 2022.
  6. Paul A. Longley; Michael F. Goodchild; David J. Maguire; David W. Rhind (2005). Geographic Information Systems and Science. John Wiley & Sons. https://books.google.co.uk/books?id=-FbVI-2tSuYC&pg=PA119. 
  7. Flattening the Earth: Two Thousand Years of Map Projections, John P. Snyder, 1993, pp. 7, ISBN 0-226-76747-7.
  8. "Equidistant Cylindrical (Plate Carrée)". PROJ coordinate transformation software library. Retrieved 25 August 2020.
  9. "Yaw - PanoTools.org Wiki". wiki.panotools.org. Retrieved 2021-05-04.
  10. "Pitch - PanoTools.org Wiki". wiki.panotools.org. Retrieved 2021-05-04.
  11. Carnë Draug, Hartmut Gimpel, Avinoam Kalma (2022) Image Package Octave URL: https://gnu-octave.github.io/packages/image/ (March, 28th, 2024)

External links edit

Page Information edit

You can display this page as Wiki2Reveal slides

Wiki2Reveal edit

The Wiki2Reveal slides were created for the 3D Modelling' and the Link for the Wiki2Reveal Slides was created with the link generator.

Wikipedia2Wikiversiy edit

This page was based on the following wikipedia-source page: