Example of CA correction for a nikon fc-e9 fisheye converterSome lenses are affected with chromatic aberration. For an explanation see: http://www.free-definition.com/Chromatic-aberration.html or: http://www.canon.com/bctv/faq/chrab.html and there are many more. The prismatic behaviour of a lens increases towards the edges, that can be seen in a fisheye lens or converter. A large amount can be corrected by software and Erik Krause and Jim Watters described this already i.e. Determination of chromatic aberration correction parameters and: Correcting Chromatic Aberration with PanoTools Radial Shift Here an example is described for lowering the CA (lateral) of a Nikon fc-e9 converter lens, corrected with ptools. Test image
(left) This image was shot at morning, sun behind; the floors of the building are relative light and have the proper dimensions to observe chromatic aberration. Preparation and Calculations
It is advisible to check if the image area of the fish-eye (circle or part of circle) is in the center of the total image. I had to move it 18 px up by panotools: correction/vertical shift/optons Red 18, green 18 and blue 18.
The calculation process consists of 5 steps:
1. Determine the (vertical) shift
Here are 4 horizontal lines that cross the vertical one. These 4 points will be used for calculating.I start at the first floor with a pixel hight (radius) of 576 pixels. The detail at right shows that this floor suffers from a red fringe above and a blue fringe below. My first rough guess is to shift the red channel 2 pixels . therefore I use the commands: Panorama tools/crrect/vertical shift/ option/red -2. After some trials I decide that -1.2 pixels is the best result. I go on the same way for blue and end with +1. The green channel doesn't need to be changed.
<------- These windows show the vertical correction with panotools. The result is at right.Up direction has a + sign and down direction has a - sign 2. List of (vertical) shift vs radiusMy list:
3. calculate the relative radius r / r_unity
At left is a scheme of the image. Inside the large circle and the border of the image is the area that contains usable image. Outside is the rest of the image that is close to black due to the fact that a fisheye lens is used. Of course you can use all here for a non fisheye lens, but then r_max=r_unity.In order to let ptools calculate a corrected radius, a radius measured in pixels has to be converted in a relative one (denoted by r_dest). A relative radius is nothing else then a dimension-less value between a minimum and a maximum value. Here we choose:( for accuray reasons) r_dest =r / r_unity (see figure left). It is easy to see that when r is in the center of the image rdest=0 /r_unity = 0 and at the the large circle rdest= r_src = runity / r_unity = 1. For highest accuracy we like to use a polynome of 4th order to calculate a shifted radius for CA correction , so we have to fill in all constants a,b,c and d. As explained before in case of r_dest = r_unity = r_src the value of r_dest and r_src=1 . Fill in these values and it says: 1= a*1^4 + b*1^3 + c*1^2 + d*1. That is the case when a + b + c + d = 1. 4. computation of the constants a,b,c and d
Computation is done by displaying a graph of corrected radius (r_src) vs. r_dest in an excel sheet and after that insert a trendline.At left is the first part of creating a graph. (BTW this is only an example. How the two columns are obtained can be seen in this CA sheet.) In the r_dest list are 7 extra points added that don't need any correction. These are the first 6 points and the last. This is done to prevent the trendline to become unsteady in the more center part of the image. Because the r_unity is is smaller than the r_max the list goes till 1.49. If you are not familiar with excel to get a graph look at this excel help
Here the trendline is added. I choose a 4th order polynome and formatted the trendline so, that the numbers are displayed as accurate as needed and that the R2 is displayed. If this value is close to 1 you have a very good ”fit” of the polynome.
Some important remarks The heart of this computation is very simple:For each r_dest a slightly altered r_scr is calculated for some colour. The formula for the altered r_src is: r_scr= (r - shift_) / r_dest The minus sign is important. Only with a minus sign you get a polynome that corrects in the right direction. To demonstrate this, look at the next two before-after fotos,
A white pixel is added in the upper corner in the ”before” foto (detail) that is split in the three colours in the ”after” foto. There you can see that ”red” is corrected in the down direction and ”blue” in the up direction, just as wanted.
At right the options that are needed for the (excel) insert trendline are switched on. Results:
5. chromatic correction with correction/radial shift of panotools
The following two images demonstrate the correction,
first foto is before, second foto is after correction the original fotos ( not the tifs but compressed and in jpg format for bandwidth purposes) are here before after
(left) Because in this example I choosed to correct a point on the outer circle (r_unity), the sum of a+b+c+d is slightly unequal of 1. If you observe carefully you will see a very small coloured line at each side of the flattened fisheye area after correction. In this case this are 3 pixels each. this can easily be cropped, but take care that each image is cropped in the same manner, to avoid stitching problems. If not corrected it can appear as a coloured haze after an enblend action.
e-mail: Wil Brugman
|