Professional Documents
Culture Documents
Brief Description
The hit-and-miss transform is a general binary morphological operation that can be
used to look for particular patterns of foreground and background pixels in an
image. It is actually the basic operation of binary morphology since almost all the
other binary morphological operators can be derived from it. As with other binary
morphological operators it takes as input a binary image and a structuring element,
and produces another binary image as output.
How It Works
The structuring element used in the hit-and-miss is a slight extension to the type
that has been introduced for erosion and dilation, in that it can contain both
foreground and background pixels, rather than just foreground pixels, i.e. both ones
and zeros. Note that the simpler type of structuring element used with erosion and
dilation is often depicted containing both ones and zeros as well, but in that case
the zeros really stand for `don't care's', and are just used to fill out the structuring
element to a convenient shaped kernel, usually a square. In all our illustrations,
these `don't care's' are shown as blanks in the kernel in order to avoid confusion.
An example of the extended kind of structuring element is shown in Figure 1. As
usual we denote foreground pixels using ones, and background pixels using zeros.
Figure 2 Four structuring elements used for corner finding in binary images using
the hit-and-miss transform. Note that they are really all the same element, but
rotated by different amounts.
Figure 3 Effect of the hit-and-miss based right angle convex corner detector on a
simple binary image. Note that the `detector' is rather sensitive.
The image
shows the triple points (i.e. points where three lines meet) of the skeleton. Note
that the hit-and-miss transform itself merely outputs single foreground pixels at
each triple point (the rest of the output image being black). To produce our
example here, this image was then dilated once using a cross-shaped structuring
element in order to mark these isolated points clearly, and this was then ORed with
the original skeleton in order to produce the overlay.
The image
shows the end points of the skeleton. This image was produced in a similar way to
the triple point image above, except of course that a different structuring element
was used for the hit-and-miss operation. In addition, the isolated points produced
by the transform were dilated with a square in order to mark them, rather than with
a cross.
The successful use of the hit-and-miss transform relies on being able to think of a
relatively small set of binary patterns that capture all the possible variations and
orientations of a feature that is to be located. For features larger than a few pixels
across this is often not feasible.
Interactive Experimentation
You can interactively experiment with this operator by clicking here.
Exercises
1. How can the hit-and-miss transform be used to perform erosion?
2. How can the hit-and-miss transform, together with the NOT operation, be
used to perform dilation?
3. What is the smallest number of different structuring elements that you
would need to use to locate all foreground points in an image which have at
least one foreground neighbor, using the hit-and-miss transform? What do
the structuring elements look like?
References
Local Information
Specific information about this operator may be found here.
More general advice about the local HIPR installation is available in the Local
Information introductory section.