Contents - Previous - Next


Control Points

At least four control points are required for calculating the transformation parameters (called a Homography in the computer vision literature) between two images or an image and a map. Each point in each image is given a unique number, and these must correspond. You may add as many control points as you wish.

How many control points?:

More than four control points may or may not improve the accuracy of the transformation. Small differences in position can't always be seen visually, but they make an enormous difference in the result when there are three control points which almost line up in the source and target images.  That causes mathematical instability, and a single pixel displacement may produce an enormous shift or skew in a transformed image.  That's why some data behaves best when you use only four points, since the line-up problem doesn't exist. However, it is desirable that control points be spaced as widely as possible in the source image.  Always start with only four points and always add only one additional point at a time. Then try the transformation to see if things improve or get worse, and if the latter, either disable or remove the fifth point before adding a sixth one. Stop adding points when there is no visual improvement. It is wrong to think that simply adding more points will somehow make things better.  Depending on the data and the terrain, this may be true, but more frequently it's not the case.  See the Technical notes for more information on the number of control points.

On the main menu, click on Control to show the control point menu:



If you are working with black and white maps or greyscale images, you may prefer to display control points with a green colour that makes them more visible. If so, click on the Green Control Points option for the image which has the focus. You may repeat this for all displayed images if you wish. You may turn it off by clicking again on the menu item.



If you want to number control points manually, click on the manual numbering option. You may also choose green points at the same time. These choices apply only to the image which has the focus. When you re-start AirPhotoSE or open a different image, you must repeat the choice.  When you choose manual numbering, a dialogue box pops up and permits you to choose a number for a point between 1 and 999.  If you choose a number which is already in use, it will be moved to the position chosen or if the position hasn't changed, it will be deleted. Click on OK to enter or delete the point or click Cancel to close the dialogue without adding the new point.

You can hide    or show all previously entered control points by clicking on  or press F4, or click on Hide/Show Control on the menu.

You can load or save control points to files under names which differ from that of the image. The default is to save them as imagename.ctl when an image is closed if they have been modified.  You will be asked if you wish to do this.

You can also delete all control points belonging to the currently active image You will be asked to confirm this after clicking on the toolbit.

You may find it helpful to place a temporary grid on either of two images to aid in placement of control points.



If the image is a calibrated map, the grid will be shown in one of three grid systems as chosen in Setup Options.

The following operations can be performed on control points in one or two images:

Enter or Delete a single control point:

From the Control menu choose:

Enter

The navigation window can be closed (or opened) in all images by pressing F2 or clicking on the Window Menu, Hide/Show Navigator entry.  Hide it when entering control points.

A right-click on the mouse button presents an overview in which a red box can be dragged to navigate to different parts of an image.  A left click repositions the full-resolution image to the chosen place. 

Press Ctrl-E on the keyboard to turn entering on and off, or use the Control menu entry. A red rimmed magnifier appears which can be dragged and centred on a control point.  Clicking the left mouse button adds a numbered control point at that position.  It is marked on the image in either black or white depending on the brightness of the background along with an identification number. 

Zoom into the image with the mouse wheel so that you can see more detail in the magnifier if necessary.  If the image is zoomed to a small scale, positional accuracy will be poor, if the image scale is too large this can cause jagged lines when the intersect tool is used.

Warning:

Turn off the navigation window if the control point entry magnifying window is present, or an unwanted point will be entered. 


Delete

Repeat the above instructions and centre the magnifier cursor over an extant control point.  The point will be deleted when the mouse button is released.



Insert a control point at the intersection of two linear features in an image:

From the Control menu choose:

Intersection

Drag the mouse to draw a red/white blinking line on the image. Release the left button and repeat the operation to draw a second line and to set a control point at the intersection of the two lines.  If the intersection is outside of the image, a square will be drawn along with the identification number at the nearest point on a side of the image in the direction of the intersection.



Move control points:

From the Control menu choose:

Move Point

The cursor changes to a finger pointing upward.  Hold the left mouse button down with the finger at the centre of the control point and drag the control point to a new position.



After moving, press Enter to record the new position. When you have moved one or more control points, press Enter for each one. When finished, uncheck the Move item on the Control menu.

Move a control point a pixel at a time (Tweaking):

From the Control menu choose:

Tweak Point

