Patent ID: 7574046

Claim:
A method for setting a parameter of a light source which applies an image pickup beam to an object surface including a background and an identification mark, said method comprising: setting a parameter of the light source which has influence on the brightness of the object surface, to a predetermined value; generating a grayscale image from the reflection of incident light which is applied to the object surface from the light source for which said parameter has been set to the predetermined value; a peak inter-class variance value selecting step which includes setting plural thresholds each for binarizing the grayscale image in density, calculating inter-class variance values to be produced respectively according to the plural thresholds, and selecting the largest inter-class variance value as the peak inter-class variance value from the inter-class variance values calculated; a maximum inter-class variance value selecting step which includes changing said light source parameter to a plurality of different values, obtaining peak inter-class variance values respectively for the plurality of different values, and selecting the largest peak inter-class variance value as the maximum inter-class variance value from the peak inter-class variance values obtained; and setting said light source parameter to a value which would give the maximum inter-class variance value.