Method and apparatus for detecting surface finish of optical lens

By dynamically adjusting the light source, establishing a three-dimensional coordinate system and training a model, the problem of uneven illumination in the surface finish detection of optical lenses was solved, and high-precision detection of lenses of different shapes was achieved.

CN120084761BActive Publication Date: 2025-11-25PUJIANG YONGQIANG CRYSTAL GLASS PROD CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510572502.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-06
Publication Date
2025-11-25
Estimated Expiration
2045-05-06

AI Technical Summary

Technical Problem

Existing technologies make it difficult to accurately detect the surface finish of optical lenses of different shapes, especially curved or concave surfaces, which leads to uneven illumination and affects the accuracy of the test results.

Method used

The method of dynamically adjusting the light source is adopted. By establishing a three-dimensional coordinate system, the light source status data and detection area image are obtained, abnormal pixels and regions are identified, and the smoothness is identified based on the trained smoothness recognition model. The light source is dynamically adjusted to correct the problem of uneven illumination.

Benefits of technology

It improves the accuracy and efficiency of optical lens surface finish inspection, adapts to different optical lens shapes, and ensures the accuracy of inspection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120084761B_ABST
    Figure CN120084761B_ABST
Patent Text Reader

Abstract

The present application relates to optical lens surface finish detection method and device, belong to finish detection technical field, the method includes: establish three-dimensional coordinate system, g light source and detection area are mapped in three-dimensional coordinate system, and the detection area is the placement area of the detected object;Get the state data of g light source and the initial image of the detection area;Get the sub-luminance value of each pixel in the initial image, determine the abnormal pixel based on the sub-luminance value, and determine the abnormal area based on the abnormal pixel;Determine the target light source and the adjustment instruction of the target light source based on the abnormal area and the state data;Based on the adjustment instruction, the target light source is corrected, the real-time detection image of the detection area after correction is collected, the real-time detection image is input into the finish recognition model trained, and whether the finish is qualified is recognized;The present application dynamically adjusts the light source, improves the detection precision and efficiency of different forms of optical lenses.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of surface finish testing technology, and specifically relates to a method and apparatus for testing the surface finish of optical lenses. Background Technology

[0002] Optical lenses, as important optical components, are widely used in devices such as cameras, microscopes, and projectors. The surface finish of optical lenses has a crucial impact on their performance. Currently, the surface finish of optical lenses is mainly detected by visual inspection methods or manual visual inspection.

[0003] For example, patent application CN115389421A discloses a glass surface smoothness testing device and method, which is applied to millimeter-level glass products. The device includes a box, and a light source is provided inside the box. A support panel is slidably connected to the top of the box, and a lens frame assembly is provided on the support panel. The lens frame assembly is composed of several ring-shaped lens frames of different sizes nested inside and outside. Each ring-shaped lens frame has a light-transmitting hole formed in the center, and the light-transmitting hole is opposite to the light source.

[0004] Traditional methods typically rely on manual inspection or simple image processing algorithms based on differences in illumination intensity. These methods often have some problems, such as difficulty in providing accurate surface finish assessment for lens surfaces of different shapes (such as curved, concave, etc.). This is because using a fixed light source to configure different shapes of lens surfaces can lead to uneven illumination, overexposure, or shadows, which affects the accuracy of the detection results.

[0005] Therefore, this invention proposes a method and apparatus for detecting the surface finish of optical lenses. Summary of the Invention

[0006] The purpose of this invention is to provide a method and apparatus for detecting the surface finish of optical lenses, so as to achieve dynamic adjustment of the light source and improve the detection accuracy and efficiency of optical lenses of different shapes.

[0007] The objective of this invention is achieved through the following technical solution: A method for detecting the surface finish of an optical lens, the method comprising:

[0008] A three-dimensional coordinate system is established, and g light sources and the detection area are mapped onto the three-dimensional coordinate system. The detection area is the placement area of ​​the object being detected. The state data of the g light sources and the initial image of the detection area are acquired. The sub-brightness value of each pixel in the initial image is acquired. Abnormal pixels are identified based on the sub-brightness values, and abnormal regions are identified based on the abnormal pixels. The target light source and its adjustment command are determined based on the abnormal regions and state data. The target light source is corrected based on the adjustment command. The real-time detection image of the detection area after correction is acquired. The real-time detection image is input into the trained surface finish recognition model to identify whether the surface finish is qualified.

[0009] Preferably, the method for determining abnormal pixels includes:

[0010] The total brightness value of the initial image is obtained by formulating the sub-brightness value of each pixel.

[0011] The deviation value is calculated based on the formula of sub-brightness value and total brightness value, and the deviation value is compared with the preset deviation threshold to determine whether it is an abnormal pixel.

[0012] Preferably, the preset deviation threshold includes a maximum deviation threshold and a minimum deviation threshold, and the abnormality types of the abnormal pixels include underexposure and overexposure;

[0013] The deviation value is compared with the maximum deviation threshold and the minimum deviation threshold, respectively;

[0014] If the deviation value is greater than or equal to the maximum deviation threshold, the pixel is determined to be an abnormal pixel, and the abnormality type is overexposure;

[0015] If the deviation value is less than or equal to the minimum deviation threshold, the pixel is determined to be an abnormal pixel, and the abnormality type is too dark;

[0016] If the maximum deviation threshold > the deviation value > the minimum deviation threshold, then the pixel is determined to be a normal pixel.

[0017] Preferably, the method for determining the abnormal region includes:

[0018] Connect adjacent abnormal pixels to form an abnormal pattern;

[0019] Input the abnormal image into the trained discrimination model to determine the authenticity of the abnormal image;

[0020] If the model output is true, then the abnormal graphic is considered an abnormal region.

[0021] If the model output is identified as false, the abnormal graphic will not be considered an abnormal region.

[0022] Preferably, the abnormal area includes overly dark areas and overexposed areas, and the method for determining whether the abnormal area is an overly dark area or an overexposed area is as follows:

[0023] The percentage of different anomaly types among the abnormal pixels in a single abnormal region is statistically analyzed.

[0024] If the total number of overexposed abnormal pixels in an abnormal area is greater than the total number of underexposed abnormal pixels, then the abnormal area is an overexposed area.

[0025] If the total number of overexposed abnormal pixels is less than or equal to the total number of underexposed abnormal pixels, then the abnormal area is an underexposed area.

[0026] Preferably, the method for determining the target light source includes:

[0027] The detection area is divided into k sub-regions in a fan shape with the center of the detection area as the center. The k sub-regions are numbered in sequence, and the g light sources are bound to the corresponding sub-regions for adjustment.

[0028] Extract the sub-region number of the abnormal region, and determine the target light source based on the sub-region number and the adjustment relationship.

[0029] Preferably, the adjustment command includes an angle adjustment command and an intensity adjustment command, and the method for determining the adjustment command is as follows:

[0030] If the abnormal area is an overexposed area, an intensity adjustment command is generated, and the intensity adjustment command is to reduce the unit light intensity of the target light source.

[0031] If the abnormal area is an overly dark area, an angle adjustment command will be generated.

[0032] Preferably, the specific method for adjusting the target light source using the angle adjustment command includes:

[0033] Obtain the distance between the boundary of the dark area and the target light source perpendicular to the detection area, and obtain the vertical height between the target light source and the detection area from the state data of the target light source;

[0034] The target angle of the target light source is calculated using a formula based on the distance value and vertical height, and the target angle is used as the adjustment parameter for the target light source.

[0035] Preferably, the training method for the discrimination model is as follows:

[0036] Collect multiple sets of historical anomaly images and their corresponding categories. If the historical anomaly image was collected when it was a non-light source problem, it is determined to be false and the category is marked as 1. If the historical anomaly image was collected when it was a light source problem, it is determined to be true and the category is marked as 0. Convert the historical anomaly image and its corresponding category into feature vector one.

[0037] The first feature vector is used as the input of the first model. The first model is trained to minimize the prediction error. When the error converges and the performance of the first model meets the requirements, the training is stopped and the resulting first model is used as the discrimination model.

[0038] Model 1 can be a support vector machine model, decision tree model, or convolutional neural network model.

[0039] Preferably, the training method for the surface finish recognition model is as follows:

[0040] Collect multiple sets of historical detection images and their corresponding labels. If the time cleanliness of the historical detection image is unqualified, the label is marked as 2. If the time cleanliness of the historical detection image is qualified, the label is marked as 3. Convert the historical detection images and their corresponding labels into feature vector 2.

[0041] The second feature vector is used as the input of the second model to train the second model. The goal is to minimize the prediction error. When the error converges and the performance of the second model meets the requirements, the training stops and the resulting second model is used as the surface smoothness recognition model.

[0042] Model 2 is either a regression model or a support vector machine model.

[0043] An optical lens surface finish testing device is provided to implement the aforementioned optical lens surface finish testing method. The device includes a light source, a detection module, a calibration module, an acquisition module, and an evaluation module. The light source is arranged around the detection module and the acquisition module. The detection module is used to acquire an initial image of the detection area. The calibration module calibrates the light source based on the initial image. The acquisition module is used to acquire real-time detection images of the detection area. The evaluation module determines whether the tested object is qualified based on the real-time detection images.

[0044] As can be seen from the above technical solutions, this application has the following beneficial effects:

[0045] 1. By dynamically adjusting the light source configuration according to the different shapes of the object being inspected, uneven illumination on the surface of the object being inspected is avoided, thereby improving the accuracy and efficiency of surface finish detection.

[0046] 2: By identifying the authenticity of abnormal areas, the inability to identify non-light source issues is avoided, improving the accuracy of dynamic adjustment of the light source, and further improving the detection accuracy and efficiency of surface finish.

[0047] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described in detail below with reference to the accompanying drawings. Attached Figure Description

[0048] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0049] Figure 1 This is a schematic flowchart of an optical lens surface finish detection method according to an embodiment of the present invention;

[0050] Figure 2 This is a schematic diagram of the structure of an optical lens surface finish detection device according to an embodiment of the present invention;

[0051] Figure 3 This is a schematic diagram showing the placement of the light source and the object being tested in this invention;

[0052] Figure 4 This is a schematic diagram showing the positional relationship between the light source and the detection module of the present invention;

[0053] Figure 5 This is a schematic diagram of the sub-region division of the present invention.

[0054] Reference numerals: 100, object being tested; 101, first protrusion; 102, second protrusion. Detailed Implementation

[0055] To further illustrate the technical means and effects adopted by the present invention to achieve the intended purpose, the following detailed description, in conjunction with the accompanying drawings and preferred embodiments, describes the specific implementation methods, structures, features, and effects of the third-party system monitoring system, method, apparatus, equipment, and storage medium proposed according to the present invention.

[0056] It should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0057] Example 1

[0058] See Figure 1 and Figure 3 A method for detecting the surface finish of an optical lens, the method comprising:

[0059] A three-dimensional coordinate system is established, mapping g light sources and the detection area onto this system, where g is an integer greater than or equal to 1. The purpose is to determine the coordinates of the g light sources and the detection area. (See also...) Figure 3 As shown, the detection area is the placement area of ​​the object being detected 100, and xyz is the three-dimensional coordinate system.

[0060] Acquire the status data of g light sources and the initial image of the detection area. The initial image is an image taken with the default light source configuration. The status data includes light intensity, light angle and vertical height of the light source. The status data is obtained from the specific parameters of the light source or the installation manual.

[0061] Obtain the sub-brightness value of each pixel in the initial image and label it as... , Let be the sub-brightness value of the i-th pixel; determine abnormal pixels based on the sub-brightness value, and determine abnormal regions based on the abnormal pixels; specifically, the method for determining abnormal pixels includes:

[0062] The total brightness value of the initial image is obtained by formulating the sub-brightness value of each pixel. The total brightness value is labeled as follows. The formula for calculating the total brightness value is: , where N is the total number of pixels in the initial image;

[0063] The deviation value is calculated based on the formulaic calculation of the sub-luminance value and the total luminance value, and is denoted as... The formula for calculating the deviation value is: ,in, To determine whether a pixel is an abnormal pixel, the deviation value is compared with a preset deviation threshold to define the preset target brightness range.

[0064] Optionally, the preset deviation thresholds include a maximum deviation threshold and a minimum deviation threshold. The abnormality types of the abnormal pixels include overexposure and underexposure. The deviation value is compared with the maximum deviation threshold and the minimum deviation threshold respectively. If the deviation value is greater than or equal to the maximum deviation threshold, the pixel is determined to be an abnormal pixel, and the abnormality type is underexposure, that is, the brightness of the area is too strong. If the deviation value is less than or equal to the minimum deviation threshold, the pixel is determined to be an abnormal pixel, and the abnormality type is underexposure, that is, the brightness of the area is too dark, specifically manifested as insufficient lighting or the presence of shadows. If the maximum deviation threshold is greater than the deviation value and the minimum deviation threshold, the pixel is determined to be a normal pixel.

[0065] More specifically, the method for determining abnormal regions includes: connecting adjacent abnormal pixels to form an abnormal pattern, see [reference]. Figure 5 As shown, Figure 5 The marked 'a' and 'b' are both abnormal graphics composed of abnormal pixels. The abnormal graphics are input into the trained discrimination model (the specific training method of the discrimination model is described below) to determine the authenticity of the abnormal graphics. If the discrimination model outputs true, the abnormal graphics are considered as abnormal regions. If the discrimination model outputs false, the abnormal graphics are not considered as abnormal regions.

[0066] The purpose is to identify abnormal areas caused by non-light source issues, thus preventing deviations in light source adjustment due to these issues. Non-light source issues include stains or scratches on the surface of the object being inspected. This is because if light source issues cause localized overexposure or underexposure, the edges of these areas tend to be smooth, meaning the edge gradient follows a fixed pattern. Figure 5 At point 'a', the edges of abnormal areas caused by stains or scratches are uneven, meaning the edge gradient is irregular, such as... Figure 5At point b marked in the text; in some embodiments, the edge gradient information of the abnormal graphic can be obtained using edge detection algorithms, such as the Sobel operator or Canny edge detection to extract edge gradient information; for example, the regularity of the edge is calculated based on the gradient change. If the edge is relatively smooth and has a consistent gradient change, similar to a light source problem, then the abnormal graphic is considered to be caused by a light source problem.

[0067] The target light source and its adjustment instructions are determined based on abnormal regions and status data. Specifically, abnormal regions include overly dark and overexposed regions. The method for determining whether an abnormal region is overly dark or overexposed is as follows: the percentage of abnormal types of abnormal pixels in a single abnormal region is counted. If the total number of overexposed abnormal pixels in an abnormal region is greater than the total number of overly dark abnormal pixels, then the abnormal region is an overexposed region, meaning that the brightness of the abnormal region is too strong, affecting the realism of image acquisition. If the total number of overexposed abnormal pixels is less than or equal to the total number of overly dark abnormal pixels, then the abnormal region is an overly dark region, meaning that the brightness of the abnormal region is too low, affecting the realism of image acquisition. The purpose is to facilitate targeted adjustment of the light source by distinguishing the types of abnormal regions.

[0068] For more details, please refer to Figure 4 and Figure 5 As shown, the method for determining the target light source includes: dividing the detection area into k sub-regions in a fan shape with the center of the detection area as the base, where k is an integer greater than 1, and numbering the k sub-regions sequentially, labeled as follows: ,in For the k-th sub-region, bind and adjust g light sources to the corresponding sub-regions. The adjustment relationship is that if one or more adjacent sub-regions exhibit abnormal conditions, adjusting the g-th light source can resolve these abnormal conditions. (See [reference]). Figure 4 and Figure 5 As shown, if the abnormal region is a, the light source G1 is blocked by the first protrusion 101 and the second protrusion 102 on the surface of the object being tested 100, and the sub-region in which it is located is If adjusting the illumination angle of light source G3 can cover the abnormal region a, then light source G3 and the sub-region... The specific adjustment relationship is determined by those skilled in the art based on the number of light sources, the type of light sources, and the number of sub-regions, and will not be elaborated on here.

[0069] For example, suppose there are g light sources, labeled as follows: G g This represents the g-th light source. Each light source is bound to a corresponding sub-region, and the relationship is adjusted, for example, by the illumination angle or blind spot of the light source. Assume the illumination angle of light source G1 is... The blind spot is located in the sub-region. The illumination angle of light source G3 can compensate for the illumination blind spot of G1, so light source G3 and the sub-region Regarding the binding and adjustment relationships, it is worth mentioning that there is no limit to the number of light sources bound to each sub-region; the specific number depends on the actual situation.

[0070] Extract the sub-region number where the abnormal area is located, and determine the target light source based on the sub-region number and the adjustment relationship. That is, determine the sub-region where the abnormal area is located based on the three-dimensional coordinate system, and then extract the corresponding sub-region number.

[0071] The adjustment commands include angle adjustment commands and intensity adjustment commands. The method for determining the adjustment command is as follows: if the abnormal area is an overexposed area, an intensity adjustment command is generated, and the intensity adjustment command is to reduce the unit illumination intensity of the target light source; for example, such as Figure 5 As shown, if area a is an overexposed area, then the light source G3 will reduce the unit light intensity. The unit light intensity is determined by those skilled in the art based on the specific circumstances.

[0072] If the abnormal area is an excessively dark area, an angle adjustment command is generated; for example, such as Figure 5 As shown, if area a is too dark, the angle of light source G3 is adjusted to change the illumination range and compensate for the blind spot of light source G1.

[0073] Specifically, the methods for adjusting the target light source using angle adjustment commands include:

[0074] Obtain the distance value between the boundary of the dark area and the target light source perpendicular to the detection area, and mark it as ZJ. Obtain the vertical height between the target light source and the detection area from the state data of the target light source.

[0075] The target angle of the target light source is calculated using a formula based on the distance value and vertical height, denoted as MB. The target angle serves as an adjustment parameter for the target light source. For example, the boundary of an overly dark region is represented as a polygon or rectangle. The boundary coordinates of the overly dark region represent the center point or a corner point of the boundary. Boundary coordinates are obtained by extracting the boundary of the overly dark region using image segmentation techniques such as contour extraction or edge detection. In some embodiments, the boundary coordinates can also be the average of the coordinates of all abnormal pixels within the abnormal region. The boundary coordinates are denoted as (X...). B Y B The coordinates of the target light source perpendicular to the detection area are marked as (X). Z Y Z The formula for calculating the distance value ZJ is: The formula for calculating the target angle MB is: ,in, To calculate the function of the angle from the horizontal line to a given point, The vertical height between the target light source and the detection area.

[0076] The purpose of adjusting the target light source based on the adjustment command is to ensure that there are no abnormal areas on the surface of the object being inspected, to ensure the accuracy of the image of the object being inspected, to acquire real-time detection images of the detection area after the correction is completed, and to input the real-time detection images into the trained surface finish recognition model to identify whether the surface finish is qualified.

[0077] The training method for the discrimination model is as follows: multiple sets of historical abnormal images and their corresponding categories are collected in an experimental environment. The categories of the historical abnormal images are divided by those skilled in the art based on the actual situation or experience at the time of collection.

[0078] If the historical abnormal image is collected when it is not a light source problem, it is judged as false and the category is marked as 1. If the historical abnormal image is collected when it is a light source problem, it is judged as true and the category is marked as 0. The historical abnormal image and its corresponding category are converted into feature vector one.

[0079] Multiple sets of historical anomalous images and their corresponding categories are divided into training, validation, and test sets. The data is normalized, and feature vector 1 is used as the input to model 1. Model 1 is trained using the training set, while the performance of model 1 is monitored using the validation set. Hyperparameters are adjusted to optimize the prediction effect. During training, the goal is to minimize the prediction error. When the error on the validation set converges and the performance of model 1 meets the requirements, training is stopped, resulting in model 1, which can accurately predict the authenticity of anomalous images, as the discrimination model. Model 1 can be a support vector machine model, decision tree model, or convolutional neural network model.

