5. Measuring Lines on Images

There are situations when measurements of linear distances are required from images, and distributions of line segment lengths. In this section we discribe two applications of linear measurements to the characterization of snow crystals and snow sintering.

In the first application, the maximum and minimum dimensions of a collection of needle-shaped snow crystals are measured. The line drawing option of xv is used to generate pairs of line segments. Each pair consists of a line drawn down the long axes of the needles, and a line drawn across the axis. The coordinates of the line segment pairs are stored sequentially in a file and the lengths can be calculated and stored in a seperate file. Various statistics can then be estimated from the line-length file such as needle length and thickness distributions, and surface areas (with certain assumptions).

5.1 Computing Crystal Dimensions

Figure 5.1 shows a digitized photomicrograph of needle shaped snow crystals from South Pole Station, Antarctica [photograph by Steve Warren, University of Washington]. This image is found in the directory ipwdemo/lines. Use cd to change to this directory and display the image.

% xv crystal.ipw &

Create a coords file and draw axial and cross-axis lines on some of the needles in the image. If this was a formal study, we would recommend that the long axis and short axis lines been drawn one after the other, so that the lengths could be identified for individual crystals from the order in the file. This is shown in figure 5.2

The lengths can now be calculated:

% linelen < coords

This will print the length of each line, one value per line, to the standard output. The command

% linelen < coords > lengths

will put the line lengths into a file. The lengths calculated by this routine are image-relative dimensions, that is, 1 pixel = 1 unit. A scaling factor must be used to compute actual lengths, which has the units length/pixel (e.g. mm/pixel x pixels = mm ).

5.2 Measuring Grain Grooves

It has been a long standing problem in snow science to characterize the degree of sintering of a snowcover. With careful laboratory procedures, specimens of snow can be sectioned and photographed to record observations of boundaries between snow crystals.

In this demonstration we use the same image used in the noise removal exercise. As shown in figure 5.3 this image has been prepared and illuminated to show the grain grooves or bond lines. This image is also found in the directory ipwdemo/lines. Display the section image, which has the pore filler masked out.

% xv section.raw.ipw &

The grain grooves appear as faint lines in a roughly hexagonal pattern. It requires a fair amount of practice to both recognize all of the grain grooves in this image and draw them onto the image. Each line should be drawn as a complete straight segment, that is, consider each of the straight parts of the lines in the image as separate. Once you have used the mouse to draw the line segments on the image, draw them on the classified image and have a look at your work.

% scribe -c coords -i section.ipw -k 0 | xv

This command line will add the bonds to the image mask as lines of black (DN = 0) pixels. The result of this procedure is shown in figure 5.4 The length of the lines can be computed with linelen.