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 registering permanent reference points and producing the associated mappings. DigImage automatically saves all relevant information about the coordinate systems in the binary file CalPnt2D.DIG in the current directory; this file is used to define the reference point mapping each time DigImage starts up.
D Displays a list of the permanent reference points currently known to the system. The locations are displayed in pixel coordinates, giving the reference locations, the reference size (in pixels) and the current locations. The presence of a star (*) beside one of the current location entries indicates that the point concerned is an outlier in the sense that it has the largest residual in the mapping process. The mapping coefficients and the rms error (residual) are also displayed. Many of the routines in DigImage utilise this rms error to give an indication of how good the mapping is. A poor mapping (one with a large rms residual) generally indicates a low quality image; DigImage may try to acquire the image again. With six permanent reference points, an acceptable rms error is less than 0.25 (pixels), with less than 0.1 frequently achieved. Note that the rms errors are available to command files through !!R0 (current to reference) and !!R1 (reference to current). Typically you will need to use the floating point specifier in conjunction with these variables (e.g. !!GR0).
F Find (automatically) the location of the permanent reference points on a particular frame, and determine the mapping to the reference frame. This option is called automatically by many DigImage routines to produce the require mapping. It is included here to provide a method of checking the quality of the mapping; to display the mapping, rms error etc., use option D. Note that the rms errors are available to command files through !!R0 (current to reference) and !!R1 (reference to current). Typically you will need to use the floating point specifier in conjunction with these variables (e.g. !!GR0).
make the system forget any permanent reference points it may know about). Note that this sets the transformation to an identity so that (i,j)rp = (i,j)cp.
This option allows the user to interactively locate permanent reference points, specify their defining intensity threshold and location mechanism. Once the points are registered they are available for the F option and any DigImage routine which uses registers a permanent reference point with the system for future use.
The mappings available range from simple translation to bi-cubic distortion functions. Note the mapping must be set if permanent reference points are defined after using the I option otherwise an identity mapping will be assumed. After changing the mapping function the coefficients will automatically be reevaluated. or implicitly)
R Restore the information about permanent reference points and mappings from a formatted file saved previously by S. Note that DigImage automatically loads all this information from a binary file CalPnt2D.DIG in the current directory when DigImage is started; if the file can not be found, then DigImage assumes identity mappings.
Note that DigImage automatically saves all this information in a binary file CalPnt2D.DIG in the current directory so that it is available for later runs of DigImage.
T This option finds current location of the already defined permanent reference points on the specified buffer (as for option F) and then redefines their reference positions as their current positions so that the mapping for the specified buffer is an identity. This option provides a quick method of updating the reference points if they differ from the already defined ones by only a small amount.