A method and detection system for automated detection of surface defects of optical prisms

By integrating an automated inspection system that combines image acquisition, light source adjustment, and multi-angle positioning with multiple recognition algorithms, the problem of high-precision automated identification and classification of surface defects in optical prisms has been solved, improving the accuracy and robustness of the inspection and making it suitable for large-scale production.

CN120847134BActive Publication Date: 2026-02-27SHANGHAI YIQING OPTICAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately and automatically identify and classify various types of defects on the surface of optical prisms, such as scratches, stains, bubbles, broken edges, and pitting, and there are issues of missed detections and misjudgments.

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. It combines image preprocessing, a defect recognition unit, and a classification output unit, and uses various specialized recognition algorithms such as convolutional neural networks and edge detection, along with a quantized scoring function, to perform defect recognition and classification.

Benefits of technology

It achieves high-precision, automated identification and classification of various defects on the surface of optical prisms, improving the accuracy and robustness of detection, and is suitable for large-scale automated detection scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120847134B_ABST
    Figure CN120847134B_ABST
Patent Text Reader

Abstract

The application discloses a kind of methods and detection systems for the automated detection of optical prism surface defects, the system includes image acquisition module, light source module, mechanical carrier module and control processing module.Image acquisition module is collected multi-angle image by high-resolution area array camera and telecentric lens;Light source module is combined with coaxial light source and low-angle ring light source to enhance defect contrast;Mechanical carrier module is the motorized stage that can be accurately rotated;Control processing module includes image pre-processing, defect identification and classification output unit, can automatically identify scratch, stain, bubble, broken edge, pitting and other defect types, and output its size and position parameters.Method, for stain and broken edge defect Designed scoring formula, combined with gray scale analysis, edge extraction and lightweight neural network to realize classification identification.The application has the advantages of comprehensive detection type, high precision, strong adaptability, etc., suitable for large-scale quality inspection link of optical elements.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of optical detection technology, and in particular to a method and a system for automatically detecting surface defects of an optical prism. BACKGROUND

[0002] As a precision optical component, the optical prism is widely used in laser systems, imaging devices, optical communication devices and precision measuring instruments. The surface quality of the optical prism directly affects the performance and stability of the optical system. Therefore, the detection of surface defects of the optical prism has important engineering significance and application value.

[0003] The existing prism surface quality detection method mainly relies on manual visual inspection or simple magnifying glass assisted observation. This method is highly subjective and has poor repeatability, and it is difficult to accurately identify and quantify various types of defects such as micro scratches, bubbles, stains, broken edges or pitting, especially in mass production, which is prone to missed detection and misjudgment. In addition, the visual features of different types of defects differ greatly, and traditional methods are difficult to achieve unified identification and classification.

[0004] In some industrial applications, machine vision has been introduced for surface detection, but most systems rely only on a single light source or fixed angle shooting, which is difficult to cope with the complex reflection characteristics of the prism surface, especially in prisms with high gloss, high refractive index or multi-prism structure. The defect features are often covered by reflected light, resulting in low detection accuracy.

[0005] In terms of detection algorithms, existing technologies mainly focus on traditional image processing methods based on edge extraction, gray level mutation or connected domain analysis, and lack of specialized identification mechanisms for different types of defects. In particular, for stain-like fuzzy boundary defects and broken edge-like structural defects, the adaptability and robustness of existing methods still have a lot of room for improvement.

[0006] In addition, most existing systems fail to form a complete automated defect identification and classification output chain, and still require manual secondary confirmation or manual classification after defect discovery, affecting detection efficiency and consistency.

[0007] Therefore, there is an urgent need for an automated detection system with multi-angle imaging, complex light source illumination control capability, and fusion of multiple defect recognition algorithms to improve the accuracy, robustness and automation level of prism surface defect detection. SUMMARY

[0008] The present application aims to solve the problem of high-precision, automated, classified identification and output of multiple types of defects (such as scratches, stains, bubbles, broken edges and pitting) on the surface of an optical prism in the prior art, to realize a multi-angle, multi-light source assisted, intelligent algorithm integrated high-reliability automatic detection system.

[0009] To solve the above technical problems, the technical scheme of the present application provides an automatic detection system for detecting surface defects of optical prisms, which comprises:

[0010] An image acquisition module is configured to acquire the surface image of the optical prism to be detected, and the image acquisition module comprises a high-resolution area array industrial camera and a telecentric lens.

[0011] A light source module is configured to enhance the visibility of the defect area in the image, and the light source module comprises a coaxial light source and a low-angle ring light source, the illumination direction of which can be adjusted to adapt to different prism structures.

[0012] A mechanical loading module is configured to realize multi-angle positioning and switching of the prism to be detected, and the mechanical loading module is an electric loading stage with a positioning accuracy of ±0.01 mm.

[0013] A control and processing module comprises 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 recognition.

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

[0016] The classification output unit is configured to output the corresponding defect type and size parameter according to the recognition result.

[0017] Optionally, the resolution of the industrial camera of the image acquisition module is not less than 20 million pixels, and the telecentric lens ensures that the defect pixel coverage is not less than 5x5 pixel area.

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

[0019] The installation angle of the coaxial light source is 0°, and the light path is consistent with the camera optical axis.

[0020] The illumination angle of the low-angle ring light source is 60°-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, which supports automatic rotation of the prism to be detected at a preset angle and synchronous adjustment of the illumination direction of the light source, to ensure the consistency of detection of each prism surface and the uniformity of illumination.

