A discrimination machine optically senses an object having a surface with
a planar structure while scanning the planar structure along the surface.
The machine includes a discrimination sensor including optical devices
detecting light generated from the planar structure. The optical devices
are disposed at an interval in a transverse direction, perpendicular to a
scanning direction, to ensure a sufficiently wide sensing area for the
object. A deviation detector detects deviation of the planar structure
from a plane based on electrical signals output from the respective
optical devices detecting the light generated by the object while the
discrimination sensor is scanning the object. An optical device selector
selects an optical device, from among the optical devices, based on the
deviation detected. A determination is made as to whether the electrical
signal output from the optical device selected is within an allowable
margin.