Defect detection method based on spectral imaging and related equipment

By selecting the region of interest using spectral imaging technology and performing spectral feature analysis in the characteristic analysis band, the problem of traditional detection methods being unable to distinguish between surface defects and dirt in transparent media is solved, thus achieving efficient defect detection.

CN121207877APending Publication Date: 2025-12-26广州光信科技有限公司
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511387598.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-26
Publication Date
2025-12-26

AI Technical Summary

Technical Problem

Traditional methods for inspecting transparent media surfaces are difficult to effectively distinguish between defects and dirt, especially in terms of their limited ability to identify minute defects and slight dirt. Furthermore, manual inspection is inefficient and highly subjective.

Method used

A defect detection method based on spectral imaging is adopted. Images of transparent media are acquired by using a line light source and a spectral camera. Regions of interest are selected, and spectral feature analysis is performed in the feature analysis band. The degree of spectral difference is used to distinguish between different regions.

Benefits of technology

It improves the ability to identify minute defects and minor dirt, effectively distinguishes between surface defects and dirt in transparent media, and enhances the accuracy of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121207877A_ABST
    Figure CN121207877A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a defect detection method based on spectral imaging and related equipment, and the method comprises the steps: carrying out the image collection of a to-be-detected transparent medium through a line light source and a spectral camera, and obtaining a clear spectral image set; performing calculation according to the spectral image set, and determining a plurality of regions of interest on the transparent medium to be detected according to a calculation result; calculating according to the spectral feature extraction results of each region of interest under a plurality of feature analysis wavebands, and determining a test value corresponding to each region of interest; and performing judgment according to the test value corresponding to each region of interest and a preset judgment threshold value corresponding to the transparent medium to be detected, and determining a defect detection result of the transparent medium to be detected. According to the embodiment of the invention, the region of interest can be selected for analysis, and the specific feature analysis wave band is selected for spectral feature analysis, so that the surface defects and smudginess of the transparent medium can be effectively distinguished. The method can be widely applied to the technical field of defect detection.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of transparent medium detection, and in particular to a defect detection method based on spectral imaging and related equipment. BACKGROUND

[0002] Common surface abnormalities include defects (such as scratches, cracks) and dirt (such as fingerprints, dust), both of which are similar in appearance. Traditional transparent medium surface detection methods mainly rely on manual visual inspection and ordinary machine vision systems. Among them, manual detection is low in efficiency, strong in subjectivity, and not sensitive to small defects; and conventional machine vision detection mainly relies on two-dimensional gray or color images, and has limited recognition ability for some low-contrast, highly reflective pollution or small defects, and it is difficult to effectively distinguish between "defects" and "dirt" surface abnormalities.

[0003] In summary, the technical problems in the related art need to be improved. SUMMARY

[0004] The main purpose of the embodiments of the present application is to propose a defect detection method based on spectral imaging and related equipment, which realizes effective distinction between transparent medium surface defects and dirt by selecting a region of interest for analysis and selecting a specific feature analysis band for spectral feature analysis.

[0005] To achieve the above-mentioned purpose, one aspect of the embodiments of the present application proposes a defect detection method based on spectral imaging, which comprises the following steps: An image of a transparent medium to be measured is collected by a line light source and a spectral camera to obtain a spectral image set; According to the calculation of the spectral image set, the calculation result is used to determine a plurality of regions of interest on the transparent medium to be measured; according to the spectral feature extraction result of each region of interest in a plurality of feature analysis bands, the test value corresponding to each region of interest is determined; wherein the spectral difference degree between the dirt area and the defect area in the feature analysis band meets the preset requirement; According to the test value corresponding to each region of interest and the preset judgment threshold value corresponding to the transparent medium to be measured, the defect detection result of the transparent medium to be measured is determined.

[0006] In some embodiments, the calculation according to the spectral image set, and the calculation result is used to determine a plurality of regions of interest on the transparent medium to be measured, comprises: According to the spectral image set, statistical feature extraction is performed to obtain a feature extraction result; According to the spectral image set, an image histogram change trend is obtained by calculation; According to the feature extraction result and the image histogram change trend, a plurality of candidate regions of interest on the transparent medium to be tested are determined; According to a spectral image at a position corresponding to each of the candidate regions of interest, a feature value corresponding to each of the candidate regions of interest is obtained. The size and position of each of the candidate regions of interest are adjusted until the feature value corresponding to each of the candidate regions of interest meets a preset threshold value, and a plurality of regions of interest on the transparent medium to be tested are determined according to the adjustment result.

[0007] In some embodiments, the test value corresponding to each of the regions of interest is calculated by the following method: Spectral feature extraction is performed on the region of interest to obtain a spectral intensity data set corresponding to the region of interest; the spectral intensity data set includes intensity values and spectral mean values at a plurality of characteristic analysis wavebands; According to a preset formula and the spectral intensity data set corresponding to the region of interest, a test value corresponding to the region of interest is obtained.

