A technology for recognizing one or more quadrangles from an input image
is disclosed. Edge areas are detected from the input image, lines
corresponding to the edge areas are extracted, a line pair selected from
the extracted lines is categorized according to a positional relationship
between two lines included in the line pair, a line pair evaluation value
is calculated for the line pair, a combination of two line pairs is
selected, a quadrangle is generated from four lines included in the two
line pairs selected, a quadrangle evaluation value is calculated for the
quadrangle based on the categories and the line pair evaluation values of
the two line pairs forming the quadrangle, and a quadrangle is selected
based on the calculated quadrangle evaluation value.