Flat stitching for tilt-shift lenses
In the large format world with technical view cameras it is quite common to have lenses with large image circles (much larger than the sensor) and shift the digital back and then stitch together 2-3 images to a larger image. The lens is held still, so what you do is to simulate a larger sensor size than you have.
For 35mm there are special tilt-shift lenses so you can work with the same methods as with a technical view camera. Canon have the TS-E 24, 45 and 90 mm, and Nikon their PC-E 24, 45 and 85mm. There are also third-party lenses available. For this flat-stitching method it is the shift function of the lens that is relevant, not tilt. Most lenses that provides shift can also do tilt though and if the scene requires a tilted focal plane, you can indeed employ tilt too.
The advantage of flat-stitching instead of having a panorama head and turning the camera and make a rectinear projection is that you have the projection directly in the lens so you don't need to stretch any pixels, so resolution becomes a bit better, despite corner resolution of the lens is a bit lower. In practice it is more a matter of taste though, some just prefer flat-stitching.
Unfortunately the 35mm shift lenses rarely have tripod collars, meaning that the camera body rather than the lens is attached to the tripod. To avoid parallax errors you thus need to have a rail on the camera to compensate for the lens shift, i e when shifting the lens X mm to the right you shift the camera X mm to the left so the lens effectively stands still. Some panorama heads happens allow that type of shifting. Using a focus rail is another option. For indoor scenes with objects within a few meters the parallax error will surely be noticed in stitching, so you need to make sure the lens does not move.
Theoretically you would not need to use Hugin for this type of stitching, since the lens stands still and the sensor is just moved around inside the image circle there would be perfect fit and no stretching needed so you just need to lay them together in any photo editor. However, in practice there is usually minor precision errors. When adjusting shift between shots, especially if you need to adjust both lens and camera body as for 35mm, there is usually some slight errors making it hard to fit manually.
Thus it is nice to be able to use Hugin. Here's how:
- Take the photos, usually 2 or 3. Assuming RAW format.
- Develop to 16 bit tiff, using for example RawTherapee
- Make sure exposure is exactly the same for all images.
- If you need to use highlight reconstruction which may alter exposure, compensate by lowering exposure slider somewhat so that no value reach maximum (255/65535) but is as close as possible to it, to make sure exposure is exactly the same for all images.
- Make minimal conversion, no sharpening curves etc, leave the final conversion to after stitching.
- Make the panorama in Hugin
- Load images
- Anchor middle image for position (exposure not important, we're not going to use it)
- Make control points, 3 per image is enough
- Manual control points are often safer and better than automatic, and you don't need many so it's a quick thing to do
- Go to optimizer, and do custom optimization:
- First X parameter for all but the anchor image, optimize
- Then add also Y paramater all but anchor, optimize
- Then finally also yaw, roll, pitch for all images but anchor, optimize
- The end result should be very small error, typically less than 0.1 pixels.
- We do no view, barrel or distortion correction, it would make no sense since the images are from different overlapping positions inside the same image circle of the lens which has not moved between shots.
- Skip exposure correction
- That is why we had to be careful to get exactly the same exposure from the raw developer
- The reason we skip exposure optimization is due to the strange vingetting offset etc you get when you shift the lens, Hugin is not designed for compensating shifted lenses.
- Stitch to desired output, preferably 16 bit tiff
- Open final tiff image in raw developer and do final color correction, curves, sharpening, vignetting/lens correction etc.