[0008] In some embodiments, the characteristic analysis waveband is determined by the following method: Image acquisition is performed on a transparent medium sample to obtain a spectral intensity data sample set corresponding to a plurality of regions of interest on the transparent medium sample; the plurality of regions of interest include a plurality of dirt regions and a plurality of defect regions with equal numbers; the spectral intensity data sample set includes spectral intensity values and spectral mean values at different wavebands; According to the spectral mean values of each of the dirt regions at different wavebands, a spectral mean value vector of the dirt regions at different wavebands is constructed; according to the spectral mean values of each of the defect regions at different wavebands, a spectral mean value vector of the defect regions at different wavebands is constructed; According to the spectral mean value vectors of the dirt regions and the defect regions at different wavebands, a spectral mean value difference between the dirt regions and the defect regions at different wavebands is obtained, a plurality of wavebands with a spectral mean value difference meeting a preset requirement are screened, and the characteristic analysis waveband is determined according to the screening result.

[0009] In some embodiments, the preset judgment threshold value corresponding to the transparent medium to be tested is determined by the following method: Image acquisition is performed on a transparent medium sample to obtain a spectral intensity data sample set corresponding to a plurality of regions of interest on the transparent medium sample; the plurality of regions of interest include a plurality of dirt regions and a plurality of defect regions with equal numbers; The test value corresponding to each of the defect regions is calculated to obtain a first data set; calculating a test value corresponding to each of the dirty areas to obtain a second data set; analyzing the first data set and the second data set to determine a preset judgment threshold of the transparent medium to be tested.

[0010] In some embodiments, the method further comprises: setting an illumination angle of the line light source as an initial value, performing image acquisition on the transparent medium to be tested to obtain a pre-adjusted spectral image set; and calculating a signal-to-noise ratio based on the pre-adjusted spectral image set and an image contrast evaluation function. adjusting the illumination angle of the line light source and performing image acquisition on the transparent medium to be tested again until the signal-to-noise ratio obtained after adjustment meets a preset condition, and determining the illumination angle of the line light source based on the adjustment result.

[0011] In some embodiments, the method further comprises: constructing a geometric model of the line light source, the spectral camera, and the transparent medium to be tested in a three-dimensional coordinate system, and setting an initial position parameter combination of the line light source and the spectral camera; performing image acquisition on the transparent medium to be tested by the line light source and the spectral camera to obtain a pre-adjusted spectral image set; and calculating quantification evaluation data based on the pre-adjusted spectral image set, wherein the quantification evaluation data includes illumination uniformity, imaging clarity, and contrast. adjusting the position parameter combination of the line light source and the spectral camera based on an optimization algorithm and performing image acquisition again until the quantification evaluation data obtained after adjustment meets a preset condition, and determining the position relationship between the line light source and the spectral camera based on the adjustment result.

[0012] To achieve the above-mentioned purposes, another aspect of the embodiments of the present application proposes a defect detection system based on spectral imaging, which comprises a line light source, a spectral camera, and a processor. The line light source and the spectral camera are configured to perform image acquisition on a transparent medium to be tested to obtain a clear spectral image set. The processor is configured to implement the method according to any one of claims 1 to 7.

[0013] To achieve the above-mentioned purposes, another aspect of the embodiments of the present application proposes a defect detection system based on spectral imaging, which comprises: An image acquisition module is configured to perform image acquisition on a transparent medium to be tested by a line light source and a spectral camera to obtain a clear spectral image set. A region of interest selection module is configured to calculate based on the spectral image set and determine a plurality of regions of interest on the transparent medium to be tested based on the calculation result. a calculation module, configured to calculate according to the spectral feature extraction result of each of the regions of interest in a plurality of characteristic analysis wavebands to determine a test value corresponding to each of the regions of interest; wherein the spectral difference degree of the contaminated region and the defect region meets a preset requirement in the characteristic analysis wavebands; a judgment module, configured to judge according to the test value corresponding to each of the regions of interest and a preset judgment threshold corresponding to the transparent medium to be tested to determine a defect detection result of the transparent medium to be tested.

[0014] To achieve the above object, another aspect of the embodiment of the present application provides an electronic device, which comprises a memory and a processor, the memory stores a computer program, and the processor implements the above method when executing the computer program.

[0015] The embodiment of the present application at least has the following beneficial effects: the present application provides a defect detection method, system and electronic device based on spectral imaging, which acquires images of the transparent medium to be tested by a line light source and a spectral camera, and calculates and analyzes a clear spectral image set obtained to determine a plurality of regions of interest on the transparent medium to be tested, i.e. one of the contaminated region or the defect region, so as to preliminarily screen the contaminated and defect regions by selecting the regions of interest, which can improve the accuracy of defect detection; further, the test value for judging the defect detection result of each region of interest is determined by calculating according to the spectral feature extraction result of each region of interest in a plurality of characteristic analysis wavebands, the waveband with obvious spectral difference degree of the contaminated region and the defect region is selected for analysis, which further improves the accuracy of defect detection; finally, the specific situation of each region of interest, i.e. contamination or defect, is determined by judging each region of interest according to the judgment threshold corresponding to the same specification of the transparent medium to be tested, and the defect detection result of each region of interest is summarized to determine the defect detection result of the whole transparent medium to be tested; for this, the present method can effectively improve the recognition ability of small defects and slight contamination by combining the "preliminary screening of the selected region of interest" and the "spectral feature analysis in the selected characteristic analysis waveband", and effectively distinguishes the defects and contamination on the surface of the transparent medium. BRIEF DESCRIPTION OF DRAWINGS

