Through image processing technology, programmers use instructions on a computer to identify the composition diagram of various molds. The automatic identification system device on the production line will identify whether the molds produced are qualified according to preset instructions, eliminating unqualified molds, fully realizing industrial testing automation, and quickly and accurately eliminating unqualified molds. This not only saves labor costs, but also avoids the subjectivity of manual testing. This paper proposes a method based on translation line segments to calculate the perimeter of irregular shapes. Translation refers to the movement of objects along a straight line in the same plane. This phenomenon is common in everyday life, such as children playing on slides in amusement parks, and the moving elevators of six supermarkets ascending or descending. Calculate the geometric feature parameters of the image area using the translation line segment method. According to the different appearance characteristics of the product, take photos of it from different angles and perform image processing, and comprehensively determine the required geometric feature parameter values. Calculate the geometric characteristic parameters of the product, and then compare them with the standard specifications. Conduct alarm marking processing for products that do not meet the requirements, facilitating manual removal.