Astrofriend's homepage
Share: Twitter Reddit Facebook Gmail Gmail Email
Search Astrofriend's homepage:

Valid CSS!

All pages shall now have been validated

Info Cookies (Kakor) / GDPR


Advertisement /

Twitter @AstrofriendLars

Follow Astrofriend

Travel News

Advertisement / Annons:

Tutorial AstroImageJ:
Transform from nonlinear to linear


  1. Introduction, transformation from nonlinear to linear
  2. Test patterns

I take no responsibility or liability for what are written here, you use the information at your own risk!

2, Test patterns

Long time ago since I looked at this.

Star pattern, 3x3 mosaic:

What I do here is to find my optics distortion. To examine that I need some sort of test pattern. In the introduction I mentioned the plugin Distortion correction. That plugin use a 3x3 mosaic with 50% overlap as reference.

When in learning process and testing it's easier to have some more control. I did a random picture of stars. There are also nine ref points in the image. That's where the camera lens' optical axis shall point and with the edges just reach the surrounding reference points. Then you get nine photos in a 3x3 mosaic with 50% overlap.

star pattern

The green dots is the random stars. The black numbered rings is the centers for each sub photo. If you find the test pattern useful you can download it at the bottom of this page.

star pattern

Camera setup, note: this is not at infinity distance and then the distortion is somewhat different. It's very important to have the cameras optical axis exact orthogonal (90 degree) against the test pattern.

star pattern

I set a mark where the center point no 5 is and adjust the camera orientation and exposure after this.

star pattern

Because it's complicated to move the camera without tilt it I instead move the test pattern. Here the pattern is moved to have point no 4 at the optical axis.

star pattern

First photo centered at point no 1. I inverted the photo before to make it have a more star look. Better test then if the software can recognize the "stars".

star pattern

Second photo centered at point no 2. Then I continue until I have all the nine photos in the 3x3 mosaic.

star pattern

I had problems to get the Distortion correction plugin to work, instead I used the Hugin software which is free to download. It's clear that the optics had a barrel distortion before it was corrected. Now when I have done this I can from Hugin get the distortion parameters.

star pattern

If I interpreted the parameters correct it's maybe like this:

Distortion correction equations
r' = 0 + a*r + b*r2 + c*r3 third degree polynomial simple distortion

If I'm correct the Distortion correction plugin to ImageJ only have two parameters, K1 and K2, corresponding to the r2 and r4 term. After reading at the Wikipedia page from the link (see page 1) I now know the distortion are most from quadratic distortion, degree 2 and 4.

These are radial symmetric corrections, it don't correct for atmosphere distortion if this is nonlinear (at very wide field).

Diagonal pattern:

This was very time consuming to do, I later found an alternative way to do it.

If I adapt this to a more astronomical view. I get this test pattern based on above ideas to use with Hugin software.

star pattern

The diagonal test pattern I have self made. Each line should start and end at a to a', b to b' and so on.

star pattern

One big advance, I only need one test image. But there are no lines in the sky, maybe a faraway rectangular building could be used in real calibration later.

star pattern

Something went wrong, the correction parameters are too big and do over corrections.

star pattern

From Hugin I get the values of the parameters, I also got a warning that they were to big.

Comparing the results:

To get it more visual I have put the parameters in a table.

Distortion correction parameters
parameter Star pattern Diagonal pattern
a (r)= -0.006 -0.2
b (r2)= 0.015 0.86
c (r3)= -0.013 -1.02

At the moment I'm not sure why I got this different results. All images are from raw format and then converted to 16 bit TIFF format which Hugin can work with.

Now I have a lot of things to think about. At least I got my lens distortion parameters, now I need them for infinity distance.

There is one thing more. These corrections include that the optical distortion center is at center of the sensor. If it not the case a more correct equation shall be more like this:

Distortion correction equations with correction for optical center
x0, y0 = coordinates of optical center r = ((x-x0)2 + (y-y0)2)1/2
r' = 0 + a*((x-x0)2 + (y-y0)2)1/2 + b*((x-x0)2 + (y-y0)2)2/2 + c*((x-x0)2 + (y-y0)2)3/2

This was simplified, see the Wikipedia link at page no 1 for the details. If distortion is not rotation symmetric, maybe because of bad aligned optics then this equation doesn't work in this simple form.

Download test patterns (zip file):

Here are my test patterns if you find it interesting, you download them at your own risk. But it's just two jpg files:

Go Back to content

Go Back
Next part: During progress

Advertisement / Annons: