Method and system for detecting surface roughness of optical glass
Images are collected and sector-shaped blocks are divided by a digital optical camera, and combined with a convolutional neural network model to determine the roughness of the optical glass surface, solving the problems of low manual detection efficiency and low overall detection accuracy, and achieving efficient and accurate automated detection.
Patent Information
- Application Number
- CN202510040731.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-01-10
AI Technical Summary
In the prior art, the detection of surface roughness of optical glass elements depends on low manual efficiency, and the accuracy of detection is directly used to use convolutional neural networks due to the transparency characteristics.
The optical glass image is collected by a digital optical camera, and after greyscale and image enhancement processing, it is divided into multiple sector-shaped blocks. The surface roughness is determined using a pre-trained convolutional neural network model, and the surface roughness is calculated based on the ratio of sector-shaped blocks.
Automatic detection of optical glass components surfaces is realized, detection efficiency is improved, and detection accuracy is improved.
Smart Images

Figure CN119879789B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of optical glass, and in particular to a method and system for detecting the surface roughness of optical glass. Background Art
[0002] Optical glass is the foundation and an important component of the photography and videography industry, optoelectronic technology industry, and medical device industry. As a basic material, optical glass is increasingly used in various fields. Due to the rapid increase in the output and demand of optical glass, traditional manufacturing technology can no longer meet the market's needs for high-efficiency and high-precision manufacturing.
[0003] Currently, during the production process of optical glass components, the surface roughness of the optical glass is mainly detected manually. This method is inefficient, restricts the improvement of production efficiency, and cannot meet the current market demand. In addition, due to the transparent characteristics of optical glass, directly using convolutional neural networks to detect the entire optical glass will result in low accuracy. Summary of the Invention
[0004] In response to the above-mentioned technical deficiencies, the purpose of the present invention is to provide a method and system for detecting the surface roughness of optical glass, aiming to solve the problem that the current production process of optical glass components mainly relies on manual roughness detection of the surface of optical glass. This method is inefficient and restricts the improvement of production efficiency. In addition, due to the transparent characteristics of optical glass, directly using convolutional neural networks to detect the entire optical glass will result in low accuracy.
[0005] In view of the above problems, the present application provides a method and system for detecting the surface roughness of optical glass.
[0006] The first aspect disclosed in the present application provides a method for detecting the surface roughness of optical glass, the method comprising the following steps:
[0007] Step 1: Place the entire optical glass on a pure white background, use a digital optical camera to capture an image of the entire optical glass, and perform grayscale processing and image enhancement processing to generate a physical image, wherein the optical glass is circular;
[0008] Step 2: Determine the center of the optical glass in the physical image, and divide the optical glass into N fan-shaped blocks with an angle of A through the center of the optical glass, where N = 2π / A, A is less than π / 2, and N is a positive integer;
[0009] Step 3: Use pure white pixels to fill all fan-shaped blocks into rectangles with a width equal to the chord length of the fan and a length equal to the radius of the fan, generating N filled rectangles;
[0010] Step 4: Input N filled rectangles into the pre-trained convolutional neural network model in sequence, determine whether there is surface roughness in the fan-shaped blocks in each filled rectangle, and calculate the number S of filled rectangles with surface roughness in the fan-shaped blocks;
[0011] Step 5: Calculate the ratio of S to N to generate a roughness measurement value for the optical glass surface.
[0012] Preferably, the step 1 specifically includes the following steps:
[0013] Step 1.1: Place the entire optical glass on a pure white background and use a digital optical camera to capture a three-channel color image of the entire optical glass to generate an initial image.
[0014] Step 1.2: Take the average value of the three channels of each pixel in the initial image as the grayscale value to generate a grayscale image;
[0015] Step 1.3: For each pixel of the grayscale image, add 1 to the grayscale value and perform a logarithmic transformation with a natural constant as the base to generate a transformed value. Then, scale the transformed value to the range of [0, 255] to generate a solid image.
[0016] Preferably, the step 2 specifically includes the following steps:
[0017] Step 2.1: Determine the center of the optical glass in the physical image and generate the center coordinates, where the center coordinates consist of the horizontal pixel position and the vertical pixel position;
[0018] Step 2.2: Create N binary images of the same size as the physical image and set all pixel values in each binary image to 0. On all binary images, draw sectors in sequence at non-overlapping, continuous positions, with the center coordinates of the circle as the center of the sector, angle A as the angle of the sector, and the radius of the optical glass in the physical image as the radius of the sector. Set the pixel values within the drawn sectors to 1.
[0019] Step 2.3: Perform a logical AND operation on the N binary images and the physical image respectively, and divide the optical glass into N sector-shaped blocks with an angle of A.
[0020] Preferably, step 4 specifically includes the following steps:
[0021] Step 4.1: Input N filled rectangles into a pre-trained convolutional neural network model in sequence. The convolutional neural network model outputs the probability that the fan-shaped block in each filled rectangle has a rough surface. The convolutional neural network model includes convolutional layers, pooling layers, and fully connected layers.
[0022] Step 4.2: If the probability that the sector-shaped block in the i-th filled rectangle has a rough surface is greater than 0.5, it is determined that the sector-shaped block in the i-th filled rectangle has a rough surface, where i = 1, 2, ..., N;
[0023] Step 4.3: Count the number S of filled rectangles with rough surfaces in the fan-shaped block.
[0024] The second aspect disclosed in the present application provides a system for detecting the surface roughness of optical glass, the system being used in the above-mentioned method for detecting the surface roughness of optical glass, the system comprising:
[0025] An acquisition module, wherein the acquisition module is used to place the entire optical glass on a pure white background, use a digital optical camera device to capture an image of the entire optical glass, and perform grayscale processing and image enhancement processing to generate a solid image, wherein the optical glass is circular;
[0026] A sector module, the sector module is used to determine the center of the optical glass in the physical image, and divide the optical glass into N sector blocks with an angle A through the center of the optical glass, where N = 2π / A, A is less than π / 2, and N is a positive integer;
[0027] A filling module, wherein the filling module is used to use pure white pixels to fill all the sector blocks into rectangles with a width equal to the chord length of the sector and a length equal to the radius of the sector, thereby generating N filled rectangles;
[0028] A determination module is configured to sequentially input N filled rectangles into a pre-trained convolutional neural network model, determine whether a sector-shaped block in each filled rectangle has a rough surface, and calculate the number S of filled rectangles having a sector-shaped block with a rough surface;
[0029] The measurement module is used to calculate the ratio of S to N and generate a measurement value of the surface roughness of the optical glass.
[0030] The third aspect disclosed in the present application provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned method for detecting the surface roughness of optical glass when executing the computer program.
[0031] The fourth aspect disclosed in the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above-mentioned method for detecting the surface roughness of optical glass when executed by a processor.
[0032] The fifth aspect disclosed in the present application provides a computer program product, including a computer program or instructions, which implement the steps of the above-mentioned method for detecting the surface roughness of optical glass when executed by a processor.
[0033] The beneficial effects of the present invention are:
[0034] (1) The automated roughness detection of the surface of circular optical glass components is realized, which solves the problem of low efficiency of roughness detection relying on manual work.
[0035] (2) The circular optical glass element is divided into multiple sector-shaped areas, which are filled into a standard input shape and then input into a convolutional neural network for surface roughness detection. This method is region-specific and solves the problem of low accuracy in directly using a convolutional neural network to detect the entire optical glass. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0037] Figure 1 The figure is an overall flow chart of a method for detecting the surface roughness of optical glass.
[0038] Figure 2 This is the overall structure diagram of an optical glass surface roughness detection system. DETAILED DESCRIPTION
[0039] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0040] like Figure 1 As shown, an embodiment of the present application provides a method for detecting the surface roughness of optical glass, the method comprising the following steps:
[0041] Step 1: Place the entire optical glass on a pure white background, use a digital optical camera to capture an image of the entire optical glass, and perform grayscale processing and image enhancement processing to generate a physical image, wherein the optical glass is circular;
[0042] Step 2: Determine the center of the optical glass in the physical image, and divide the optical glass into N fan-shaped blocks with an angle of A through the center of the optical glass, where N = 2π / A, A is less than π / 2, and N is a positive integer;
[0043] Step 3: Use pure white pixels to fill all fan-shaped blocks into rectangles with a width equal to the chord length of the fan and a length equal to the radius of the fan, generating N filled rectangles;
[0044] Step 4: Input N filled rectangles into the pre-trained convolutional neural network model in sequence, determine whether there is surface roughness in the fan-shaped blocks in each filled rectangle, and calculate the number S of filled rectangles with surface roughness in the fan-shaped blocks;
[0045] Step 5: Calculate the ratio of S to N to generate a roughness measurement value for the optical glass surface.
[0046] Furthermore, the step 1 specifically includes the following steps:
[0047] Step 1.1: Place the entire optical glass on a pure white background and use a digital optical camera to capture a three-channel color image of the entire optical glass to generate an initial image.
[0048] Step 1.2: Take the average value of the three channels of each pixel in the initial image as the grayscale value to generate a grayscale image;
[0049] Step 1.3: For each pixel of the grayscale image, add 1 to the grayscale value and perform a logarithmic transformation with a natural constant as the base to generate a transformed value. Then, scale the transformed value to the range of [0, 255] to generate a solid image.
[0050] Furthermore, the step 2 specifically includes the following steps:
[0051] Step 2.1: Determine the center of the optical glass in the physical image and generate the center coordinates, where the center coordinates consist of the horizontal pixel position and the vertical pixel position;
[0052] Step 2.2: Create N binary images of the same size as the physical image and set all pixel values in each binary image to 0. On all binary images, draw sectors in sequence at non-overlapping, continuous positions, with the center coordinates of the circle as the center of the sector, angle A as the angle of the sector, and the radius of the optical glass in the physical image as the radius of the sector. Set the pixel values within the drawn sectors to 1.
[0053] Step 2.3: Perform a logical AND operation on the N binary images and the physical image respectively, and divide the optical glass into N sector-shaped blocks with an angle of A.
[0054] Furthermore, the step 4 specifically includes the following steps:
[0055] Step 4.1: Input N filled rectangles into a pre-trained convolutional neural network model in sequence. The convolutional neural network model outputs the probability that the fan-shaped block in each filled rectangle has a rough surface. The convolutional neural network model includes convolutional layers, pooling layers, and fully connected layers.
[0056] Step 4.2: If the probability that the sector-shaped block in the i-th filled rectangle has a rough surface is greater than 0.5, it is determined that the sector-shaped block in the i-th filled rectangle has a rough surface, where i = 1, 2, ..., N;
[0057] Step 4.3: Count the number S of filled rectangles with rough surfaces in the fan-shaped block.
[0058] Specifically, the convolutional neural network model includes 4 convolutional layers, 4 pooling layers and 1 fully connected layer. The training data set of the convolutional neural network model is constructed by collecting previous optical glass surface images and processing them using the same method as steps 1 to 3. Finally, the positive and negative samples are manually labeled to construct the training data set. The training data set is divided into training set and test set in a ratio of 8 to 2, and a positive and negative sample balance strategy is adopted.
[0059] Specifically, the learning rate of the convolutional neural network model during training is set to 0.001. The Adam optimizer is used in the training process, and Dropout is performed to prevent overfitting. The loss function uses the binary cross entropy loss function.
[0060] In summary, the method for detecting the surface roughness of optical glass provided in the embodiments of the present application has the following technical effects:
[0061] (1) The automated roughness detection of the surface of circular optical glass components is realized, which solves the problem of low efficiency of roughness detection relying on manual work.
[0062] (2) The circular optical glass element is divided into multiple sector-shaped areas, which are filled into a standard input shape and then input into a convolutional neural network for surface roughness detection. This method is region-specific and solves the problem of low accuracy in directly using a convolutional neural network to detect the entire optical glass.
[0063] Based on the same inventive concept as the method for detecting the surface roughness of optical glass in the above embodiment, Figure 2 As shown, the present application provides a system for detecting the surface roughness of optical glass, the system comprising:
[0064] An acquisition module, wherein the acquisition module is used to place the entire optical glass on a pure white background, use a digital optical camera device to capture an image of the entire optical glass, and perform grayscale processing and image enhancement processing to generate a solid image, wherein the optical glass is circular;
[0065] A sector module, the sector module is used to determine the center of the optical glass in the physical image, and divide the optical glass into N sector blocks with an angle A through the center of the optical glass, where N = 2π / A, A is less than π / 2, and N is a positive integer;
[0066] A filling module, wherein the filling module is used to use pure white pixels to fill all the sector blocks into rectangles with a width equal to the chord length of the sector and a length equal to the radius of the sector, thereby generating N filled rectangles;
[0067] A determination module is configured to sequentially input N filled rectangles into a pre-trained convolutional neural network model, determine whether a sector-shaped block in each filled rectangle has a rough surface, and calculate the number S of filled rectangles having a sector-shaped block with a rough surface;
[0068] The measurement module is used to calculate the ratio of S to N and generate a measurement value of the surface roughness of the optical glass.
[0069] Through the above detailed description of a method for detecting the surface roughness of optical glass in this specification, those skilled in the art can clearly understand an optical glass surface roughness detection system in this embodiment. Since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0070] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps of the above-mentioned method for detecting the surface roughness of optical glass when executing the computer program.
[0071] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned method for detecting the surface roughness of optical glass are implemented.
[0072] In one embodiment, a computer program product is provided, including a computer program or instructions, which implements the steps of the above-mentioned method for detecting the surface roughness of optical glass when the computer program or instructions are executed by a processor.
[0073] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0074] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for detecting the surface roughness of optical glass, characterized in that: The method comprises the following steps: Step 1: Place the entire optical glass on a pure white background, use a digital optical camera to capture an image of the entire optical glass, and perform grayscale processing and image enhancement processing to generate a physical image, wherein the optical glass is circular; Step 2: Determine the center of the optical glass in the physical image, and divide the optical glass into N fan-shaped blocks with an angle of A through the center of the optical glass, where N = 2π / A, A is less than π / 2, and N is a positive integer; Wherein, the step 2 specifically includes the following steps: Step 2.1: Determine the center of the optical glass in the physical image and generate the center coordinates, where the center coordinates consist of the horizontal pixel position and the vertical pixel position; Step 2.2: Create N binary images of the same size as the physical image and set all pixel values in each binary image to 0. On all binary images, draw sectors in sequence at non-overlapping, continuous positions, with the center coordinates of the circle as the center of the sector, angle A as the angle of the sector, and the radius of the optical glass in the physical image as the radius of the sector. Set the pixel values within the drawn sectors to 1. Step 2.3: Perform a logical AND operation on the N binary images and the physical image to divide the optical glass into N fan-shaped blocks with an angle of A. Step 3: Use pure white pixels to fill all fan-shaped blocks into rectangles with a width equal to the chord length of the fan and a length equal to the radius of the fan, generating N filled rectangles; Step 4: Input N filled rectangles into the pre-trained convolutional neural network model in sequence, determine whether there is surface roughness in the fan-shaped blocks in each filled rectangle, and calculate the number S of filled rectangles with surface roughness in the fan-shaped blocks; Step 5: Calculate the ratio of S to N to generate a roughness measurement value for the optical glass surface.
2. The method for detecting the surface roughness of optical glass according to claim 1, wherein: The step 1 specifically includes the following steps: Step 1.1: Place the entire optical glass on a pure white background and use a digital optical camera to capture a three-channel color image of the entire optical glass to generate an initial image. Step 1.2: Take the average value of the three channels of each pixel in the initial image as the grayscale value to generate a grayscale image; Step 1.3: For each pixel of the grayscale image, add 1 to the grayscale value and perform a logarithmic transformation with a natural constant as the base to generate a transformed value. Then, scale the transformed value to the range of [0, 255] to generate a solid image.
3. The method for detecting the surface roughness of optical glass according to claim 1, wherein: The step 4 specifically includes the following steps: Step 4.1: Input N filled rectangles into a pre-trained convolutional neural network model in sequence. The convolutional neural network model outputs the probability that the fan-shaped block in each filled rectangle has a rough surface. The convolutional neural network model includes convolutional layers, pooling layers, and fully connected layers. Step 4.2: If the probability that the sector-shaped block in the i-th filled rectangle has a rough surface is greater than 0.5, it is determined that the sector-shaped block in the i-th filled rectangle has a rough surface, where i = 1, 2, ..., N; Step 4.3: Count the number S of filled rectangles with rough surfaces in the fan-shaped block.
4. A system for detecting the surface roughness of optical glass, the system comprising: An acquisition module, wherein the acquisition module is used to place the entire optical glass on a pure white background, use a digital optical camera device to capture an image of the entire optical glass, and perform grayscale processing and image enhancement processing to generate a solid image, wherein the optical glass is circular; A sector module, the sector module is used to determine the center of the optical glass in the physical image, and divide the optical glass into N sector blocks with an angle A through the center of the optical glass, where N = 2π / A, A is less than π / 2, and N is a positive integer; The sector module specifically performs the following steps: Determine the center of the optical glass in the physical image and generate the coordinates of the center, where the coordinates of the center are composed of the pixel position in the horizontal direction and the pixel position in the vertical direction; Create N binary images of the same size as the physical image, and set all pixel values of each binary image to 0. On all binary images, draw sectors in sequence at non-overlapping continuous positions, with the center coordinates of the circle as the center of the sector block, angle A as the angle of the sector block, and the radius of the optical glass in the physical image as the radius of the sector block. Set the pixel values within the drawn sectors to 1. Perform logical AND operations on N binary images and physical images respectively, and divide the optical glass into N fan-shaped blocks with an angle of A. A filling module, wherein the filling module is used to use pure white pixels to fill all the sector blocks into rectangles with a width equal to the chord length of the sector and a length equal to the radius of the sector, thereby generating N filled rectangles; A determination module is configured to sequentially input N filled rectangles into a pre-trained convolutional neural network model, determine whether a sector-shaped block in each filled rectangle has a rough surface, and calculate the number S of filled rectangles having a sector-shaped block with a rough surface; The measurement module is used to calculate the ratio of S to N and generate a measurement value of the surface roughness of the optical glass.
5. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method for detecting the surface roughness of optical glass according to any one of claims 1 to 3 are implemented.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of a method for detecting the surface roughness of optical glass according to any one of claims 1 to 3 are implemented.
7. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method for detecting the surface roughness of optical glass according to any one of claims 1 to 3 are realized.
Citation Information
Patent Citations
Workpiece surface roughness detection optimization method based on improved histogram homogenization algorithm
CN114972330A
System and method for digitally detecting quality of rough surface of prefabricated part
CN116433587A