Correcting Color Separation in Scanning Back Cameras
Helmut Dersch
(der@fh-furtwangen.de)
Technical University Furtwangen
November 24, 1999

This article describes a procedure to correct color separation in certain digital cameras using a scanning back (Phase one) like the well known PanoScan. This color separation is due to the varying angle of the light rays that hit the line scanner. In the center, the three color channels rgb coincide, whereas at the top and bottom the red and blue channels get shifted by a couple of pixels horizontally, see diagram below. An example image is shown in the next image, left part. This is a 220 pixel portion of a 5594 pixel high scan extracted from the lower edge of the image. Correction is accomplished by shifting the color channels horizontally against each other. Panorama Tools (1.9.2 or newer) provides a facility to enter arbitrary horizontal shifts. This shift is accessible in the 'Correct' submenu, option 'Radial Shift'. The button 'options' opens the dialog window below, which is used to provide the necessary parameters. In this case (Nikon 16mm fisheye on PanoScan) we use b = 0.0049 (red), b = 0 (green), b = - 0.0044 (blue). Note that the numeric values are partially hidden in the screen shot. Clicking 'ok' initiates the transformation which results in the right image above. To determine suitable values check the formula in the diagram above. In the current example a quadratic correction (b) is used. Then I determined the horizontal shift dx between the color channels in the scan, which amounts to roughly -8 pixels for the blue and +9 for the red channel. The vertical pixel coordinate read with the crosshair turns out to be 5058 out of a total image height of 5594 pixels. Calculation of the y-coordinate is complicated since I chose an algorithm that makes the coefficients useable for any scanning resolution. First, determine the distance of the pixel from the center line, which is 5058-(5594/2)=2261. This is the absolute y-coordinate ya. Then determine the relative y-coordinate yr, which is ya devided by half of the height, ie yr=2261/2797=0.808. Then calculate b-values for red and blue using the equation b = dx / (yr*ya). Be sure to enter the correct sign of dx. The y-coordinates, however, are always counted positive in either direction.

This correction perfectly eliminates the error at the point you have used for measuring dx, but might fail on other points. Then you might try linear correction using c = dx / ya or cubic correction using a = dx / (yr * yr * ya). For the current example quadratic correction worked best. If you are adventerous, you might try to mix the three correction modes.