[0022] To solve the above technical problems, the technical scheme of the present application also provides a method for detecting surface defects of optical prisms, which comprises the following steps:

[0023] Step 1: Collect multiple angle surface images of the optical prism to be tested by an image acquisition module;

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

[0025] Step 3: Based on the gray scale changes, edge features, and texture features in the images, extract candidate regions that may have defects;

[0026] Step 4: Apply multiple recognition algorithms to the candidate regions to detect whether there are scratches, stains, bubbles, broken edges, or pitting;

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

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

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

[0030] Step 12: Use contrast-limited adaptive histogram equalization (CLAHE) to enhance low brightness areas;

[0031] Step 13: Use a convolutional neural network to extract features such as fuzzy boundaries and uneven gray scale in the stain regions;

[0032] Step 14: Screen out candidate stain regions with irregular shapes and fuzzy boundaries;

[0033] Step 15: Output the area, gray scale distribution, and position coordinates of each stain;

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

[0035]

[0036] Where:

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

[0038] K is the number of stain regions;

[0039] G ref is the background reference gray scale value;

[0040] G i is the average gray scale of the i-th stain region;

[0041] A i is the area of the i-th stain region;

[0042] A totalis the total area of the detected region;

[0043] α, β are weight adjustment factors, controlling the proportion of gray level / area;

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

[0045] Step 17: When R stain is higher than the set threshold T stain , it is determined that there is a stain, and the area, position and risk score of the corresponding 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 profile edge of the prism by using Canny edge detection and morphological closing operation;

[0048] Step 22: Determine whether the edge has a break, an angle defect or a mutation by straight line fitting and morphological continuity analysis;

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

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

[0051] Step 25: And quantify the degree of broken edge by the following scoring function:

[0052]

[0053] Wherein:

[0054] R break is the edge damage score (0-1);

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

[0056] L j is the actual edge length of the jth segment;

[0057] L ref·j is the ideal edge length of the jth reference edge;

[0058] ΔG j is the jth segment gray level mutation value (edge intensity);

[0059] G max is the maximum gray level value in the current image (for normalization);

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

[0061] Step 26: When Rbreak greater than a preset threshold T break When the result is greater than the preset threshold T, it is determined that there is a broken edge, and the start and end coordinates, length, and score value of the damaged area are sent to the classification output unit to output the corresponding flaw type and structural parameters.

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

[0063] Step 31: Gaussian filtering and threshold binarization processing are performed on the image;

[0064] Step 32: closed connected domains are extracted and their geometric morphological features are calculated;

[0065] Step 33: a YOLO series target detection model is used to identify regions with high circularity and low gray level mutation boundary;

[0066] Step 34: the center coordinates, outer diameter, and circularity index of the bubble are output according to the detection result;

[0067] Step 35: when the circularity threshold and the gray level edge feature determination condition are met, the region is identified as a bubble region, and the center coordinates, diameter, and circularity parameters are sent to the classification output unit to output the corresponding bubble type and size feature.

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

[0069] Step 41: image details are enhanced through median filtering and gray level equalization processing;

[0070] Step 42: isolated high gray level regions with an area less than a set threshold are extracted based on Blob analysis;

[0071] Step 43: a lightweight neural network model is used to exclude false defects such as reflection and dust points;

[0072] Step 44: the number, maximum diameter, and unit area distribution density of the pimples are output;

[0073] Step 45: for the identified pimple region, the number, maximum diameter, and unit area distribution density are output, and the above results are sent to the classification output unit to output the corresponding flaw type and statistical parameters.

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

[0075] Step 51: Sobel operator edge detection is performed on the image, and linear high gradient regions are extracted;

[0076] Step 52: Hough transform is applied to preliminarily screen linear structures with long strip shape and consistent direction;

[0077] Step 53: a lightweight convolutional neural network is used to further identify real scratches;

[0078] Step 54: output the length, direction angle and start and end coordinate points of the scratch;

[0079] Step 55: send the length, direction angle and coordinate information corresponding to the recognized scratch area to the classification output unit to output the corresponding scratch type and geometric parameters.

[0080] The beneficial effects of the technical scheme of the present application are:

[0081] The present application integrates an image acquisition module, an image preprocessing unit, a defect recognition unit and a classification output unit. The system can simultaneously recognize various surface defects including scratches, stains, bubbles, broken edges and pockmarks, and output corresponding parameters such as size and position, realizing full-type detection and fine classification of prism surface quality.

[0082] The present application adopts a coaxial light source + low-angle ring light source composite light structure, the irradiation angle of which is adjustable, which can effectively cope with the reflection characteristics of prisms of different geometric structures, enhance the contrast of the defect area, and improve the visibility of the defect features, thereby improving the overall recognition accuracy and robustness.

[0083] The present application controls the synchronous rotation of the electrically driven object platform and the light source. The system can capture image information of each face of the prism from multiple angles, which is particularly suitable for work conditions with multiple prism faces and complex edge angles, effectively avoiding the problems of missed detection and misjudgment caused by single-view angle shielding.

[0084] The present application designs a targeted image recognition algorithm path for different defect types, such as color space enhancement and CNN recognition for stain defects, edge fitting and gray level jump analysis for broken edge defects, and quantitatively evaluates the defect risk by introducing a scoring formula, realizing a more accurate defect determination mechanism.

