Abstract:While visually inspecting workpieces with multiple holes, due to the existence of the slant angle (the intersection angle between the imaging plane and the workpiece plane) and lens distortion, the circular features of the holes mutate into ovals or other shapes in the image, which increases the complexity of the algorithm and reduces the detection accuracy. A kind of image correction method was put forward in which angle and distortion correction was used to reflect the actual workpieces after analyzing the causes of the image’s mutation. Firstly, the angle correction was performed by fitting ellipse based on geometric distances on the found subpixel corner points,the ratio of the minor axis to the major axis was the cosine of the slant angle, the new image with zero slant angle was obtained by correcting the image with the slant angle. After angle correction, the difference in the image between the points with the same actual distance was stable within two pixels to improve detection accuracy.Then, distortion correction was performed to remap the pixels using distortion parameters and formulas. Experimental verification shows that using the corrected image, the circular features can be detected more easily and accurately.