An image measuring apparatus comprises an imaging portion with pixels,
each pixel being allocated with one color, four pixels constituting one
set, one set being allocated with a plurality of colors to express a
color, and the sets being arranged in matrix, configured to image a
measuring object and output four image data based on the four pixels,
respectively; and a calculation portion which calculates, based on the
four image data, respectively, positions of the measuring object and
contrast values at one side and an other side across the measuring object
as a boundary, and which generates a position data of the measuring
object based on the positions and contrast values, and outputs the
position data.