[0085] The present application formats the recognition results through the classification output unit, including defect category, position coordinate, area or length parameter, etc., and has the ability to interface with the upper quality control system or production control system, suitable for large-scale automatic detection scenarios. BRIEF DESCRIPTION OF DRAWINGS

[0086] Figure 1 Fig. 1 is a structural schematic diagram of an automatic detection system in an embodiment of the present application;

[0087] Figure 2 Fig. 3 is a module schematic diagram of a control and processing module in an embodiment of the present application;

[0088] Figure 3 Fig. 5 is a stain detection step diagram in an embodiment of the present application;

[0089] Figure 4 Figure 2 is a flow chart of a step of edge breakage detection in an embodiment of the present application. DETAILED DESCRIPTION

[0090] The present application will be further described with reference to the drawings and specific embodiments, but not as a limitation of the present application.

[0091] In the description of the present application, it needs to be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise" and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and therefore cannot be understood as indicating or implying that the devices or elements indicated must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the present application.

[0092] In addition, the terms "first", "second" are only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features defined with "first", "second" can explicitly or implicitly include one or more of the features. In the description of the present application, the meaning of "a plurality of" is two or more, unless otherwise specifically limited.

[0093] In the present application, unless otherwise specifically defined and limited, the terms "mounting", "connecting", "connecting", "fixing" and the like should be understood broadly, for example, it can be fixedly connected, or it can be detachably connected, or integrally connected; it can be mechanically connected, or it can be electrically connected; it can be directly connected, or it can be indirectly connected through an intermediate medium, or it can be the communication inside two elements. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.

[0094] In the present application, unless otherwise specifically defined and limited, the first feature "above" or "below" the second feature can include that the first and second features are in direct contact, or that the first and second features are not in direct contact but are in contact through another feature between them. Moreover, the first feature "above", "above" and "above" the second feature includes that the first feature is directly above and obliquely above the second feature, or only indicates that the horizontal height of the first feature is higher than that of the second feature. The first feature "below", "below" and "below" the second feature includes that the first feature is directly above and obliquely above the second feature, or only indicates that the horizontal height of the first feature is less than that of the second feature.

[0095] Please refer to Figure 1 and Figure 2As shown, an embodiment of an automated detection system for detecting surface defects of optical prisms is shown, including the following.

[0096] System composition

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

[0098] Image acquisition module: for acquiring the surface image of the optical prism to be tested, this module includes a high-resolution area array industrial camera and a telecentric lens. The resolution of the industrial camera is not less than 20 million pixels, which can capture the subtle features of the surface of the optical prism. The use of telecentric lens ensures that the imaging scale remains consistent during imaging regardless of the position of the object in the lens, thereby ensuring that the defect pixels cover no less than 5x5 pixel area, providing a basis for subsequent accurate identification of defects. This high-resolution and accurate pixel coverage configuration allows even the smallest defects to be clearly presented in the image, without loss of defect information due to imaging scale problems.

[0099] Light source module: for enhancing the visibility of defect areas in the image, including coaxial light source and low-angle ring light source, whose illumination direction can be adjusted to adapt to different prism structures. The coaxial light source is installed at an angle of 0°, its light path is consistent with the camera optical axis, which can provide uniform front lighting, making the reflected light of the optical prism surface and the camera receiving light on the same axis, which helps to highlight the flatness and texture details of the surface. The illumination angle of the low-angle ring light source is 60°-80°, this angle setting can enhance diffuse reflection and suppress specular reflection. When detecting optical prisms, different structures of prism surfaces have different reflection characteristics of light. By adjusting the illumination angles of the two light sources, the defect area and the normal area can form more obvious contrast, so that the defect features can be displayed more clearly. For example, for some prism surfaces with high gloss, the low-angle ring light source can effectively reduce the interference caused by specular reflection, making it easier to observe defects such as stains and scratches.

[0100] Mechanical loading module: used to realize the multi-angle positioning and switching of the prism to be tested, it is an electric loading stage with a positioning accuracy of ±0.01 mm. The loading stage can accurately control the position and angle of the optical prism, so that the camera can collect images of the prism surface from different angles. Moreover, the mechanical loading module and the light source module are linked through the control system, supporting automatic rotation of the prism to be tested at preset angles and synchronous adjustment of the light source irradiation direction. Such design ensures that each prism face can be uniformly illuminated during detection, ensuring detection consistency and avoiding missed detection and misjudgment caused by single-view angle blocking. For example, for a prism with multiple prism faces and complex edge angles, the mechanical loading module can rotate to collect image information of each prism face comprehensively, without missing any area that may have defects.

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

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

[0103] Defect recognition unit: automatically identify surface defects such as scratches, stains, bubbles, broken edges and pits in the image. For different types of defects, a variety of specialized recognition algorithms are used. For stains, a series of operations such as RGB to HSV color space conversion, brightness channel normalization, CLAHE enhancement, convolutional neural network feature extraction, and shape and boundary screening are used to identify, and the stain risk value is calculated by the scoring function; for broken edges, the profile edge is extracted by using Canny edge detection and morphological closing operation, the edge abnormality is judged by straight line fitting and morphological continuity analysis, the edge offset and incompleteness are calculated, and the broken edge degree is quantified by the scoring function; for bubbles, after Gaussian filtering denoising, threshold binarization, closed connected domain extraction, YOLO series target detection model identification and roundness and gray edge feature judgment are used for detection; for pits, the image details are enhanced by median filtering and gray balance, the isolated high gray area is extracted based on Blob analysis, and the lightweight neural network model is used to exclude false defects; for scratches, the edge is detected by Sobel operator, the linear structure is screened by Hough transform, and the lightweight convolutional neural network is further identified. These targeted recognition algorithms fully consider the feature differences of different defects, improving the accuracy and robustness of defect recognition.

