Examples / Stitching
Introduction
This example runs through how to develop a series of bracketed exposures using FFDD6 tools into a developed medium to large resolution stitched photo.

The scenario presented here represents the worst case most photographers will experience for generating a stitched image: low light (before dawn), fast changing light, very long exposures, large dynamic range, and water. Building a seamlessly developed extended dynamic range stitched image in these conditions is probably one of the toughest problems to solve in Photoshop, requiring an expert skill level, dedication, and some hard work. However, the results can simply be stunning and are well worth the effort for the ultimate in clarity and resolution.
The Source Exposures
Starting with 25 exposures composed of 6 series of vertical bracketed exposures taken at different rotational positions on a tripod.

Notice that under the early morning shooting conditions, there wasn't enough time to insure the full range of exposures for each bracketed series. In better conditions, the bracketed series should include more overexposed shots. Also some of the exposures in each series do not follow the exact same series of shutter times. This mistake wasn't corrected because of time constraints. Skipped exposures can result in noise, so it is best to use the same series of shutter times for each series. However, as long as the darkest exposure in each bracketed series has the same shutter time, FFDD will be able to correctly handle all the files.
Also notice that the darkest exposure in each series is probably less than ideal and too dark. This is not a problem for FFDD6, it will automatically handle exposures which are too dark to be useful (in terms of noise). This is actually ideal for tough shooting conditions, where it is wise to include a darker than necessary exposure to insure that there is no chance that the darkest exposure has any points of over-exposure.
Step 1 : Conversion and Naming
First convert all the raw files into DNG. Then rename all the files as per the naming conventions described on the batch script page. This step is necessary so that the batch script knows the grouping of each image for each series.
Step 2 : Correct Raw Settings
Open all the DNG files in Adobe Camera Raw, using the Select All and Synchronize... buttons to insure the changes effect all files. Then correct the Chromatic Aberration.

Afterwards correct the Vignetting.