[0080] The training method for the surface finish recognition model is as follows: In the experimental environment, multiple sets of historical detection images and their corresponding labels are collected. The labels of the historical detection images are divided by those skilled in the art based on the actual situation or experience at the time of collection. If the surface finish of the historical detection image is unqualified, the label is marked as 2. If the surface finish of the historical detection image is qualified, the label is marked as 3. The historical detection images and their corresponding labels are converted into feature vectors.

[0081] Multiple sets of historical detection images and their corresponding labels are divided into training, validation, and test sets. The data is normalized, and feature vector 2 is used as the input to model 2. Model 2 is trained using the training set, while the performance of model 2 is monitored through the validation set. Hyperparameters are adjusted to optimize the prediction effect. During training, the goal is to minimize the prediction error. When the error on the validation set converges and the performance of model 2 meets the requirements, training stops, resulting in model 2 that can accurately predict whether the surface finish is qualified, which is used as the surface finish recognition model. Model 2 is either a regression model or a support vector machine model.

[0082] Specifically, taking Model 1 as an example, Model 1 uses mean squared error (MSE) as the loss function to measure the model's prediction error:

[0083] ;

[0084] in, It is the actual category corresponding to the historical anomaly graph. It is the category corresponding to the historical anomaly graph predicted by Model 1. is the number of feature vector groups, where s represents the s-th feature vector group. The goal of Model 1 is to minimize this loss function.

[0085] During training, feature vector one or feature vector two is input into model one or model two. The parameters of the model are adjusted by optimization algorithms such as gradient descent to minimize the loss function, thereby optimizing the prediction results of the corresponding categories of historical abnormal graphics or the corresponding labels of historical detection images. During model validation and evaluation, validation set data is used to evaluate the generalization ability of the model to ensure that the model can make accurate predictions on new data.

[0086] This embodiment improves the accuracy of optical lens surface finish detection by dynamically adjusting the light source configuration to ensure the illumination quality of the detection area. It is also adaptable to optical lenses of different shapes, such as those with curved, concave, convex, elliptical, or mixed-shape surfaces.

[0087] Example 2

[0088] See Figure 2 As shown, an optical lens surface finish testing device is used to implement the aforementioned optical lens surface finish testing method. The device includes a light source, a detection module, a calibration module, a data acquisition module, and an evaluation module. The modules are connected via wired and / or wireless networks. There are g light sources distributed around the detection and data acquisition modules. (See reference...) Figure 4 As shown.

[0089] Both the detection module and the acquisition module use high-definition cameras to capture image data of the object being detected. The object being detected is an optical lens with different surface shapes, such as curved, concave spherical, convex spherical, elliptical convex, and mixed-shape surfaces.

[0090] For example, different optical lens surfaces are illuminated by a light source, and the angle of reflected light and the surface illumination blind zone are different. If the illumination uniformity of the surface of the object being tested is not guaranteed, the accuracy of analyzing the smoothness using the image data collected by the acquisition module will be affected.

[0091] The detection module is used to acquire the initial image, and the acquisition module is used to acquire the image of the object to be detected within the detection area after the light source is corrected.

[0092] It is worth mentioning that in some embodiments, the detection module and the acquisition module can be shared or only one can be retained. The light source adjusts its illumination angle through a servo gimbal, which will not be elaborated on here.

[0093] Specifically, the correction module corrects the illumination angle or intensity of g light sources based on image data, with the aim of ensuring the uniformity of illumination on the surface of the object being tested.

