Method for automatically detecting surface defects of optical prism and detection system

By integrating a high-resolution camera, multiple light sources, and multi-angle positioning into an automated detection system, and combining various recognition algorithms, the problems of automation and accuracy in detecting surface defects of optical prisms have been solved, achieving efficient identification and classification of multiple types of defects.

CN120847134AActive Publication Date: 2025-10-28SHANGHAI YIQING OPTICAL TECH CO LTD

Patent Information

Application Number
CN202511293373.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-11
Publication Date
2025-10-28
Estimated Expiration
2045-09-11

AI Technical Summary

Technical Problem

Existing methods for detecting surface defects in optical prisms rely on manual visual inspection, which has poor repeatability and makes it difficult to accurately identify various types of defects. Existing machine vision systems also have difficulty coping with complex reflective characteristics and lack automation and robustness.

Method used

An image acquisition module using a high-resolution area array industrial camera and a telecentric lens, combined with a light source module consisting of a coaxial light source and a low-angle ring light source, achieves multi-angle positioning through an electric stage. Combined with image preprocessing, a defect recognition unit, and a classification output unit, it applies various recognition algorithms such as convolutional neural networks and edge detection to achieve automated recognition and classification of multiple types of defects.

Benefits of technology

It achieves high-precision, automated identification and classification of various defects on the surface of optical prisms, improves the accuracy and robustness of detection, is suitable for prisms with complex structures, and has large-scale automated detection capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120847134A_ABST
    Figure CN120847134A_ABST
Patent Text Reader

Abstract

The invention discloses a method for automatically detecting surface defects of an optical prism and a detection system. The system comprises an image acquisition module, a light source module, a mechanical loading module and a control processing module. The image acquisition module acquires multi-angle images through a high-resolution area-array camera and a telecentric lens; the light source module combines a coaxial light source and a low-angle annular light source to enhance the defect contrast; the mechanical object carrying module is an electric object carrying table capable of accurately rotating; the control processing module comprises an image preprocessing unit, a defect recognition unit and a classification output unit, and can automatically recognize defect types such as scratches, stains, bubbles, broken edges and hard spots and output size and position parameters of the defects. In the aspect of the method, a score calculation formula is designed for stain and broken edge defects, and classification and recognition are realized by combining gray analysis, edge extraction and a lightweight neural network. The method has the advantages of comprehensive detection types, high precision, strong adaptability and the like, and is suitable for large-scale quality inspection links of optical elements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of optical inspection technology, and in particular to a method and inspection system for automated inspection of surface defects in optical prisms. Background Technology

[0002] Optical prisms, as precision optical components, are widely used in laser systems, imaging equipment, optical communication devices, and precision measuring instruments. Their surface quality directly affects the performance and stability of the optical system. Therefore, the detection of surface defects in optical prisms has significant engineering importance and application value.

[0003] Existing methods for inspecting the surface quality of prisms mainly rely on manual visual inspection or simple magnifying glass-assisted observation. This approach is highly subjective, has poor repeatability, and struggles to accurately identify and quantify various types of defects, such as minute scratches, bubbles, stains, broken edges, or pitting. This is particularly problematic in mass production, where missed detections and misjudgments are common. Furthermore, the visual characteristics of different defect types vary significantly, making it difficult for traditional methods to achieve unified identification and classification.

[0004] Machine vision has been introduced for surface inspection in some industrial applications, but most systems rely on a single light source or fixed-angle shooting, which makes it difficult to deal with the complex reflection characteristics of prism surfaces. Especially in prisms with high gloss, high refractive index or multifaceted structures, defect features are often obscured by reflected light, resulting in low detection accuracy.

[0005] In terms of detection algorithms, existing technologies are mostly based on traditional image processing methods such as edge extraction, gray-scale abrupt changes, or connected component analysis. They lack dedicated recognition mechanisms for different types of defects. In particular, for fuzzy boundary defects such as stains and structural defects such as broken edges, the adaptability and robustness of existing methods still have considerable room for improvement.

[0006] In addition, most existing systems have failed to form a complete automated defect identification and classification output chain. After a defect is discovered, it still requires manual secondary confirmation or manual classification, which affects detection efficiency and consistency.

[0007] Therefore, there is an urgent need for an automated detection system that has multi-angle imaging, complex light source illumination control capabilities, and integrates multiple defect recognition algorithms to improve the accuracy, robustness, and automation level of prism surface defect detection. Summary of the Invention

[0008] The present invention aims to solve the problem in the prior art that it is impossible to accurately, automatically, classify and identify and output various types of defects (such as scratches, stains, bubbles, broken edges, and pits) on the surface of optical prisms, so as to realize a highly reliable automatic detection system with multi-angle, multi-light source assistance and integrated intelligent algorithm.

[0009] To address the aforementioned technical problems, the present invention provides an automated inspection system for detecting surface defects in optical prisms, comprising:

[0010] An image acquisition module is used to acquire surface images of the optical prism under test. The image acquisition module includes a high-resolution area array industrial camera and a telecentric lens.

[0011] A light source module is used to enhance the visibility of defective areas in an image. The light source module includes a coaxial light source and a low-angle ring light source, and its illumination direction can be adjusted to adapt to different prism structures.

[0012] The mechanical loading module is used to realize multi-angle positioning and switching of the prism under test. The mechanical loading module is an electric loading stage with a positioning accuracy of ±0.01mm.

[0013] The control and processing module includes an image preprocessing unit, a defect recognition unit, and a classification output unit;

[0014] The image preprocessing unit is configured to perform noise removal, brightness normalization, and image enhancement operations on the acquired image to improve the accuracy of subsequent defect identification.

[0015] The defect recognition unit is configured to automatically recognize surface defects such as scratches, stains, bubbles, broken edges, and pits in the image;

[0016] The classification output unit is configured to output the corresponding defect type and size parameters based on the identification results.

