Chromatic aberration

From PanoTools.org Wiki
Revision as of 16:54, 3 May 2005 by Erik Krause (talk | contribs) (→‎What it is: fixed link to Paul van Walree)
Jump to navigation Jump to search

Intro

Color fringes can be very annoying, especially in stitched panoramas. Since they often appear nearer to the edges of single images they are near to any seam between two images in the panorama. Even worse, they change color where they cross the seam.

Hence chromatic aberration should be corrected if visible otherwise, at least for full screen or printed panoramas where you allow to zoom in to the native camera resolution. While correction is relatively easy CA can not be automatically determined like f.e. barrel distortion. Only visual judgement can give you enough control of the result. Unfortunately it needs some experience to do this.

What it is

Chromatic aberration is a common lens error visible in images as colored fringes or colored blur along edges. It is caused by a different refractive index of glass for light at different wavelength. There is a nice description with lots of links on Wikipedia.

Another good description is found on Paul van Walree's page.

lCA

Different refractive index means different focal length for a single lens. This would lead to different focal planes for different colors. You would have to focus differently for red, blue or green. This effect is called longitudinal chromatic aberration (lCA). If you have a fringe near the image center that changes color if you defocus slightly, this is most likely longitudinal chromatic aberration. This type can not be corrected by software but it gets less if stopped down.

tCA

When a lens is corrected for longitudinal chromatic aberration, different colors focus more or less in the same point on the optical axis, but they might focus in different distances off axis resulting in images of different size for different colors. This type is called lateral or transverse chromatic aberration (tCA). If you have complementary colored fringes progressively more from the center to the corners, this is most likely transverse chromatic aberration (although there are some exceptions as the example below illustrates). This type can be corrected by software but it does not change by stopping down.

What it is not

Digital photography introduced some new types of color fringes, that are not lens chromatic aberration. They are frequently confused with tCA and unfortunately they occur often mixed with tCA. These effects might be visible as purple or blue fringes and are visible around overexposed areas in most cases.

They might have different causes:

  • By sensor overflow visible as blooming. This blooming often has a purple color because of the bayer pattern of the sensor: If a sensor cell overflows to the neighboring cells all cells are affected the same. There are 50% green but only 25% red and 25% blue sensor cells. Hence blue and red are weighted more resulting in purple fringes around overexposed areas. Since CMOS sensors are not prone to overflow this affects only CCD sensors.
  • By chromatic aberration and other errors in the micro lenses that are in front of the sensor.
  • By reflections between the sensor and the protective glass (that might be coated and hence reflects colored).
  • By interpolation errors or anti moire filters.
  • By partial color saturation: Blue sky f.e. might be clipped to pure white because all color channels are saturated. If there is a blurred dark object in the image the sensors in the blur region receive only part of the light and hence don't saturate. The blur region appears blue. This is the only effect that applies to analog film as well.

How to avoid