[0016] Figure 1 is a flowchart of a defect detection method based on spectral imaging provided by the embodiment of the present application; Figure 2 is a structural schematic diagram of a defect detection system based on spectral imaging provided by the embodiment of the present application; Figure 3 is another structural schematic diagram of a defect detection system based on spectral imaging provided by the embodiment of the present application; Figure 4 is a structural block diagram of a defect detection system based on spectral imaging provided by an embodiment of the present application; Figure 5 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0017] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application is further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application. When the following description relates to the drawings, the same numerals in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with embodiments of the present application, but are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the appended claims.

[0018] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0019] Before the embodiments of the present application are described in detail, first, some nouns and terms involved in the embodiments of the present application are described, and the nouns and terms involved in the embodiments of the present application are applicable to the following explanations.

[0020] 1) Defect detection: refers to a process of identifying abnormalities or defects on the surface or inside of a product that do not meet standard quality requirements using automation technology.

[0021] 2) Region of interest (ROI): refers to a specific target area selected manually or circled automatically from an image or data for concentrated analysis and processing.

[0022] Transparent media are widely used in the fields of electronics and optics, and the surface quality thereof directly affects the performance of products. Common surface abnormalities include defects (such as scratches and cracks) and dirt (such as fingerprints and dust), which are similar in appearance and difficult to accurately distinguish by traditional manual detection or visual systems, especially for transparent or reflective transparent media.

[0023] In the related art, traditional transparent medium surface detection methods mainly rely on manual inspection, ordinary machine vision systems or laser displacement sensors. Manual detection is low in efficiency, strong in subjectivity and insensitive to small defects; and conventional machine vision detection mainly relies on two-dimensional gray or color images, and has limited recognition ability for some low-contrast, highly reflective pollution or small defects, and it is difficult to effectively distinguish between "defects" and "dirt", which are two types of surface abnormalities.

[0024] Therefore, the application provides a defect detection method and device based on spectral imaging, an electronic device and a program product. The method comprises the following steps: acquiring an image of a transparent medium to be detected by a line light source and a spectral camera; calculating and analyzing a clear spectral image set obtained by the acquisition, to determine a plurality of regions of interest on the transparent medium to be detected, which are one of a dirty region or a defect region; selecting the regions of interest to preliminarily screen the dirty and defect regions, so as to improve the accuracy of defect detection; further calculating a test value for judging a defect detection result of each region of interest according to a spectral feature extraction result of each region of interest under a plurality of characteristic analysis wavebands, to further improve the accuracy of defect detection by selecting a waveband with obvious spectral difference between the dirty and defect regions under the waveband; finally, judging each region of interest according to a judgment threshold corresponding to the same specification as the transparent medium to be detected, to determine whether each region of interest is dirty or defective, and to collect the defect detection results of each region of interest, so as to determine a defect detection result of the whole transparent medium to be detected. In this way, the method can effectively improve the recognition ability of small defects and slight dirt, and effectively distinguish the defects and dirt on the surface of the transparent medium.

[0025] The defect detection method based on spectral imaging provided in the embodiments of the application relates to the technical field of defect detection. The defect detection method based on spectral imaging provided in the embodiments of the application can be applied to a terminal, can be applied to a server, and can also be software running in the terminal or the server. In some embodiments, the terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a vehicle-mounted terminal, and the like, but is not limited thereto. The server end can be configured as a stand-alone physical server, can be configured as a server cluster or a distributed system composed of multiple physical servers, can be configured as a cloud server providing basic cloud computing services such as cloud service, cloud database, cloud computing, cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, and big data and artificial intelligence platform, and can also be a node server in a blockchain network. The software can be an application for implementing the defect detection method based on spectral imaging, and the like, but is not limited to the above forms.

[0026] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0027] Figure 1 This is an optional flowchart of a defect detection method based on spectral imaging provided in an embodiment of this application. Figure 1 The method may include, but is not limited to, steps S100 to S300: Step S100: Acquire images of the transparent medium under test using a line light source and a spectral camera to obtain a clear set of spectral images.

[0028] Obtain a clear spectral image set of the transparent medium under test, which serves as the data basis for defect detection of the transparent medium under test.

[0029] Step S200: Perform calculations based on the spectral image set, and determine several regions of interest on the transparent medium to be tested based on the calculation results.

[0030] By analyzing and calculating the spectral image data of the transparent medium to be tested, several regions of interest that may be defective or dirty areas on the transparent medium to be tested are identified, and the preliminary screening is completed.

[0031] Step S300: Calculate and determine the test value corresponding to each region of interest based on the spectral feature extraction results of each region of interest under several feature analysis bands; wherein, under the feature analysis bands, the degree of spectral difference between the dirty area and the defective area meets the preset requirements. The test value is obtained by calculating the spectral feature extraction results of each region of interest under a specific feature analysis band. Since the spectral differences between dirt and defects are significant under the feature analysis band, the test value is used as a reference to judge the difference between small defect areas and slightly dirty areas, which can effectively improve the defect detection sensitivity of the transparent medium under test.

