Panoramic Photography with Hugin

0
759

The world of panoramic imaging, along with HDR, is perhaps one of the sinister trends that has generated the most discussions on the Web in recent years and one of the topics I least like to talk about. Therefore, in this article, I will not discuss the possibility of creating impossible perspectives or unreal 360º worlds, but rather the possibility of prudently managing the possibilities of “stitching” or “stitcher” images in order to overcome situations where there is some difficulty in the shooting angles with our optics, or where we need images with a resolution higher than that provided by our sensor.

When we delve into the world of heritage documentation or digitization, sooner or later, becoming familiar with these techniques may be a good option to overcome certain difficulties.

Talking about panoramic photography is, in a way, a generalization of the possibilities of assembling image mosaics, since this technique does not always imply a panoramic sensation, but can be a highly recommended strategy to create high-resolution images or immersions in our scene in order to seek greater detail or overcome certain perspective problems or distortions created by certain optics.

However, within the spectacular possibilities of panoramic photography, the transposition of a spherical view to a 2D world poses a certain mathematical challenge addressed by the science of cartography through projections of spheres or ellipsoids onto a flat surface. The concept of projections in panoramic photography requires some caution since much of the precision of our projects depends on them.

In the world of tools for constructing panoramas, overlapping, or stitching images, there is a considerable offer of both paid options such as the well-known PTGui among others, but currently there are free tools like Autopano or Hugin that offer possibilities that are not only identical but even superior to many paid tools. In fact, both Hugin and PTGui are based on Panotools (Panorama Tools).

Capture: the no-parallax point

punto_no_paralajeTaking a good series of shots suitable for mosaic assembly, although apparently trivial, can become a small nightmare due to a phenomenon commonly, and incorrectly called the “nodal point,” when we should actually talk about the “no-parallax” point or “entrance pupil.” However, the confusion is so widespread that frequently, even manufacturers of panoramic accessories continue to refer to the nodal point or axis.

During the rotation of our camera on the tripod, what is known as the parallax phenomenon can occur, which results in significant errors when joining one or more images. The no-parallax point of our equipment is located somewhere near the entrance of our lens, being a point that can only be empirically calculated for each lens model.

To calculate the no-parallax point, we can mount our camera on some type of panoramic head or accessory so that our camera does not pivot on the usual focal plane but on some area that we can vary on our lens, and align this with two points slightly spaced apart. When rotating the camera to the right or left, at the moment we find this point or axis, both objects will remain perfectly aligned.

The location of this point on our lenses and not on the usual focal plane implies acquiring or manufacturing an adapter that allows the precise rotation of our camera around this point; these are known as “nodal” or panoramic heads.

In certain types of scenes or optics, we can challenge this theory to some extent; however, at any moment, “ghost” lines or shapes may appear in our scene.

Obviously, each image we take must have some overlap with the previous one to ensure we have the greatest number of control points between each pair of images.

In the following article “Calculations around the field of view in panoramic photography” you can obtain more information about planning panoramic photography. Or you can also use the panorama calculator.

Assembly

The operating principle of these tools is usually quite similar:

  1. hugin cargar imagenesWe load a set of images where there is some overlap between each of them. Next, the information about the lens used is displayed along with the possibility of loading a lens profile, which if we do not have, we can go to the Camera and Lens tab and adjust the radial distortion parameters there.
  2. hugin puntos de controlCommon points in the overlapping areas are searched with the Align command, either automatically or manually from the Control Points tab, which allows determining the sequence, orientation, and tilt of the image set.
  3. Appropriate projection adjustments are made if necessary from the Stitcher tab, or by using the Panorama Quick Preview window, where we can edit the alignment, rotation, and projection of our images.
  4. The new image is reconstructed thanks to the information gathered in the previous steps.

The process, although simple, can become quite complicated if we start diving into the numerous options offered by the Hugin environment.

hugin correccion de lenteOne of the aspects to which we should at least pay some attention is lens correction phenomena, particularly if we work with short focal length optics, which usually present the characteristic barrel distortion more pronounced than long focal length lenses.

To mitigate defects introduced by lens distortions in the assembly of our panoramas, it is advisable to perform a prior correction of these distortions or do it within Hugin itself. In a previous article “Lens Correction: LensFun, Hugin, and ImageMagick” I addressed certain concepts and tools related to Hugin for correcting the usual “barrel” distortion where I presented the characterization factors a, b, and c and how to obtain them from the LensFun database.

Once these LensFun factors are calculated or obtained, they can be defined in the Hugin panel enabled for this situation, where we will take the opportunity to create a lens profile to shorten the process in subsequent works. Another way to address the problem is to perform this correction with an Adobe Lens Profile, also addressed in another previous article “Lens Correction with Adobe Lens Profile,” provided we have a version higher than CS5.

Another common difficulty in this type of process is choosing the type of projection to select. Recommendations are risky at this point since it depends on the degrees covered by our vision, the type of lens, and the use that will be given to our panorama, as projections differ if we are going to print it or display it in some type of panoramic viewer.

abrigo toros prado navazo, Albarracin

One of the most common projections in these processes is rectilinear since it is possibly the most familiar to our perception as it is produced by most lenses. However, it can produce certain distortions at the edges of panoramas, so its use is recommended for panoramas with a field of view less than 120º. However, if we need to print a panoramic sequence of more than 120º, probably 180º or 360º of vision, the most common is to resort to cylindrical projection, which is frequent in certain types of panoramic photography cameras. A characteristic of cylindrical projection is that the information at the poles is extremely compressed, so it is usually discarded, and this type of projection is not recommended for vertical angles greater than 120º. A very close alternative to cylindrical projection is Mercator, which gives us a bit more vertical angle, up to 147º, and with slightly less distortion. Very similar to Mercator is Miller, which is usually a good choice for printing. On the other hand, if our panorama is intended for printing, the most appropriate might be to resort to equirectangular projection, which allows viewing angles of 360º by 180º and is the most common projection in panoramic scanning cameras equipped with fisheye lenses and some interactive panoramic image viewers.

There are many other projections that you can consult in the Hugin Wiki in the Projections section