ManualImageSolver


Script for solving the coordinates of an astronomical image using control points defined by the user. [more]

Keywords: coordinates, annotation

Contents

[hide]

Introduction

The objective of ManualImageSolver is to solve the coordinates of images that ImageSolver can not solve. The script ImageSolver is able to find the coordinates of an astronomical image without more user interaction than a few starting parameters (approximate image center and resolution). The coordinates solution is stored in the image in keywords using the WCS convention [1] [2].

ImageSolver works well with clean images of medium/high resolution. However images with too much noise or a wide field are much harder to solve and sometimes ImageSolver can not do it.

ManualImageSolver is able to find the coordinates of astronomical images that can not be solved by ImageSolver. This script uses a group of control points defined by the user that match points in the image that is being solved (Target image) with the corresponding point in an image with known coordinates (Reference image). Given enough control points the script can determine the coordinates of the image with quite good precision. This script can support images with strong distortions.

Usage

This script is used in three steps:

Reference image

ManualImageSolver requires a reference image that covers completely the target image. This image should be of good quality, it must have enough stars in the whole area of the target image and it must have a high quality coordinates solution. Although a real image can be used, the best results are achieved using a synthetic image generated using CatalogStarGenerator. CatalogStarGenerator can easily generate a good quality image of any part of the sky.

These are a few suggestions for generating the reference image:

Control points

The control points are pairs of points in the reference and target images that correspond to the same coordinates, usually the same star. The control points can be defined using the process DynamicAlignment. After opening the reference and target images in PixInsight you have to launch the process DynamicAlignment. The reference image must be selected as "Source" (first) and the target image as the "Target" (second). The process of selecting the control points is this:

The first step (identifying the same star in both images) is perhaps the hardest part of the process. Fortunately, DynamicAlignment can predict the approximate position of the control points in the target image after the two or three first control points have been set. Because of this, only the two first points are really difficult to match in both images. After them, the rest of points can be matched using the prediction of DynamicAlignment and some common sense.

After selecting enough control points you have to save the DynamicAlignment process to a process icon. This is done dragging the triangle at the lower left corner of the interface window to the workspace.

These are a few suggestions for selecting the control points:

Execution of ManualImageSolver

As the final step you have to run the script ManualImageSolver. This script analyzes the control points and the reference image and calculates a solution for the coordinates of the target window.

ManualImageSolver works on the active window in PixInsight. When you run the script it shows its configuration dialog:

Control points icon

This parameter shows a list of the DynamicAlignment icons available in the workspace. You have to select the icon that contains the control points that you want to use for solving the image. This icon can be created using the process explained in the section Control points.

Reference image

This parameter shows a list of all the images open in PixInsight that have coordinates defined. You should select the image that was used for creating the control points icon or one with exactly the same geometry.

Polynomial degree

This parameter configures the degree of the polynomials used for defining the solution. When the image has no distortion or you only need an approximate solution you should use a value of one (lineal solution).

Values greater than one can be used when the image has geometric distortions. The best value can be found by trial and error. The script shows in the console several statistics that can help to choose the correct value. The residuals image can be helpful too. For most common optical systems the polynomial degree can be 2 or 3, and very rarely values greater than 5 are advisable.

Generate residuals image

When this option is selected after finding the solution the script generates an image which shows the residuals of the solution. The image shows as green crosses the predicted position of the control points using the calculated solution. Red lines from each control point join the predicted position to the actual position marked by the user.

This image can be used to analyze the errors of the solution. In a good solution all the red lines should be very short (in a perfect solution the lines should have degenerated to points). When there is a control point with misplaced position its red arrow is much longer than the rest of control points. When most red lines are long you should increase the value of the degree of the polynomial.

Show distortion map

When this option is activated the script creates a new window with a representation of the distortions in the image. The new image contains a grid with arrows at the center of each cell. The arrows point to the point where the center of the cells would be located if the image didn't have optical aberrations. Since usually the aberrations are quite small, the arrows are exaggerated ten times.

This option is only enabled when the polynomial degree is greater than one.

Figure 1

Generate distortion model

This option is available when the polynomial degree is greater than one. The script generates a CSV archive with a distortion model that consists in a list of points and their displacement relative to an ideal image with no geometrical optical aberrations. The points used in the model are the control points, so the control points should cover the whole image for best results.