LCA can be avoided if shot stopped down. Purple or blue fringes might benefit from stopping down, too. They can be avoided in most cases if you expose for the highlights (i.e. don't overexpose). tCA can only not be avoided if you can use a better lens. Fixed focal length lenses are less prone to tCA than cheap zoom lenses. Converters are often very bad. You can avoid tCA while stitching if you don't use the corners where it is most prominent.

How to distinguish

If you want to correct color fringes by software you need to know which type they are. If all of the following points are met your image most likely contains true tCA:

  • Corners should show most color fringes whereas the center should show none.
  • Color fringes should be not only at the edges of overexposed areas but at lower contrast edges, too.
  • Color fringes should be of complementary color (cyan-red, blue-orange or purple-yellow) on opposite sides of a dark or bright area.
  • Color fringes should be in all corners the same direction pointing out from the center.

Example with true tCA

This image is reduced to 30% but still shows heavy tCA as a result of the usage of a cheap wide angle converter:

CA tCA00.jpg

Here a crop of the upper left corner, enlarged to 200%. To verify this is true tCA you can simply cycle through the color channels (f.e. by pressing Ctrl+1, Ctrl+2 and Ctrl+3 in Photoshop). If the whole image content in areas with more or less neutral colors seems to move this is true tCA:

CA tCA01.jpg CA tCA01.gif

(switch on GIF animation to see the different channels in the right image)

The whole image content seems to move if channels change. This is clearly due to tCA. As you can see, the channels have different sharpness. This is most likely due to longitudinal CA.

For comparison a similar sized and enlarged crop from the center:

CA tCA03.jpg

There are no color fringes in the center. A good indicator of true tCA.

You can try to correct tCA by hand in one corner in Photoshop to see whether it is worth the effort to correct it in total:

  • crop to a corner with visible tCA
  • enlarge by 200% to 400%
  • flatten image if needed.
  • try to nudge the red and the blue channel in order to minimze fringes. To do this, in the channels palette:
    • Click the red channel to make it the active one.
    • Click the small eye symbol of the RGB channel in order to make all colors visible
    • Choose the move tool from the tools palette
    • Nudge the red channel with the arrow keys until the fringes are blue-yellow
    • repeat the same for the blue channel and nudge to optimum
    • repeat for the red channel if there are still red-green fringes

Here is the above example after using this technique.

CA tCA02.jpg

The remaining light blue fringes can not be corrected. They are most likely not lens tCA but an effect as described under What it is not.

Example with no tCA but purple fringes

This image is reduced to 40%. It shows purple fringes but no chromatic aberration:

CA fringes00.jpg

Here the enlargement of the upper left corner and the moving channels:

CA fringes01.jpg CA fringes01.gif

(switch on GIF animation to see the different channels in the right image)

As you can notice, the details on the grey tree don't move at all. It's only the left (outside) side of the overexposed sky areas that changes.


Strange Example

This crop (lower left corner) is from a frequently used combo: Nikon D70 with Nikkor 10.5mm full frame fisheye (image (c) Andrey Ilyin). At the first glance this looks like normal red-cyan tCA. But if you try to correct this one, it will drive you nuts. Have a close look on the moving channels:

CA strange01.jpg CA strange01.gif

(switch on GIF animation to see the different channels in the right image)

As you can see part of the image details move but part doesn't (the blade of grass in the center). If you minimize the fringes there will be new fringes or even double details with different color:

CA strange02.jpg

This weird kind of colored fringes is definitely not lens CA. I can only think of some effects with the microlenses Nikon placed in front of each sensor pixel, but this is wild guess.

How to correct

In many cases it would be enough to adjust the size of the color channels to correct for tCA. However, adjustment has to be possible in sub-pixel steps since with larger steps often one step is either too much or too less.

Easy

The most convenient way to correct tCA is to use a tool like the Adobe Raw Converter or Picture Window Pro offer. You zoom into a corner with good details and use a pair of sliders to adjust the image size for the red channel (red-cyan fringes) and the blue channel (blue-orange fringes - the purple-yellow type is a mixture of red-cyan and blue-orange type). Both ways allow for sub-pixel adjustment.

This technique (including sub pixel adjustment) can be peformed by hand with any image editor that can make size adjustments to single channels. If the step size is too large, the image can be upsampled prior to correction.

However, if you use one of those easy approaches look closely at different areas of the image - especially different distances from the image center. It could well be that correction in one area causes fringes in another one. If this is the case tCA in this image doesn't follow an easy linear scheme and hence can't be corrected this way.

Precise

Panorama tools Radial Shift filter allows for separate correction of red, green and blue channel using a third degree polinomial. This kind of curve should be complex enough to correct for any kind of non-linear tCA.

Unfortunately it was very difficult to estimate the correct values. until in the year 2004 Jim Watters and Erik Krause found a way how to determine suitable correction coefficients using different calculation approaches.

Based on this work Eric Gerds developped a Photoshop CS Javascript called PTShift that allows for manual correction in different areas and passes the found deviations as virtual control points to PTOptimizer in order to calculate correction coefficients.

Erik Krause 17:18, 2 May 2005 (EDT)