Method, device and system for detecting surface defects of object and medium
By using a multi-wavelength beam detection method to analyze the reflection spectrum of an object's surface, the problems of equipment redundancy and data fusion difficulties in existing technologies are solved, achieving efficient and reliable surface defect detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-12
- Publication Date
- 2026-03-27
AI Technical Summary
In existing technologies, dual detection schemes based on laser scanning and machine vision suffer from problems such as equipment redundancy, complex processes, and difficulties in data fusion, resulting in high system costs, slow detection speeds, and large errors.
The multi-wavelength beam detection method is adopted. By receiving and analyzing the reflection spectrum of the object surface, the surface defect type is distinguished by using the spectral information. This simplifies the process to a single acquisition and direct analysis, avoiding the need for multi-source data fusion.
It reduces equipment redundancy and manufacturing costs, simplifies the testing process, improves testing speed and the reliability of results, and avoids errors in the process of multi-source data fusion.
Smart Images

Figure CN121740778A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of automated inspection technology, and in particular to a method, apparatus, system and medium for detecting defects on the surface of an object. Background Technology
[0002] In the industrial product manufacturing process, surface defect detection is a crucial step in ensuring product quality and production efficiency. Existing technologies typically employ a dual detection scheme that combines laser scanning and machine vision to identify surface defects.
[0003] The first approach is a laser scanning-based system, such as using laser triangulation to quickly acquire the three-dimensional topographic features of the object's surface. However, this approach lacks sufficient single-point spectral resolution. The second approach is a machine vision-based system, which uses a high-resolution industrial camera to capture the fine texture information of the object's surface. The performance of this approach is highly dependent on a complex external optical illumination system.
[0004] Combining these two separate systems, while complementary to some extent, introduces a series of inherent technical challenges. First, this two-stage or dual-system parallel approach results in significant equipment redundancy, requiring the simultaneous procurement, integration, and maintenance of two different sensing modalities, increasing overall system cost and maintenance complexity. Second, the detection process becomes more complex, necessitating two independent data acquisition processes and intricate synchronization and calibration of the two systems. The most critical challenge lies in the difficulty of multi-source data fusion. Accurate spatial registration and information fusion of 3D point cloud data from a laser scanner with 2D image data from a camera is a computationally intensive and algorithmically complex problem. This not only reduces the overall detection speed but may also introduce new error sources, limiting the final performance of the detection system. Summary of the Invention
[0005] This disclosure provides a method, apparatus, system, and medium for detecting defects on the surface of an object; it can solve the technical problems in the prior art caused by the use of multi-sensor fusion schemes, such as equipment redundancy, process complexity, and difficulty in data fusion.
[0006] The technical solution disclosed herein is implemented as follows: In a first aspect, this disclosure provides a method for detecting defects on the surface of an object, comprising: Receive the reflection spectrum reflected by the surface of the object being measured, wherein the reflection spectrum is obtained by reflecting a multi-wavelength light beam by the surface of the object being measured; The spectral characteristics of the reflectance spectrum are obtained, and the defect type of the surface of the object under test is determined based on the spectral characteristics.
[0007] Secondly, this disclosure provides an apparatus for detecting defects on the surface of an object, comprising: The receiving module receives the reflection spectrum reflected by the surface of the object being measured, wherein the reflection spectrum is obtained by reflecting a multi-wavelength light beam by the surface of the object being measured. The determination module acquires the spectral characteristics of the reflection spectrum and determines the defect type of the surface of the object under test based on the spectral characteristics.
[0008] Thirdly, this disclosure provides a system for detecting defects on the surface of an object, comprising: The light source module is configured to emit multi-wavelength beams; A photodetector is positioned to receive the reflection spectrum reflected from the surface of a test object irradiated by the multi-wavelength light beam; and A processor, communicatively coupled to the photodetector, is configured to perform the method as described in the first aspect.
[0009] Fourthly, this disclosure provides a computer storage medium storing at least one instruction that is executed by a processor to implement the method for detecting surface defects of an object as described in the first aspect.
[0010] This disclosure provides a method, apparatus, system, and medium for detecting surface defects of objects. By analyzing the reflection spectrum of a multi-wavelength light beam from the object's surface, spectral information is used as a basis for distinguishing different surface states. Since different types of surface defects (such as microscopic roughness, physical discontinuities in cracks, and macroscopic geometric damage) have fundamentally different interaction mechanisms with light at different wavelengths, these differences are manifested in unique forms in the morphology of the reflection spectrum. By receiving and analyzing the reflection spectrum, rich physical information characterizing the surface state can be directly obtained. There is no need to integrate two-dimensional imaging devices such as industrial cameras, nor to perform complex data registration and fusion calculations between three-dimensional point clouds and two-dimensional images. This simplifies the hardware structure of the detection system, reducing equipment redundancy and manufacturing costs. Simultaneously, the detection process is simplified from multiple acquisitions, data fusion, and comprehensive judgment to single acquisition and direct analysis, improving detection speed. Furthermore, since all analyses are based on spectral data from a single source, errors and uncertainties that may be introduced during multi-source data fusion are avoided, thus contributing to improved consistency and reliability of the detection results. Attached Figure Description
[0011] Figure 1 This disclosure provides a structural block diagram of a system for detecting surface defects of an object.
[0012] Figure 2 A flowchart of a method for detecting surface defects of an object provided in this disclosure.
[0013] Figure 3 This is a data flow diagram for a defect detection model provided in this disclosure.
[0014] Figure 4 This is a diagram showing the correspondence between crack defects and spectral characteristics provided in this disclosure.
[0015] Figure 5 This is a diagram showing the correspondence between edge roughness defects and spectral characteristics provided in this disclosure.
[0016] Figure 6 This is a diagram showing the correspondence between edge damage defects and spectral characteristics provided in this disclosure.
[0017] Figure 7 This is a correspondence diagram between defect-free features and spectral characteristics provided in this disclosure.
[0018] Figure 8 This is a structural block diagram of a device for detecting surface defects of an object, as provided in this disclosure. Detailed Implementation
[0019] The technical solutions in this disclosure will now be clearly and completely described with reference to the accompanying drawings.
[0020] Reference Figure 1 This diagram illustrates a schematic structural block diagram of a system 100 for detecting surface defects of an object according to an embodiment of the present disclosure. The system 100 can be used to perform the steps described in subsequent method embodiments. The system 100 may include a light source module 110, an optical assembly 120, a photodetector 130, and a processing unit 140.
[0021] The light source module 110 is used to generate and emit a multi-wavelength light beam 111. In one specific embodiment, the light source module 110 can be a tunable laser source. Unlike a laser that can only emit a single fixed wavelength, a tunable laser source can continuously or discretely change its output wavelength within a certain wavelength range. This capability is fundamental to acquiring full-spectrum reflectance information of the surface of the object under test 150. For example, the light source module 110 can be tuned in the near-infrared (NIR) spectral range (e.g., 750 nm to 2500 nm), in which many industrial materials (e.g., metals, polymers, semiconductors, etc.) have unique absorption, reflection, or scattering properties, which can be used to distinguish different surface states.
[0022] In some embodiments, the tunable laser source can be specifically implemented as various types of semiconductor lasers, each with different characteristics in terms of tuning range, tuning speed, stability, and cost, to adapt to different industrial applications. For example, the light source module 110 can be a distributed feedback (DFB) laser array. This array integrates multiple DFB laser chips, each designed to emit at a specific center wavelength. Step-like coarse tuning of the wavelength can be achieved by selectively activating different lasers in the array through electrical switches. Fine tuning near the center wavelength can then be achieved by finely adjusting the drive current or operating temperature of the activated laser. This results in high wavelength stability and good reliability.
[0023] Tunable laser sources can also be distributed Bragg reflector (DBR) lasers. Unlike DFB lasers, which integrate the grating structure with the gain region, DBR lasers separate the gain region from the grating, which serves as the wavelength selection element. The reflected wavelength is tuned by changing the refractive index of the grating region through altering the injection current. In particular, sampled grating DBR (SG-DBR) lasers, through the design of multiple sampling grating mirrors with comb-shaped reflection spectra, offer a compact structure and a wide tuning range, making them suitable for applications requiring broad spectral coverage.
[0024] The specific selection of the light source module can also be customized based on user needs, which will not be elaborated here.
[0025] The function of the optical component 120 is to guide the multi-wavelength light beam 111 emitted by the light source module 110 to the surface of the object under test 150, and to collect the reflected light 151 reflected back from the surface. The optical component 120 may include, but is not limited to, optical elements such as optical fibers, collimating lenses, focusing lenses, and beam splitters. The combination of these elements can shape and precisely focus the laser beam onto a small area of the surface under test, while collecting the reflected light from that area and guiding it to the photodetector 130.
[0026] The photodetector 130 is configured to receive reflected light 151 collected by the optical component 120 and convert it into an electrical signal. The photodetector 130 possesses high sensitivity, low noise, and a wide spectral response range to ensure accurate measurement of the intensity of weak reflected light at different wavelengths. Depending on the operation of the light source module 110, the photodetector 130 can be a single-point photodiode used in conjunction with a wavelength-scanning tunable laser source; alternatively, the photodetector 130 can also be a miniature spectrometer (such as a structure based on gratings and linear array detectors) capable of capturing spectral information across the entire wavelength band at once, used in conjunction with a light source emitting a broadband composite beam.
[0027] The processing unit 140 is connected to the light source module 110 and the photodetector 130 via a communication interface. The processing unit 140 can be an embedded system, an industrial personal computer (IPC), a digital signal processor (DSP), or a field-programmable gate array (FPGA), etc. The processing unit 140 typically includes at least one processor and a memory, which stores computer program instructions executable by the processor. When the processor executes these instructions, it implements the method for detecting surface defects of an object as described in this disclosure. Specifically, the processing unit 140 controls the wavelength scanning or emission sequence of the light source module 110, synchronously acquires corresponding electrical signals from the photodetector 130, converts analog signals into digital signals to form raw reflectance spectral data, and executes a series of subsequent data processing and defect classification algorithms.
[0028] Reference Figure 2 The diagram illustrates a flowchart of a method 200 for detecting surface defects of an object according to an embodiment of the present disclosure. This method can be... Figure 1 The processing unit 140 in the system 100 shown executes this.
[0029] In step S210, the reflection spectrum reflected by the surface of the object under test is received. The reflection spectrum is obtained by reflecting a multi-wavelength light beam by the surface of the object under test.
[0030] In some exemplary embodiments of this disclosure, step S210 is physically performed by photodetector 130, which captures photons reflected from the surface of the object under test 150 and converts them into electrical signals that vary over time (or correspond to different wavelengths). Processing unit 140 then reads these signals from photodetector 130 and digitizes them using analog-to-digital conversion (ADC) to form a raw spectral data sequence. Each data point in this sequence represents the intensity of reflected light from the surface of the object under test at a specific wavelength. For example, if a tunable laser source scans from wavelength λ1 to λn, processing unit 140 will simultaneously acquire n light intensity values I(λ1), I(λ2),..., I(λn), constituting the raw reflection spectrum.
[0031] In step S220, the spectral characteristics of the reflection spectrum are obtained, and the defect type of the surface of the object under test is determined based on the spectral characteristics.
[0032] In some example embodiments of this disclosure, the processor extracts information (i.e., spectral features) from raw reflectance spectral data that may contain noise and interference, which can stably and reliably characterize the surface state, and uses this information to make a determination about the defect type. This step can be further decomposed into two sub-processes: acquiring spectral features and determining the defect type based on the features.
[0033] First, regarding the acquisition of spectral features, at least one preprocessing operation should be performed on the reflectance spectrum to eliminate noise and interference. Raw spectral data is often not pure; it contains various non-ideal factors. For example, photodetectors and subsequent amplification circuits can introduce high-frequency random noise; temperature variations in the instrument or small fluctuations in light source power due to prolonged operation can cause slow drifts in the spectral baseline or changes in overall intensity; ambient light in the production environment (such as fluorescent lights or natural light) can also superimpose on the reflectance signal, creating interference. These noises and interferences can mask or distort the true spectral features, affecting the accuracy of subsequent defect classification.
[0034] In some examples, the above preprocessing operations may specifically include baseline correction and smoothing.
[0035] Baseline correction is used to eliminate low-frequency baseline drift caused by factors such as instrument drift or stray light. The spectral baseline refers to the background profile of the spectral signal in the absence of characteristic absorption or reflection peaks. Ideally, the spectral baseline should be a horizontal straight line. However, in actual measurements, due to insufficient instrument warm-up, changes in ambient temperature, and light source aging, the baseline often exhibits a slowly changing curved shape. This drift can raise or lower the true spectral peaks, affecting the accurate calculation of peak height and peak area, and may even produce spurious broad peaks. Baseline correction can estimate this drifted baseline and subtract it from the original spectrum, thereby restoring the true shape and relative intensity relationships of the spectral features.
[0036] Smoothing is primarily used to filter out high-frequency random noise from detectors or circuits. This noise manifests as rapid, irregular, tiny fluctuations in the spectral curve. Smoothing suppresses these random fluctuations by locally averaging or fitting neighboring data points, making the spectral curve smoother. Its technical advantage lies in effectively reducing noise levels and improving the signal-to-noise ratio while preserving as much of the width and shape information of true spectral features (such as peaks and valleys) as possible. A properly smoothed spectrum has a clearer internal structure and patterns, facilitating subsequent feature extraction and pattern recognition.
[0037] Specifically, baseline correction can be implemented using asymmetric least squares (ALS). In practice, this process first iteratively calculates a baseline vector. At the beginning of each iteration, a penalized least squares equation is solved based on the weight vector of the current iteration. This equation contains two parts: a fidelity term, which penalizes the difference between the baseline vector and the original spectral vector; and a smoothness term, which penalizes the non-smoothness of the baseline vector itself (usually measured by the sum of squares of its second-order differences). By minimizing the weighted sum of these two terms, a baseline vector that balances fidelity and smoothness can be updated.
[0038] Next, each data point in the original spectrum is compared with the value of the updated baseline vector at its corresponding position. For data points whose original spectral values are higher than the baseline vector value, their corresponding weights are decreased in the next iteration. Conversely, for data points whose original spectral values are lower than the baseline vector value, their corresponding weights are increased in the next iteration. Through this asymmetric weight update strategy, the influence of data points in the spectral peak region on baseline fitting is gradually weakened, while the influence of data points in the baseline region is gradually strengthened.
[0039] This iterative process continues until the baseline vector converges or the preset number of iterations is reached. Finally, the corrected data points are obtained by subtracting the baseline vector calculated through this iteration from the original reflectance spectrum.
[0040] Baseline correction using the asymmetric least squares method can flexibly and accurately fit baselines of various complex shapes. In particular, for signals with a large number of spectral peaks of different shapes, the generated baseline is smoother and less susceptible to noise interference.
[0041] Smoothing can be specifically implemented using Savitzky-Golay (SG) filters. SG filtering is a smoothing method widely used in signal processing and spectral analysis, and its underlying operation logic is based on local polynomial least squares fitting.
[0042] In practice, for each data point in the reflectance spectrum, a predefined window is first defined around it, containing the data point and several adjacent data points on its left and right sides. Then, within this local window, a polynomial of a specific order (e.g., a second- or fourth-order polynomial) is found using the least squares method, such that the polynomial curve best fits all the data points within the window. The best fit is defined as minimizing the sum of the squared distances from all data points to this polynomial curve. After finding this local fitting polynomial, the calculated value of this local polynomial at the center point of the window (i.e., the currently processed data point) is used as the smoothed new data point. Subsequently, the window is slid forward one data point, and the process of local polynomial fitting and smoothing value calculation is repeated for the next data point until the entire spectral data has been traversed.
[0043] While effectively filtering out high-frequency noise, SG smoothing can better preserve the shape, height, and width of important features in the original spectrum (such as peaks and valleys) than a simple moving average filter. SG filters use polynomials to fit local data, which can better capture changes in peak curvature and cause less distortion of peak features.
[0044] In some examples, the method disclosed herein for detecting surface defects may also include compensation for ambient light. Ambient light, as an additive interference, is directly superimposed on the reflectance spectrum, affecting the accuracy of the measurement.
[0045] First, before the light source module 110 emits the multi-wavelength beam, i.e., in the active illumination-off state, the photodetector 130 performs a data acquisition. The received signal at this time contains only light from the surrounding environment; this is the acquired ambient light data, also known as the background spectrum. Then, during the normal detection process, after the multi-wavelength beam is projected onto the surface of the object being measured, data acquisition is performed again. The received signal this time is the superposition of the target reflectance spectrum and the background spectrum. Finally, in the processing unit 140, the background spectrum data acquired in the first acquisition is subtracted point-by-point from the mixed spectral data acquired in the second acquisition, resulting in a compensated, pure reflectance spectrum that eliminates the influence of ambient light. This compensated spectral characteristic is then used for subsequent defect type determination.
[0046] This significantly enhances the robustness of the detection system to changes in ambient light. Furthermore, by actively measuring and subtracting background light, this embodiment enables the system to operate stably in open industrial environments with dynamically changing lighting conditions.
[0047] Secondly, regarding determining defect types based on spectral characteristics, specifically, defect detection models can be used to determine defect types, referring to... Figure 3 The defect detection model can include convolutional kernels, pooling layers 320, fully connected layers 330, and a final output layer 340. Specifically, the process of determining the defect type first involves acquiring local feature maps of the spectral features. Here, "spectral features" refers to a preprocessed, clean one-dimensional spectral data vector. This step is typically performed by convolutional layers 310 in the computation model. In a one-dimensional convolution operation, multiple small convolutional kernels (also called filters) slide along the input spectral feature vector. Each convolutional kernel is essentially a small weight vector trained to identify a specific local pattern in the spectrum, such as the rising edge of a peak, the steepness of a valley, or an oscillation at a specific frequency. As the convolutional kernel slides across the input spectrum, it performs an inner product operation with local segments of the spectrum. When the pattern of a local segment highly matches the pattern of the convolutional kernel, the result produces a large activation value. The results of all convolutional kernel operations are combined to form a series of local feature maps. These feature maps can be understood as observations of the original spectrum at different levels of abstraction, with each map highlighting the location and intensity of a specific local pattern present in the original spectrum.
[0048] Next, the local features are downsampled to obtain locally compact features. This step can be performed by a pooling layer 320 (e.g., a max-pooling layer) in the defect detection model. The pooling layer 320 slides across the feature map in a small window and extracts a representative value (e.g., maximum or average value) from each window as the output. This reduces the size of the feature map, i.e., downsampling, lowers the dimensionality of the data, reduces the complexity of subsequent calculations, and helps prevent model overfitting; it also brings a degree of translation invariance to the model. For example, even if a feature peak undergoes a slight positional shift in the spectrum, its representation in the compact features may still be the same after max pooling, which enhances the model's robustness to small changes. The result after downsampling is a more abstract and robust locally compact feature of the original spectral features.
[0049] Next, the probability distribution of each preset defect type corresponding to the local compact features is determined. This step is typically accomplished by the fully connected layer 330 and the final output layer 340 (such as a Softmax layer) in the model. The local compact features are first flattened into a long vector and then input into one or more fully connected networks. The fully connected layer 330 performs global, non-linear combination and weighting of the various locally compact features extracted earlier, thereby learning the complex relationships between these features and performing inference. Finally, the output layer 340 calculates the probability value of the input spectrum belonging to each preset defect type (such as crack, roughness, breakage, no defect, etc.) based on the output of the fully connected layer 330. These probability values constitute a probability distribution, the sum of which is 1.
[0050] The final step is to determine the preset defect type with the highest probability value in the probability distribution as the defect type of the surface of the object being tested. This is a simple decision rule: select the category that the model deems most likely as the final classification result.
[0051] This paper presents an end-to-end classification paradigm that automatically learns features from data. Compared to traditional methods that rely on manually designed feature extraction algorithms, this deep learning-based process can discover more subtle and complex patterns in the data, thereby achieving higher classification accuracy. For example, for two visually similar defects with subtle spectral differences, manually designed rules may struggle to distinguish them. However, by training on large amounts of data, the deep learning model can automatically learn these subtle spectral differences and use them as the basis for classification. Figure 3 This process is illustrated schematically. The input spectral features are processed by convolutional layer 310 and pooling layer 320 to obtain compact features, which are then passed through fully connected layer 330 and output layer 340 to finally output the defect type.
[0052] It should be noted that the defect detection model described above is trained. The above illustration describes one type of defect detection model. The initial model of the defect detection model can be a convolutional neural network (CNN) model, an object detection convolutional neural network (faster-RCNN) model, a recurrent neural network (RNN) model, or a generative adversarial network (GAN) model, but is not limited to these. Other neural network models known to those skilled in the art can also be used. No specific limitations are made in the real-time method of this example.
[0053] Specifically, refer to Figure 4 The preset defect type can include cracks corresponding to steeply drooping troughs. The physical principle is that, as a physical discontinuity on the material surface, when a beam of light shines on the crack area, most of the light enters the crack and is scattered and absorbed multiple times, or is scattered out at a large angle deviating from the receiving direction. This results in a significant decrease in the intensity of reflected light that can be effectively received by the photodetector 130 over a wide wavelength range. This manifests as a characteristic, steep, and broad trough in the spectrum. Figure 4 The spectrum in the image is an example. Associating this feature with the crack category in the image allows the model to make judgments based on explicit physical signals, improving the reliability of detecting cracks, a critical defect.
[0054] Reference Figure 5 The preset defect type can also include edge roughness corresponding to the oscillating split peak characteristics. The rough surface can be regarded as being composed of a large number of randomly oriented tiny facets. When multi-wavelength light beams irradiate such a surface, complex scattering, diffraction, and interference effects occur on these microstructures. The constructive or destructive interference of light of different wavelengths in different directions results in the final received reflection spectrum exhibiting a high-frequency, oscillating, peak-split structure across the entire wavelength range. Figure 5 The spectrum in the image is one example. Correlating this high-frequency oscillation mode with edge roughness categories allows the model to quantify and identify the micro-geometry of the surface.
[0055] Reference Figure 6 The preset defect types can also include edge damage corresponding to a single-peak feature. The physical principle is that edge damage (such as chipped edges or notches) is usually a macroscopic geometric anomaly that can form a relatively smooth, large, fresh surface at the edge of an object. When a beam of light strikes this newly formed surface at the appropriate angle, a strong reflection, similar to specular reflection, may occur, causing a large amount of light to be directly reflected back to the photodetector. This efficient reflection results in a sharp increase in the intensity of the received light at one or more wavelengths, thus forming a sharp single peak in the spectrum with an intensity much higher than that of a normal surface reflection signal. Figure 6The spectrum in the image serves as an example; correlating this high-intensity unimodal feature with edge damage categories allows the model to effectively detect macroscopic damage that directly impacts product functionality or safety. Furthermore, it's also possible to... Figure 7 The spectrum is correlated with the defect-free category.
[0056] After completing the association and training the above defect detection model, the obtained spectral features can be directly input into the defect detection model to obtain the final defect type.
[0057] This disclosure also provides an apparatus for detecting defects on the surface of an object, with reference to... Figure 8 The apparatus 800 for detecting defects on the surface of an object may include a receiving module 810 and a determining module 820.
[0058] The receiving module 810 can be used to receive the reflection spectrum reflected by the surface of the object being measured. The reflection spectrum is obtained by reflecting a multi-wavelength light beam by the surface of the object being measured.
[0059] The determination module 820 can be used to acquire the spectral characteristics of the reflectance spectrum and determine the type of defect on the surface of the object under test based on the spectral characteristics.
[0060] In some examples, the determination module 820 can also be used to acquire local feature maps of spectral features; perform downsampling on the local features to obtain local compact features; determine the probability distribution of each preset defect type corresponding to the local compact features; and determine the preset defect type with the highest probability value in the probability distribution as the defect type of the surface of the object being measured.
[0061] In some examples, the preset defect types include cracks corresponding to steeply drooping troughs, edge roughness corresponding to oscillating split peaks, and edge breakage corresponding to single-peak features.
[0062] In some examples, the determination module 820 can also be used to perform at least one preprocessing operation on the reflectance spectrum to remove noise and interference, thereby obtaining spectral features.
[0063] In some examples, preprocessing operations include baseline correction processing to eliminate low-frequency baseline drift caused by instrument drift or stray light; and smoothing processing to filter out high-frequency random noise from detectors or circuits.
[0064] In some examples, the baseline correction process includes: solving for a baseline vector through iterative computation, wherein each iteration includes: updating the baseline vector by determining a penalized least squares equation based on the fidelity and self-smoothness of the reflectance spectrum according to the weight vector of the current iteration; comparing the reflectance spectrum with the updated baseline vector, decreasing the corresponding weight of data points in the reflectance spectrum that are higher than the baseline vector in the next iteration, and increasing the corresponding weight of data points that are lower than the baseline vector in the next iteration, thereby asymmetrically updating the weight vector; and subtracting the baseline vector obtained by the iterative computation from the reflectance spectrum to obtain the corrected data points.
[0065] In some examples, the smoothing process includes: for each data point in the reflectance spectrum, fitting a local polynomial using the least squares method within a preset window centered on the data point; and using the value of the local polynomial at the data point as the smoothed data point.
[0066] In some examples, the device 800 for detecting defects on the surface of an object can also be used to acquire ambient light data; and to compensate for spectral features based on the ambient light data in order to determine the defect type using the compensated spectral features.
[0067] This disclosure also provides a computer-readable storage medium storing at least one instruction that is executed by a processor to implement the method for detecting surface defects of an object as described in the various embodiments above.
[0068] This disclosure also provides a computer program product including computer instructions stored in a computer-readable storage medium; a processor of a computing device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computing device to perform the method for detecting surface defects of an object as described in the various embodiments above.
[0069] Those skilled in the art will recognize that the functions described in this disclosure in one or more of the examples above can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transfer of a computer program from one place to another. Storage media can be any available medium accessible to a general-purpose or special-purpose computer.
[0070] It should be noted that the technical solutions described in this disclosure can be combined arbitrarily as long as they do not conflict.
[0071] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for detecting surface defects of an object, characterized in that, The method comprises: receiving a reflected spectrum reflected by a surface of a measured object, the reflected spectrum being obtained by reflecting a multi-wavelength light beam by the surface of the measured object; obtaining a spectral feature of the reflected spectrum, and determining a defect type of the surface of the measured object based on the spectral feature.
2. The method for detecting surface defects of an object according to claim 1, wherein, The determining of the defect type of the surface of the measured object based on the spectral feature comprises: obtaining a local feature map of the spectral feature; performing down-sampling processing on the local feature to obtain a local compact feature; determining a probability distribution of each preset defect type corresponding to the local compact feature; determining, as the defect type of the surface of the measured object, the preset defect type having a maximum probability value in the probability distribution.
3. The method for detecting surface defects of an object according to claim 2, wherein, The preset defect types include a crack corresponding to an abrupt drop valley feature, an edge roughness corresponding to an oscillation split peak feature, and an edge breakage corresponding to a single peak feature.
4. The method for detecting surface defects of an object according to claim 1, wherein, The obtaining of the spectral feature of the reflected spectrum comprises: performing at least one pre-processing operation on the reflected spectrum to eliminate noise and interference therein, thereby obtaining the spectral feature.
5. The method for detecting surface defects of an object according to claim 4, wherein, The pre-processing operation comprises a baseline correction processing for eliminating low-frequency baseline drift caused by instrument drift or stray light, and a smoothing processing for filtering out high-frequency random noise from a detector or a circuit.
6. The method for detecting surface defects of an object according to claim 5, wherein, The baseline correction processing comprises: solving a baseline vector by iterative calculation, wherein each iteration comprises: determining a penalized least square equation based on a weight vector of a current iteration according to fidelity and self-smoothness of the reflected spectrum, to update the baseline vector; comparing the reflected spectrum with the updated baseline vector, and in a next iteration, decreasing a corresponding weight of a data point in the reflected spectrum higher than the baseline vector, and increasing a corresponding weight of a data point in the reflected spectrum lower than the baseline vector, thereby asymmetrically updating the weight vector; subtracting the baseline vector obtained by the iterative calculation from the reflected spectrum to obtain corrected data points.
7. The method for detecting surface defects of an object according to claim 5, wherein, The smoothing processing comprises: for each data point in the reflected spectrum, fitting a local polynomial within a preset window centered on the data point by least square method; using a value of the local polynomial at the data point as a smoothed data point.
8. The method for detecting surface defects of an object according to claim 1, wherein, The method further comprises: obtaining ambient light data; compensating the spectral feature according to the ambient light data to determine the defect type using a compensated spectral feature.
9. An apparatus for detecting surface defects of an object, characterized by The method comprises: a receiving module configured to receive a reflected spectrum reflected by a surface of a measured object, the reflected spectrum being obtained by reflecting a multi-wavelength light beam by the surface of the measured object; a determining module configured to obtain a spectral feature of the reflected spectrum, and determine a defect type of the surface of the measured object based on the spectral feature.
10. A system for detecting surface defects of an object, characterized in that The method comprises: a light source module configured to emit a multi-wavelength light beam; a photodetector positioned to receive a reflected spectrum reflected by a surface of a measured object irradiated by the multi-wavelength light beam; and a processor communicatively coupled to the photodetector, the processor being configured to perform the method for detecting a defect on a surface of an object according to any one of claims 1 to 8. 11. A computer storage medium, characterized in that The computer storage medium stores at least one instruction for being executed by the processor to implement the method for detecting surface defects of an object according to any one of claims 1 to 8.