A recognizing and sub-pixel locating algorithm of a crosshair image and a calibrating method of the setup are studied. A
sub-pixel locating accuracy and 2" within the full range are achieved. The crosshair captured with a CCD camera was
processed and calculated by a computer. The gray values of each cross section of each line were fitted to Gaussian curve
with the least squares method, the central points of the curves were fitted to a line with the same method, the
intersections of two pair of lines were obtained and 2D displacement in pixels was figured out. With the precision stage
and HP5528A dual-frequency laser interferometer, the setup within the full range was calibrated with piecewise linear
interpolation method. Eye fatigue and errors by eye sighting and reading are eliminated and measuring efficiency is
raised greatly. It is suitable for NC machine stage precision measurement and stage error automatic compensation.