A method for detecting a specific pattern contained in an image. The
pattern-detection method has steps of binarizing the input image data to
obtain binary image data, recognizing a partial image that is contained
in the binary image data, is part of the specific pattern, and has an
empty inside, and determining the specific pattern contained in the image
based on the recognition results. In the partial-image recognition step,
a pixel-block area of predetermined size containing a target pixel is
successively scanned for the binary image data, and a partial image
contained in the binary image data is recognized on the condition that at
least one OFF-pixel exists within a reference block consisting of the
target pixel and predetermined pixels in its neighborhood within the
block.