[0032] Step S400: judging according to the test value corresponding to each region of interest and the preset judgment threshold value corresponding to the transparent medium to be tested, to determine the defect detection result of the transparent medium to be tested.

[0033] The defect detection results of each region of interest are summarized to determine the defect detection result of the whole transparent medium to be tested.

[0034] In step S200 of some embodiments, the process of determining a plurality of regions of interest on the transparent medium to be tested according to the calculation result of the spectral image set includes but is not limited to steps S210 to S240, wherein: Step S210: statistical feature extraction is performed according to the spectral image set to obtain a feature extraction result; and an image histogram change trend is obtained by calculating the spectral image set.

[0035] The image processing technology is used to pre-process the transparent medium image obtained under the line light source irradiation, a plurality of statistical features (such as local contrast, brightness gradient, standard deviation, edge density, etc.) in the image are analyzed by a computer program, and the image histogram change trend is combined as reference data for determining a plurality of candidate regions of interest (ROI).

[0036] Step S220: a plurality of candidate regions of interest on the transparent medium to be tested are determined according to the feature extraction result and the image histogram change trend.

[0037] The reference data is analyzed by a computer program to automatically determine a plurality of candidate regions of interest on the transparent medium to be tested.

[0038] Step S230: the spectral image at the position corresponding to each candidate region of interest is calculated to obtain a feature value corresponding to each candidate region of interest.

[0039] The feature value corresponding to each candidate region of interest is calculated as reference data for subsequent adjustment; wherein histogram statistical features (such as mean μ, standard deviation σ and gradient intensity G) can be used for analysis.

[0040] Step S240: the size and position of each candidate region of interest are adjusted until the feature value corresponding to each candidate region of interest meets the preset threshold value, and a plurality of regions of interest on the transparent medium to be tested are determined according to the adjustment result.

[0041] The size and position of the ROI are adjusted by traversal, and the feature value is monitored in real time until the preset threshold standard is reached, so as to realize the adaptive selection of the ROI and improve the analysis stability and automation degree; in an example, the region with a contrast greater than 0.6 and a gradient intensity greater than 0.5 can be selected as the final ROI.

[0042] In step S300 of some embodiments, the calculation process of the test value corresponding to each region of interest includes but is not limited to step S310 and step S320; wherein, Step S310: performing spectral feature extraction on the region of interest to obtain a spectral intensity dataset corresponding to the region of interest; the spectral intensity dataset includes intensity values corresponding to a plurality of characteristic analysis bands and spectral mean values.

[0043] After selecting the ROI, spectral feature extraction is performed on the ROI to obtain spectral intensity values corresponding to the ROI in different bands and spectral intensity mean values, which serve as a data basis for subsequent calculation of the test value.

[0044] Step S320: calculating the test value corresponding to the region of interest according to a preset formula and the spectral intensity dataset corresponding to the region of interest.

[0045] According to formula (1), the spectral intensity values corresponding to the region of interest ROI in different bands and the spectral intensity mean values are calculated to obtain the test value corresponding to the region of interest, wherein the specific expression of formula (1) is as follows: (1) In the following formulas, represents the test value, i.e., the standard deviation; represents the spectral intensity value of the i-th data point, represents the mean value of the spectral intensity values of the data points; represents the total number of spectral bands; In step S300 of some embodiments, the characteristic analysis bands are determined by the following method: Step S330: performing image acquisition on the transparent medium sample to obtain a spectral intensity dataset corresponding to a plurality of regions of interest on the transparent medium sample; the plurality of regions of interest include a plurality of dirt regions and a plurality of defect regions with equal numbers; the spectral intensity dataset includes spectral intensity values and spectral mean values in different bands.

[0046] The spectral intensity dataset of the dirt regions and the defect regions on the transparent medium sample is obtained, which serves as a data basis for subsequent calculation of the spectral mean vector.

[0047] Step S340: statistically calculating the spectral mean values of each dirt region in different bands to construct a spectral mean vector of the dirt regions in different bands; and statistically calculating the spectral mean values of each defect region in different bands to construct a spectral mean vector of the defect regions in different bands.

[0048] According to the statistics of the spectral mean of each region in the two types of regions under different wavebands, a spectral mean vector under different wavebands is constructed as the data basis for subsequent calculation of the spectral mean difference under different wavebands.

[0049] Step S350: According to the spectral mean vectors of the dirty regions and the defect regions under different wavebands, the spectral mean difference of the dirty regions and the defect regions under different wavebands is obtained, a plurality of wavebands satisfying the preset requirement of the spectral mean difference are screened, and the characteristic analysis waveband is determined according to the screening result.

[0050] By calculating the spectral mean difference of the two types of regions under different wavebands, a plurality of wavebands capable of distinguishing the spectral difference between the defect regions and the dirty regions to the greatest extent are selected as the characteristic analysis waveband, so as to improve the accuracy and feasibility of the defect detection and analysis of the transparent medium to be tested.