[0104] Classification output unit: output the corresponding defect type and size parameter according to the recognition result. This unit organizes and formats the recognition results of the defect recognition unit, including defect category, position coordinates, area or length parameters and other information. This formatted output enables the system to interface with the upper quality control system or production control system, making it easy to transmit detection results to other systems for further analysis and processing, suitable for large-scale automated detection scenarios. For example, on the production line, the detection results can be directly fed back to the production control system to adjust the production process in time and improve product quality.

[0105] Working method

[0106] The method for detecting surface defects of optical prisms of the present application comprises the following steps:

[0107] Step 1: Collect multiple angle surface images of the optical prism to be tested by the image acquisition module. The position and angle of the prism are accurately controlled by the motorized stage, and the illumination direction of the light source module is adjusted at the same time, so that the images of each face of the prism are obtained from different angles, ensuring that the prism surface is fully covered and avoiding missed detection due to viewing angle problems.

[0108] Step 2: Preprocess the collected images, including noise removal, brightness correction and image enhancement. Adopt appropriate filtering algorithm to remove noise, correct brightness difference by brightness normalization algorithm, and use image enhancement technology to highlight image details, providing clear and accurate image data for subsequent defect recognition.

[0109] Step 3: Based on the gray level changes, edge features, and texture features in the image, candidate regions are extracted for areas where defects may exist. Different types of defects often exhibit different gray level changes, edge features, and texture features in the image. For example, scratches usually appear as linear high gradient regions, and stains may exhibit fuzzy boundaries and uneven gray levels. By analyzing these features, the areas where defects may exist can be preliminarily determined, narrowing the scope for subsequent accurate identification.

[0110] Step 4: Apply multiple recognition algorithms to the candidate regions to detect whether there are scratches, stains, bubbles, broken edges, or pitting. For different types of defects, special recognition algorithms are used. For example, for stain detection, first convert the RGB color space to HSV, then normalize the brightness channel, use CLAHE to enhance the low brightness area, extract the stain features through the convolutional neural network, screen the candidate stain regions with irregular shape and fuzzy boundary, and calculate the stain risk value; for broken edge detection, use Canny edge detection and morphological closing operation to extract the contour edge, judge whether the edge is abnormal through straight line fitting and morphological continuity analysis, calculate the offset and incompleteness of the edge relative to the ideal edge, and quantify the broken edge degree; for bubble detection, perform Gaussian filter denoising and threshold binarization processing on the image, extract the closed connected domain and calculate the geometric morphological features, and use the YOLO series target detection model to identify the regions that meet the conditions; for pitting detection, enhance the image details through median filter and gray balance processing, extract isolated high gray level regions with an area less than a set threshold based on Blob analysis, and use a lightweight neural network model to exclude false defects; for scratch detection, extract linear high gradient regions through Sobel operator edge detection, apply Hough transform to preliminarily screen linear structures with long strip shape and consistent direction, and further identify real scratches based on a lightweight convolutional neural network.

[0111] Step 5: Output the identified defect categories and their corresponding size parameters and position coordinates. The identified defect information is sorted and output by the classification output unit, outputting the specific types of defects such as scratches and stains, as well as the size parameters such as area and length, and the position coordinates in the image, so as to facilitate the positioning and further analysis of the defects.

[0112] The detection of stains, as shown in Figure 3

[0113] Step 11: Perform RGB to HSV color space conversion on the image to be tested, and normalize the brightness channel. The HSV color space is more suitable for analyzing color and brightness. By converting the RGB image to an HSV image and normalizing the brightness channel, the feature differences of stains in brightness can be better highlighted, and the influence of light changes on stain detection can be reduced. ​

[0114] Step 12: Enhance the low-light area using Contrast Limited Adaptive Histogram Equalization (CLAHE). CLAHE can equalize the histogram of an image within a local range, enhancing the contrast of the image, especially for low-light areas. Stains are usually represented as low-light areas in images, and through CLAHE processing, the details of the stain area can be made clearer, facilitating subsequent feature extraction and recognition.

[0115] Step 13: Use a convolutional neural network to extract features such as fuzzy boundaries and uneven gray scale in the stain area. Convolutional neural networks have strong feature extraction capabilities and can accurately extract features of stains through learning from a large number of stain sample images. In stain detection, it can identify features such as fuzzy boundaries and uneven gray scale distribution in the stain area, providing a basis for accurate stain recognition.

[0116] Step 14: Screen candidate stain areas with irregular shapes and fuzzy boundaries. According to the general characteristics of stains, irregular shapes and fuzzy boundaries are important features that distinguish stains from other objects. By analyzing the extracted features, candidate areas that meet these characteristics are selected, further narrowing the scope of stain recognition.

[0117] Step 15: Output the area, gray scale distribution, and position coordinates of each stain. Accurate acquisition of the area, gray scale distribution, and position coordinates of the stain helps to quantitatively evaluate and locate the stain, 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] Where:

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