[0017] Optionally, the industrial camera of the image acquisition module has a resolution of no less than 20 million pixels, and the telecentric lens ensures that defective pixels cover an area of ​​no less than 5×5 pixels.

[0018] Optionally, in the combined structure of the coaxial light source and the low-angle ring light source:

[0019] The coaxial light source is installed at a 0° angle, and its optical path is consistent with the camera's optical axis.

[0020] The low-angle ring light source has an illumination angle of 60° to 80°, which is used to enhance diffuse reflection and suppress specular reflection.

[0021] Optionally, the mechanical loading module and the light source module are linked through a control system to support automatic rotation of the prism under test at a preset angle and synchronous adjustment of the light source illumination direction to ensure the detection consistency and illumination uniformity of each prism face.

[0022] To address the aforementioned technical problems, the present invention also provides a method for detecting surface defects of an optical prism, characterized by comprising the following steps:

[0023] Step 1: Acquire surface images of the optical prism under test from multiple angles using the image acquisition module;

[0024] Step 2: Preprocess the acquired images, including noise removal, brightness correction, and image enhancement;

[0025] Step 3: Based on grayscale variations, edge features, and texture features in the image, candidate regions are extracted for areas that may have defects;

[0026] Step 4: Apply multiple recognition algorithms to the candidate areas to detect the presence of scratches, stains, bubbles, broken edges, or pits;

[0027] Step 5: Output the identified defect categories and their corresponding size parameters and location coordinates.

[0028] Optionally, the detection of the stain includes:

[0029] Step 11: Perform RGB to HSV color space conversion on the image to be tested, and normalize the luminance channel;

[0030] Step 12: Enhance low-brightness areas using Contrast-Limited Adaptive Histogram Equalization (CLAHE);

[0031] Step 13: Use a convolutional neural network to extract features such as blurred boundaries and uneven gray levels in the stained area;

[0032] Step 14: Filter candidate stain areas with irregular shapes and blurred boundaries;

[0033] Step 15: Output the area, grayscale distribution, and location coordinates of each stain;

[0034] Step 16: Calculate the stain risk value based on the following scoring function:

[0035]

[0036] in:

[0037] R stain Stain risk score (0-1);

[0038] K represents the number of stained areas;

[0039] G ref Use the grayscale value as a background reference;

[0040] G i Let be the average gray level of the i-th stain area;

[0041] A i Let i be the area of ​​the i-th stain region;

[0042] A totalThis refers to the total area of ​​the detection zone;

[0043] α and β are weighting adjustment factors that control the grayscale / area ratio;

[0044] ∈ represents small positive numbers to prevent division by zero (a stability term);

[0045] Step 17: When R stain Higher than the set threshold T stain When a stain is detected, the area, location, and risk score of the stain are sent to the classification output unit to output the corresponding defect type and size parameters.

[0046] Optionally, the detection of the broken edge includes:

[0047] Step 21: Extract the contour edges of the prism using Canny edge detection and morphological closing operation;

[0048] Step 22: Determine whether there are breaks, missing corners, or abrupt changes at the edges through line fitting and morphological continuity analysis;

[0049] Step 23: Calculate the offset and degree of incompleteness of the detected edge segments relative to the ideal edge;

[0050] Step 24: Output the start and end coordinates of the broken edge region, the broken length, and the edge abrupt change intensity;

[0051] Step 25: Quantify the degree of edge breaking using the following scoring function:

[0052]

[0053] in:

[0054] R break Edge damage is rated (0-1);

[0055] M represents the total number of detected edge segments;

[0056] L j Let j be the actual edge length of the j-th segment;

[0057] L ref·j Let j be the ideal length of the reference edge;

[0058] ΔG j The grayscale abrupt change value (edge ​​intensity) of the j-th segment;

[0059] G max This is the maximum grayscale value in the current image (used for normalization).

[0060] δ is a small positive number to prevent division by zero (stability term);

[0061] Step 26: When Rbreak Greater than the preset threshold T break When a defect is detected, the start and end coordinates, length, and score of the defective area are sent to the classification output unit, which outputs the corresponding defect type and structural parameters.

[0062] Optionally, the detection of the bubbles includes:

[0063] Step 31: Perform Gaussian filtering for noise reduction and threshold binarization on the image;

[0064] Step 32: Extract closed connected components and calculate their geometric features;

[0065] Step 33: Use the YOLO series of object detection models to identify regions with highly rounded, low-grayscale abrupt boundary changes;

[0066] Step 34: Output the center coordinates, outer diameter, and roundness index of the bubble based on the test results;

[0067] Step 35: When the roundness threshold and grayscale edge feature determination conditions are met, it is identified as a bubble region, and its center coordinates, diameter and roundness parameters are sent to the classification output unit to output the corresponding bubble type and size features.

[0068] Optionally, the detection of the pitting includes:

[0069] Step 41: Enhance image details through median filtering and grayscale equalization;

[0070] Step 42: Extract isolated high-grayscale regions with an area smaller than a set threshold based on Blob analysis;

[0071] Step 43: Use a lightweight neural network model to eliminate false defects such as reflections and dust spots;

[0072] Step 44: Output the number of pits, maximum diameter, and distribution density per unit area;

[0073] Step 45: For the identified pitted areas, output their number, maximum diameter, and distribution density per unit area, and send the above results to the classification output unit to output the corresponding defect type and statistical parameters.

[0074] Optionally, the detection of the scratch includes:

[0075] Step 51: Perform Sobel edge detection on the image and extract linear high gradient regions;

[0076] Step 52: Apply Hough transform to initially screen for long, linear structures with consistent orientation;

[0077] Step 53: Further identify real scratches based on a lightweight convolutional neural network;

[0078] Step 54: Output the length, direction angle, and start and end coordinates of the scratch;

[0079] Step 55: Send the length, orientation angle and coordinate information of the identified scratch area to the classification output unit to output the corresponding scratch type and geometric parameters.

[0080] The beneficial effects of the technical solution of this invention are:

[0081] This invention integrates an image acquisition module, an image preprocessing unit, a defect recognition unit, and a classification output unit. The system can simultaneously identify various surface defects, including scratches, stains, bubbles, broken edges, and pitting, and output corresponding parameters such as size and location, thereby achieving full-type detection and refined classification of prism surface quality.

[0082] This invention employs a composite illumination structure of a coaxial light source and a low-angle ring light source, with an adjustable illumination angle. This effectively addresses the reflection characteristics of prism surfaces with different geometries, enhances the contrast of defect areas, and improves the visibility of defect features, thereby increasing the overall recognition accuracy and robustness.

[0083] This invention controls the electric loading platform to rotate synchronously with the light source, enabling the system to capture image information from multiple angles of various faces of the prism. It is particularly suitable for working conditions where the prism structure has multiple facets and complex edge angles, effectively avoiding the problems of missed detection and misjudgment caused by single-view occlusion.

[0084] This invention designs targeted image recognition algorithm paths for different defect types. For example, color space enhancement and CNN recognition are used for stain defects, and edge fitting and grayscale jump analysis are used for edge-damped defects. Furthermore, a scoring formula is introduced to quantify the defect risk and achieve a more accurate defect judgment mechanism.

[0085] This invention uses a classification output unit to format the identification results, including defect category, location coordinates, area or length parameters, etc. It has the ability to interface with the upper-level quality control system or production control system and is suitable for large-scale automated inspection scenarios. Attached Figure Description

[0086] Figure 1 This is a schematic diagram of the structure of the automated detection system in an embodiment of the present invention;

[0087] Figure 2 This is a schematic diagram of the control and processing module in an embodiment of the present invention;

[0088] Figure 3 This is a diagram illustrating the stain detection steps in an embodiment of the present invention;

[0089] Figure 4 This is a diagram illustrating the edge-breaking detection steps in an embodiment of the present invention. Detailed Implementation

[0090] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, but this is not intended to limit the scope of the invention.

[0091] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," and "counterclockwise," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0092] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0093] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0094] In this invention, unless otherwise explicitly specified and limited, "above" or "below" the second feature can include direct contact between the first and second features, or contact between the first and second features through another feature between them. Furthermore, "above," "over," and "on top" of the second feature includes the first feature being directly above or diagonally above the second feature, or simply indicates that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature includes the first feature being directly above or diagonally above the second feature, or simply indicates that the first feature is at a lower horizontal level than the second feature.

[0095] See Figure 1 and Figure 2As shown, an automated inspection system for detecting surface defects of an optical prism is illustrated, including the following.

[0096] System composition

[0097] The automated inspection system for detecting surface defects of optical prisms of the present invention includes the following modules:

[0098] Image Acquisition Module: This module acquires surface images of the optical prism under test. It includes a high-resolution area array industrial camera and a telecentric lens. The industrial camera has a resolution of at least 20 megapixels, capable of capturing minute features on the optical prism surface. The use of a telecentric lens ensures that the imaging ratio remains consistent regardless of the object's position within the lens during imaging, guaranteeing that defect pixel coverage is at least 5×5 pixels, providing a foundation for accurate defect identification. This high-resolution and precise pixel coverage configuration ensures that even extremely small defects are clearly presented in the image, without loss of defect information due to imaging ratio issues.

[0099] Light source module: Used to enhance the visibility of defective areas in images, including a coaxial light source and a low-angle ring light source. The illumination direction is adjustable to accommodate different prism structures. The coaxial light source is installed at 0°, with its optical path aligned with the camera's optical axis, providing uniform frontal illumination. This ensures that the reflected light from the optical prism surface and the light received by the camera are on the same axis, helping to highlight surface smoothness and texture details. The low-angle ring light source has an illumination angle of 60°-80°. This angle setting enhances diffuse reflection and suppresses specular reflection. When inspecting optical prisms, different prism structures have different light reflection characteristics. By adjusting the illumination angles of these two light sources, a more obvious contrast can be created between defective and normal areas, thus more clearly displaying defect features. For example, for some prism surfaces with high gloss, the low-angle ring light source can effectively reduce interference from specular reflection, making defects such as stains and scratches easier to observe.

[0100] The mechanical stage, a motorized stage, enables multi-angle positioning and switching of the prism under test, achieving a positioning accuracy of ±0.01mm. This stage precisely controls the position and angle of the optical prism, allowing the camera to acquire images of the prism surface from different angles. Furthermore, the mechanical stage and the light source module are linked through a control system, supporting automatic rotation of the prism at preset angles and synchronous adjustment of the light source's illumination direction. This design ensures uniform illumination of all facets during inspection, guaranteeing consistent testing and preventing missed detections and misjudgments caused by single-view occlusion. For example, for prisms with multiple facets and complex edge angles, the rotation of the mechanical stage allows for comprehensive acquisition of image information from each facet, leaving no potentially defective area undetected.

[0101] Control and processing module: includes image preprocessing unit, defect recognition unit and classification output unit.

[0102] The image preprocessing unit performs noise removal, brightness normalization, and image enhancement operations on the acquired images to improve the accuracy of subsequent defect identification. During image acquisition, environmental noise, light source fluctuations, and other factors may cause noise interference and uneven brightness in the acquired images. Noise removal can be achieved using filtering algorithms such as Gaussian filtering and median filtering to remove random noise and make the image clearer. Brightness normalization adjusts the brightness of images acquired under different lighting conditions to a uniform standard, eliminating the impact of lighting differences on subsequent defect identification. Image enhancement operations can employ histogram equalization, contrast enhancement, and other methods to highlight details in the image, making defect features more apparent and providing better image data for the defect identification unit.

