Coordinate Systems


Contents Summary

Detailed Contents
1. Introduction
2. Starting DigImage
3. Basic Operation
4. Sample Session
5. Command Files
6. Movies
7. Coordinate Systems
8. Warnings, Errors and Crashes
9. Utilities
10. Macros
11. Other Considerations
12. Updates
Appendix A: Menus
Index


7 Coordinate Systems

7.1 WORLD COORDINATE SYSTEM

A crucial component of any measurement system is the ability to make the measurements against some standard reference. For distances etc. the use of pixels may be satisfactory in some circumstances, but more normally the pixel system should be related to the real world coordinates of the process being imaged. To facilitate this process, DigImage has built in coordinate mapping procedures, enabling direct access to the world coordinates once the system has been specified using the [;PW: Coordinate System Mapping] menu:

        Coordinate System Mappings
D  Display world coordinate mapping
I  Initialise world coordinate mapping
L  Locate world coordinate points
M: Mapping function
R  Restore world coordinate mapping
S  Save world coordinate mapping

f1 Help shift_f1 General help
Q  Return to parent menu
->

The world coordinate system is set up by the following process: first initialise the reference point system using [I Initialise world coordinate mapping]. This deletes any current world coordinate system from DigImage. Points used in determining the mapping for the new coordinate system may then be specified using [L Locate world coordinate points] as follows:

->L
Locate world reference points on which buffer ?
=>

Select a buffer in which you have previously stored an image for which the real world coordinates are known at a number of points. A convenient method is to temporarily locate a grid of lines in the experimental apparatus. Such a grid may be of lines engraved or scribed on a sheet of Perspex which may be illuminated either in the same plane as the Perspex by a sheet of light (in which case the Perspex acts as a light guide with the scribed lines scattering the light), or normal to the Perspex. Suppose such an image is in buffer 1.

=>1
        Cursor Positioning: Locate world reference point
 arrow keys and numeric pad     page up/down home/end
 delete: Move to initial position       5  Move to centre of buffer
C  Condense buffer       E  Enlarge buffer
S  Toggle speed  M  Set cursor coordinates manlly
T  Toggle cursor on/off  V  Enable mouse <=> no VTR ctrl

P  Maintain present zoom and exit        Q  Restore previous zoom and exit
R  Reset to no zoom and exit     H  Help on cursor
->

The DigImage cursor is used to locate the world reference points. Use the cursor keys and or numeric key pad to move the cursor to one of the known points. [S Toggle speed] may be used to toggle between steps of 1 and 16 pixels at a time. [E Enlarge buffer] magnifies the image by a factor of two (up to a factor of eight), keeping the cursor near the centre of the display, while [C Condense buffer] reverses the process. Note that the cross-hairs (generated by the frame grabber hardware) are two pixels wide in the absence of magnification (this is necessary to prevent the flicker which would occur if they were displayed on only one of the two video fields). Once you have located the point, exit the Cursor Positioning submenu using either [P Maintain present zoom and exit], [Q Restore previous zoom and exit] or [R Reset to no zoom and exit]. If a mouse is fitted, then this may be used to reposition the cursor (unless the computer is currently monitoring the VTR). For more help on using the cursor, consult [H Help on cursor] within the submenu.

->Q
What are the real world coordinates of this point ?
=>

You must now inform DigImage of the real world coordinates for the point you have located. The x coordinate is specified first and the y second. These may both be given on the same line, separated by a space, or may be given on separate lines. While it is up to the user to decide the orientation of the coordinate axes (which need not be aligned with the pixel system), some aspects of the particle tracking facility will assume that the x axis is horizontal towards the right and y vertically upwards. Once the x and y coordinates are specified, you will be given the choice of specifying further points. At least three points which are not collinear must be specified for DigImage to be able to generate a coordinate mapping. Generally more points than this are recommended to produce a more accurate mapping. We shall assume here that six points have been specified by the above process.

=> ...   ...
Another world reference point {Y/N} ?
->
->N

Control returns to the parent menu:

        Coordinate System Mappings
D  Display world coordinate mapping
I  Initialise world coordinate mapping
L  Locate world coordinate points
M: Mapping function
R  Restore world coordinate mapping
S  Save world coordinate mapping
U  Units for mapping

f1 Help shift_f1 General help
Q  Return to parent menu
->

The final step in setting up the world coordinate system is to specify the mapping type and determine the required coefficients. This is achieved using the [M: Mapping function] option.

-> M
        Mapping functions - Currently: 1
1  a + bx + cy
2  a + bx + cy + dxy
3  a + bx + cy + 0xy + ex^2 + fy^2
4  a + bx + cy + dxy + ex^2 + fy^2

6  a + bx + cy + dxy + ex^2 + fx^3
7  a + bx + cy + dxy + ey^2 + fy^3

Q  Return to previous menu
->

The Mapping functions submenu is produced to enable selection of a suitable mapping between pixel and world (and the reverse) coordinate systems. The options presented in the menu will depend on the number of coefficients to be

fitted and the number of points specified. In the above example option 5 is not displayed as it has eight coefficients while only six points have been specified. You should select the simplest form of mapping consistent with the optical arrangement. In the vast majority of cases this will be [1 a+bx+cy] if viewing normally or [2 a+bx+cy+dxy] if viewing from an angle. The mapping functions are generated using a least squares routine. For further help consult the f1 help system.

The world coordinate system has now been specified. DigImage will now inform you of the world coordinates as well as the pixel coordinates whenever accessing the Cursor Positioning or Window Selection sub-menus, as well as with a large variety of other facilities. Details of this coordinate system will be saved automatically in the files CALWORLD.DIG and CALWLDPT.DIG in the current directory. These files are used to reinstate the coordinate system whenever you restart DigImage or DigImage changes from one module to another.

