1. A method for coarsely classifying whether or not an unknown input document belongs to a group with one or more reference documents earlier classified, each defining structured or unstructured formats of text and background, comprising: comparing counts of contours between images corresponding to the unknown input document and the one or more reference documents; and determining inclusion or not in the group based on the counts of contours.