[0103] Defect Recognition Unit: Automatically identifies surface defects such as scratches, stains, bubbles, broken edges, and pits in images. Multiple specialized recognition algorithms are employed for different types of defects. For stains, a series of operations are performed, including RGB to HSV color space conversion, luminance channel normalization, CLAHE enhancement, convolutional neural network feature extraction, and shape and boundary filtering. A scoring function is used to calculate the stain risk value. For broken edges, Canny edge detection and morphological closing operations are used to extract contour edges. Linear fitting and morphological continuity analysis are used to determine edge anomalies, calculate edge offset and incompleteness, and quantify the degree of edge breakage using a scoring function. For bubbles, Gaussian filtering for noise reduction, threshold binarization, closed connected component extraction, YOLO series object detection models, and roundness and grayscale edge feature determination are used for detection. For pits, median filtering and grayscale equalization enhance image details, Blob analysis extracts isolated high-grayscale regions, and a lightweight neural network model eliminates false defects. For scratches, Sobel operator edge detection, Hough transform filtering for linear structures, and a lightweight convolutional neural network are used for further identification. These targeted identification algorithms fully consider the differences in characteristics of different defects, improving the accuracy and robustness of defect identification.

[0104] The classification output unit outputs the corresponding defect type and size parameters based on the identification results. This unit organizes and formats the identification results from the defect identification unit, including information such as defect category, location coordinates, area, or length parameters. This formatted output enables the system to interface with higher-level quality control systems or production control systems, facilitating the transmission of inspection results to other systems for further analysis and processing. This is suitable for large-scale automated inspection scenarios. For example, on a production line, inspection results can be directly fed back to the production control system for timely adjustments to the production process, improving product quality.

[0105] Working methods

[0106] The method of the present invention for detecting defects on the surface of an optical prism includes the following steps:

[0107] Step 1: Acquire surface images of the optical prism under test from multiple angles using the image acquisition module. The position and angle of the prism are precisely controlled using a motorized stage, while the illumination direction is adjusted in conjunction with the light source module. Images of each facet of the prism are acquired from different angles to ensure complete coverage of the prism surface and avoid missed detections due to viewing angle issues.

[0108] Step 2: Preprocess the acquired images, including noise removal, brightness correction, and image enhancement. Appropriate filtering algorithms are used to remove noise, brightness differences are corrected using a brightness normalization algorithm, and image enhancement techniques are applied to highlight image details, providing clear and accurate image data for subsequent defect identification.

[0109] Step 3: Based on grayscale variations, edge features, and texture features in the image, candidate regions for potential defects are extracted. Different types of defects often exhibit different grayscale variations, edge features, and texture features in the image. For example, scratches typically appear as linear high-gradient regions, while stains may exhibit blurred boundaries and uneven grayscale. By analyzing these features, regions that may contain defects can be preliminarily identified, narrowing down the scope for subsequent precise identification.

[0110] Step 4: Apply multiple recognition algorithms to the candidate areas to detect the presence of scratches, stains, bubbles, broken edges, or pitting. Specific recognition algorithms are used for different types of defects. For example, in stain detection, RGB to HSV color space conversion is performed first, then the brightness channel is normalized, CLAHE is used to enhance low-brightness areas, and stain features are extracted using a convolutional neural network. Candidate stain areas with irregular shapes and blurred boundaries are screened, and stain risk values ​​are calculated. In edge detection, Canny edge detection and morphological closing operations are used to extract contour edges. Linear fitting and morphological continuity analysis are used to determine whether there are abnormalities in the edges. The offset and incompleteness of the edges relative to the ideal edges are calculated, and the degree of edge damage is quantified. In bubble detection, Gaussian filtering and threshold binarization are performed on the image. Closed connected components are extracted and geometric features are calculated. YOLO series target detection models are used to identify regions that meet the conditions. In pitting detection, median filtering and gray-level equalization are used to enhance image details. Isolated high-gray-level regions with an area smaller than a set threshold are extracted based on Blob analysis. A lightweight neural network model is used to eliminate false defects. In scratch detection, linear high-gradient regions are extracted using Sobel edge detection. Hough transform is applied to initially screen long, linear structures with consistent orientation. Then, a lightweight convolutional neural network is used to further identify real scratches.

[0111] Step 5: Output the identified defect categories and their corresponding size parameters and location coordinates. Organize the identified defect information and output the specific defect type (e.g., scratches, stains) through the classification output unit. Simultaneously, output the defect's size parameters (e.g., area, length) and its location coordinates in the image to facilitate defect localization and further analysis.

[0112] Stain detection, such as Figure 3 As shown:

[0113] Step 11: Convert the image to be tested from RGB to HSV color space and normalize the luminance channel. The HSV color space is more suitable for analyzing color and luminance. By converting the RGB image to an HSV image and normalizing the luminance channel, the characteristic differences of stains in terms of luminance can be better highlighted, and the influence of lighting changes on stain detection can be reduced.

[0114] Step 12: Enhance low-brightness areas using Contrast-Limited Adaptive Histogram Equalization (CLAHE). CLAHE can equalize the histogram of an image locally, enhancing image contrast, especially significantly improving detail in low-brightness areas. Stains in images typically appear as low-brightness areas; CLAHE processing can make the details of stained areas clearer, facilitating subsequent feature extraction and recognition.

[0115] Step 13: Use a convolutional neural network to extract features such as blurred boundaries and uneven grayscale distribution in the stained area. Convolutional neural networks have powerful feature extraction capabilities; through learning from a large number of stained sample images, they can accurately extract the features of the stain. In stain detection, it can identify features such as blurred boundaries and uneven grayscale distribution in the stained area, providing a basis for accurate stain identification.

[0116] Step 14: Filter candidate stain areas with irregular shapes and blurred boundaries. Based on the general characteristics of stains, irregular shapes and blurred boundaries are important features that distinguish stains from other objects. By analyzing the extracted features, candidate areas that meet these characteristics are filtered out, further narrowing down the range of stain identification.

[0117] Step 15: Output the area, grayscale distribution, and location coordinates of each stain. Accurately obtaining the area, grayscale distribution, and location coordinates of stains helps in the quantitative assessment and localization of stains, providing detailed data support for subsequent defect classification and processing.

[0118] Step 16: Calculate the stain risk value based on the following scoring function:

[0119]