[0122] K is the number of stain areas;

[0123] G ref is the background reference gray value;

[0124] G i is the average gray scale of the i-th stain area;

[0125] A i is the area of the i-th stain area;

[0126] A total is the total detection area;

[0127] a, b are weight adjustment factors, controlling the gray level / area ratio;

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

[0129] This scoring function takes into account both the gray level difference between the stain area and the background and the proportion of the stain area in the total detection area. By adjusting the weight adjustment factors a and b, the relative importance of gray level and area in stain risk assessment can be flexibly controlled according to actual needs, thus more accurately assessing the risk level of stains.

[0130] Step 17: When R stain is higher than the set threshold T stain , it is determined that there is a stain, and the area, location and risk score of the corresponding stain are sent to the classification output unit to output the corresponding defect type and size parameters. Set a suitable threshold T stain . When the calculated stain risk score is higher than 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. Send the relevant information of the stain to the classification output unit to realize accurate classification and parameter output of the stain defect.

[0131] Detection of broken edges, such as Figure 4 shown:

[0132] Step 21: Use Canny edge detection and morphological closing operation to extract the profile edge of the prism. Canny edge detection algorithm can effectively detect the edge information in the image, and morphological closing operation can smooth and fill the edge, making the extracted profile edge more complete. Through the combination of these two methods, the profile edge of the prism can be accurately obtained, providing a basis for subsequent broken edge detection.

[0133] Step 22: Determine whether the edge is broken, missing corners or mutated by straight line fitting and morphological continuity analysis. Straight line fitting is performed on the extracted profile edge to analyze the morphological continuity of the edge. If the edge is broken, missing corners or mutated, etc., it indicates that there may be a broken edge defect. Straight line fitting can help determine the ideal edge shape, and by comparing with the actual edge, the abnormality of the edge can be accurately judged.

[0134] Step 23: Calculate the offset and incompleteness of the detected edge segment relative to the ideal edge. By calculating the offset and incompleteness of the edge segment relative to the ideal edge, the severity of the broken edge can be quantified. The greater the offset and the higher the incompleteness, the more serious the broken edge defect.

[0135] Step 24: output the start and end coordinates of the broken edge area, the broken length and the edge mutation intensity. Accurate recording of the start and end coordinates of the broken edge area, the broken length and the edge mutation intensity and other information helps to locate and evaluate the broken edge defect, and provides detailed data support for subsequent processing.

[0136] Step 25: and quantify the broken edge degree by the following scoring function:

[0137]

[0138] Wherein:

[0139] R break is the edge break score (0-1);

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

[0141] L j is the actual edge length of the jth segment;

[0142] L ref·j is the ideal length of the jth reference edge;

[0143] ΔG j is the jth segment gray scale mutation value (edge intensity);

[0144] G max is the maximum gray value in the current image (for normalization);

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

[0146] This scoring function comprehensively considers the difference between the actual length and the ideal length of the edge segment and the gray scale mutation value. Through the weighted calculation of these factors, the broken edge degree can be accurately quantified, and a quantitative index is provided for the evaluation of broken edge defects.

[0147] Step 26: when R break is greater than the preset threshold T break , it is determined that there is a broken edge, and the start and end coordinates, length and score value of the broken area are sent to the classification output unit to output the corresponding defect type and structure parameters. Set a reasonable preset threshold T break , when the calculated edge break score is greater than the threshold, it indicates that there is a broken edge defect. The relevant information of the broken edge area is sent to the classification output unit to realize accurate classification and parameter output of the broken edge defect.

[0148] Bubble detection:

[0149] Step 31: Gaussian filter denoising and threshold binarization processing is performed on the image. Gaussian filter can effectively remove the noise in the image, making the image smoother. Threshold binarization processing converts the image into a black and white binary image, which is convenient for subsequent extraction and analysis of bubble area. By setting appropriate threshold, the bubble area can be separated from the background.

[0150] Step 32: Extract closed connected domain and calculate its geometric morphological features. In the binary image, the closed connected domain usually corresponds to the object region in the image. By extracting the closed connected domain and calculating its geometric morphological features such as area, perimeter, roundness, etc., the region that may be a bubble can be preliminarily screened out. Bubble usually has high roundness, through the analysis of roundness and other features, the existence of bubble can be further determined.

[0151] Step 33: Use YOLO series target detection model to identify the region with high roundness and low gray level mutation boundary. YOLO series target detection model has fast and accurate target detection ability. Through the learning of a large number of bubble sample images, it can identify the region with high roundness and low gray level mutation boundary, which is the typical feature of bubble. Using this model can more accurately detect the bubble area and improve the accuracy of bubble detection.

[0152] Step 34: According to the detection result, output the center coordinates, outer diameter and roundness index of the bubble. Accurate output of the center coordinates, outer diameter and roundness index of the bubble helps to locate and quantify the bubble, providing detailed data support for subsequent defect classification and processing.

[0153] Step 35: When the roundness threshold and gray level edge feature judgment conditions are met, the region is identified as a bubble region, and the 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 threshold and gray level edge feature judgment condition, when the detected region meets these conditions, it is determined as a bubble region. Send the relevant information of the bubble to the classification output unit to realize the accurate classification and parameter output of the bubble defect.

[0154] Detection of pitting:

[0155] Step 41: Enhance image details by median filter and gray balance processing. Median filter can effectively remove noise in the image while preserving edge information of the image. Gray balance processing can make the gray distribution of the image more uniform, enhance the contrast of the image and highlight the detailed information in the image. Pitting in the image usually appears as a small isolated high gray region, through these processing, pitting can be more obvious, which is convenient for subsequent detection.

[0156] Step 42: Extract isolated high gray-level regions with an area 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 gray-level regions with an area smaller than a certain value can be extracted, which are likely to be pitting. In this way, possible pitting regions can be preliminarily screened out, preparing for subsequent accurate identification.

[0157] Step 43: Exclude pseudo-defects such as reflections and dust spots using a lightweight neural network model. In actual detection, there may be some pseudo-defects such as reflections and dust spots similar to pitting, which may interfere with the accurate detection of pitting. Using a lightweight neural network model, these pseudo-defects can be accurately identified and excluded through learning from a large number of samples, improving the accuracy of pitting detection.

[0158] Step 44: Output the number of pitting, maximum diameter, and unit area distribution density. Accurately count the number of pitting, measure the maximum diameter, and calculate the unit area distribution density. These parameters can comprehensively reflect the distribution and severity of pitting on the surface of the optical prism, providing important basis for evaluating the surface quality of the optical prism.

[0159] Step 45: Output the number, maximum diameter, and unit area distribution density of the identified pitting region, and send the above results to the classification output unit to output the corresponding defect type and statistical parameters. Send the relevant information of pitting to the classification output unit to realize accurate classification of pitting defects and output of statistical parameters, facilitating further analysis and processing of pitting defects.

[0160] Scratch detection:

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

[0162] Step 52: Apply Hough transform to preliminarily screen out linear structures with long strip shape and consistent direction. Hough transform is a method for detecting straight lines and other geometric shapes in an image. After extracting linear high gradient regions, Hough transform can be applied to screen out linear structures with long strip shape and consistent direction from these regions, further narrowing down the candidate regions of scratches and improving the accuracy of scratch detection.

[0163] Step 53: Further identification of real scratches based on lightweight convolutional neural network. After the first two steps, although some possible scratch areas have been screened out, there may still be some misjudgments. Based on the lightweight convolutional neural network, through the learning of a large number of scratch sample images, the real scratches can be more accurately identified, and the interference of other similar structures is excluded, and the accuracy of scratch detection is improved.

[0164] Step 54: Output the length, direction angle and start and end coordinate points of the scratch. Accurate acquisition of the length, direction angle and start and end coordinate points of the scratch helps to position and quantitatively analyze the scratch, and provides detailed data support for evaluating the influence of the scratch on the surface quality of the optical prism.

[0165] Step 55: Send the length, direction angle and coordinate information of the identified scratch area to the classification output unit to output the corresponding scratch type and geometric parameters. Send the related information of the scratch to the classification output unit to realize accurate classification and geometric parameter output of the scratch defect, which is convenient for further processing and analysis of the scratch defect.

[0166] The method and detection system for automatically detecting surface defects of optical prisms of the present embodiment will be described in detail below.

[0167] System preparation

[0168] Image acquisition module: a high-resolution area array industrial camera with a resolution of 24 million pixels is selected, and a telecentric lens is matched to ensure that the fine defects on the prism surface can be clearly captured, and the defect pixel coverage reaches more than 5x5 pixel area. Install the industrial camera and telecentric lens in the appropriate position so that they can face the three prisms to be tested on the motorized stage.

[0169] Light source module: install coaxial light source and low-angle ring light source. Set the coaxial light source to 0° installation so that its light path is strictly consistent with the camera optical axis; according to the structural characteristics of the three prisms, adjust the irradiation angle of the low-angle ring light source to 70° to enhance the diffuse reflection and suppress the mirror reflection, and highlight the defect area.

[0170] Mechanical loading module: install the motorized stage under the camera and light source to ensure that its positioning accuracy reaches ±0.01 mm. Control the system to set the motorized stage to automatically rotate at a preset angle, 60° each time, and set the light source module to work with the motorized stage, adjust the light source irradiation direction synchronously when the motorized stage rotates, to ensure the light illumination balance of each prism surface.

[0171] Control and processing module: Ensure the normal operation of the software programs of image preprocessing unit, defect recognition unit and classification output unit, and load the corresponding algorithm model and parameter settings. For example, in the scoring function of stain detection, set a = 0.6, b = 0.4, e = 0.001, T stain = 0.5; in the scoring function of broken edge detection, set d = 0.01, T break = 0.3, etc.

[0172] Detection process

[0173] Image acquisition: Place the prism to be tested on the motorized stage and start the system. The motorized stage rotates the prism at a preset angle, and after each rotation, the image acquisition module captures the surface image of the prism at that angle through the industrial camera and telecentric lens. During rotation, the light source module adjusts the illumination direction synchronously to ensure that each facet can be well illuminated. Surface images at multiple angles (e.g. 0°, 60°, 120°) are collected and transmitted to the control and processing module.

[0174] Image preprocessing: After receiving the collected images, the image preprocessing unit first uses the Gaussian filter algorithm to remove noise in the image, making the image smoother. Then, brightness normalization is performed by calculating the average brightness of the image to adjust the brightness of all images to a uniform level. Finally, histogram equalization is used to enhance the contrast of the image and highlight the detailed information in the image, providing clear image data for subsequent defect recognition.

[0175] Defect recognition

