1. An image processor which detects a specified pattern defined by arrangement of three or more elements comprising: a first detector which detects positions of a plurality of element candidates based on input image data; a selector which selects n pairs (n&gE;2) of element candidates in the plurality of element candidates detected by said first detector; a determinater unit which determines n arrangement criterions based on the positions of the n pairs selected by said selector and determines one arrangement criterion based on the n arrangement criterions; a calculater unit which calculates positions of all the elements in the specified pattern by using the one arrangement criterion determined by said determinater unit; and a second detector which detects the specified pattern based on the positions on the arrangement calculated by said calculator unit.