[0120] in:

[0121] R stain Stain risk score (0-1);

[0122] K represents the number of stained areas;

[0123] G ref Use the grayscale value as a background reference;

[0124] G i Let be the average gray level of the i-th stain area;

[0125] A i Let i be the area of ​​the i-th stain region;

[0126] A total This refers to the total area of ​​the detection zone;

[0127] α and β are weighting adjustment factors that control the grayscale / area ratio;

[0128] ∈ is for small positive numbers to prevent division by zero (stability term).

[0129] This scoring function takes into account the grayscale difference between the stained area and the background, as well as the proportion of the stained area in the total detection area. By adjusting the weight adjustment factors α and β, the relative importance of grayscale and area in stain risk assessment can be flexibly controlled according to actual needs, thereby more accurately assessing the risk level of stains.

[0130] Step 17: When R stain Higher than the set threshold T stain When a stain is detected, its area, location, and risk score are sent to the classification output unit to output the corresponding defect type and size parameters. An appropriate threshold T is set. stain When the calculated stain risk score exceeds the threshold, it indicates that the stain has a certain impact on the surface quality of the optical prism and needs to be recorded and processed. The relevant stain information is sent to the classification output unit to achieve accurate classification and parameter output of stain defects.

[0131] Edge breaking detection, such as Figure 4 As shown:

[0132] Step 21: Extract the prism's contour edges using Canny edge detection and morphological closing operations. The Canny edge detection algorithm effectively detects edge information in the image, while morphological closing operations smooth and fill in the edges, making the extracted contour edges more complete. By combining these two methods, the contour edges of the prism can be accurately obtained, providing a foundation for subsequent edge breakage detection.

[0133] Step 22: Determine if there are breaks, missing corners, or abrupt changes in the edges through linear fitting and morphological continuity analysis. Perform linear fitting on the extracted contour edges and analyze the morphological continuity of the edges. If there are breaks, missing corners, or abrupt changes in the edges, it indicates that there may be edge defects. Linear fitting can help determine the ideal edge shape, and by comparing it with the actual edge, abnormalities in the edges can be accurately identified.

[0134] Step 23: Calculate the offset and degree of incompleteness of the detected edge segments relative to the ideal edge. By calculating the offset and degree of incompleteness of the edge segments relative to the ideal edge, the severity of the edge breakage can be quantified. The larger the offset and the higher the degree of incompleteness, the more severe the edge breakage defect.

[0135] Step 24: Output the start and end coordinates, damage length, and edge abrupt change intensity of the damaged area. Accurately recording the start and end coordinates, damage length, and edge abrupt change intensity of the damaged area helps in locating and evaluating the damaged edge, providing detailed data support for subsequent processing.

[0136] Step 25: Quantify the degree of edge breaking using the following scoring function:

[0137]

[0138] in:

[0139] R break Edge damage is rated (0-1);

[0140] M represents the total number of detected edge segments;

[0141] L j Let j be the actual edge length of the j-th segment;

[0142] L ref·j Let j be the ideal length of the reference edge;

[0143] ΔG j The grayscale abrupt change value (edge ​​intensity) of the j-th segment;

[0144] G max This is the maximum grayscale value in the current image (used for normalization).

[0145] δ is a small positive number to prevent division by zero (stability term).

[0146] This scoring function takes into account the difference between the actual length and the ideal length of the edge segment, as well as the gray-scale abrupt change value. By weighting these factors, it can accurately quantify the degree of edge breakage and provide a quantitative indicator for the assessment of edge breakage defects.

[0147] Step 26: When R break Greater than the preset threshold T break When a defect is detected, the start and end coordinates, length, and score of the damaged area are sent to the classification output unit, which then outputs the corresponding defect type and structural parameters. A reasonable preset threshold T is set. break When the calculated edge damage score exceeds the threshold, it indicates the presence of an edge damage defect. The relevant information of the damaged area is sent to the classification output unit to achieve accurate classification and parameter output of the edge damage defect.

[0148] Bubble detection:

[0149] Step 31: Perform Gaussian filtering for noise reduction and threshold binarization on the image. Gaussian filtering effectively removes noise from the image, making it smoother. Threshold binarization converts the image into a black and white binary image, facilitating subsequent extraction and analysis of the bubble region. By setting an appropriate threshold, the bubble region can be separated from the background.

[0150] Step 32: Extract closed connected components and calculate their geometric features. In binary images, closed connected components typically correspond to object regions in the image. By extracting closed connected components and calculating their geometric features, such as area, perimeter, and roundness, regions that may be bubbles can be preliminarily identified. Bubbles usually have high roundness; by analyzing features such as roundness, the presence of bubbles can be further confirmed.

[0151] Step 33: Use the YOLO series object detection model to identify regions with highly rounded, low-grayscale abrupt boundary changes. The YOLO series object detection model has fast and accurate object detection capabilities. Through learning from a large number of bubble sample images, it can identify regions with highly rounded, low-grayscale abrupt boundary changes, which are typical features of bubbles. Using this model, bubble regions can be detected more accurately, improving the accuracy of bubble detection.

[0152] Step 34: Output the center coordinates, outer diameter, and roundness index of the bubble based on the detection results. Accurately outputting the center coordinates, outer diameter, and roundness index of the bubble helps in the location and quantitative evaluation of the bubble, providing detailed data support for subsequent defect classification and processing.

[0153] Step 35: When the roundness threshold and grayscale edge feature determination conditions are met, the region is identified as a bubble, and its center coordinates, diameter, and roundness parameters are sent to the classification output unit to output the corresponding bubble type and size characteristics. Set appropriate roundness thresholds and grayscale edge feature determination conditions; when a detected region meets these conditions, it is determined to be a bubble region. Send the relevant bubble information to the classification output unit to achieve accurate classification and parameter output of bubble defects.

[0154] Detection of pitting:

[0155] Step 41: Enhance image details through median filtering and gray-level equalization. Median filtering effectively removes noise from the image while preserving edge information. Gray-level equalization makes the gray-level distribution more uniform, enhances image contrast, and highlights details. Mottles in an image typically appear as small, isolated high-gray-level areas; these processing steps make them more noticeable, facilitating subsequent detection.

[0156] Step 42: Extract isolated high-grayscale regions with areas smaller than a set threshold based on Blob analysis. Blob analysis is a method for detecting connected regions in an image. By setting an appropriate threshold, isolated high-grayscale regions with areas smaller than a certain value can be extracted. These regions are likely to be speckled areas. In this way, potential speckled areas can be preliminarily screened, preparing for subsequent accurate identification.

[0157] Step 43: Use a lightweight neural network model to eliminate false defects such as reflections and dust spots. In actual inspection, there may be some false defects similar to pitting, such as reflective areas or dust spots, which may interfere with the accurate detection of pitting. Using a lightweight neural network model, through learning from a large number of samples, these false defects can be accurately identified and eliminated, improving the accuracy of pitting detection.

[0158] Step 44: Output the number of pits, maximum diameter, and distribution density per unit area. Accurately counting the number of pits, measuring the maximum diameter, and calculating the distribution density per unit area are crucial parameters that comprehensively reflect the distribution and severity of pits on the optical prism surface, providing important information for evaluating the surface quality of the optical prism.

[0159] Step 45: For the identified pitted areas, output their quantity, maximum diameter, and distribution density per unit area, and send these results to the classification output unit to output the corresponding defect type and statistical parameters. Sending the relevant information of the pitted areas to the classification output unit enables accurate classification of pitted defects and output of statistical parameters, facilitating further analysis and processing of pitted defects.

[0160] Scratch detection:

[0161] Step 51: Perform Sobel edge detection on the image and extract linear high-gradient regions. The Sobel operator is a commonly used edge detection operator that can detect edges by calculating the gradient values ​​of pixels in an image. Scratches in an image usually appear as linear high-gradient regions. By using the Sobel operator for edge detection, these regions that may be scratches can be effectively extracted.

[0162] Step 52: Apply Hough Transform to initially screen elongated, uniformly oriented linear structures. Hough Transform is a method for detecting geometric shapes such as straight lines in an image. After extracting linear high-gradient regions, applying Hough Transform can filter out elongated, uniformly oriented linear structures from these regions, further narrowing down the candidate region for scratches and improving the accuracy of scratch detection.

[0163] Step 53: Further identify real scratches based on a lightweight convolutional neural network. After the first two steps, although some possible scratch areas have been identified, some false positives may still exist. Based on a lightweight convolutional neural network, by learning from a large number of scratch sample images, it is possible to more accurately identify real scratches, eliminate interference from other similar structures, and improve the accuracy of scratch detection.

[0164] Step 54: Output the length, orientation angle, and start and end coordinates of the scratch. Accurately obtaining information such as the length, orientation angle, and start and end coordinates of the scratch helps in the localization and quantitative analysis of the scratch, providing detailed data support for assessing the impact of the scratch on the surface quality of the optical prism.

[0165] Step 55: Send the length, orientation angle, and coordinate information corresponding to the identified scratch area to the classification output unit to output the corresponding scratch type and geometric parameters. Sending the relevant scratch information to the classification output unit enables accurate classification of scratch defects and output of geometric parameters, facilitating further processing and analysis of the scratch defects.

[0166] The following provides a detailed illustrative description of the method and detection system for automatically detecting surface defects of optical prisms according to this embodiment.

[0167] System Preparation

[0168] Image acquisition module: A high-resolution area array industrial camera with a resolution of 24 megapixels is selected, paired with a telecentric lens to ensure clear capture of minute defects on the prism surface, and to guarantee that the defect pixel coverage reaches a 5×5 pixel area or more. The industrial camera and telecentric lens are mounted in a suitable position so that they are directly facing the prism under test on the motorized stage.

[0169] Light source module: Installs a coaxial light source and a low-angle ring light source. The coaxial light source is installed at 0° to ensure its optical path is strictly aligned with the camera's optical axis. Based on the structural characteristics of the prism, the illumination angle of the low-angle ring light source is adjusted to 70° to enhance diffuse reflection and suppress specular reflection, thus highlighting defective areas.

[0170] Mechanical loading module: The motorized loading stage is installed below the camera and light source, ensuring a positioning accuracy of ±0.01mm. The control system is set to automatically rotate the motorized loading stage at preset angles, rotating 60° at a time. Simultaneously, the light source module is linked to the motorized loading stage, adjusting the illumination direction synchronously as the loading stage rotates to ensure uniform illumination across all surfaces.

[0171] Control and Processing Module: Ensures the normal operation of the software programs for the image preprocessing unit, defect recognition unit, and classification output unit, and loads the corresponding algorithm models and parameter settings. For example, in the stain detection scoring function, α = 0.6, β = 0.4, ∈ = 0.001, T stain =0.5; In the edge-breaking detection scoring function, set δ = 0.01, T break =0.3 etc.

[0172] Testing process

[0173] Image Acquisition: Place the prism under test on the motorized stage and start the system. The motorized stage rotates the prism at a preset angle. After each rotation, the image acquisition module acquires an image of the prism's surface at that angle using an industrial camera and a telecentric lens. During rotation, the light source module synchronously adjusts the illumination direction to ensure that each facet receives good lighting conditions. Surface images at multiple angles (e.g., 0°, 60°, 120°) are acquired and transmitted to the control and processing module.

[0174] Image preprocessing: After receiving the acquired images, the image preprocessing unit first uses a Gaussian filtering algorithm to remove noise and smooth the images. Next, brightness normalization is performed, adjusting the brightness of all images to a uniform level by calculating the average brightness. Finally, histogram equalization is used to enhance image contrast, highlighting details and providing clear image data for subsequent defect identification.

[0175] Defect identification

