1. A pattern detecting method comprising: selecting, from among a group of device patterns included in a region near a target pattern in a device forming region, as an alignment pattern in the device forming region, patterns whose barycenter positions in a first direction are not changed even if patterns are deformed by bringing the patterns close to each other or by a difference of density of the patterns at the time of pattern forming, setting a barycenter position of the alignment pattern in the first direction as alignment reference coordinates, and detecting the target pattern based on the alignment reference coordinates.