Visual control method and device for lens mold opening
The automated mold-opening equipment controlled by computer vision has solved the problems of high labor intensity of manual operation and high difficulty of machine recognition in the lens mold-opening process, and has achieved efficient and safe lens separation and improved production efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TONGJI UNIV
- Filing Date
- 2023-09-08
- Publication Date
- 2026-04-21
AI Technical Summary
The existing lens mold-making process suffers from problems such as high labor intensity, low production efficiency, high mold wear and occupational disease risks due to manual operation, and difficulty and poor accuracy in machine recognition.
An automated mold-opening device based on computer vision is used. It identifies the position and shape of the B mold and resin lens through a high-resolution camera and image processing algorithm. Combined with a vision control system, it automatically adjusts the mold-opening force, speed and angle to achieve precise separation.
It improves the accuracy and stability of mold making, reduces the risk of human error and occupational diseases, enhances production efficiency and product quality, and creates a safe and comfortable working environment.
Smart Images

Figure CN117507214B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to industrial robots, industrial automation equipment, and computer vision, and in particular to a visual control method and device for lens mold making. Background Technology
[0002] In the lens processing industry, especially for resin lenses, they can be divided into two types: cast resin lenses and injection-molded resin lenses. Currently, in the market, lens mold making is an essential process in lens processing. This process requires the mold maker to separate the upper B-mold from the resin lens. Then, through subsequent steps, the resin lens will automatically separate from the A-mold. Therefore, the main task of automatic mold making equipment is to realize the separation operation between the B-mold and the resin lens.
[0003] Traditional manual mold making often presents several problems. Currently, manual operation involves inserting the glass mold into a limiting groove and then using a small hammer and shovel to separate the lens. Because manual mold making uses ordinary tools, it requires a certain level of skill, is labor-intensive, and has low production efficiency. Furthermore, it can damage the lens mold, leading to reduced lens production and increased mold wear. In addition, workers engaged in mold making for extended periods often suffer from occupational diseases such as frozen shoulder and upper limb fasciitis. Machine mold making also presents challenges. While it's necessary to inspect the gap between the mold and the lens, the high similarity between the lens and mold makes camera recognition inaccurate. Moreover, the diverse materials of the lens and mold, as well as their post-cast state, introduce significant interference factors, increasing the difficulty of separating the lens from the mold. Summary of the Invention
[0004] The purpose of this invention is to overcome the defects of the prior art and provide a visual control method and device for lens mold making.
[0005] The objective of this invention can be achieved through the following technical solutions:
[0006] On one hand, this invention discloses a visual control method for lens mold making, comprising the following steps:
[0007] S1: Perform visual and die calibration on the lens mold-making equipment;
[0008] S2: The camera is controlled by the controller of the lens mold opening equipment to capture images of the lens module;
[0009] S3: Capture partial images of the left and right sides of the image to locate the lens module;
[0010] S4: Set the top, bottom, left, and right boundaries of the region of interest;
[0011] S5: Based on the upper, lower, left and right boundaries of the region of interest, crop the image of the region of interest so that the region of interest mainly contains the bright reflective areas. If the region of interest cannot be found, repeat S3 and S4.
[0012] S6: Divide the region of interest image into left and right parts, and find the gaps in the B-mode of the lens module in each part.
[0013] S7: Binarize and contour-find the left and right parts of the region of interest respectively to determine whether the gap finding was successful;
[0014] S8: If the gap search fails, a failure signal is sent to the controller of the lens mold opening equipment, and the controller of the lens mold opening equipment sends a re-identification command, repeating S2 to S7.
[0015] S9: If the gap is successfully found, send the mold opening command and height data to the controller of the lens mold opening equipment.
[0016] Furthermore, the calibration of the vision and mold-opening blade of the lens mold-opening device described in S1 specifically includes the following steps:
[0017] S11: Place the checkerboard calibration plate of the lens mold opening equipment on the recognition plane, capture an image containing the calibration plate through the camera, and calibrate the camera's intrinsic and extrinsic parameters.
[0018] S12: Engrave a mark on the resin lens and mark the height of the mold-opening cutter at this time as the zero point of the mold-opening cutter; capture images with a camera, pre-set the range of the mark's appearance, perform edge detection on the image blocks within this range, calculate the average value of the vertical coordinates of all detected marks to the edge, and use the average value of the vertical coordinates as the visual zero point to complete the calibration of the vision and the mold-opening cutter.
[0019] Furthermore, the camera intrinsic parameters mentioned in S21 include the focal length fx in the X direction, the focal length fy in the Y direction, and the camera optical center coordinates (cx, cy). The camera extrinsic parameters include three-dimensional rotation and three-dimensional translation.
[0020] Furthermore, S4 specifically includes:
[0021] S41. Set the upper and lower boundaries of the region of interest for vertical search, calculate the brightness histograms of the local images of the left and right sides of the image respectively, set the brightness threshold according to the distribution of the histograms, perform adaptive binarization of the image, extract the contours, filter out small contours, sort the vertical coordinates of the centroid of the contours; take the uppermost contour, calculate its lower boundary as the upper boundary of the region of interest; take the lowermost contour, calculate its upper boundary as the lower boundary of the region of interest.
[0022] S42. Set the left and right boundaries of the horizontal search region of interest. Take the region of interest 30 pixels down from the top of the B model, binarize the region of interest, extract the contours, filter out small contours, and sort the centroids of the contours by their vertical coordinates. Take the leftmost contour, calculate its right boundary, and use it as the left boundary of the region of interest. Take the rightmost contour, calculate its left boundary, and use it as the right boundary of the region of interest.
[0023] Furthermore, the partial images of the left and right sides of the image described in S5 need to be backlit by a black plate behind the backlight of the lens module.
[0024] Optionally, S7's determination of whether the gap search is successful includes: after removing small contours, sorting the longitudinal coordinates of the centroid of the contours, taking the topmost contour, calculating the average longitudinal coordinate within the top 10 pixels of this contour area, calculating the main direction of the pixel distribution within the 10 pixels, and determining whether the deviation of the main direction exceeds the longitudinal angle threshold of 5° and whether the difference in the longitudinal coordinates of the left and right gaps exceeds 2mm.
[0025] Furthermore, the principal direction is calculated using principal component analysis.
[0026] Furthermore, if the main direction deviates from the longitudinal angle threshold by more than 5°, the gap search will fail; if the difference between the longitudinal coordinates of the left and right gaps exceeds 2mm, the gap search will fail.
[0027] Furthermore, if the main direction deviates by less than 5° from the longitudinal angle threshold, and the difference in the longitudinal coordinates of the left and right gaps is less than 2mm, then the gap is successfully found, and the mold opening command and height data are sent to the controller.
[0028] Secondly, the present invention discloses a vision control device for lens mold making, including a controller and a checkerboard calibration plate. The device has a ring-shaped four-station system, including a loading station, a vision station, a mold making station, and a unloading station. At the vision station, a grayscale camera with at least 5 million pixels and a uniform lighting plate are installed. The surface light source has an opening in the middle, and the center of the camera's optical axis coincides with the center of the opening. The device is used in any of the methods described above.
[0029] Compared with the prior art, the present invention has the following beneficial effects:
[0030] (1) Based on the image processing and recognition technology in computer vision control methods, the present invention monitors and analyzes the mold opening process in real time through a high-resolution camera. Using image processing algorithms, it can accurately identify the position and shape of the B mold and resin lens, and perform precise control operations based on this information.
[0031] (2) In this invention, by using a computer vision system in an automated mold opening device to automatically adjust the force, speed and angle during the mold opening process according to preset parameters and mold features, a reliable separation operation can be achieved. This invention can not only improve the accuracy and stability of mold opening, but also eliminate the influence of human factors on the quality of mold opening.
[0032] (3) By introducing vision-based automated mold-making equipment, this invention can not only reduce errors and damage in manual mold making, but also effectively protect the health of mold-making workers and reduce the incidence of occupational diseases caused by work, thereby creating a safer and more comfortable working environment; it can also improve production efficiency and product quality, has important application prospects, and can bring significant technological progress and economic benefits to related industries. Attached Figure Description
[0033] Figure 1 This is a flowchart of the method of the present invention;
[0034] Figure 2 This is a detailed flowchart of one embodiment of the present invention;
[0035] Figure 3 This is a schematic diagram of the mold opening process for the present invention;
[0036] Figure 4 This is a schematic diagram of camera intrinsic parameter calibration according to the present invention;
[0037] Figure 5 This is a schematic diagram of camera extrinsic parameter calibration according to the present invention;
[0038] Figure 6 This is a schematic diagram of the mold-opening tool and vision station calibration of the present invention;
[0039] Figure 7 This is a diagram showing the lens mold gap identification of the present invention;
[0040] Figure 8 This is a schematic diagram illustrating the workflow for finding the region of interest in this invention.
[0041] Figure 9 This is a flowchart of the difficult sample identification process of the present invention. Attached image description:
[0043] Figure 3 1. B mold; 2. Resin lens; 3. A mold; 4. Mold cutting tool.
[0044] Figure 5 1. Mold; 2. Calibration plate; 3. Camera. Detailed Implementation
[0045] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.
[0046] Example
[0047] This embodiment provides a visual control method for lens mold making, such as... Figure 1 and Figure 2 As shown, the specific steps include:
[0048] Step 1: Operate a vision control device for lens mold making. This device can be a non-standard automated machine with a circular four-station layout, typically including a loading station, a vision station, a mold making station, and a unloading station. At the vision station, install a grayscale camera with at least 5 megapixels and a high-brightness, uniformly lit plate. The surface light source should have a central opening, and the camera's optical axis should be aligned as closely as possible with the center of the opening. A mold making diagram is shown below. Figure 3 As shown, the lens mold-making equipment is calibrated with vision and mold-making cutter. The controller (PLC) of the equipment sends recognition instructions to the vision control software. The mold-making cutter enters the gap position according to the vision recognition and the B mold falls off.
[0049] Step 2: As Figure 4 and Figure 5 As shown, a high-precision checkerboard calibration plate of the device is placed on the recognition plane, and an image containing the calibration plate is captured by the camera to calibrate the intrinsic and extrinsic parameters of the camera. The intrinsic parameters of the camera include the focal length fx in the X direction, the focal length fy in the Y direction, and the optical center (cx, cy) of the camera. The extrinsic parameters of the camera include three-dimensional rotation and three-dimensional translation.
[0050] Step 3: As Figure 6 As shown, place the lens module on the workstation, rotate the workstation to the mold-opening station, adjust its position, and engrave a mark on the resin. Record the height of the mold-opening cutter at this point as the zero point of the mold-opening cutter. Rotate the workstation back to the vision station, capture the image with the camera, manually set the appearance range of the mark in advance, perform edge detection on the image blocks within this range, calculate the average value of the vertical coordinates of all detected marks to the edge, and take the average value of the vertical coordinates of the marks as the vision zero point. This completes the calibration of the vision and the mold-opening cutter.
[0051] Step 4: The vision control software receives the recognition signal and controls the camera to capture images.
[0052] Step 5: As Figure 8As shown, partial images of the left and right sides of the image are cropped to locate the lens and its module. Specifically, a matte black cardstock is used as the background behind the lens module, i.e., the side facing away from the light source. The search range for the upper and lower edges of the lens module is set based on the maximum thickness of the lens module on the production line. The brightness histograms of the partial images of the left and right sides of the image are calculated separately. A brightness threshold is set based on the histogram distribution, and adaptive binarization of the image is performed to extract contours, filter out small contours, and sort the vertical coordinates of the contour centroids. The uppermost contour is taken, and its lower boundary is calculated as the upper boundary of the lens module; the lowermost contour is taken, and its upper boundary is calculated as the lower boundary of the lens module. The upper and lower boundaries of the corresponding region of interest are set based on the search range of the upper and lower boundaries of the lens module.
[0053] Step 6: The upper and lower boundaries of the region of interest (ROI) are completely consistent with the upper and lower boundaries of the lens module. The upper and lower boundaries of the ROI are obtained based on the upper and lower boundaries of the lens module. Based on the radiation range of the surface light source and the disturbance range of the lens module when it is attracted by the cylinder, the left and right boundaries of the ROI are set for horizontal search. A 30-pixel ROI is taken from the top of the B-mode, binarized, and its contours are extracted. Small contours are filtered out, and the centroids of the contours are sorted vertically. The leftmost contour is taken, and its right boundary is calculated as the left boundary of the ROI; the rightmost contour is taken, and its left boundary is calculated as the right boundary of the ROI.
[0054] Step 7: Based on the top, bottom, left, and right boundaries of the region of interest (ROI), crop the ROI image so that it mainly contains the bright, reflective areas. If the ROI cannot be found, rotate the lens again and repeat steps 5, 6, and 7 to search again.
[0055] Step 8: Gap identification illustration as shown Figure 7 Due to the presence of the surface light source opening, the lighting effect in the center line of the region of interest is poor. Therefore, the image of the region of interest is divided into left and right parts, and the gap of the B model is searched in each part.
[0056] Step 9: Binarize and perform contour finding on the left and right parts of the region of interest respectively. After removing small contours, sort the vertical coordinates of the centroids of the contours. Take the topmost contour and calculate the average vertical coordinate within the top 10 pixels of this contour region. Use principal component analysis to calculate the principal direction of the pixel distribution within the vertical 10 pixels, and determine whether the deviation of the principal direction exceeds the vertical angle threshold of 5° and whether the difference in the vertical coordinates of the left and right gaps exceeds 2mm.
[0057] Step 10: If the main direction deviates by more than 5° from the longitudinal angle threshold, the gap search is considered to have failed; if the difference between the longitudinal coordinates of the left and right gaps exceeds 2mm, the gap search is also considered to have failed, a failure signal is sent, and a re-identification command is sent.
[0058] Step 11: If the main direction deviates less than the longitudinal angle threshold of 5°, and the difference in the longitudinal coordinates of the left and right gaps is less than 2mm, then the gap is successfully found, and the mold opening command and height data are sent to the controller.
[0059] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.
Claims
1. A visual control method for lens mold making, characterized in that, Includes the following steps: S1: Perform visual and die calibration on the lens mold-making equipment; S2: The camera is controlled by the controller of the lens mold opening equipment to capture images of the lens module; S3: Capture partial images of the left and right sides of the image to locate the lens module; S4: Set the upper, lower, left, and right boundaries of the region of interest; calculate the brightness of the local image, perform adaptive binarization of the image, extract the contours, and take the uppermost and lowermost contours as the upper and lower boundaries of the region of interest; take the region of interest of a set number of pixels from the top of the B-mode downwards, binarize the region of interest, extract the contours, and take the leftmost and rightmost contours as the left and right boundaries of the region of interest. S5: Based on the upper, lower, left and right boundaries of the region of interest, crop the image of the region of interest so that the region of interest mainly contains the bright reflective areas. If the region of interest cannot be found, repeat S3 and S4. S6: Divide the region of interest image into left and right parts, and find the gaps in the B-mode of the lens module in each part. S7: Binarize and contour-find the left and right parts of the region of interest respectively to determine whether the gap finding was successful; S8: If the gap search fails, a failure signal is sent to the controller of the lens mold opening equipment, and the controller of the lens mold opening equipment sends a re-identification command, repeating S2~S7. S9: If the gap is successfully found, send the mold opening command and height data to the controller of the lens mold opening equipment; The method described in S7 for determining whether the gap search is successful includes: after removing small outlines, sorting the vertical coordinates of the centroid of the outlines, taking the topmost outline, calculating the average vertical coordinate within the top 10 pixels of this outline area, calculating the main direction of the pixel distribution within the top 10 pixels, and determining whether the deviation of the main direction exceeds the vertical angle threshold of 5° and whether the difference between the vertical coordinates of the left and right gaps exceeds 2mm. If the main direction deviates from the longitudinal angle threshold by more than 5°, the gap search will fail; if the difference between the longitudinal coordinates of the left and right gaps exceeds 2mm, the gap search will fail. If the deviation of the main direction is less than 5° of the longitudinal angle threshold, and the difference in the longitudinal coordinates of the left and right gaps is less than 2mm, then the gap is successfully found, and the mold opening command and height data are sent to the controller.
2. The visual control method for lens mold opening according to claim 1, characterized in that, The calibration of the vision and mold-opening blade for the lens mold-opening equipment described in S1 specifically includes the following steps: S11: Place the checkerboard calibration plate of the lens mold opening equipment on the recognition plane, capture an image containing the calibration plate through the camera, and calibrate the camera's intrinsic and extrinsic parameters. S12: Engrave a mark on the resin lens and mark the height of the mold-opening cutter at this time as the zero point of the mold-opening cutter; capture images with a camera, manually predict and set the range of the mark's appearance, perform edge detection on the image blocks within this range, calculate the average value of the vertical coordinates of all detected marks to the edge, and use the average value of the vertical coordinates as the visual zero point to complete the calibration of vision and mold-opening cutter.
3. The visual control method for lens mold opening according to claim 2, characterized in that, The camera intrinsic parameters described in S11 include the focal length fx in the X direction, the focal length fy in the Y direction, and the camera optical center coordinates (cx, cy). The camera extrinsic parameters include three-dimensional rotation and three-dimensional translation.
4. The visual control method for lens mold opening according to claim 1, characterized in that, S4 specifically includes: S41. Set the upper and lower boundaries of the region of interest for vertical search, calculate the brightness histograms of the local images of the left and right sides of the image respectively, set the brightness threshold according to the distribution of the histograms, perform adaptive binarization of the image, extract the contours, filter out small contours, sort the vertical coordinates of the centroid of the contours; take the uppermost contour, calculate its lower boundary as the upper boundary of the region of interest; take the lowermost contour, calculate its upper boundary as the lower boundary of the region of interest. S42. Set the left and right boundaries of the horizontal search region of interest. Take the region of interest 30 pixels down from the top of the B model, binarize the region of interest, extract the contours, filter out small contours, and sort the centroids of the contours by their vertical coordinates. Take the leftmost contour, calculate its right boundary, and use it as the left boundary of the region of interest. Take the rightmost contour, calculate its left boundary, and use it as the right boundary of the region of interest.
5. The visual control method for lens mold opening according to claim 1, characterized in that, The partial images of the left and right sides of the image described in S5 need to be captured using a black plate as a background behind the backlight of the lens module.
6. The visual control method for lens mold opening according to claim 1, characterized in that, The principal direction is calculated using principal component analysis.
7. A vision control device for lens mold making, comprising a controller and a checkerboard calibration plate, the device having a circular four-station layout, including a loading station, a vision station, a mold making station, and a unloading station; at the vision station, a grayscale camera with at least 5 megapixels and a uniform lighting plate are installed, with a central opening in the surface light source, and the center of the camera's optical axis coinciding with the center of the opening, characterized in that... The device is used to implement the method described in any one of claims 1-6.
Citation Information
Patent Citations
Slit detection device and detection method
CN106469451A
Visual lens position finding device for filling lens mold opening
CN215791187U