[0051] In step S400 of an embodiment, the preset judgment threshold corresponding to the transparent medium to be tested is determined by the following method: Step S410: Image acquisition is performed on the transparent medium sample to obtain a spectral intensity data sample set corresponding to a plurality of regions of interest on the transparent medium sample; the plurality of regions of interest include a plurality of dirty regions and a plurality of defect regions with equal number.

[0052] The spectral intensity data sample set of the plurality of dirty regions and the plurality of defect regions of the transparent medium sample is obtained as the data basis for subsequent calculation and testing.

[0053] Step S420: The test value corresponding to each defect region is calculated to obtain a first data set; and the test value corresponding to each dirty region is calculated to obtain a second data set.

[0054] The range in which the test value corresponding to the defect region is calculated and the range in which the test value corresponding to the dirty region is calculated.

[0055] Step S430: According to the first data set and the second data set, the preset judgment threshold of the transparent medium to be tested is determined.

[0056] The range in which the test value corresponding to the defect region is calculated and the range in which the test value corresponding to the dirty region is calculated.

[0057] In an embodiment, the process of defect detection on the transparent medium is as follows: (1) The image collected by the transparent medium sample is subjected to gray level histogram equalization, histogram statistical features (mean μ, standard deviation σ, gradient intensity G) are used, and in the process of traversing the ROI size, a plurality of regions satisfying the contrast >0.6 and the gradient intensity >0.5 are selected as the final ROI region.

[0058] In particular, defects (such as scratches, cracks) are defined as anomalies that cannot be erased on the surface of the transparent medium, and dirt (such as fingerprints, water stains, dust) is defined as anomalies that can be erased on the surface.

[0059] (2) According to the sample data calculation and analysis, the transparent medium in this example has the largest spectral difference between the two types of regions in the three specific characteristic analysis wavebands. Therefore, the spectral intensities of the ROI regions A and B are collected in the three specific characteristic analysis wavebands, and the average intensities at each wavelength are calculated. Further calculation of the mean vector corresponding to the region in the specific analysis waveband: the mean vector of region A (scratch): 0.32, 0.56, 0.71. The mean vector of region B (fingerprint): 0.44, 0.48, 0.52.

[0060] (3) The process of calculating the test values of region A and region B is as follows:

[0061] The spectral mean of the spectral intensity of region A (scratch) in the three wavebands:

[0062]

[0063] The spectral intensity of region B (fingerprint) in the three wavebands:

[0064]

[0065] (4) Based on the sample data analysis, it is found that the spectral response of the defect region fluctuates greatly in the three wavebands, and the standard deviation value is significantly higher than that of the dirt region; the test value σ of the defect region ranges from 0.4 to 0.8, and the test value σ of the dirt region ranges from 0.01 to 0.3. Therefore, the judgment threshold is set to = 0.35.

[0066] Judgment is made by pre-setting the judgment threshold, such as: region A: is determined to be a defect. Region B: is determined to be dirt ​​​​​​​​​​​​​In step S400 of some embodiments, the process of determining the defect detection result of the transparent medium to be tested by judging according to the test value corresponding to each region of interest and the preset judgment threshold corresponding to the transparent medium to be tested, includes but is not limited to step S410: Step S410: If the test value corresponding to the region of interest is greater than the preset judgment threshold corresponding to the transparent medium to be tested, it is determined that the region of interest is a defect region, otherwise it is determined that the region of interest is a dirty region; the defect detection result of the transparent medium to be tested is determined according to the determination result of each region of interest.

[0067] The type judgment result of each region of interest on the transparent medium to be tested is summarized to determine the defect detection result thereof.

[0068] In some embodiments, the method of the present application further includes the following steps: Step S510: Set the illumination angle of the line light source to an initial value, and perform image acquisition on the transparent medium to be tested to obtain a pre-adjusted spectral image set; calculate the signal-to-noise ratio according to the pre-adjusted spectral image set and the image contrast evaluation function.

[0069] The signal-to-noise ratio is obtained by analyzing the obtained image set, which is used as a standard for evaluating the pros and cons of the setting of the illumination angle of the line light source.

[0070] Step S520: Adjust the illumination angle of the line light source and re-perform image acquisition on the transparent medium to be tested until the signal-to-noise ratio obtained after adjustment meets the preset condition, and determine the illumination angle of the line light source according to the adjustment result.

[0071] Adjust the illumination angle of the line light source and re-calculate the signal-to-noise ratio until the adjusted signal-to-noise ratio meets the preset condition to determine the optimal illumination angle of the line light source.

[0072] In an embodiment, the illumination angle of the line light source can be arranged at an inclination angle of 35°-55°. The method of the present application sets the parameter space of the incident angle of the line light source, and simulates or acquires imaging data under different angles by computer program, and calculates the signal-to-noise ratio of defects and dirty areas by using the image contrast evaluation function, and then determines the optimal light source inclination angle range. Experimental results show that when the illumination angle of the line light source is 35°-55°, the imaging contrast of defects and dirt reaches the optimum, thereby realizing high-reliability defect detection.