[0176] Stain detection: The pre-processed image undergoes RGB to HSV color space conversion, and the luminance channel is normalized. Then, CLAHE is applied to enhance low-brightness areas, making stains more prominent. A pre-trained convolutional neural network is used to extract features such as blurred boundaries and uneven grayscale in the stain areas, filtering out candidate stain areas with irregular shapes and blurred boundaries. The area, grayscale distribution, and location coordinates of each candidate stain area are calculated, and then analyzed according to a scoring function. Calculate the stain risk value. Assume a risk value R is calculated for a specific stained area. stain =0.6, higher than the set threshold T stain =0.5, indicating that there is a stain in the area, and its area, location and risk score are sent to the classification output unit.

[0177] Edge Damage Detection: The contour edges of a prism are extracted using Canny edge detection and morphological closing operations. Linear fitting and morphological continuity analysis are performed on the extracted contour edges to determine if there are breaks, missing corners, or abrupt changes. For example, if a significant break is detected on an edge segment, the offset and degree of incompleteness of that edge segment relative to the ideal edge are calculated. The start and end coordinates of the damaged area, the damage length, and the intensity of edge abrupt changes are output, and the degree of edge damage is quantified according to a scoring function. Assuming the calculated R break =0.4, greater than the preset threshold T break =0.3, indicating the presence of a broken edge, and sending the start and end coordinates, length, and score of the broken area to the classification output unit.

[0178] Bubble detection: The image undergoes Gaussian filtering for noise reduction and threshold binarization to extract closed connected components and calculate their geometric features. YOLO target detection models are used to identify regions with high roundness and low gray-level abrupt boundary changes. For example, if a region with a roundness of 0.9 meets the roundness threshold and its gray-level edge features match those of a bubble, it is identified as a bubble region. The bubble's center coordinates, outer diameter, and roundness index are output and sent to the classification output unit.

[0179] Pockmark detection: Image details are enhanced through median filtering and grayscale equalization. Isolated high-grayscale regions with areas smaller than a set threshold are extracted based on blob analysis. A lightweight neural network model is used to eliminate false defects such as reflections and dust spots, thus identifying pinpoint areas. The number of pinpoints is counted, the maximum diameter is measured, and the distribution density per unit area is calculated. For example, if 5 pinpoints are detected with a maximum diameter of 0.1 mm, the distribution density per unit area is 0.02 pinpoints / mm. 2 The number, maximum diameter, and density of the speckles per unit area are sent to the classification output unit.

[0180] Scratch detection: The image is subjected to Sobel edge detection and linear high-gradient regions are extracted. Hough transform is applied to initially screen for long, linear structures with consistent orientation. A lightweight convolutional neural network is then used to further identify real scratches, outputting the scratch's length, orientation angle, and start and end coordinates. For example, if a scratch with a length of 1mm, an orientation angle of 45°, and start and end coordinates (x1, y1) and (x2, y2) is identified, this information is sent to the classification output unit.

[0181] Classification Output: The classification output unit receives various defect information from the defect identification unit, organizes and formats it for output. Output content includes defect category (e.g., stains, broken edges, bubbles, pitting, scratches), location coordinates, area or length parameters (e.g., stain area, broken edge length, bubble diameter, maximum pitting diameter, scratch length), and risk score (e.g., stain risk score, broken edge score). This output information can be directly transmitted to the upper-level quality control system or production control system for adjustments and optimization of the production process to ensure product quality.

[0182] In summary, by integrating an image acquisition module, an image preprocessing unit, a defect recognition unit, and a classification output unit, this invention enables the system to simultaneously identify various surface defects, including scratches, stains, bubbles, broken edges, and pitting, and output corresponding parameters such as size and location, thereby achieving full-type detection and refined classification of prism surface quality.

[0183] This invention employs a composite illumination structure of a coaxial light source and a low-angle ring light source, with an adjustable illumination angle. This effectively addresses the reflection characteristics of prism surfaces with different geometries, enhances the contrast of defect areas, and improves the visibility of defect features, thereby increasing the overall recognition accuracy and robustness.

[0184] This invention controls the electric loading platform to rotate synchronously with the light source, enabling the system to capture image information from multiple angles of various faces of the prism. It is particularly suitable for working conditions where the prism structure has multiple facets and complex edge angles, effectively avoiding the problems of missed detection and misjudgment caused by single-view occlusion.

[0185] This invention designs targeted image recognition algorithm paths for different defect types. For example, color space enhancement and CNN recognition are used for stain defects, and edge fitting and grayscale jump analysis are used for edge-damped defects. Furthermore, a scoring formula is introduced to quantify the defect risk and achieve a more accurate defect judgment mechanism.

[0186] This invention uses a classification output unit to format the identification results, including defect category, location coordinates, area or length parameters, etc. It has the ability to interface with the upper-level quality control system or production control system and is suitable for large-scale automated inspection scenarios.

[0187] The above are merely preferred embodiments of the present invention and are not intended to limit the implementation methods and protection scope of the present invention. Those skilled in the art should recognize that any equivalent substitutions and obvious changes made based on the description and illustrations of the present invention should be included within the protection scope of the present invention.

Claims

1. An automated inspection system for detecting surface defects in optical prisms, characterized in that, include: An image acquisition module is used to acquire surface images of the optical prism under test. The image acquisition module includes a high-resolution area array industrial camera and a telecentric lens. A light source module is used to enhance the visibility of defective areas in an image. The light source module includes a coaxial light source and a low-angle ring light source, and its illumination direction can be adjusted to adapt to different prism structures. The mechanical loading module is used to realize multi-angle positioning and switching of the prism under test. The mechanical loading module is an electric loading stage with a positioning accuracy of ±0.01mm. The control and processing module includes an image preprocessing unit, a defect recognition unit, and a classification output unit; The image preprocessing unit is configured to perform noise removal, brightness normalization, and image enhancement operations on the acquired image to improve the accuracy of subsequent defect identification. The defect recognition unit is configured to automatically recognize surface defects such as scratches, stains, bubbles, broken edges, and pits in the image; The classification output unit is configured to output the corresponding defect type and size parameters based on the identification results.