[0094] More specifically, the correction module also includes a model training unit one, which is used to train the discrimination model. The training method of the discrimination model is as follows: multiple sets of historical abnormal images and their corresponding categories are collected under experimental conditions. The categories of the historical abnormal images are classified by those skilled in the art based on the actual situation or experience at the time of collection. If the historical abnormal image was collected when it was a non-light source problem, it is judged as false and the category is marked as 1. If the historical abnormal image was collected when it was a light source problem, it is judged as true and the category is marked as 0. The historical abnormal images and their corresponding categories are converted into feature vector one. The multiple sets of historical abnormal images and their corresponding categories are divided into training set, validation set and test set, and the data is normalized. Feature vector one is used as the input of model one. Model one is trained using the training set. At the same time, the performance of model one is monitored through the validation set, and the hyperparameters are adjusted to optimize the prediction effect. During the training process, the goal is to minimize the prediction error. When the error on the validation set converges and the performance of model one meets the requirements, the training is stopped, and model one that can accurately predict the authenticity of abnormal images is obtained as the discrimination model. Model one is a support vector machine model, decision tree model or convolutional neural network model.

[0095] The evaluation module analyzes the smoothness of the image data collected by the acquisition module. The evaluation module also includes a model training unit two, which is used to train the smoothness recognition model. The training method of the smoothness recognition model is as follows: multiple sets of historical detection images and their corresponding labels are collected under experimental conditions. The corresponding labels of the historical detection images are divided by those skilled in the art based on the actual situation or experience at the time of collection. If the smoothness of the historical detection images is unqualified, the label is marked as 2; if the smoothness of the historical detection images is qualified, the label is marked as 3. The historical detection images and their corresponding labels are converted into feature vector two.

[0096] Multiple sets of historical detection images and their corresponding labels are divided into training, validation, and test sets. The data is normalized, and feature vector 2 is used as the input to model 2. Model 2 is trained using the training set, while the performance of model 2 is monitored through the validation set. Hyperparameters are adjusted to optimize the prediction effect. During training, the goal is to minimize the prediction error. When the error on the validation set converges and the performance of model 2 meets the requirements, training stops, resulting in model 2 that can accurately predict whether the surface finish is qualified, which is used as the surface finish recognition model. Model 2 is either a regression model or a support vector machine model.

[0097] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A method for detecting the surface finish of an optical lens, characterized in that, The method includes: Establish a three-dimensional coordinate system and map the g light sources and the detection area onto the three-dimensional coordinate system. The detection area is the placement area of ​​the object being detected. Acquire the state data of g light sources and the initial image of the detection area; Obtain the sub-brightness value of each pixel in the initial image, determine abnormal pixels based on the sub-brightness values, and determine abnormal regions based on the abnormal pixels; The method for determining the abnormal region includes: connecting adjacent abnormal pixels to form an abnormal shape; The abnormal image is input into the trained discrimination model to determine whether the abnormal image is real or fake. If the discrimination model outputs true, the abnormal image is considered an abnormal region. If the discrimination model outputs false, the abnormal image is not considered an abnormal region. Abnormal regions caused by non-light source problems are filtered out. Non-light source problems include stains and scratches on the surface of the object being detected. The abnormal areas include overly dark areas and overexposed areas; The target light source and its adjustment instructions are determined based on abnormal areas and status data. The method for determining the target light source includes: The detection area is divided into k sub-regions in a fan shape with the center of the detection area as the center. The k sub-regions are numbered sequentially. G light sources are bound to the corresponding sub-regions with adjustment relationships. The adjustment relationship is that if an abnormal area appears in one or more adjacent sub-regions, the abnormal area can be resolved by adjusting the g-th light source. The number of the sub-region where the abnormal area is located is extracted, and the target light source is determined based on the number and the adjustment relationship. The adjustment commands include angle adjustment commands and intensity adjustment commands. If the abnormal area is an overexposed area, an intensity adjustment command is generated, and the intensity adjustment command reduces the unit illumination intensity of the target light source. If the abnormal area is an underexposed area, an angle adjustment command is generated. The specific method for adjusting the target light source using the angle adjustment command includes: obtaining the distance value between the boundary of the underexposed area and the target light source perpendicular to the detection area; obtaining the vertical height between the target light source and the detection area from the state data of the target light source; calculating the target angle of the target light source based on the distance value and the vertical height, and using the target angle as the target light source adjustment parameter. The target light source is corrected based on the adjustment command. Real-time detection images of the detection area after correction are collected. The real-time detection images are input into the trained surface finish recognition model to identify whether the surface finish is qualified.

