Abstract:A high-precision measurement method based on machine vision was proposed to address the accuracy issues in offset detection, centroid positioning, and dimension measurement during chip placement. The method involves preprocessing the patch component images captured by a CMOS camera with grayscale conversion, hybrid filtering, and threshold segmentation. Sub-pixel edge detection was achieved using an improved Canny operator and Franklin moment algorithm. Depending on the offset angle of the component image, two edge segmentation strategies were employed to suit different measurement scenarios. The least squares method and RANSAC algorithm were then used to fit contour lines and obtain accurate contour line and intersection coordinates. Experimental results show that the method achieves an angle detection error of less than 0.05°, a centroid positioning error of less than 0.6 pixels, and a dimension measurement error within ±0.008 mm, with a relative error of less than ±0.1%. The processing time is approximately 21% shorter than that of the Canny-Zernike moment algorithm. The method offers high automation, fast measurement speed, and micron-level precision, making it suitable for real-time industrial chip placement detection.