2. The detection system according to claim 1, characterized in that, The image acquisition module has an industrial camera with a resolution of no less than 20 million pixels, and a telecentric lens ensures that defective pixels cover an area of ​​no less than 5×5 pixels.

3. The detection system according to claim 1, characterized in that, In the combined structure of the coaxial light source and the low-angle ring light source: The coaxial light source is installed at a 0° angle, and its optical path is consistent with the camera's optical axis. The low-angle ring light source has an illumination angle of 60° to 80°, which is used to enhance diffuse reflection and suppress specular reflection.

4. The detection system according to claim 1, characterized in that, The mechanical loading module and the light source module are linked through a control system to support automatic rotation of the prism under test at a preset angle and synchronous adjustment of the light source illumination direction to ensure the detection consistency and illumination uniformity of each prism face.

5. A method for detecting surface defects of an optical prism, characterized in that, The following steps are involved: Step 1: Acquire surface images of the optical prism under test from multiple angles using the image acquisition module; Step 2: Preprocess the acquired images, including noise removal, brightness correction, and image enhancement; Step 3: Based on grayscale variations, edge features, and texture features in the image, candidate regions are extracted for areas that may have defects; Step 4: Apply multiple recognition algorithms to the candidate areas to detect the presence of scratches, stains, bubbles, broken edges, or pits; Step 5: Output the identified defect categories and their corresponding size parameters and location coordinates.

6. The method according to claim 5, characterized in that, The detection of the stains includes: Step 11: Perform RGB to HSV color space conversion on the image to be tested, and normalize the luminance channel; Step 12: Enhance low-brightness areas using Contrast-Limited Adaptive Histogram Equalization (CLAHE); Step 13: Use a convolutional neural network to extract features such as blurred boundaries and uneven gray levels in the stained area; Step 14: Filter candidate stain areas with irregular shapes and blurred boundaries; Step 15: Output the area, grayscale distribution, and location coordinates of each stain; Step 16: Calculate the stain risk value based on the following scoring function: in: R stain Stain risk score (0-1); K represents the number of stained areas; G ref Use the grayscale value as a background reference; G i Let be the average gray level of the i-th stain area; A i Let i be the area of ​​the i-th stain region; A total This refers to the total area of ​​the detection zone; α and β are weighting adjustment factors that control the grayscale / area ratio; ∈ represents small positive numbers to prevent division by zero (a stability term); Step 17: When R stain Higher than the set threshold T stain When a stain is detected, the area, location, and risk score of the stain are sent to the classification output unit to output the corresponding defect type and size parameters.

7. The method according to claim 5, characterized in that, The detection of the broken edge includes: Step 21: Extract the contour edges of the prism using Canny edge detection and morphological closing operation; Step 22: Determine whether there are breaks, missing corners, or abrupt changes at the edges through line fitting and morphological continuity analysis; Step 23: Calculate the offset and degree of incompleteness of the detected edge segments relative to the ideal edge; Step 24: Output the start and end coordinates of the broken edge region, the broken length, and the edge abrupt change intensity; Step 25: Quantify the degree of edge breaking using the following scoring function: in: R break Edge damage is rated (0-1); M represents the total number of detected edge segments; L j Let j be the actual edge length of the j-th segment; L ref·j Let j be the ideal length of the reference edge; ΔG j The grayscale abrupt change value (edge ​​intensity) of the j-th segment; G max This is the maximum grayscale value in the current image (used for normalization). δ is a small positive number to prevent division by zero (stability term); Step 26: When R break Greater than the preset threshold T break When a defect is detected, the start and end coordinates, length, and score of the defective area are sent to the classification output unit, which outputs the corresponding defect type and structural parameters.

8. The method according to claim 5, characterized in that, The detection of the bubbles includes: Step 31: Perform Gaussian filtering for noise reduction and threshold binarization on the image; Step 32: Extract closed connected components and calculate their geometric features; Step 33: Use the YOLO series of object detection models to identify regions with highly rounded, low-grayscale abrupt boundary changes; Step 34: Output the center coordinates, outer diameter, and roundness index of the bubble based on the test results; Step 35: When the roundness threshold and grayscale edge feature determination conditions are met, it is identified as a bubble region, and its center coordinates, diameter and roundness parameters are sent to the classification output unit to output the corresponding bubble type and size features.

9. The method according to claim 5, characterized in that, The detection of the pitting includes: Step 41: Enhance image details through median filtering and grayscale equalization; Step 42: Extract isolated high-grayscale regions with an area smaller than a set threshold based on Blob analysis; Step 43: Use a lightweight neural network model to eliminate false defects such as reflections and dust spots; Step 44: Output the number of pits, maximum diameter, and distribution density per unit area; Step 45: For the identified pitted areas, output their number, maximum diameter, and distribution density per unit area, and send the above results to the classification output unit to output the corresponding defect type and statistical parameters.

10. The method according to claim 5, characterized in that, The detection of the scratches includes: Step 51: Perform Sobel edge detection on the image and extract linear high gradient regions; Step 52: Apply Hough transform to initially screen for long, linear structures with consistent orientation; Step 53: Further identify real scratches based on a lightweight convolutional neural network; Step 54: Output the length, direction angle, and start and end coordinates of the scratch; Step 55: Send the length, orientation angle and coordinate information of the identified scratch area to the classification output unit to output the corresponding scratch type and geometric parameters.

Citation Information

Patent Citations

  • Machine vision-based saw chain surface defect automatic detection system and defect detection method

    CN115456999A

  • Optical element surface defect detection method based on YOLOX algorithm

    CN116612106A

  • Sparkling water machine remote monitoring and fault prediction method and system

    CN119760610A

  • Optical lens surface defect detection method and system based on image processing

    CN119880946A

  • Surface defects evaluation system and method for spherical optical components

    US20170292916A1

Cited By

  • Automatic evaluation method for surface defects of road marking

    CN121616899A