Abstract:A correction algorithm based on the principle of geometric optics is proposed to address the geometric deformation of part images in machine vision defect detection of polyhedral injection molded parts. Under the condition that the shooting positioning error is not greater than 1 mm, the correction error of the method is theoretically <0.1 mm, which can meet the needs of machine vision defect detection for injection molded parts. Firstly, preprocess the collected images to obtain image edges; Next, the intersection points of the contour lines are determined as part vertices, and different surfaces of the part are segmented based on their positions and mapped onto a two-dimensional plane; Then, calculate the offset of each pixel in the image based on geometric optics; Finally, perform point by point correction on the pixels in the image. Using a set of hexahedral parts to simulate actual working conditions, experiments were conducted under different shooting positioning error states, and the correction algorithm was validated using Matlab. The experimental results show that the error of the proposed method is within 0.1 mm, which is consistent with theoretical analysis and meets the requirements for geometric correction accuracy of part images in machine vision defect detection of injection molded parts.