World Coordinate System Mappings

World Coordinate System Mappings

DigImage utilises up to four coordinate systems simultaneously, depending on the precise needs of the algorithms and the required data. The most fundamental system is the current pixel coordinate system, denoted here by (i,j)cp with the origin (0,0)cp at the top left of the buffer. The i coordinate is vertically downward and the j coordinate is directed towards the right. For PAL systems, (i,j)cp ranges to (511,511)cp, while with NTSC systems (i,j)cp is limited to (479,511)cp. All processing in DigImage is, in the first instance, performed in the current pixel coordinate system as this is the system in which the frame grabber presents its data.

The second most important coordinate system is the current world coordinate system, denoted here by (x,y)cw. This coordinate system is defined by the user on the basis of some known 'world reference points' in a reference image. The location of the origin and orientation of the axes is arbitrary. As it is generally the world coordinates which are relevent, DigImage performs much of the second teir of computations in the world system (generally in the reference world system (x,y)rw which is introduced later).

From the (i,j)cp and (x,y)cw coordinates of the world reference points, DigImage is able to construct mappings W(.) and P(.) such that

           (x,y)cw = W((i,j)cp)
           (i,j)cp = P((x,y)cw)

using a least squares routine with a range of different forms for W(.) and P(.) to allow for both linear and nonlinear relationships between the pixel and world coordinate systems. Note that P(W((i,j)cp)) and W(P((x,y)cw)) are only approximately equal to (i,j)cp and (x,y)cw (respectively) due to the nature of the least squares fits.

An unfortunate aspect about digitizing video signals, especially from video tape, is that small errors can occur in the timing of the sync signal which may lead to shifting or distortion of the digitized image. Most commonly the errors lead to a simple translation of the image, timings within the complete frame introducing little or no distortion (see the help on [FI Interlace filters] for details of distortion between the two fields). It is therefore desirable to be able to correct for any such misalignment. DigImage corrects for such timing errors, and a broader range of experimentally introduced distortions, through the use of 'permanent reference points'. These points are typically part of the experimental set up and may be either white on a dark background or black on a light background. One approach is to use a front silvered mirror to superimpose points generated by a flourescent strip (covered in aluminium foil, painted black; the points are obtained by pinholes in the foil)

Once the permanent reference points are registered with DigImage (this is achieved interactively by locating the points and specifying a threshold), DigImage is able to locate the points automatically for each frame being processed. By comparing the location of the points in the current pixel coordinate system (i,j)cp with their registered reference locations, DigImage is able to construct a mapping between the current pixel coordinates and a reference pixel coordinate system (i,j)rp. This mapping, and its approximate inverse (both are least squares fits to the same set of data), are given by

           (i,j)rp = R((i,j)cp)
           (i,j)cp = C((i,j)rp)

The final coordinate system is the reference world coordinate system (x,y)rw. Whereas the current world coordinate system is obtained by mapping the current pixel system to world coordinates (assuming no additional distortions), the reference world system is obtained by mapping the reference pixel system to world coordinates. Symbolically this is

           (x,y)rw = W((i,j)rp) = W(R((i,j)cp))
           (i,j)cp = C((i,j)rp) = C(P((x,y)rw))

Where coordinate accuracy is essential, the use of permanent reference points in combination with a world reference points produces the best results and allows DigImage to utilise the reference world coordinate system (x,y)rw.

The options available in the submenu provide the user with the means of specifying the world coordnate system. DigImage automatically saves all relevant information about the coordinate systems in two binary files (CalWldPt.DIG and CalWorld.DIG) in the current directory; these files are used to define the coordinate systems each time DigImage starts up.

A Add world coordinates scale.

This option adds a length scale marking to a selected buffer.

D Displays a list of the coefficients for mapping pixel to world and world to pixel coordinates. A list of the points used to define these mappings, along with their pixel and world coordinates, is also displayed. The presence of a star (*) beside one of the entries indicates that the point concerned is an outlier in the sense that it has the largest residual in the mapping process.

I Initialise world coordinate mapping.

DigImage stores the list of coordinates used for the world calibration in a formatted file (CalWldPt.DIG) in the current directory. This option clears this list of calibration points and initialises the world transformation matrix to an identity. Note that this file may be editted to remove erroneous points if required; after editting, the W option should be run to recalculate the transformations. Only experienced users should attempt such a direct modification of CalWldPt.DIG.

L Locate world coordinate points.

This option is used to specify the location of the points for which the world coordinates are known. The option proceeds interactively with the cursor used to find the point on the frame buffer; DigImage then requests the world coordinate of the point. Each time this option is called, further points are added to the list of points. To reinitialise the list, use [I Initialise world coordinate mapping].

M Mapping function.

This option allows specification of the mapping function to be used. Once specified, the mapping will be generated.

R Restore a world transformation from a formatted file previously saved by Y.

Note that DigImage automatically loads all this information from a binary file CalWorld.DIG in the current directory when DigImage is started; if the file can not be found, then DigImage assumes an identity mapping.

S Save a world transformation to a formatted file.

Note that DigImage automatically saves all this information in a binary file CalWorld.DIG in the current directory so that it is available for later runs of DigImage.

T Transform image using coordinate mapping.

This option may be used to remap an image to, for example, undo geometric distortion present in the original image. The option takes the current world coordinate system and uses the inverse mapping world->pixel to determine the intensities of an image where the world coordinates are orthogonal and aligned with the pixel coordinates.

U Specify length units.

This option may be used to record the type of length units used for the world coordinate system. The value specified is displayed in a number of places, but not used directly.


Parent menu

Main Menu

DigImage User Documentation


Stuart Dalziel, last page update: 19 February 1996