The high-density circuit board width detection algorithms are proposed. The detection algorithms include the pre-processing algorithm of measured image line width and the final detection algorithm. The noise suppression of morphological erosion operator based on partial differential equations (PDE) is presented. The mathematical statistical methods and clustering segmentation edge are utilized to measure the upper and lower line width of high-density circuit board with sub-pixel fit to improve detection accuracy. Experiments show that the algorithm can accurately measure the line width distance of circuit board. And measure system analysis results show that the measured data accord with the statistical process control theory and are significant for guiding practice. (C) 2013 Elsevier GmbH. All rights reserved.