Tuesday 26 April 2011

stich n shift

To shift the lens (and thus distort the image) or use a distorted image ... that is the question ;-)

Panorama can be a useful tool to help you make your lens wider than it is. Its often a handy tool in the arsenal of the interior and landscape photographer. As photographers learn more about their tools (often by reading on bulletin boards or magazines rather than books and by doing) they come across the concept of a shift lens.

Canon (for instance) make such a tool in the TS-E series.

This is my TS-E 24, or was rather as I've sold it a while ago.

The TS-E lens are lenses which can tilt and shift. This article will focus on the shift aspect and perhaps explain why I no longer have the above (often coveted) tilt shift lens.

The reason you want to "shift" a lens in the first place is to account for perspective changes which occur more obviously with wide angle lenses when you look up or down.

Shifting the lens causes the image to be projected onto the film (or sensor in digital cameras) in a trapezoid shape and bring together lines which your brain knows to be parallel but which the camera makes into a distorted shape by looking up. Try reading this for a more complete explanation.

This can also be corrected for in software, after taking the picture. For example this shot was taken with 2 images stiched together and corrected for in photomatix. I used a 9mm lens on my 4/3 camera (which by itself is about equal to an 18 or 21mm lens on a full frame 35mm camera.

overview

clearly each section is quite wide, but I wanted wider, so I took 2 images (well 3 really but I was too lazy to show the middle one in this exersize).

perhaps this image shows more obviously how each section is altered ... here I have not yet tilted up so the view is still looking down at the altar more.

pano-layers

You can see that the outsides of the image are unscaled and the image scales towards the center thus reducing the amount of losses. Of course one could try to work in such a way as to force the software to make the sides longer, but that would be counter productive. Perhaps I should do a blog post on pano techniques?

So, lets look at an uncorrected version of the image ...

left

you can see that the software has not only joined them together for me, but looking at the curved edges in the above stitch example has also corrected for some pincushion distortion that the lens has (as well as the perspective fixing). This left me with an image which I can crop out and get essentially the view of something more like a 7mm lens without having to have such a creature.

The image of course has to be distorted for this and some will argue to you that there will be some losses. Here is the 100% pixel crops from the upper left of the image there

left-vs-right

so clearly it has been stretched and elongated during this process, but its nothing horrific. Also, recall that if that distortion did not happen somewhere (software post, or lens pre) you would not get the perspective correction.

Its important to point out here that this is exactly what a shifting process does ... stretch and elongate the image by projecting it from an angle. From the wikipedia article above:

when just angling the camera back:


the image is cast onto the sensor / film but is distorted according to our sence of correctness.

When shifting the lens


the image is distorted; note the angles of light are no longer symmetrical entering the camera and falling on the sensor.

One can do this in software by calculation of where the pixels should go, or you can do it in hardware by using a lens to throw the angles differently onto the sensor. Its really all the same and the same losses due to inaccuracy happen in the system (well more or less, optical losses will be different ones to those in calculations).

So, do you remember Polar to rectangular conversion from maths in school? Well assuming you have a triangle like this:


recall you can calculate the length of r if you know the length of X and the angle theta. Alternatively you can measure r and theta if you know the lengths of X and Y.

Its all the same, but the accuracy depends on the tools you have to use.

The difference in the picture is comes down to which is more accurate: the lens or the software?

So, getting back to the question above which is better? Shift or Stitch?


Its reasonably well known that most wide angle lenses get softer towards the edge, so by using the middle of the lens you are starting with a clearer picture and therefore more accurate data to calculate with. Clearly if you were to stitch you would have more pixels to start working with (the combination of two 4000 wide images into one that is say 6000) and thus after stretching into shape you can shrink back to 4000 wide and thus clear up any distortions.

To get the same in stitching as a shot from a wide angle I'll typically use 3 overlapping portrait images to make a landscape, or a stack of 3 landscapes to equal a portrait. You'll need an expensive and well made ultra wide to equal an image from a number of stitched wide or normal lens images. Even then if you're stitching more than 3 images together you'll never match it with a shift lens even going up double the capture area (meaning going from 4/3 to full frame).

but what about stitched shifted images


This is an interesting point, and the one which prompted me to blog about this.

It would seem that if you stitched shifted images together that you'd have the best of both worlds. But its not as it may seem. Recall from the above discussion that as you shift you not only move the lens to correct for perspective, but you move out into the edges of the lens which are not as sharp and perfect as the center. I know that when I shift my TS-E 24 that the image is corrected for, by experience has shown me that it is far less sharp then when it is not shifted.

So by using the lens shifted to capture a mosaic of images to stitch together I may make it easier to stitch together (come on, who does this by hand anyway?) but because your outer images are of lower optical quality you actually make the edges of the image worse than if I had used the lens fixed in its sweet spot and just allowed the software to scale it for your.

So why shift?

Well firstly shift lenses were made back in a time when we did not have software to correct images. They are also based on the fact that we moved away from flexible view cameras to fixed and rigid cameras. On a view camera you don't even consider the concept of a shift lens as all lenses will shift with the front standard. Like this one:



Which is what I do these days if I need movements.

The remaining benefit (more so today) of the shift lens is being able to work with a single capture, for those times when (say due to movement) you can't take 2 images and stitch ... because the subject moves. So now no longer need to shift lenses on my digital and if I need to make a single take I'll use my large format film: where having a single shot is often enough.



where I can scan the 5 inch sheet and get 11,000 good pixels from a simple flatbed or more from a drum scan. Of course in that above image some shift was applied, but being a 'normal' its of marginal benefits. Tilt on the other hand is quite important in the above image.

So while I'm not interested in shifting anymore, I am inclined to tilt ... where I can get stuff like this from a 6x12 (notice the relationships of foreground mid ground and back ground with respect to focus and blur ... try that without tilt!!)

and hopefully equally interesting stuff from the 4/3 too, as I have a Tilt adaptor on the way for my Oly lenses expect to see something on the benefits of Tilt on micro 4/3 soon :-)

2 comments:

Lens Bubble said...

I have always wanted to try the T/S lenses, but thought that they were too specialized. I did use a T/S 24mm once, and it was a very sharp lens wide open, probably because the optical imaging circle is much larger than normal lens. I am interested to hear your experience on your Tilt adapter.

obakesan said...

you know, if I was using a 5D or other full frame camera I'd never have sold the TS-E's, but as I was using APS (and now 4/3) they just no longer made sence.

If I go back to full frame I'll pick them up again, but for now I keep using 4x5 or 6x12 when I want something more than 4/3 :-)