A computer readable recording medium in which a program for controlling the computer to retrieve a pattern from an image is recorded, the pattern comprising a plurality of elements having a specific positional relationship with each other, the program being capable of executing the following functions:
- a reference element detecting function for detecting a plurality of elements from the image, and for specifying two of the detected elements as candidate elements of the pattern;
- an element position calculating function for calculating positions of residual elements of the pattern other than elements of the pattern that correspond to the two specified detected elements based on coordinates of the two detected elements;
- a residual element verifying function for verifying residual detected elements, which are the detected elements not specified by the reference element detecting unit, in the positions calculated by the element position calculating function;
- and
- a pattern retrieving function for retrieving the pattern based on the two specified elements detected by the reference element detecting function and the residual elements detected by the residual element detecting function.