[0073] In some embodiments, the method of the present application further includes the following steps: Step S610: Construct a geometric model of the line light source, the spectral camera and the transparent medium to be tested in a three-dimensional coordinate system, and set the initial position parameter combination of the line light source and the spectral camera.

[0074] According to the line light source, the spectral camera and the space geometry model of the transparent medium to be measured, and setting the initial position parameter combination therebetween as the initial state.

[0075] Step S620: image acquisition of the transparent medium to be measured by the line light source and the spectral camera, obtaining a pre-adjusted spectral image set; calculating according to the pre-adjusted spectral image set, obtaining quantitative evaluation data; the quantitative evaluation data includes illumination uniformity, imaging clarity and contrast.

[0076] According to the initial state of the current position relationship, image acquisition is performed, and a series of quantitative evaluation data are obtained by calculating according to the acquired spectral image set, as a reference for adjusting the position relationship between the line light source, the spectral camera and the transparent medium to be measured.

[0077] Step S630: adjusting the position parameter combination of the line light source and the spectral camera based on the optimization algorithm and re-performing image acquisition until the quantitative evaluation data obtained after adjustment meet the preset requirements, and determining the position relationship between the line light source and the spectral camera according to the adjustment result.

[0078] Adjusting the position parameter combination and recalculating the quantitative evaluation data until the adjusted quantitative evaluation data meet the preset conditions, and determining the optimal position parameter combination between the line light source, the spectral camera and the transparent medium to be measured.

[0079] In an embodiment, the line light source and the line-scan spectral camera are arranged on the same side of the transparent medium mounting position. Preferably, the vertical distance between the line light source and the line-scan spectral camera is 100mm-500mm, and the horizontal distance is 50mm-200mm. The method of the present application establishes a geometric model of the line light source, the line-scan spectral camera and the transparent medium to be measured in a three-dimensional coordinate system, and a computer program performs parameter search within the above space range, and quantitatively evaluates the illumination uniformity, imaging clarity and defect contrast under different combinations. Based on the optimal parameter range determined by the optimization algorithm, imaging distortion caused by excessive or insufficient relative displacement can be effectively avoided, thereby ensuring high-precision imaging effect of the transparent medium defects and dirt.

[0080] In summary, the method embodiment includes but is not limited to the following beneficial effects: Through adjustment and optimization of the light source illumination angle and the device position relationship, the device effectively suppresses background interference during the acquisition process, improves signal purity and effective spectral response range, and can obtain high-resolution and high-signal-to-noise ratio spectral data when performing line-by-line spectral scanning on different regions of the medium surface.

[0081] By combining the selection of the region of interest and the selection of the characteristic analysis band, the defect detection process of the transparent medium is carried out, the collected data can be characterized and noise suppressed, and thus the detection sensitivity to the tiny defects and slight dirt can be effectively improved.

[0082] By setting the illumination angle, automatically or manually adjusting the collection posture, and combining the spectral difference analysis under the selected wavelength, the transparent medium surface defects and dirt can be accurately distinguished. Experimental results show that under the same equipment conditions, the method can significantly improve the recognition accuracy and repeatability, and has higher practical value and engineering adaptability.

[0083] Referring to Figure 2 and Figure 3 , the embodiment of the application also provides a defect detection system based on spectral imaging, which can implement the above method, and the system comprises an optical light shielding box body (1), a line scanning spectral camera (2), a line light source (3), a line scanning platform (4), and a controller; wherein, The line scanning spectral camera (2) is installed at the top end inside the optical light shielding box body (1), the line scanning platform (4) is installed at the bottom end inside the optical light shielding box body (1), and the line light source (3) is installed between the line scanning spectral camera (2) and the line scanning platform (4); the transparent medium is clamped on the line scanning platform (4) by the transparent medium clamp (5).

[0084] The system further comprises a base (6), a camera support (7), and a camera clamp (8); wherein, The optical light shielding box body (1) is installed on the base (6); the camera support (7) is installed on the base (6); The camera clamp (8) is installed on the camera support (7) and can move up and down and left and right on the camera support (7), and the spectral camera (2) is installed in the camera clamp (8); The system further comprises a light source support (9) and a driving motor (10), wherein, The light source support (9) is installed on the base (6) and can move up and down and adjust the angle on the base (6); the line light source (3) is installed on the light source support (9); and the line scanning platform (4) is controlled to move by the driving motor (10).

[0085] The controller is used to implement the above method.

[0086] In summary, the system embodiment includes but is not limited to the following beneficial effects: The line light source in the system has the advantages of good irradiation uniformity, high brightness, and strong working stability, and can significantly improve the imaging quality of the spectral acquisition system in the actual detection scene, thereby maximizing the recognition ability of micro defects and slight dirt. Further, cooperating with a high-sensitivity line scanning spectral camera for synchronous acquisition, the system can obtain high-resolution and high-signal-to-noise ratio spectral data when performing spectral scanning on different regions of the transparent medium surface, effectively improving the recognition accuracy of defects and dirt.

[0087] It can be understood that the contents in the above method embodiments are applicable to the system embodiments, and the functions specifically implemented by the device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above method embodiments.

