An image acquiring section acquires a pattern image of a sample. A figure
creating section creates a figure, which reflects a shape of the
micropattern, on the basis of the pattern image. A density distribution
data acquiring section acquires density distribution data on a straight
line perpendicular to a tangential line of an outline of the figure. An
edge detecting section detects pattern edge coordinates from the density
distribution data. A pattern shape measuring section measures a shape of
the micropattern on the basis of the pattern edge coordinates.