A light blue rimmed magnifier appears. Drag this to centre it over a control point and release the button.  



The control point colour changes to red. You can now move the control point a pixel at a time with the four arrow keys on the numeric keypad.  The original red marker is retained for reference. 



During the process, a small dialogue box shows the average symmetric reprojection error for all points and the error at each point if you have two images visible with equal numbers of corresponding control points:



The average reprojection error is calculated from the difference in Euclidean distance between the known coordinate of a point in one image compared with it's calculated value on transformation from the corresponding image and the reverse. Averaging is used to compensate partly for differing image sizes.  The average error for all points is shown above the list. Minimising the reprojection error at all points by "tweaking" the position of each point in turn with the arrow keys should always be done for best results before transforming an image.  

When you have reached an optimum whereby the reprojection error increases if you move one pixel up, down, left or right, then press Enter to record the tweaked position.

Global Optimisation:

AirPhoto can search for a position for the selected point which minimises the global reprojection error (not necessarily the minimum reprojection error for the chosen point). This operation should not be applied to a map.

From the Control Menu choose:

Global Optimisation

or   Clicking on this button will activate a Optimisation method which attempts to minimise the global re-projection error for all enabled control points. When the operation completes, you can examine the result in the reprojection error box which is displayed. If it is hidden behind the navigation window, it can be made visible by pressing F2 to close the navigation window. 

If you are working with images and maps, enter the control points as accurately as you can for both before applying tweaking to the image. In most cases, it is not helpful to apply tweaking to the map, since this will displace the points slightly from the positions you have chosen. Make sure that the window with the image rather than that which has the map has the focus before selecting this operation. Repeated applications of global tweaking may reduce the error slightly, but after that it will only fluctuate slightly around the value obtained the first time.  

Note:

The reprojection error box can be shown or hidden at any time by pressing shift-F9 even if no "tweaking" has been done.  

Warning:

Apply Global Optimisation only after all manual Optimisation and placement of control points has produced a nearly satisfactory transformation.


Press Enter on the keyboard, and the control point is moved to the new position selected with the arrow keys or determined via auto-tweaking and the red marker is turned off.

Disable a control point or a control point pair:

From the Control menu choose:

Disable Point

A blue rimmed magnifier appears and when placed over a control point and the button released, the control point is disabled and changes its colour to blue. If a corresponding control point in another image exists, it too will be disabled.  Repeat the operation to re-enable disabled control points. Disabled control points are not deleted. They are simply not used. Disabling a point pair enables you to see how this affects a later transformation or prediction of a new control point.



Enable all control points in an image

If you have disabled a number of control points in an image, you can re-enable all of them with a single click on:

Enable All Points

Please note that this does not affect disabled control points in any other image unlike disabling a control point which disables the corresponding point in another visible image. If you want to re-enable all points in a second image, click on it to give it the focus and click the menu option again or hold down the Ctrl key and press A.

Enter a pair of control points simultaneously in an image pair:

From the Control menu choose:

Pairwise Enter Points

If two images  with at least 4 control points each are already loaded and comparable areas displayed, then two magnifiers appear, one cyan rimmed, the other magenta rimmed. The cyan rimmed magnifier tracks the mouse when it is dragged. Releasing the right button enters two control points simultaneously in both images. If the cyan magnifier is held on a control point which has a corresponding point in the other image and the button released, both control points will be deleted.  Corresponding areas in both images should be visible when using this technique, but off-image control points can be added, leaving a little square mark at the image border to remind you that it is there. 



If the position of the control point entered by the magenta magnifier isn't perfect, refine it using the control point "tweaking" operation described above. The method used for control point prediction is only approximate. It's precision increases with the number of entered control point pairs, but it is not perfect. If control points have been tweaked before using this option, results are usually quite close to optimal, but post-tweaking is advisable in most cases.  Please note that this action has no "Hot Key" to turn it off, since it can't be applied simultaneously to two images.

Debugging control point placement for transformation:

If you experience difficulty in the placement and appearance of a transformed image, you can check changes rapidly without actually transforming by clicking on the Debug option on the Control menu:

Debug Only

When this option is checked, follow it with the Transform option, and the programme will display the area covered by the transformed data thusly:



Make changes in control point placement and repeat this operation until a satisfactory position is obtained, then uncheck the Debug option and carry out the transformation normally.