[0088] Referring to Figure 4 The embodiment of the present application also provides a defect detection system based on spectral imaging, which can implement the above method, and the system comprises: An image acquisition module is configured to acquire clear spectral image sets by performing image acquisition on the transparent medium to be measured by the line light source and the spectral camera; An area of interest selection module is configured to calculate according to the spectral image sets, and determine a plurality of areas of interest on the transparent medium to be measured according to the calculation results; A calculation module is configured to calculate according to the spectral feature extraction results of each area of interest under a plurality of characteristic analysis wavebands, and determine a test value corresponding to each area of interest; wherein the spectral difference degree between the dirt area and the defect area under the characteristic analysis waveband meets a preset requirement; A judgment module is configured to judge according to the test value corresponding to each area of interest and a preset judgment threshold corresponding to the transparent medium to be measured, and determine a defect detection result of the transparent medium to be measured.

[0089] It can be understood that the contents in the above method embodiments are applicable to the system embodiments, and the functions specifically implemented by the system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above method embodiments.

[0090] Referring to Figure 5 The embodiment of the present application also provides an electronic device, which comprises a memory and a processor, the memory stores a computer program, and the processor implements the above method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a vehicle-mounted computer, etc.

[0091] It can be understood that the contents in the above method embodiments are all applicable to the present device embodiments, the present device embodiments specifically implement the same functions as the above method embodiments, and achieve the same beneficial effects as the above method embodiments.

[0092] The present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the above method.

[0093] It can be understood that the contents in the above method embodiments are all applicable to the present program product embodiments, the present program product embodiments specifically implement the same functions as the above method embodiments, and achieve the same beneficial effects as the above method embodiments.

[0094] The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. In addition, the memory can include a high-speed random access memory, and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some embodiments, the memory can optionally include a memory remotely arranged relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0095] The present application at least includes the following beneficial effects: the present application provides a defect detection method and device based on spectral imaging, an electronic device and a program product, the scheme performs image acquisition on the transparent medium to be measured by a line light source and a spectral camera, and performs calculation and analysis according to the clear spectral image set obtained, to determine a plurality of regions of interest on the transparent medium to be measured, i.e. one of the possible dirty regions or defect regions, through the selection of the regions of interest, the preliminary screening of the dirty and defect regions is realized, which can improve the accuracy of defect detection; further, according to the spectral feature extraction result of each region of interest under a plurality of characteristic analysis wavebands, the test value for judging the defect detection result of each region of interest is determined, through the selection of the waveband with obvious spectral difference degree between the dirty region and the defect region under the waveband, the accuracy of defect detection is further improved; finally, according to the judgment threshold corresponding to the same specification as the transparent medium to be measured, each region of interest is judged to determine whether the specific situation of each region of interest is dirty or defect, and the defect detection results of each region of interest are summarized to determine the overall defect detection result of the transparent medium to be measured; for this, the present application method can effectively improve the recognition ability of small defects and slight dirt through the combination of "preliminary screening of the regions of interest" and "spectral feature analysis of specific characteristic analysis waveband", and effectively distinguish the defects and dirt on the surface of the transparent medium.

[0096] The embodiments described in the present application are for more clearly illustrating the technical solutions of the present application, and do not constitute a limitation on the technical solutions provided by the present application. Those skilled in the art can know that, with the evolution of technology and the appearance of new application scenarios, the technical solutions provided by the present application are also applicable to similar technical problems.

[0097] Those skilled in the art can understand that the technical solutions shown in the figures do not constitute a limitation on the present application, and can include more or fewer steps than shown in the figures, or combine certain steps, or different steps.

[0098] The device embodiments described above are merely illustrative, and the units described as separate components can or can not be physically separated, that is, they can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the present embodiment according to actual needs.

[0099] Those skilled in the art can understand that all or some of the steps in the above disclosed method, the function modules / units in the system and the device can be implemented as software, firmware, hardware and their appropriate combinations.

[0100] The terms "first", "second", "third", "fourth" and the like (if any) in the specification of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0101] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative, for example, the division of the above-mentioned units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed each other can be through some interface, indirect coupling or communication connection between devices or units, which can be electrical, mechanical or other forms.

[0102] The units described above as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, i.e., may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.

[0103] If the integrated unit is implemented in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program storage media.

[0104] The preferred embodiments of the embodiments of the present application are described above with reference to the accompanying drawings, and the scope of the rights of the embodiments of the present application is not limited thereto. Any modifications, equivalent replacements and improvements made by those skilled in the art without departing from the scope and essence of the embodiments of the present application shall be within the scope of the rights of the embodiments of the present application.

Claims

1. A method of defect detection based on spectral imaging, characterized in that, The method includes the following steps: A clear set of spectral images is obtained by acquiring images of the transparent medium under test using a line light source and a spectral camera; Calculations are performed based on the spectral image set, and several regions of interest are determined on the transparent medium to be tested based on the calculation results; The test value corresponding to each region of interest is determined by calculating the spectral feature extraction results of each region of interest under several feature analysis bands; wherein, under the feature analysis bands, the degree of spectral difference between the dirty area and the defective area meets the preset requirements. The defect detection result of the transparent medium under test is determined by judging the test value corresponding to each region of interest and the preset judgment threshold corresponding to the transparent medium under test.

