An edge detection filter can be used to find lines in images. For example, to use signal processing methods to analyse snow roughness profiles a list of surface height coordinates must be generated. This could be accomplished by tracing the snow surface using the line drawing mode of xv. However, a Laplacian edge detection filter automatically generates a monomodal list of coordinates, which can then by input to signal processing algorithms.
You may use the snow surface profile you removed the noise from in the previous demonstration, or you may use our version, found in the directory ipwdemo/filter. To use our image, use the cd command to change directories.
Display the image using xv.
The IPW algorithm used to get the signal requires that the image is standing on its side. Transpose image and perform Laplacian filter:
% transpose rough.clean.ipw | laplace > rough.lapl
% xv rough.lapl
The signature file must contain only one value of snow surface height for every value of distance along the profile. That is, vertical faces or overhangs in the snow surface profile must be adjusted. The program that generates this signal saves only the greatest surface height coordinate for each pixel position along the profile.
Use getsig to compute the signature file. For quality control, getsig will also display the line with the points in the signature file in gray, and the points deleted in white. (the colors can be changed using the color editor in xv).
% getsig rough.lapl > rough.sig
A schematic diagram of this process is shown in Flowchart 2
Figure 4.1 shows the original image and the two resultant images are shown in figure 4.2 and figure 4.3.
The surface of the grains in a classified image of a snow section cut can be outlined also using a filter. Use laplace to outline grains in a microscopic image of snow and display the filtered image using xv.
% laplace < section2.ipw | xv
Note that the image comes up all black, so it needs contrast stretching. In this case, use histogram equalization first. The input and output images described in this section are shown in figure 4.4 and figure 4.5.
laplace is actually a shell script which generates the laplacian kernel and calls the program convolve To use smoothing, edge enhancement or other edge detection kernels (as described in Part 1, or in an image processing text), use mkkern to enter the kernel and convolve to filter the image. For example, the following set of commands perform an edge enhancement.
% mkkern > kern
Enter kernel (^D to end)
-1 -1 -1
-1 9 -1
-1 -1 -1
^d
% convolve -i image -c kern > image.kern