In an image processing device, a contour image generation section extracts
edge points according to image data acquired by an image acquiring
section, and generates a contour image of a object formed out of the edge
points; a first fitting line generation section conducts fitting of line
of a predetermined shape to the object on the contour image according to
the contour image, and generates a first fitting line; an effective edge
point region generation section generates an effective edge point region
in which the first fitting line has a width and a region in the line
width is made to be the effective edge point region; and a second fitting
line generation section generates a second fitting line formed out of a
line of a predetermined shape according to the edge points in the
effective edge point region on the contour image.