A confocal optical system is disposed one-dimensionally or two-dimensionally. Reflected light from an object (11, 12) is detected by a photodetector array (4) through a light receiving pin-hole array and the peak processing of the luminous intensity of the light received by the photodetector array is performed to measure the height of the object. If the received luminous intensity of the photodetector array exceeds a luminous power which is fixed within the dynamic range (Vs) of the photodetector array, the peak processing is made ineffective.