[0176] Stain detection: The preprocessed image is converted from RGB to HSV color space, and the brightness channel is normalized. Then, CLAHE is used to enhance the low brightness area, making the stain area more obvious. The trained convolutional neural network is used to extract the fuzzy boundary and uneven gray features of the stain area, and the candidate stain area with irregular shape and fuzzy boundary is selected. The area, gray distribution and position coordinates of each candidate stain area are calculated, and the scoring function Calculate the risk value of the stain. Suppose the risk value R stain = 0.6 of a stain area is calculated, which is higher than the set threshold T stain = 0.5, it is determined that there is a stain in this area, and its area, position and risk score are sent to the classification output unit.

[0177] Edge break detection: Canny edge detection and morphological closing operation are used to extract the profile edge of the prism. Straight line fitting and morphological continuity analysis are performed on the extracted profile edge to determine whether the edge has breaks, missing corners, or mutations. For example, if a significant break is detected in a certain edge segment, the offset and incompleteness of the edge segment relative to the ideal edge are calculated. The start and end coordinates of the broken edge region, the length of the broken edge, and the edge mutation intensity are output, and the degree of edge break is quantified according to the scoring function. False, if R break = 0.4, which is greater than the preset threshold T break = 0.3, it is determined that there is a broken edge, and the start and end coordinates, length, and score of the damaged region are sent to the classification output unit.

[0178] Bubble detection: Gaussian filter denoising and threshold binarization processing are performed on the image, and the closed connected domain is extracted and its geometric shape feature is calculated. The YOLO series target detection model is used to identify regions with high circularity and low gray level mutation boundary. For example, if a region has a circularity of 0.9 and meets the circularity threshold, and the gray level edge feature meets the bubble feature, it is determined to be a bubble region. The center coordinates, outer diameter, and circularity index of the bubble are output, and the center coordinates, diameter, and circularity parameters are sent to the classification output unit.

[0179] Pit detection: The image details are enhanced by median filtering and gray balance processing, and isolated high gray regions with an area less than a set threshold are extracted based on Blob analysis. A lightweight neural network model is used to exclude false defects such as reflections and dust points to determine the pit region. The number of pits, the maximum diameter, and the unit area distribution density are counted and measured, such as detecting 5 pits, a maximum diameter of 0.1 mm, and a unit area distribution density of 0.02 pits / mm 2 . The number of pits, maximum diameter, and unit area distribution density are sent to the classification output unit.

[0180] Scratch detection: Sobel operator edge detection is performed on the image to extract linear high gradient regions, and Hough transform is applied to preliminarily screen long strip-shaped and direction-consistent linear structures. A lightweight convolutional neural network is used to further identify real scratches, and the length, direction angle, and start and end coordinate points of the scratch are output. For example, a scratch with a length of 1 mm, a direction angle of 45°, and start and end coordinate points of (x1, y1) and (x2, y2) is identified, and 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, sorts and formats the output. The output includes defect categories (such as stains, broken edges, bubbles, pitting, scratches), location coordinates, area or length parameters (such as stain area, broken edge length, bubble diameter, pitting maximum diameter, scratch length), risk score (such as stain risk score, broken edge score), etc. These output information can be directly transmitted to the upper quality control system or production control system to adjust and optimize the production process and ensure product quality.

[0182] In summary, the present application integrates image acquisition module, image preprocessing unit, defect identification unit and classification output unit, the system can identify multiple surface defects including scratches, stains, bubbles, broken edges and pitting, and output corresponding size, position and other parameters, realizing full-type detection and fine classification of prism surface quality.

[0183] The present application adopts coaxial light source + low-angle ring light source composite light structure, the illumination angle is adjustable, which can effectively deal with the reflection characteristics of prism surface with different geometric structures, enhance the contrast of defect area, improve the visibility of defect features, and improve the overall recognition accuracy and robustness.

[0184] The present application controls the synchronous rotation of the electric carrying platform and the light source, and the system can capture image information of each face of the prism from multiple angles, especially suitable for prism structure with multiple prismatic surfaces and complex edge angles, effectively avoiding the problems of missed detection and misjudgment caused by single view angle shielding.

[0185] The present application designs a targeted image recognition algorithm path for different defect types, such as color space enhancement and CNN recognition for stain defects, edge fitting and gray level jump analysis for broken edge defects, and quantitatively evaluates the defect risk by introducing a scoring formula, realizing a more accurate defect judgment mechanism.

[0186] The present application formats the recognition results through the classification output unit, including defect categories, location coordinates, area or length parameters, etc., has the ability to interface with the upper quality control system or production control system, and is suitable for large-scale automatic detection scenarios.

[0187] The above is only the preferred embodiment of the present application, and is not limited to the implementation and protection scope of the present application. For those skilled in the art, it should be realized that any equivalent replacement and obvious changes made by applying the contents of the present application specification and drawings should be included in the protection scope of the present application.

Claims

