In order to realize precise measurement for printed circuit board linewidth, Coaxial light is selected as AOI lighting system. Through image processing technology, the gradient feature around boundary region is extracted. And least squares curve fitting
is performed on gradient data, the precise position of boundary is located, so the measuring value of linewidth is calculated. Furthermore, for ensuring measuring accuracy, the research also analyzes relation between illuminator and measuring accuracy. And an illumination adjustment method based on entropy is proposed. After the method is implemented to achieve the best illuminator, the measuring result is pleasant, the average measuring error can be reduced to 13um, about 1/4 pixel on the condition that the image ratio is 55.7um per pixel. The method is very practical, and provides referent value to precise measuring work based on image processing technology.