7.2 PERMANENT REFERENCE POINTS

The discussion in the previous subsection (7.1 ) assumes that the relationship between the pixel and world coordinate systems is always constant. However this is seldom the case. Small errors in the digitising process will generally lead to a slight translation (and possibly distortion) of the incoming image which will not be the same from one frame to another. Further there may be some vibration or wobble in the experimental set up which we would wish to correct. For these reasons DigImage has a second tier of coordinate transformations allowing automatic generation based on a number of discrete permanent reference points.

These reference points should be mounted rigidly with respect to the experimental apparatus. They should be compact points with an intensity distinctly different (either higher or lower) than the immediate surrounds. Once registered with DigImage, they will be detected automatically when required and used to generate a mapping from the current pixel coordinate system to the reference pixel system. The mapping to the world coordinate system will then be made from the reference pixel system. Specifying the permanent reference points is also achieved in [;PR Reference coordinate system mappings]:

        Reference Coordinate System Mappings
D  Display permanent reference points
F  Find current reference mapping
I  Initialise permanent reference point counter
L  Locate permanent reference point
M  Mapping type for perm ref points: 1
R  Restore permanent reference points from file
S  Save permanent reference points to file
T  Transfer current locations to reference

f1 Help                           shift_f1 General help
Q  Return to parent menu
->

To start with, use [I Initialise permanent reference point counter] to clear any existing points, then select [L Locate permanent reference point], and specify the buffer into which you have already acquired an image containing the points (buffer 1, say).

->L
Locate reference points in which buffer ?
=>
=>1
        Cursor Positioning: Specify Permanent Reference Point
...
->

The reference points are described by a location and an intensity threshold. As they may shift from one frame to another, a search in the neighbourhood of their reference position will be conducted, hence the need for them to be sharply defined relative to their surroundings. The initial specification of the points is achieved using the Cursor Positioning submenu to locate a pixel within a reference point (lying within the intensity you choose to specify the reference point with).

->Q
Threshold for reference point ?
=>

The user is then prompted for the threshold (100, for example). If the intensity of the pixel where the cursor was left is lower than the threshold, DigImage will assume the reference point is dark on a light background, while if the intensity is higher, DigImage will assume it is a light reference point. Once it has the threshold, DigImage is able to determine the size and location of the reference point. The location may be determined as either the location of the centroid of the area falling within the specified intensity threshold, or as the centroid of the volume of the area, where the third dimension is given by the intensity excess. Normally the volume centroid yields more accurate results when generating the mapping functions. DigImage then gives the option of specifying further reference points in a similar manner.

=>100
Use Area or Volume centroid {A/V} ?
->
->V
Specify another reference point {Y/N} ?
->

Typically about six reference points is ideal, arranged down either side of the field of view. One convenient and effective method of generating reference points is to cover a fluorescent tube with aluminium foil and paint the foil matt back. Small diffuse points of light may then be produced by piercing the foil with a sharp needle. These points may then be superimposed on the experiment by using a narrow front silvered mirror (back silvered mirrors lead to multiple reflections which cause difficulties in locating the reference points). The mirror should be positioned as close to the experimental apparatus as possible, and the fluorescent tube then positioned so that the focal distance is the same as that for the experiment, thus enabling both the experiment and reference points to be in focus.

As with the world coordinate system, we must also specify a mapping function. This is achieved by selecting [M Mapping type for perm ref points]. A menu will be displayed offering the various mapping functions available. Only those for which sufficient reference points have been specified will be offered.

        Permanent Reference Point Mapping Type
0  Ir = Ip; Jr = Jp
1  Ir = #(integer) + Ip;  Jr = # + Jp
2  Ir = #(real)    + Ip;  Jr = # + Jp
3  Ir = # + #Ip + #Jp; Jr = # + #Ip + #Jp
4  Ir = # + #Ip + #Jp + #IpJp; Jr = # + #Ip + #Jp + #IpJp
5  Ir = # + #Ip + #Jp; Jr = # + #Ip + #Jp + #Ip^2 + #IpJp >> Q  No change

f1 Help                           shift_f1 General help
->

The simplest form of reference point mapping consistent with the physical arrangement should be specified. For this menu a # represents a coefficient evaluated from the reference points thus [0 Ir=Ip; Jr=Jp] does not utilise the reference points. In the majority of cases where only the digitisation process is introducing a coordinate transformation the simple translation [1 Ir=#(integer)+Ip; Jr=#+Jp] is the best choice. The vertical translation is confined to be an even integer multiple of pixels, corresponding to the image being translated by a complete line in the vertical. While such a mapping in principle requires only a single reference points, use of multiple reference points yields less sensitivity to noise and generally a more accurate mapping. As with the world coordinate system, a least squares routine is used to generate the mapping.

The additional reference points also allow us to make some quantitative assessment of the quality of the image by looking at the error in the mapping function. This feature is used extensively by the particle tracking system to detect low quality images. If a low quality image is found, then the particle tracking system will try to grab the same frame again.

To check how good the reference points and mapping you have selected are, execute [F Find current reference mapping] to locate the current positions of the reference points on some other buffer, then [D Display permanent reference points] to display both their reference and current locations, the mapping functions and root mean square errors.

Note that the reference points and current mappings are automatically saved in the file CALPNT2D.DIG in the current directory. This file is used to reinstate the points and mapping whenever DigImage is started or changes from one program module to another.

For further details on either the world coordinate mapping, or the permanent reference point system, consult the <f1> help system.

Goto next document (Warnings)


Links

SYSTEM OVERVIEW

Contents
Index

OTHER

DigImage documentation page
DigImage home page
Stuart Dalziel's home page


Stuart Dalziel, last page update: 21 June 1999