White point can also be adjusted to a common value, or simply let the batch script compute the average white point from the files. All other Camera Raw settings need not be adjusted (and will be ignored), as the batch script will automatically calculate the correct settings before loading the file.
When finished in Camera Raw, make sure to click the Done button to save all the settings in the DNG files.
Step 3 : Produce the Blended Negatives With the FFDD6 Batch Script
Open Photoshop and run the batch script on the directory containing the DNG files. It is a good idea to run this batch process at night or during lunch, because it can take a long time (and 100% of the computer's resources) to run through all the files. The goal here is to build the extended dynamic range digital negatives which will be stitched in the next step.

Step 4 : Stitch the Blended Negatives
Open your favorite photo stitching tool such as Hugin. Then stitch all the blended negatives (the -N.tif files) together. The rest of this section is going to be a quick tutorial of stitching with Hugin, so skip along to Step 5 if not a Hugin user.
Hugin and other stitching tools can be a real pain to learn. Perhaps due to a lack of good documentation, and perhaps because certain features simply don't work well or as expected. My aim here is to help you avoid the mine field of problems, and instead zero in on a method which works well all the time, even when shooting without a proper pano head which rotates the camera and lens on the focal point of the lens.
Hugin Step 1 : First load all the images into Hugin with the Add individual images... button. When finished select the center most image and click both Anchor this image for position and Anchor this image for exposure.

Hugin Step 2 : Then setup the Camera and Lens parameters. This gets messy and requires some math.

While Hugin can be used to guess the lens parameters from control points in the images, this almost never works well. By far the best method is to simply lookup the lens parameters from the included PTLensDB folder included with Hugin. In this case the camera lens was for a Canon DSLR, and the profile_canonSLR.txt file in the PTLensDB folder contained the following info for the lens.
begin lens
group: canonSLR
multiplier: 1.0
menu_lens: Canon EF 70-200mm f/4L USM
cal_abc: 70 0.000000 -0.006408 0.000000 (line for 70mm)
cal_abc: 75 0.000000 -0.005162 0.000000
cal_abc: 81 0.000000 -0.003271 0.000000
cal_abc: 94 0.000000 0.000642 0.000000
cal_abc: 100 0.000000 0.002069 0.000000
cal_abc: 109 0.000000 0.003375 0.000000
cal_abc: 122 0.000000 0.004125 0.000000
cal_abc: 135 0.000000 0.005898 0.000000
cal_abc: 145 0.000000 0.006262 0.000000
cal_abc: 159 0.000000 0.007369 0.000000
cal_abc: 168 0.000000 0.008619 0.000000
cal_abc: 184 0.000000 0.008464 0.000000
cal_abc: 200 0.000000 0.008816 0.000000
end
In this case the series of exposures was taken at 70mm, so simply look at the correct line for 70mm and copy out the values. The first column contains the number for distortion (a), the second for barrel (b), and the third for distortion (c). The other settings in Image Center Shift, Image Shearing, and Exposure and Color should all be set to zero.
The settings in the Design Parameters section can be more complex. If you are stitching horizontal images from a 35mm camera (or full frame digital like the Canon 5D), then simply write in the focal length of the lens in the focal length box and Hugin will correctly compute the degrees of view (v). However if you are shooting verticals (Hugin assumes this value is field of view in the horizontal direction, and doesn't correct the value for verticals) or shooting with a camera which does not have a full 35mm frame digital sensor, then manual calculation of the horizontal degrees of view (v) will be necessary. Luckily the math is not too complex.
degrees of view = 2 * arctan(frame size/(focal length * 2))
The frame size for a 35mm camera is 36mm x 24mm. So when shooting verticals simply place in 24 as the frame size in the above equation (otherwise use 36 for horizontals). If the camera is a reduced frame 35mm, then divide the frame size by the digital multiplier factor for the camera.
degrees of view = 2 * arctan(frame size/(focal length * 2 * digital multiplier))
This digital multiplier is 1.6 for most Canons, 1.3 for the Canon 1D, 1.5 for most Pentax, Nikon and Sony DSLRs and 2 for most Olympus DSLRs. Check out Bob Atkins Photography for a good source to learn more.
Now for this example a full frame Canon 5D was used with a 70mm lens to shoot vertical images.
degrees of view = 2 * arctan(24mm / (70mm * 2))
degrees of view = 2 * arctan(24 / (140))
degrees of view = 2 * arctan(0.171428)
degrees of view = 2 * 9.72757 degrees
degrees of view = 19.4552 degrees
The answer of 19.4552 was written into the degrees of view (v) box in hugin.
Hugin Step 3 : Create control points.

Those who have tried the Feature Matching (Autopano) option to automagically create control points will know that it doesn't work in all cases, especially when not using a pano head with a wide angle lens.
A more consistent method (and one I had to learn the hard way!) is to manually generate the control points by selecting 3-5 points per image pair and selecting points as close to the horizon as possible. Using points as distant in the image as possible will insure that the horizon always matches. In the case where something doesn't match up, it is better that the horizon matches, because if it doesn't, this cannot be fixed easily later, while tiny foreground mismatch can be corrected for.
A fast method to select control points is simply to work with images 0 and 1, then images 1 and 2, then images 2 and 3, and so on until all sequential image pairs have a selection of at least 3 control points.
Hugin Step 4 : Run the Optimizer.

Since the camera settings were already correctly set previously, only yaw (y), pitch (p), and roll (r) need to be corrected here. To do this use the Custom parameters below as the Optimize method from the drop down list. Then insure that all BUT the image selected as the anchor (from the Hugin Step 1), are checked all the upper three columns for yaw, pitch, and roll. Note in this example, image 4 is the anchor. Then click the Optimize now! button. Check the Panorama preview window to see the results.
At this point is a good idea to go back into the Image tab and adjust the Image Orientation (yaw, pitch, and roll) of the anchor image.

Simply make numerical adjustments by hand and re-run the Optimizer until the image is properly centers left to right, and the horizon lines up with the center of the preview like this.

Make sure to setup the correct projection as well. In this case Cylindrical provided the desired result.
Hugin Step 5 : Do the Final Stitching.

First click on Calculate Optimal Size to get the proper image size. Which is this case will result in a 49 mega-pixel image. Then choose the interpolator (i) option. Spline 64 tends to give very good results, while the sinc options are mathematically better, they suffer from artifacting when sharpening in post processing. Make sure gamma (g) is set to 1.00 (for Linear) or matches what is set as the colorspace in the TIFF files when blending using the batch script! Output format should be TIFF with Soft Blending enabled. When finished, make sure to save the project (in a PTO file) in case Hugin crashes, and click the Stitch now! button to begin stitching. Go take an hour break while everything crunches away.
Hugin Trouble Shooting : Images are too dark to work with.
Depending on image type or monitor settings, sometimes the image may appear too dark in Hugin to work with when setting control points. A work around for this problem is to re-run the batch script on the original DNG files with Gamma=3.0 instead of Linear, then setup the controls points in Hugin, then re-run the batch script with the correct settings for stitching (use Linear now), and then do the final stitching in Hugin.

Note that the batch script will not overwrite the -N negative files, so they must be removed before running.
This ugly workaround saves the -N negative files in a non-linear colorspace which will tend to display brighter in Hugin, which will aid by making it easier to setup control points. Optionally, one could skip the re-blending into Linear step, and simply set the gamma (g) to 3.00 in the Stitching Options in Hugin. Then later after loading the final stitched image into Photoshop, convert it back to Linear using the red ProPhotoRGB-Linear action button and save the file. However this will result in a slightly lower quality stitched image.
Step 5 : Handling Stitching Blending Problems
For most photographers, this isn't going to be a problem so feel free to skip along to step 6. As was mentioned at the beginning of the page, this is a worst case situation: the scene is just too dynamic (changing light) and the stitching program simply couldn't figure out how to properly blend between the images, resulting in the following.

This is about the point where after tons of work, you will probably note that the only ideal automatic method to build super high quality stitched images under tough conditions is to hire a really good assistant!
Manual Blending
Not only does Hugin generate the final stitched image, but it also generates images of all the source photos alone as they appear in the final stitched image but before blending. Thankfully, manually blending between these images and doing some exposure matching by hand can be used to correct the problem of the stitching software messing up the blends.
There are many ways to do this. I am going to only very briefly touch on the method I use here. Feel free to email me at with questions. Start with the source image which represents the brightest part of the stitched image (which in this case is the right most image). Then start blending in each of the adjacent images until finished. To blend in the other images, I load the new image (the image to blend into the group of currently stitched images) on the bottom. Then add a Levels Adjustment Layer attached to this bottom image as Clipping Mask (I will use this later to adjust and match exposure). Then above this is the stitched image set to Difference as the blending mode, with an extra Levels Adjustment Layer on top of this to amplify the difference between the layers.
With this messy construct setup, I can match exposure by adjusting the Output White Level in Levels Adjustment Layer which is attached to the new image as a Clipping Mask. Basically play with the white point until the difference on the screen is as minimal (dark) as possible. This process can be see below.

Once this is finished, I go back and draw a gradient in the Layer Mask to smoothly blend in the new image. Then re-order the layers so the new image (with it's corresponding Layer Mask and Levels Adjustment Layer Clipping Mask) is on top of the stitched image, and set the stitched image to Normal blending mode (was Difference before). Then merge these layers together.

Now repeat this process for the rest of the images, until a final manually blended stitched image is created.
Step 6 : Build a Smaller Image to use in Development
At this point stitching is finished, and the result is a undeveloped extended dynamic range stitched negative. Developing this 49 mega-pixel file in Photoshop at its full size would take forever, as each layer would use about 392 MB of memory.

The solution is to instead develop a smaller screen sized image using Adjustment Layers and then use the batch script to apply those Adjustment Layers to the full size stitched negative as a batch process over night or at lunch. The batch script can also be used to generate the smaller development image using the -D option.

Or simply manually shrink the stitched file down to a manageable size, and save with a -D.tif as the end of the filename.
Step 7 : Develop The Smaller Image
Develop the smaller image using Adjustment Layers and the FFDD actions. Make sure NOT to crop the image here, otherwise any Gradients and Layer Masks will not line up in the next step.

For this image I decided to go with strong contrast and a red tinted white point. The knee layer was used to add a film like tone curve to the highlights and to control their overexposure. The shadow/exposure/colortemp is simply a Levels Adjustment Layer which was used to adjust the white point. Two gnd layers were used, the lowest to handle the left to right exposure difference, and the upper one to handle the the difference in exposure of the center with respect to the top and bottom.
Step 8 : Apply Development to Full Size Stitched Negative
Use the batch tool's *-P.tif : Apply quick development to blended negatives option to build the final full size developed file. Look at the batch doc page for information on the required file naming.

And the final full size developed and cropped result.

100% crop (not yet sharpened) in the center where a bird just happened to be still enough for the long exposures.