2. The method of claim 1, wherein, The step of calculating based on the spectral image set and determining several regions of interest on the transparent medium to be tested based on the calculation results includes: Statistical feature extraction is performed on the spectral image set to obtain the feature extraction results; The trend of image histogram variation is obtained by calculating based on the spectral image set. Based on the feature extraction results and the trend of the image histogram, several candidate regions of interest are determined on the transparent medium to be tested. The feature value corresponding to each candidate region of interest is calculated based on the spectral image at the corresponding position of each candidate region of interest. The size and position of each candidate region of interest are adjusted until the feature value corresponding to each candidate region of interest meets the preset threshold. Based on the adjustment results, several regions of interest on the transparent medium to be tested are determined.

3. The method of claim 1, wherein, The test value corresponding to each region of interest is calculated in the following way: Spectral features are extracted from the region of interest to obtain the corresponding spectral intensity dataset; the spectral intensity dataset includes intensity values ​​and spectral mean values ​​corresponding to several feature analysis bands; The test value corresponding to the region of interest is obtained by calculating based on the preset formula and the spectral intensity dataset corresponding to the region of interest.

4. The method of claim 3, wherein, The characteristic analysis bands are determined in the following way: Images are acquired from a transparent medium sample to obtain a set of spectral intensity data corresponding to several regions of interest on the transparent medium sample; the several regions of interest include an equal number of contaminated areas and several defective areas; the set of spectral intensity data includes spectral intensity values ​​and spectral mean values ​​in different spectral bands; Based on the statistical analysis of the spectral mean values ​​of each contaminated area in different bands, a spectral mean vector of the contaminated area in different bands is constructed; based on the statistical analysis of the spectral mean values ​​of each defective area in different bands, a spectral mean vector of the defective area in different bands is constructed. The difference between the spectral mean vectors of the dirty and defective areas in different bands is calculated. Several bands whose spectral mean differences meet the preset requirements are selected, and the feature analysis bands are determined based on the selection results.

5. The method of claim 4, wherein, The preset judgment threshold corresponding to the transparent medium to be tested is determined in the following way: Image acquisition is performed on a transparent medium sample to obtain a set of spectral intensity data samples corresponding to a plurality of regions of interest on the transparent medium sample; the plurality of regions of interest include a plurality of dirt regions and a plurality of defect regions in equal number; A test value corresponding to each of the defect regions is calculated to obtain a first data set; A test value corresponding to each of the dirt regions is calculated to obtain a second data set; The first data set and the second data set are analyzed to determine a preset judgment threshold of the transparent medium under test.

6. The method of claim 1, wherein, The method further includes: An initial value is set for an illumination angle of the line light source, and image acquisition is performed on the transparent medium under test to obtain a pre-adjusted spectral image set; a signal-to-noise ratio is calculated based on the pre-adjusted spectral image set and an image contrast evaluation function; The illumination angle of the line light source is adjusted, and image acquisition is performed again on the transparent medium under test until the signal-to-noise ratio obtained after adjustment meets a preset condition, and the illumination angle of the line light source is determined based on the adjustment result.

7. The method of claim 1, wherein, The method further includes: A geometric model of the line light source, the spectral camera, and the transparent medium under test is constructed under a three-dimensional coordinate system, and an initial position parameter combination of the line light source and the spectral camera is set; Image acquisition is performed on the transparent medium under test by the line light source and the spectral camera to obtain a pre-adjusted spectral image set; quantitative evaluation data are calculated based on the pre-adjusted spectral image set; the quantitative evaluation data include illumination uniformity, imaging clarity, and contrast; An optimization algorithm is used to adjust the position parameter combination of the line light source and the spectral camera and perform image acquisition again until the quantitative evaluation data obtained after adjustment meet a preset condition, and the positional relationship between the line light source and the spectral camera is determined based on the adjustment result.

8. A spectral imaging based defect detection system, characterized in that, The system includes a line light source, a spectral camera, and a processor; The line light source and the spectral camera are configured to perform image acquisition on a transparent medium under test to obtain a clear spectral image set; The processor is configured to implement the method of any one of claims 1 to 7.

9. A spectral imaging based defect detection system, characterized in that, The system includes: An image acquisition module configured to perform image acquisition on a transparent medium under test by a line light source and a spectral camera to obtain a clear spectral image set; A region of interest selection module configured to calculate based on the spectral image set and determine a plurality of regions of interest on the transparent medium under test based on the calculation result; A calculation module configured to calculate based on spectral feature extraction results of each of the regions of interest at a plurality of characteristic analysis wavebands to determine a test value corresponding to each of the regions of interest; wherein the spectral difference degree between a dirt region and a defect region at the characteristic analysis wavebands meets a preset requirement; A judgment module configured to determine a defect detection result of the transparent medium under test based on a judgment of the test value corresponding to each of the regions of interest and a preset judgment threshold corresponding to the transparent medium under test.

10. An electronic device, comprising: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the method of any one of claims 1 to 7 when executing the computer program.

Citation Information

Cited By

  • An in-situ cleaning method and system for adhesion defects

    CN122530085A