1. An automated inspection system for detecting surface defects in optical prisms, characterized in that, Comprise: An image acquisition module for acquiring surface images of the optical prism to be tested, the image acquisition module comprising a high-resolution area array industrial camera and a telecentric lens; A light source module for enhancing the visibility of defect areas in the image, the light source module comprising a coaxial light source and a low-angle ring light source, the illumination direction of which can be adjusted to adapt to different prism structures; A mechanical carrier module for realizing multi-angle positioning and switching of the prism to be tested, the mechanical carrier module being an electrically driven stage with a positioning accuracy of ±0.01mm; A control and processing module comprising an image preprocessing unit, a defect identification 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 identification unit is configured to automatically identify scratches, stains, bubbles, broken edges and pitting surface defects in the image; The classification output unit is configured to output the corresponding defect type and size parameters according to the identification results; Wherein The identification of the stain comprises the following steps: Step 11: Perform RGB to HSV color space conversion on the image to be tested, and normalize the brightness channel; Step 12: Use contrast limited adaptive histogram equalization (CLAHE) to enhance the low brightness area; Step 13: Use a convolutional neural network to extract the fuzzy boundary and gray scale unevenness features in the stain area; Step 14: Screen the candidate stain areas with irregular shape and fuzzy boundary; Step 15: Output the area, gray scale distribution and position coordinates of each stain; Step 16: And calculate the stain risk value based on the following scoring function: ; Wherein: To score the stain risk; is the number of stain areas; background reference gray value; the average gray level of the first st stain area; For the first Stain area; A is the total detection area; weight adjustment factor, controlling the gray scale / area ratio; To prevent small positive numbers from being zeroed out; Step 17: When above a set threshold a stain is determined to exist, and the area, location, and risk score corresponding to the stain are sent to the classification output unit to output the corresponding blemish type and size parameters.

2. The detection system of claim 1, wherein, The resolution of the industrial camera of the image acquisition module is not less than 20 million pixels, and the telecentric lens ensures that the defect pixel coverage is not less than 5x5 pixels.

3. The detection system of claim 1, wherein, In the combination structure of the coaxial light source and the low-angle ring light source: The coaxial light source is installed at an angle of 0°, and its light path is consistent with the camera optical axis; The illumination angle of the low-angle ring light source is 60°~80°, which is used to enhance diffuse reflection and suppress specular reflection.

4. The detection system of claim 1, wherein, The mechanical carrier module and the light source module are linked through the control system, supporting automatic rotation of the prism to be tested at a preset angle, and synchronous adjustment of the light source illumination direction, to ensure the consistency and illumination uniformity of the detection of each edge surface.

5. The detection system of claim 1, wherein, The detection of the broken edge comprises: Step 21: Use Canny edge detection and morphological closing operation to extract the contour edge of the prism; Step 22: Determine whether the edge has breaks, missing corners or mutations through straight line fitting and morphological continuity analysis; Step 23: Calculate the offset and incompleteness of the detected edge segment relative to the ideal edge; Step 24: Output the start and end coordinates, broken length and edge mutation intensity of the broken edge area; Step 25: And quantify the broken edge degree through the following scoring function: ; Wherein: Edge break score; total number of edge segments detected; for the first segment actual edge length; For the first segment reference edge ideal length; For the first Segmental gradation mutation value; Max is the maximum gray value in the current image; To prevent small positive numbers from being zeroed out; Step 26: When greater than a preset threshold , it is determined that there is a broken edge, and the start and end coordinates, length, and score value of the damaged area are sent to the classification output unit to output the corresponding defect type and structure parameters.

6. The detection system of claim 1, wherein, The detection of the bubble comprises: Step 31: Perform Gaussian filter denoising and threshold binarization processing on the image; Step 32: Extract the closed connected domain and calculate its geometric shape features; Step 33: Use the YOLO series target detection model to identify regions with high circularity and low gray scale mutation boundary; Step 34: Output the center coordinates, outer diameter, and roundness index of the bubble according to the detection results; Step 35: When the roundness threshold and gray edge feature judgment conditions are met, identify as a bubble area, and send the center coordinates, diameter, and roundness parameters to the classification output unit to output the corresponding bubble type and size characteristics.

7. The detection system of claim 1, wherein, The detection of the pitting includes: Step 41: Enhance image details through median filtering and gray balance processing; Step 42: Extract isolated high gray area with area less than the set threshold based on Blob analysis; Step 43: Use lightweight neural network model to exclude light reflection and dust point false defects; Step 44: Output the number, maximum diameter, and unit area distribution density of the pitting; Step 45: Output the number, maximum diameter, and unit area distribution density of the identified pitting area, and send the above results to the classification output unit to output the corresponding defect type and statistical parameters.

8. The detection system of claim 1, wherein, The detection of the scratch includes: Step 51: Perform Sobel operator edge detection on the image and extract linear high gradient area; Step 52: Apply Hough transform to preliminarily screen linear structures with long strip shape and consistent direction; Step 53: Further identify real scratches based on lightweight convolutional neural network; Step 54: Output the length, direction angle, and start and end coordinate points of the scratch; Step 55: Send the length, direction angle, and coordinate information of the identified scratch area to the classification output unit to output the corresponding scratch type and geometric parameters.

9. A method for detecting surface defects of an optical prism, applied to the detection system according to any one of claims 1 to 8, characterized in that, The method includes the following steps: Step 1: Collect multiple angle surface images of the optical prism to be tested through the image acquisition module; Step 2: Preprocess the collected images, including noise removal, brightness correction, and image enhancement; Step 3: Based on the gray scale change, edge feature, and texture feature in the image, extract candidate regions for areas that may have defects; Step 4: Apply multiple recognition algorithms to the candidate regions to detect whether there are scratches, stains, bubbles, broken edges, or pitting; Step 5: Output the recognized defect categories and their corresponding size parameters and position coordinates.