Proxel Lens Corrector Photoshop Plugin Help

1. Introduction

This tool corrects lens distortion and sensor misalignment. The distortion is both of the classical polynomial type and for fish eye lenses.

1.1 Lens Correction Files

The tool can use camera/lens description files (*.lcf) generated by the Proxel Lens Analyzer tool.

1.2 Invocation of the Plugin

The plugin is started from the "File→Automate→Lens Corrector" menu.

2. Parameters

2.1 Parameter Coordinate System

All parameters use the same coordinate system. We assume that the original image is taken with the camera in the normal position, i.e. landscape mode and not upside-down. We use half the width as unit distance and the center of the image as origin.

2.2 Distortion and Fish Eye

2.2.1 Polynomial Distortion

The distortion for lenses are normally modelled as a polynomial, i.e:
rimage = rorig1 + k1 * rorig3 + k2 * rorig5.

Positive k1 and k2 correct pincushion distortion.

Negative values correct barrel distortion.

NOTE – that large negative values do not generally correspond to any real lens distortion. It will eventually curve down again and create inverted images and other strange effects.

2.2.2 Fish Eye Distortion

Fish eye lenses are described by this formula:
rimage = fish_r * 2.0 / PI * atan((rorig / fish_r) * (PI / 2.0)).

The fish_r parameter is the radius at the sensor for a 180 degree fish eye image.

Note that when parts outside the 180 degree circle are found on the sensor, the corrected image is really infinitely large. This is not possible – more about this in section "Limit on Image" below.

2.3 Translation

If the sensor is not perfectly centered to the lens, the image might need to be translated before applying corrections.

NOTE – to be able to detect translation, the distortion needs to be large, e.g. a fish eye lens, or the translation needs to be large, e.g. a shift lens. On the other hand – translation that cannot be detected does not affect the image visibly, so it does not matter. Therefore – for normal lenses, translation is best kept to 0.

3. Scaling of Canvas and Image

Normally the corrected image does not fit to the original canvas. The tool has two methods for correcting this – canvas expansion and scaling.

3.1 Automatic Canvas Size

It is advisable to use one of the two automatic modes for canvas size, i.e. "outer" and "inner". You will probably use the "inner" mode – and this is the default mode.

The "inner" mode finds the largest canvas rectangle that contains no parts outside the image. The "outer" mode finds the smallest rectangle that contains the entire original image.

NOTE – For extreme values on parameters the "inner" and "outer" definitions might get rather complicated. The entire original image might not be possible to draw on the output. Some parts of the image might even be inverted. Inverted parts are defined as being outside the image.

NOTE – the computed expansions are shown in the four custom fields after doing a preview. Expansions might be negative. Expansions might also be strange, i.e. left=10000, right=-9000. This means that the canvas is moved in the coordinate system. This can only be the case for extreme parameters.

NOTE – you can also see the actual size of the resulting image.

3.2 Manual Canvas Size

It is also possible to set the canvas size manually. Either you can set it to no expansion or you can set the expansion to custom values.

NOTE – that the custom values are zapped each time you use any other setting and do a preview.

3.3 Limit on Automatic Canvas Size

Doing canvas size changes are generally dangerous – as the canvas can get very large. To protect against this there is a limit on the canvas size. The size fields will turn red when you have exceeded the maximum allowed limit.

See also "Scale Image" below.

3.4 Scale Image

You can also set the scaling of the image. This feature is mainly used when the canvas expansion above results in a too large image.

NOTE – To ensure optimal quality of the image, it is advisable to keep the image scaling parameter to 1.0. The center of the image will thus not be scaled and and no information will be lost there.

4. Project File and EXIF

4.1 Getting EXIF Info

When reading an image Photoshop also reads a copy of the meta information (a.k.a. as EXIF info). This tool extracts what camera has been used and also what focal length has been used, if possible. The focal length is used when loading parameters from the project file.

NOTE – currently no lens information for cameras with interchangeable lenses is extracted. This is due to the fact that no standardization of that information exists. In many cases you can extract that info with the Proxel EXIF Tool though (http://www.proxel.se/exif.html).

4.2 Setting Focal Length Manually

If no valid focal length could be found, you can set the focal length manually.

NOTE – for fixed focal length lenses you don't need to set the focal length. This value is only used to interpolate the parameters for the focal length you have used.

4.3 Setting the Project File Name

You can set the project file name, i.e. the file that describes the camera (plus lens if you have a camera with interchangeable lenses).

NOTE – this does not actually load the file.

4.4 Loading Parameters from Project File

If the lens is fixed focal length the parameters are loaded directly from the project file.

If the lens is a zoom lens, you need a focal length (either from EXIF or manually) to interpolate the parameters from the measured parameters in the project file.

5. Interpolation Method

You can choose between several interpolation methods. In practice you can use bicubic for most work - it is fast and good. If you have higher demands you can use sinc8x8 or sinc16x16. They are slower though. The mode sinc32x32 is very slow and you have to make tests to determine if you find any improvements over sinc16x16.

6. Preview

The preview window can either show the original or the corrected image. In the "corrected" mode, the preview is automatically updated whenever you change any settings.

7. Detection of Camera Orientation

The tool assumes that you have analyzed the image in landscape mode. So – if the image is in portrait mode – the camera is assumed to have been rotated counterclockwise 90 degrees.

A button containing a camera icon shows the assumption that the plugin has made. You can flip the orientation by pushing the button.

NOTE – it is only necessary to flip the orientation if the parameters for translation (xc and yc) are non zero.

8. Lens Analyzer

The project files are simple text files. They are made by the Proxel Lens Analyzer tool. This tool uses straight lines and advanced detection and optimization to detect lens distortion. This tool is a part of the same package as the Lens Corrector Photoshop plugin.

9. Registration

The demo of the Proxel Lens Corrector Photoshop plugin is fully functional, except watermarking of the result. You need to register the product to remove this watermarking. A registration key can be bought from Proxel Software HB. Please visit http://www.proxel.se/ for further information.

To register the product you need to run Photoshop with administrator rights, load an image, start the tool, enter the registration dialog and insert the key. If the OK button and the key text field in the registration dialog are active (non grayed) you have administrator rights.