Main Window: Optimizer tab

The Optimizer attempts to align the images such that they are overlapping seamlessly. It does this by minimizing the distance of every Control Point. On the Optimizer tab, settings for the optimizer can be changed. This page is visible in Advanced mode only; in Simple mode the optimizer uses default settings.

The optimizer can optimize the following parameters:

The optimizer can be controlled through a simple or an advanced interface. The interface can be switched using the Simple or Advanced button at the top of the Optimizer page. Note that this Simple and Advanced optimizer interface are not related to the Simple / Advanced mode of the project.

Simple interface

The simple interface is sufficient in most circumstances. PTGui will set the optimizer parameters to values that usually give good results. There are only three parameters to set:

Optimize using... chooses between the built in optimizer of PTGui, or the Panorama Tools optimizer (if installed). The Panorama Tools optimizer should be configured in Options / Preferences first.

Press the Run Optimizer button to start the optimization process. The optimizer shows its progress in the form of the average control point distance. The lower this number, the better the results. When the optimization has finished, PTGui will show you a short report with the results of the optimization process. You can then choose to accept or reject the optimization. If you accept the results, all image parameters, lens parameters and shift parameters are updated with the results from the optimizer.

Advanced interface

The Advanced interface gives you full control over what should, and what should not be optimized. Use this interface if you want to exclude certain images or parameters from the optimization process.

The image orientation parameters (yaw, pitch and roll) are normally optimized for each image individually (although it is possible to link the roll and/or pitch values using the checkboxes, in which case the optimizer will optimize to a common value for all selected images).

The other paramaters can be optimized for all images together, or for individual images separately. In most circumstances you will use the same lens parameters and shift parameters for all images and in that case the optimizer will optimize these for all images together. But if you have defined individual lens, individual shift and/or individual shear settings for certain images, the lens parameters and shift parametes can also be optimized for those individual images separately.

Always be careful to leave one image 'anchored': the yaw, roll and pitch of one image should not be optimized, so that the other images will be aligned relative to the anchor image. Projects which should be leveled using 'horizontal line' or 'vertical line' control points are an exception: for such projects, the pitch and roll of the anchor images should also be included in the optimization, in order to give the optimizer enough freedom to level the panorama. Only the yaw of the anchor image should never be optimized.

The advanced interface consists of a table with checkboxes, one for each parameter that can be optimized. By selecting the appropriate parameters, you tell the optimizer what it should optimize.

Viewpoint checkbox [PTGui Pro only]: enable viewpoint correction for an image. For images for which this checkbox is enabled, the VP parameters in the Image Parameters tab will be optimized. Viewpoint correction corrects for an offset of the camera position of an image relative to the camera position of the other images. Viewpoint offset correction only works for photographs of flat surfaces; the process is explained in detail in the Viewpoint Correction tutorial.

Link roll / Link pitch: when enabled, the roll and/or pitch values that are selected for optimization are jointly optimized: the optimizer will give all those images the same roll and/or pitch. This is an experimental feature, originally intended for straightening the panorama. However, a better way to do this is through Edit - Straighten Panorama in the Panorama Editor menu. The latter will straighten the panorama without disturbing the alignment between images.

Hor / vert control points: PTGui offers two ways of handling control points of the horizontal line and vertical line type: 'Include in single pass' will do a single optimization pass for all control points (normal and h/v line) together. 'Level in second pass' will first optimize the panorama using all normal control points, then a second separate leveling pass is done using only the h/v control points. The 'Level in second pass' method is generally recommended: the h/v control points will only be used for leveling, they will not disturb the alignment between images or affect the optimized lens parameters. But one particular use for 'Include in single pass' is when straightening or defishing a single image for architectural photos: in such a case it can be useful to have the lens parameters determined by straight horizontal or vertical features in the image. When set to 'Ignore', only the regular control points are used, no leveling takes place.

You can tell the optimizer to leave certain control points out of the optimization process. A control point will only be used if both its images are selected in the Use control points of listbox.

Multiple checkboxes can be checked simultaneously by double clicking on the header above the first checkbox, or by selecting a range of checkboxes using the mouse and pressing the space bar.

When 'Optimize using Panorama Tools' is chosen, PTGui 'talks' to the Panorama Tools optimizer using a script. If you are familiar with the Panorama Tools script syntax, you can select Show Script to show the script that is sent to the Panorama Tools Optimizer. You can even modify it before and after the optimizer is run.

Optimization tips

If the optimizer reports a not so good result, chances are that there are misplaced control points. To find those control points, open the Control Point Table and inspect the control points with the highest distance value (the location of a control point can be viewed by double clicking on it in the table).

Optimizing the field of view may not work in all circumstances. In some cases, the optimizer optimizes the field of view down to zero in order to minimize the control point distance. PTGui will warn you if this has happened. In that case, your only choice is to disable the field of view optimization and let the optimizer use your guessed field of view value. It's easy to see that this will not happen with full 360 degree panoramas, as long as you have not forgotten to also define control points between the first and the last image. In that case, the circle is round and the field of view could not be optimized down to zero without giving a large control point error. Therefore, a good way to determine the field of view of your lens is by making a 360 degree panorama and run it through the optimizer.