A resin lens automatic pouring method and system based on machine vision
By using a machine vision system to detect the liquid surface and mold surface characters in real time, combined with camera measurement, high-precision quantitative casting of resin lenses is achieved, solving the problems of low efficiency and poor accuracy of manual casting, and improving production efficiency and lens quality.
Patent Information
- Application Number
- CN202310741682.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-21
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2043-06-21
AI Technical Summary
In current resin lens production, manual casting is inefficient and has poor precision, while automated casting methods lack precision and are prone to problems such as incomplete casting or overflow. Furthermore, existing machine vision methods cannot accurately calculate the amount of resin to be cast.
An automated resin lens casting system based on machine vision is adopted. The system uses horizontal and vertical cameras to detect the liquid level in real time, and combines character recognition and size measurement on the mold surface to calculate the remaining cavity volume, thereby achieving high-precision quantitative casting.
It improved casting precision, reduced production costs, increased production efficiency, prevented resin overflow, and achieved uniform lens quality and improved production efficiency.
Smart Images

Figure CN117021440B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of machine vision and resin eyeglass lens manufacturing, specifically relating to a method and system for high-precision casting of lenses based on machine vision. Background Technology
[0002] The production of resin eyeglass lenses requires casting into molds. Currently, the injection molding of lens molds is primarily done manually, which is labor-intensive and time-consuming. Furthermore, manual labor can easily lead to visual fatigue, resulting in inconsistent resin injection amounts and significant variations in product quality. Therefore, companies are attempting to develop automated equipment to replace manual casting. Conventional automated casting methods primarily use sensors to detect whether the resin is fully injected, such as the through-beam injection method (CN107116736A), needle punching method (CN107116737A), and vacuum method (CN107116768A). However, in actual production, the casting accuracy using these methods remains relatively low, easily resulting in incomplete filling or resin overflow. With the widespread application of machine vision technology in industry, methods for detecting liquid levels using machine vision have emerged. Most of these methods employ a single camera to detect the liquid surface and adjust the pouring speed based on the height of the liquid level line. However, they cannot accurately calculate the volume of resin to be poured. Since the mold is circular, when the liquid level rises too quickly when the mold is almost full, the image processing data may not be able to be transmitted to the pouring speed control equipment in time, causing the resin to overflow and resulting in pouring failure. Summary of the Invention
[0003] To address the shortcomings of existing technologies, this invention provides an automated resin lens casting method and system based on machine vision. The invention first uses character recognition on the mold surface to estimate the cavity volume for rough casting. Then, two cameras located axially and radially on the mold continuously monitor the dynamic liquid level and calculate the remaining cavity volume for precise casting. The combination of these two methods achieves high-precision and rapid resin lens casting, reducing production costs and improving production efficiency and quality.
[0004] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0005] An automated resin lens casting system based on machine vision includes: a vision experiment platform and a central control unit;
[0006] The visual experiment platform includes a horizontal camera for taking frontal images of the lens mold and a vertical camera for taking side images of the lens mold;
[0007] The central control unit incorporates a character detection module, a character recognition module, and an automatic pouring module. The character detection module receives a frontal image of the lens mold captured by a horizontal camera and performs character detection after preprocessing the image. The character recognition module receives the detection results from the character detection module and uses its built-in recognition algorithm to recognize each character individually. The automatic pouring module includes a mold positioning module, a size measurement module, and a liquid level extraction module. The mold positioning module outputs the position of the circular area of the mold, the size measurement module measures the thickness of the gap between molds, and the liquid level extraction module extracts the real-time rising liquid level during dynamic pouring. The remaining cavity volume is calculated based on the output results of the three modules, and quantitative pouring control is performed on the pouring equipment based on the remaining cavity volume.
[0008] Furthermore, the visual experiment platform is equipped with a strip light source and a panel light source. The strip light source is located at the bottom of the lens mold, facing the side of the lens mold and opposite to the vertical camera. The panel light source is located facing the front of the lens mold and opposite to the horizontal camera.
[0009] Furthermore, the visual experiment platform is also equipped with a pouring head.
[0010] Furthermore, the pouring head is also equipped with a flow meter and a vertical stepper motor.
[0011] Furthermore, the visual experiment platform includes a base and two opposing mounting brackets set on the base. One base is used to mount the lens mold, the strip light source, and the panel light source, while the other base is used to mount the pouring head and the horizontal camera.
[0012] An automated resin lens casting method based on machine vision includes the following steps:
[0013] S1. Use a visual experiment platform to obtain front and side images of the lens mold respectively;
[0014] S2. Perform image preprocessing on the frontal and side images respectively;
[0015] S3. Use image segmentation methods to segment the frontal image, and use a deep learning model to detect characters on the frontal image; based on the character detection results, perform character recognition on the detected characters.
[0016] S4. Perform edge detection on the front image, and then use Hough circle transform to find the circular outer contour of the mold to locate the mold area; perform edge detection on the side image, find the straight contour, and calculate the gap thickness of the lens mold; combine the results of the mold area location to extract the dynamic liquid level line.
[0017] S5. The circular area of the mold is divided based on the dynamic liquid level line to obtain the cavity area. The volume of the remaining cavity is calculated by combining the gap thickness, and quantitative pouring control is performed based on the cavity volume.
[0018] Furthermore, edge detection is performed using the Canny edge detection operator in S4.
[0019] Furthermore, S4 uses the Hough line transform to find the straight line contour from the edge detection results.
[0020] Furthermore, during the extraction of dynamic liquid level lines, image denoising is performed using the image frame difference method to highlight the details of the changing liquid level lines.
[0021] Furthermore, the process of extracting the liquid level line is as follows:
[0022] S4.1. Binarize the denoised frontal image, calculate the radius and center coordinates of the circle using the region localization algorithm, and delineate the circular ROI region in the binary image.
[0023] S4.2. Traverse the pixels of the defined ROI region row by row, record the number of traversals for each row, i.e., the length of each row is denoted as n, read the gray value of each pixel position, and count the number of pixels with a gray value of 255 in each row, denoted as m.
[0024] S4.2 Calculate the liquid level score for each row, i.e., the value of m / n, and find the row coordinates of the row with the highest score, which is the final extracted height position of the liquid level line.
[0025] The beneficial effects of this invention are:
[0026] This invention can roughly estimate the internal volume of a mold by detecting and identifying the diopter characters on its surface. A priori capacity is set for pouring, and then, in conjunction with the remaining cavity volume calculated by the automatic pouring module, the remaining cavity is poured quantitatively. This not only saves pouring time but also improves pouring quality, preventing resin overflow or incomplete pouring. Furthermore, the invention can automatically classify the poured lenses based on the identified diopter character information and automatically calculate the daily lens production output, greatly improving enterprise production efficiency.
[0027] Figure 1 This is a schematic diagram of the specific visual experimental platform of the present invention;
[0028] Figure 2 This is a flowchart of the character detection and recognition module of the present invention;
[0029] Figure 3 This is a diagram showing the character recognition module's recognition effect in this invention.
[0030] Figure 4This is a rendering of the mold positioning module of the present invention;
[0031] Figure 5 This is a rendering of the dimension measurement module of the present invention;
[0032] Figure 6 Figures 6a and 6b are effect diagrams of the liquid level extraction module of the present invention;
[0033] Figure 7 This is a diagram illustrating the cavity region segmentation effect of the present invention.
[0034] Figure 8 This is a schematic diagram of the working process of the present invention.
[0035] In the diagram, 1 is a strip light source, 2 is a lens mold, 3 is a horizontal stepper motor, 4 is a panel light source, 5 is a vertical camera, 6 is a vertical stepper motor, 7 is a flow meter, 8 is a pouring head, and 9 is a horizontal camera. Detailed Implementation
[0036] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the invention.
[0037] Combination Figure 1 The illustrated automatic resin lens casting system based on machine vision includes:
[0038] The visual experiment platform includes a base and two opposing mounting brackets mounted on the base. One base is used to mount a lens mold 2, a strip light source 1, and a panel light source 4. More specifically, the strip light source 1 is positioned at the bottom of the lens mold 2, facing the side of the lens mold 2; the panel light source 4 faces the front of the lens mold 2. This mounting bracket is mounted on the base via a horizontal stepper motor 3 and a screw component, allowing adjustment of the horizontal (X-direction) position of the lens mold 2. The other base is used to mount a pouring head 8 and a horizontal camera 9. The horizontal camera 9 is positioned opposite the panel light source 4. The pouring head 8 is also equipped with a flow meter 7 and a vertical stepper motor 6. More specifically, the horizontal camera 9 is responsible for acquiring a frontal image of the mold to identify characters on the mold surface and detect liquid levels, while the vertical camera 9 is responsible for acquiring a side image of the mold to measure the gap width between mold sections.
[0039] The central control unit is connected via signals to the bar light source 1, horizontal stepper motor 3, panel light source 4, vertical camera 5, vertical stepper motor 6, flow meter 7, pouring head 8, and horizontal camera 9 on the vision experiment platform; it controls the start and stop of the above-mentioned electrical control units accordingly; combined with... Figure 2-7As shown, the central control unit incorporates a character detection module, a character recognition module, and an automatic pouring module. The character detection module receives the frontal image of the lens mold 2 captured by the horizontal camera 9, preprocesses the image, and then performs character detection. The character recognition module receives the detection results from the character detection module and uses its built-in recognition algorithm to recognize each character individually. The automatic pouring module includes a mold positioning module, a dimension measurement module, and a liquid level extraction module. The mold positioning module outputs the position of the circular area of the mold, the dimension measurement module measures the thickness of the gap between molds, and the liquid level extraction module extracts the real-time rising liquid level during dynamic pouring. Based on the outputs of the three modules, the remaining cavity volume is calculated, and quantitative pouring is performed in conjunction with the pouring equipment.
[0040] In this embodiment, for the character detection module, such as Figure 2 As shown, firstly, a large number of raw images are collected using a horizontal camera (9) as the dataset for the deep learning model. An image segmentation method, such as the DBNet model, is used to train the character detection module. To address issues such as low character contrast and inconsistent character positions, an attention mechanism is introduced into the network to improve detection accuracy. Further, based on the detection boxes generated by the character detection module, such as... Figure 3 As shown, the original image is cropped out based on the detection box.
[0041] In this embodiment, the character recognition module identifies each character in the cut-out detection box. The character recognition module is trained based on a CRNN+CTC architecture. Prior values can be set based on the recognition results for resin pre-pouring.
[0042] More preferably, for the front image of the mold acquired by the horizontal camera 9, image preprocessing is first performed, edge detection is performed using the Canny edge detection operator, and then the Hough circle transform is used to find the circular outer contour of the mold, such as... Figure 4 As shown, this achieves the positioning of the mold area.
[0043] More preferably, the vertical camera 5 acquires side images of the mold, such as... Figure 5 As shown, noise reduction is performed first, then edge detection is performed to obtain the edge information of the mold, Hough linear transform is used to find the straight line contours, and the distance of the contour gap is calculated.
[0044] More preferably, image denoising is performed using the image inter-frame difference method to highlight the details of the transformed liquid level line. The dynamic liquid level line is then extracted by combining the results output from the mold positioning module. The specific algorithm steps for liquid level line extraction are as follows:
[0045] (1) Binarize the denoised image, solve the radius and center coordinates of the circle according to the region localization algorithm, and delineate the ROI region of the circle in the binary image;
[0046] (2) Traverse the pixels of the defined ROI region row by row, record the number of traversals of each row, i.e., the length of each row is recorded as n, read the gray value of each pixel position, and count the number of pixels with a gray value of 255 in each row, recorded as m.
[0047] (3) Calculate the liquid level score for each row, i.e. the value of m / n, and find the row coordinates of the row with the highest score, which is the final height position of the extracted liquid level.
[0048] like Figure 6 As shown, the position of the rising liquid level is obtained, and the circular area of the mold is further divided to obtain the cavity area, as shown. Figure 7 As shown, the volume of the remaining cavity is calculated by combining the gap thickness calculated by the size measurement module, so as to control the casting device to achieve high-precision quantitative casting.
[0049] In this embodiment, the central control unit can be implemented using a computer, utilizing the corresponding algorithms built into its various modules to achieve functions such as character detection, character recognition, and automatic pouring control.
[0050] Based on the aforementioned automatic resin lens casting system based on machine vision, this application also proposes an automatic resin lens casting method based on machine vision, as follows: Figure 8 It includes the following steps:
[0051] S1. Use a visual experiment platform to obtain the front and side images of the lens mold 2 respectively;
[0052] S2. Perform image preprocessing on the frontal and side images respectively;
[0053] S3. Use image segmentation methods to segment the frontal image, and use a deep learning model to detect characters on the frontal image; based on the character detection results, perform character recognition on the detected characters.
[0054] S4. For the front image, perform edge detection using the Canny edge detection operator, and then use the Hough circle transform to find the circular outer contour of the mold to locate the mold area; for the side image, perform edge detection, use the Hough line transform to find the straight line contour, and calculate the gap thickness of the lens mold 2; combine the results of the mold area location to extract the dynamic liquid level line.
[0055] S5. The circular area of the mold is divided based on the dynamic liquid level line to obtain the cavity area. The volume of the remaining cavity is calculated based on the gap thickness, and quantitative pouring control is performed based on the cavity volume. More specifically, the value is returned to the flow pump to correct the volume of pouring resin in real time until the mold is completely filled.
[0056] More preferably, the present invention can roughly cast resin lenses based on the identified lens power information, and then use dual cameras to calculate the cavity volume for fine casting, which greatly improves the casting speed and casting quality of resin lenses. Furthermore, the identified character power information can be used to sort the lenses, which greatly improves production efficiency.
[0057] The above embodiments are only used to illustrate the design concept and features of the present invention, and their purpose is to enable those skilled in the art to understand the content of the present invention and implement it accordingly. The protection scope of the present invention is not limited to the above embodiments. Therefore, all equivalent changes or modifications made based on the principles and design ideas disclosed in the present invention are within the protection scope of the present invention.
Claims
1. A machine vision-based automatic resin lens casting system, characterized by, The application relates to a machine vision-based automatic resin lens pouring system. The visual experiment platform comprises a horizontal camera (9) for adopting a front image of a lens mold (2) and a vertical camera (5) for adopting a side image of the lens mold (2). The total control unit is internally provided with a character detection module, a character recognition module and an automatic pouring module; the character detection module receives the front image of the lens mold (2) collected by the horizontal camera (9), and performs character detection after pre-processing the front image; the character recognition module receives the detection result of the character detection module, and performs character-by-character recognition by using the recognition algorithm built-in the character recognition module; the automatic pouring module comprises a mold positioning module, a size measuring module and a liquid level line extraction module; the mold positioning module is responsible for outputting the position of the circular area of the mold, the size measuring module is responsible for measuring the thickness of the gap between the molds, and the liquid level line extraction module is responsible for extracting the real-time rising liquid surface in the dynamic pouring process; the residual cavity volume is calculated according to the output results of the three modules, and the pouring equipment is quantitatively poured and controlled based on the residual cavity volume. The visual experiment platform is provided with a strip light source (1) and a panel light source (4); the strip light source (1) is arranged at the bottom of the lens mold (2), is arranged towards the side edge of the lens mold (2) and is opposite to the vertical camera (5); and the panel light source (4) is arranged towards the front of the lens mold (2) and is opposite to the horizontal camera (9).
2. The machine vision-based automatic resin lens casting system according to claim 1, wherein, The visual experiment platform is further provided with a pouring head (8).
3. The machine vision-based automatic resin lens casting system of claim 1, wherein, The pouring head (8) is further provided with a flowmeter (7) and a vertical stepping motor (6).
4. The machine vision-based automatic resin lens casting system of claim 3, wherein, The visual experiment platform comprises a base, two oppositely arranged mounting supports arranged on the base, one of the mounting supports is used for mounting the lens mold (2), the strip light source (1) and the panel light source (4), and the other mounting support is used for mounting the pouring head (8) and the horizontal camera (9).
5. The machine vision-based automatic resin lens casting system of claim 1, wherein, The method comprises the following steps:
6. A machine vision-based automatic resin lens casting method, characterized by, S1, acquiring the front image and the side image of the lens mold (2) by using the visual experiment platform; S2, performing image pre-processing on the front image and the side image respectively; S3, performing segmentation on the front image by using an image segmentation method, detecting the characters on the front image by using a deep learning model, and performing character recognition on the detected characters based on the character detection result; S4, performing edge detection on the front image, then finding the circular contour of the mold by using a Hough circle transformation to realize the positioning of the mold area, performing edge detection on the side image, then finding the linear contour, and calculating the gap thickness of the lens mold (2); and combining the positioning result of the mold area to extract the dynamic liquid level line; S5, segmenting the circular area of the mold based on the dynamic liquid level line to obtain a cavity area, calculating the volume of the residual cavity by combining the gap thickness, and performing quantitative pouring control based on the cavity volume. In S4, the canny edge detection operator is used for edge detection.
7. The machine vision-based automatic resin lens casting method according to claim 6, wherein, In S4, the Hough line transformation is used to find the linear contour from the edge detection result.
8. The machine vision-based automatic resin lens casting method of claim 6, wherein, 9. The machine vision-based automatic resin lens casting method according to claim 6, 7 or 8, wherein, In the process of extracting dynamic liquid level line, image frame difference method is used for image denoising processing, and the details of the transformed liquid level line part are highlighted.
10. The machine vision-based automatic resin lens casting method of claim 9, wherein, The process of liquid level line extraction is as follows: S4.1, the denoised front image is binarized, the radius and center coordinates of the circle are solved according to the region positioning algorithm, and the ROI region of the circular image is demarcated; S4.2, the ROI region is traversed row by row, the traversal times of each row are recorded, that is, the length of each row is recorded as n, the gray value of each pixel position is read, and the number of pixel points with gray value 255 in each row is counted, which is recorded as m; S4.3, calculate the liquid level line score of each row, that is, the value of m / n, find the row coordinate of the row with the highest score, that is, the height position of the finally extracted liquid level line.
Citation Information
Patent Citations
Liquid level detecting method-bijection method for lens monomer pouring
CN107116736A
Liquid level detecting method-needle punching method for lens monomer pouring
CN107116737A
Liquid level detecting method, namely vacuum method, for eyeglass monomer pouring
CN107116768A
Lens mold pouring system
CN108582615A
Liquid filling method and lens manufacturing method
US5605656A