2. The method for detecting the surface finish of an optical lens according to claim 1, characterized in that, The method for determining abnormal pixels includes: The total brightness value of the initial image is obtained by formulating the sub-brightness value of each pixel. The deviation value is calculated based on the formula of sub-brightness value and total brightness value, and the deviation value is compared with the preset deviation threshold to determine whether it is an abnormal pixel.

3. The method for detecting the surface finish of an optical lens according to claim 2, characterized in that, The preset deviation thresholds include a maximum deviation threshold and a minimum deviation threshold, and the abnormality types of the abnormal pixels include underexposure and overexposure. The deviation value is compared with the maximum deviation threshold and the minimum deviation threshold, respectively; If the deviation value is greater than or equal to the maximum deviation threshold, the pixel is determined to be an abnormal pixel, and the abnormality type is overexposure; If the deviation value is less than or equal to the minimum deviation threshold, the pixel is determined to be an abnormal pixel, and the abnormality type is too dark; If the maximum deviation threshold > the deviation value > the minimum deviation threshold, then the pixel is determined to be a normal pixel.

4. The method for detecting the surface finish of an optical lens according to claim 1, characterized in that, The method for determining whether the abnormal area is an overly dark area or an overexposed area is as follows: The percentage of different anomaly types among the abnormal pixels in a single abnormal region is statistically analyzed. If the total number of overexposed abnormal pixels in an abnormal area is greater than the total number of underexposed abnormal pixels, then the abnormal area is an overexposed area. If the total number of overexposed abnormal pixels is less than or equal to the total number of underexposed abnormal pixels, then the abnormal area is an underexposed area.

5. The method for detecting the surface finish of an optical lens according to claim 1, characterized in that, The training method for the discrimination model is as follows: Collect multiple sets of historical anomaly images and their corresponding categories. If the historical anomaly image was collected when it was a non-light source problem, it is determined to be false and the category is marked as 1. If the historical anomaly image was collected when it was a light source problem, it is determined to be true and the category is marked as 0. Convert the historical anomaly image and its corresponding category into feature vector one. The first feature vector is used as the input of the first model. The first model is trained to minimize the prediction error. When the error converges and the performance of the first model meets the requirements, the training is stopped and the resulting first model is used as the discrimination model. Model 1 can be a support vector machine model, decision tree model, or convolutional neural network model.

6. The method for detecting the surface finish of an optical lens according to claim 1, characterized in that, The training method for the surface finish recognition model is as follows: Collect multiple sets of historical detection images and their corresponding labels. If the time cleanliness of the historical detection image is unqualified, the label is marked as 2. If the time cleanliness of the historical detection image is qualified, the label is marked as 3. Convert the historical detection images and their corresponding labels into feature vector 2. The second feature vector is used as the input of the second model to train the second model. The goal is to minimize the prediction error. When the error converges and the performance of the second model meets the requirements, the training stops and the resulting second model is used as the surface smoothness recognition model. Model 2 is either a regression model or a support vector machine model.

7. An optical lens surface finish detection device, used to implement the optical lens surface finish detection method according to any one of claims 1-6, characterized in that, The device includes a light source, a detection module, a calibration module, an acquisition module, and an evaluation module. The light source is arranged around the detection module and the acquisition module. The detection module is used to acquire an initial image of the detection area. The calibration module calibrates the light source based on the initial image. The acquisition module is used to acquire real-time detection images of the detection area. The evaluation module determines whether the surface finish of the object being tested is qualified based on the real-time detection images.

Citation Information

Patent Citations

  • Glass surface smoothness detection device and method

    CN115389421A

  • Camera overexposure anomaly adjustment method and system for photovoltaic cell panel image acquisition

    CN112308843A

  • Light source and setting method thereof, and optical detection method and system

    CN113155845A

  • Light source optimization method for light supplement system of visual inspection system and used experimental device

    CN115356347A

  • Magnet surface defect detection equipment control method for AI optimization and controller

    CN119290894A