The distortion model is compatible with StarAlignment and ImageSolver.

After running the script, the target image gets its coordinates solution and the console shows the values of this solution. The quality of the solution can be checked analyzing the value of the RMS error reported in the console, analyzing the residuals image and using AnnotationScript for drawing a grid and the position of the stars on the target image.

Advanced tasks

Solution optimization

Since the process of defining the control points for ManualImageSolver is quite slow and tedious, the user usually will not want to define more than 30-40 control points. Although this number is enough for calculating a good solution for most images, the quality of the solution is not comparable to the solutions calculated by ImageSolver which can use several hundreds of samples.

The solutions calculated by ManualImageSolver can be optimized using ImageSolver. Although ImageSolver can not solve many images, when these images are already solved, ImageSolver can be used for further improving the solution.

After solving the image using ManualImageSolver you can run ImageSolver selecting the option "Only apply optimization" which is available at the "Advanced parameters" section. It is important to configure correctly the degree of the polynomials of the solution and the catalog filter in order to extract enough (but not too many) stars.

The possibility of optimizing the solutions using ImageSolver allows to use ManualImageSolver to get an approximate solution using only a few control points and then get a precise solution using ImageSolver.

Manual solving of many images

The process of solving images using ManualImageSolver is quite tedious because the user has to define the control points one by one. When you want to solve many images, this get old fast.

There are several strategies than can be used for accelerating this process. The next sections explain them, from the fastest/easiest to the slowest.

Method 1 - Distortion model

Both ImageSolver and ManualImageSolver can generate distortion models for solved images. The distortion models can be used in ImageSolver for assisting in the process of matching the stars of the image against a catalog. This allows ImageSolver to solve images that it would not be able to solve without a distortion model.

You can use in an image the distortion model generated from another when both have been taken with the same equipment and parameters: same camera, lenses/telescope, focal length and aperture.

When you need to manually solve many images taken with the same optical system, you can use distortion models to speed up the process.

First you have to create the distortion model. The documentation of ImageSolver has a section describing how to generate a distortion model.

When you have a good distortion model, the images can be solved using the following procedure:

There are a few tests that can be done for checking if the solution is correct:

If an image can not be solved using this method you have to use the second method.

Method 2 - Distortion model and a few control points

This method is very similar to the previous one but it needs more work. It requires to get a distortion model the same way as explained in the previous section.

For each image you have to do this:

If the solver finishes without errors you can check the quality of the solution the same way as the previous method (distortion map, residuals image, annotation).

If this method can not still solve any of the images you have to use the next method on them.

Method 3 - Manual solve and optimize

This method consists in calculating a medium precision solution using ManualImageSolver and then optimizing the solution with ImageSolver:

Even if ImageSolver still could not solve the image, the first step (ManualImageSolver) has calculated a solution good enough for most purposes. In this extreme case you should add more control points to ManualImageSolver for improving the solution.

Algorithm

The algorithm of ManualImageSolver is this:

  1. The script reads the control points from the DynamicAlignment icon. For each point it gets the pixel coordinates of the same star in both images.
  2. Using the solution of the reference image it converts for each control point the pixel coordinates to AR/Dec coordinates.
  3. Now for each control point it has the celestial coordinates and the pixel coordinates in the target image.
  4. The script computes an approximation to the celestial coordinates of the center of the image and creates a Gnomonic projection with origin at the center of the image.
  5. Then it projects the celestial coordinates of the control points using the Gnomonic projection to a flat space (we can call it G).
  6. Using a multiple linear regression it calculates the polynomials that transform the pixel coordinates of the control points to G.
  7. The projection and the polynomials define a solution. Since it used an approximation of the celestial coordinates of the center of the image, the solution is not optimal yet.
  8. The solution is refined calculating a new approximation to the center of the image using the new solution. The steps 5-7 are repeated until it converges.

Limitations

ManualImageSolver has the following limitations:

References

[1] E. W. Greisen, M. R. Calabretta (2002) Representations of World Coordinates in FITS, Astronomy & Astrophysics, 395, 1061-1075

[2] M. R. Calabretta, E. W. Greisen (2002) Representations of Celestial Coordinates in FITS, Astronomy & Astrophysics, 395, 1077-1122

Related Tools

DynamicAlignment

Related Scripts

ImageSolver, AnnotateImage, CatalogStarGenerator