Online defect detection method and system for flexographic label based on machine vision

By using a machine vision-based differential analysis method, the defect features and background interference features on the surface of flexographic labels are distinguished, and the scratch defect area is accurately identified. This solves the problem of low detection accuracy in the production process of flexographic labels and achieves efficient scratch defect detection.

CN121962027APending Publication Date: 2026-05-01FOSHAN FENGYI LABEL PRODUCTS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
FOSHAN FENGYI LABEL PRODUCTS CO LTD
Filing Date
2025-12-26
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In existing technologies, the accuracy of scratch defect detection for flexographic labels is low, with high false detection and false negative rates. This is mainly due to the significant impact of background interference factors caused by material color differences and variations in the brightness of printed patterns.

Method used

Using a machine vision-based approach, the original reflectance spectrum data of the full-area surface image of flexographic labels is compared with the preset standard reflectance spectrum data to distinguish the spectral differences between defect features and background interference features, determine the pixel region of scratch defects, and accurately screen out real defect pixels based on the comparison of differential reflectance peak intensity values ​​and thresholds.

Benefits of technology

It improves the accuracy of scratch defect detection in flexographic labels during the production process, reduces misjudgments and omissions caused by background interference, and ensures the accuracy of defect location.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121962027A_ABST
    Figure CN121962027A_ABST
Patent Text Reader

Abstract

The invention provides a flexographic label online defect detection method and system based on machine vision, and the method comprises the steps: carrying out differential analysis based on original reflection spectrum data corresponding to a global surface image of a flexographic label and preset standard reflection spectrum data, and obtaining differential reflection spectrum data; performing difference analysis on the spectral characteristics of each pixel point in the global surface image based on the differential reflection spectrum data to obtain a reflection wavelength; analyzing a differential reflection peak intensity value of each pixel point in the global surface image under a target wavelength based on the differential reflection spectrum data, and comparing the differential reflection peak intensity value of each pixel point with a differential reflection peak intensity threshold to determine a scratch defect pixel region; and determining a defect area with scratches in the global surface image based on a pixel position corresponding relation between the scratch defect pixel area and the global surface image. According to the invention, the accuracy of scratch defect detection of the flexographic label in the production process is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method and system for online defect detection of flexographic labels based on machine vision. Background Technology

[0002] In the production of flexographic labels, scratch defects can seriously affect the appearance quality of the product. Therefore, online scratch defect detection is a key process in the production process.

[0003] In existing technologies, a single reflectance spectral detection method is commonly used to detect scratch defects on flexographic labels online. This method collects reflectance spectral data from the surface of the flexographic label, compares the collected reflectance spectral data with preset standard spectral data, and determines whether scratch defects exist based on the comparison results.

[0004] However, background interference factors such as material color difference and printing pattern brightness difference on the surface of flexographic labels can lead to low feature recognition of single reflectance spectrum data, making it difficult to effectively distinguish between background interference and real scratch defects during the detection process. This results in a high false detection rate and false negative rate for scratch defects, leading to low accuracy in scratch defect detection during the production process of flexographic labels. Summary of the Invention

[0005] This invention provides a machine vision-based online defect detection method and system for flexographic labels, aiming to improve the accuracy of scratch defect detection in the production process of flexographic labels.

[0006] In a first aspect, the present invention provides an online defect detection method for flexographic labels based on machine vision, comprising: Differential reflectance spectral data is obtained by performing differential analysis between the original reflectance spectral data corresponding to the full-area surface image of the flexographic label acquired by the machine vision device and the preset standard reflectance spectral data. Based on the differential reflectance spectral data, the spectral features of each pixel in the global surface image are analyzed to distinguish the spectral differences between defect features and background interference features, and the reflected wavelength is obtained. Based on the differential reflectance spectral data, the differential reflectance peak intensity value of each pixel in the global surface image at the reflection wavelength is analyzed, and the differential reflectance peak intensity value of each pixel is compared with the differential reflectance peak intensity threshold to determine the pixel region of the scratch defect. Based on the correspondence between the pixel region of the scratch defect and the pixel position of the global surface image, the defect region in the global surface image containing scratches is determined.

[0007] Secondly, the present invention provides a machine vision-based online defect detection system for flexographic labels, applied to the machine vision-based online defect detection method for flexographic labels as described in the first aspect; the machine vision-based online defect detection system for flexographic labels includes: The spectral difference analysis module is used to perform differential analysis between the original reflectance spectral data corresponding to the full-area surface image of the flexographic label acquired by the machine vision device and the preset standard reflectance spectral data to obtain differential reflectance spectral data. The spectral difference analysis module is used to perform difference analysis on the spectral features of each pixel in the global surface image based on the differential reflectance spectral data, so as to distinguish the spectral differences between defect features and background interference features and obtain the reflection wavelength. The scratch defect analysis module is used to analyze the differential reflection peak intensity value of each pixel in the global surface image at the reflection wavelength based on the differential reflectance spectral data, and to determine the scratch defect pixel region by comparing the differential reflection peak intensity value of each pixel with the differential reflection peak intensity threshold. The scratch defect localization module is used to determine the defect area in the global surface image where scratches exist based on the correspondence between the pixel area of ​​the scratch defect and the pixel position of the global surface image.

[0008] Thirdly, the present invention provides an electronic device, comprising: a memory for storing computer software programs; and a processor for reading and executing the computer software programs, thereby realizing the online defect detection method for flexographic labels based on machine vision as described above.

[0009] Fourthly, the present invention provides a non-transitory computer-readable storage medium storing a computer software program, which, when executed by a processor, implements the online defect detection method for flexographic labels based on machine vision as described above.

[0010] Fifthly, the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the online defect detection method for flexographic labels based on machine vision as described above.

[0011] The online defect detection method for flexographic labels based on machine vision provided in this invention performs differential analysis on the original reflectance spectral data corresponding to the full-area surface image of the flexographic label and the preset standard reflectance spectral data to obtain differential reflectance spectral data. This initially offsets the spectral baseline shift caused by background interference such as material color difference and printing pattern brightness difference throughout the entire area. Next, based on the differential reflectance spectral data, the spectral features of each pixel in the full-area surface image are analyzed for difference. This accurately captures the essential difference between defect features (spectral abrupt changes due to surface structure damage) and background interference features (gradual spectral changes), thereby determining the target wavelength that maximizes the highlighting of defect features and improving defect feature identification. Then, based on the differential reflectance spectral data, the intensity value of the differential reflectance peak of each pixel at the target wavelength is analyzed and compared with the threshold to determine the pixel region of the scratch defect. Since the target wavelength has eliminated the invalid spectral range of background interference, the pixels corresponding to the real defects can be accurately screened, avoiding misjudgment (misjudging background interference as defects) or missed judgment (defect features are masked and not identified) caused by background interference. Finally, the defect area is determined based on the correspondence between the pixel region of the scratch defect and the pixel position of the whole surface image, ensuring the accuracy of defect positioning. This solves the problem of low feature recognition and high false detection and missed detection rates caused by background interference, and improves the accuracy of scratch defect detection in flexographic labels during the production process. Attached Figure Description

[0012] Figure 1 This is a flowchart illustrating the online defect detection method for flexographic labels based on machine vision provided in an embodiment of the present invention. Figure 2 This is a schematic diagram of the structure of the online defect detection system for flexographic labels based on machine vision provided in an embodiment of the present invention; Figure 3 An embodiment diagram of the electronic device provided in this invention; Figure 4 An embodiment diagram of a computer-readable storage medium provided in accordance with the present invention. Detailed Implementation

[0013] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

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

[0015] In the description of this invention, the term "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this invention is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed herein.

[0016] Optionally, see Figure 1 , Figure 1 This is a flowchart illustrating the online defect detection method for flexographic labels based on machine vision provided by the present invention. In this embodiment of the invention, the executing entity of the online defect detection method for flexographic labels based on machine vision is an online defect detection system. Therefore, the online defect detection method for flexographic labels based on machine vision includes: Step 10: Perform differential analysis on the original reflectance spectral data corresponding to the full-area surface image of the flexographic label acquired by the machine vision device and the preset standard reflectance spectral data to obtain differential reflectance spectral data.

[0017] Optionally, the online defect detection system controls a machine vision device to capture images of the flexographic label, obtaining a full-area surface image of the flexographic label, and simultaneously acquiring the raw reflectance spectral data of each pixel in the full-area surface image at different wavelengths.

[0018] Machine vision equipment refers to specialized devices with image acquisition capabilities, capable of capturing images of the entire surface of flexographic labels and obtaining the reflectance spectral information of each pixel at different wavelengths. Examples include industrial cameras equipped with spectral imaging modules. A full-area surface image refers to a complete image covering the entire surface area of ​​the flexographic label without omissions, containing information about all pixels on the label surface. Raw reflectance spectral data refers to the spectral data corresponding to the light reflected by each pixel at different wavelengths in the full-area surface image acquired by the machine vision equipment; this spectral data directly reflects the original reflectance characteristics of the pixel.

[0019] Optionally, the preset standard reflectance spectrum data refers to the reflectance spectrum data that each pixel should have at each corresponding wavelength under the defect-free and normal state of the flexographic label.

[0020] Furthermore, the online defect detection system performs differential calculations on the original reflectance spectral data and the preset standard reflectance spectral data of each pixel at the same wavelength, according to the principle of one-to-one wavelength correspondence. That is, the value of the original reflectance spectral data at the same wavelength is subtracted from the value of the preset standard reflectance spectral data at the same wavelength to obtain the differential reflectance intensity information of each pixel at each wavelength. These differential reflectance intensity information of all pixels together constitute the differential reflectance spectral data. Therefore, the differential reflectance intensity information reflects the degree of difference between the actual reflectance characteristics of the pixel and the standard reflectance characteristics.

[0021] In one embodiment, a batch of red flexographic labels is tested for defects. A machine vision device is controlled to photograph one of the red flexographic labels, acquiring a full-area surface image of the label. Simultaneously, the reflection intensity value of pixel A in the image is recorded as 80 (unit: arbitrary reflection intensity unit) at 450nm and 60 at 550nm; the reflection intensity value of pixel B is 75 at 450nm and 58 at 550nm. Then, preset standard reflection spectrum data is retrieved, where the reflection intensity value of the pixel corresponding to the defect-free red flexographic label (the standard position pixel corresponding to pixels A and B) is 78 at 450nm and 59 at 550nm. Next, differential calculations were performed. Pixel A's differential reflectance intensity value at 450nm is 80-78=2, and at 550nm is 60-59=1; pixel B's differential reflectance intensity value at 450nm is 75-78=-3, and at 550nm is 58-59=-1. These differential reflectance intensity values ​​of pixels A and B at different wavelengths, along with the differential reflectance intensity values ​​of all other pixels in the global surface image at various wavelengths, together constitute the differential reflectance spectral data of the red flexographic label.

[0022] Step 20: Based on the differential reflectance spectral data, perform differential analysis on the spectral features of each pixel in the global surface image to distinguish the spectral differences between defect features and background interference features, and obtain the reflection wavelength.

[0023] Optionally, the online defect detection system extracts the spectral features of each pixel in the global surface image based on the differential reflectance spectral data. The spectral features, i.e., the differential reflectance spectral data, present characteristics that can reflect the reflectance properties of the pixel, such as the trend of reflection intensity changing with wavelength and the peak reflection intensity at a specific wavelength.

[0024] Furthermore, the online defect detection system classifies and compares these spectral features to distinguish which spectral features are defect features caused by defects in flexographic labels and which are background interference features caused by factors such as the detection environment. That is, by analyzing the differences between defect features and background interference features at different wavelengths, wavelengths that can characterize defect features and are less affected by background interference features are selected. These wavelengths are the reflection wavelengths, as described in steps 201 to 203.

[0025] Among them, defect features refer to the spectral characteristics that differ from normal areas in differential reflectance spectral data when defects such as scratches and stains exist on the surface of flexographic labels. Background interference features refer to the interfering spectral characteristics that appear in differential reflectance spectral data due to factors such as light fluctuations in the detection environment and slight non-defective texture differences on the label surface. Reflectance wavelengths include monochromatic wavelengths and polychromatic wavelengths. Monochromatic wavelengths are those with only a single wavelength, while polychromatic wavelengths are those with two or more wavelengths.

[0026] Step 30: Analyze the differential reflection peak intensity value of each pixel in the global surface image at the reflection wavelength based on differential reflectance spectral data, and compare the differential reflection peak intensity value of each pixel with the differential reflection peak intensity threshold to determine the pixel region of the scratch defect.

[0027] Optionally, the online defect detection system, based on differential reflectance spectral data, extracts the differential reflectance peak intensity value at the reflection wavelength for each pixel in the global surface image, as described in steps 301 to 303. Here, the differential reflectance peak intensity value refers to the numerical value corresponding to the peak reflection intensity in the differential reflectance spectral data at the reflection wavelength.

[0028] Furthermore, the online defect detection system compares the differential reflection peak intensity value of each pixel with a pre-set differential reflection peak intensity threshold. The differential reflection peak intensity threshold is a critical value used to determine whether a pixel belongs to a scratch defect pixel. It is determined through a large number of experiments based on statistical analysis of the differential reflection peak intensity values ​​of flexographic labels with and without defects at the reflection wavelength.

[0029] Furthermore, for pixels with a differential reflection peak intensity value greater than the differential reflection peak intensity threshold, the online defect detection system determines that the pixel is a pixel related to a scratch defect; for pixels with a differential reflection peak intensity value less than or equal to the differential reflection peak intensity threshold, the pixel is determined to be a normal pixel or a pixel corresponding to background interference.

[0030] Furthermore, the online defect detection system integrates all pixels identified as related to scratch defects to obtain the scratch defect pixel region.

[0031] In one embodiment, it is assumed that the reflection wavelengths obtained through step 20 are 450nm and 550nm. The online defect detection system extracts the differential reflection peak intensity value of pixel A at the 450nm reflection wavelength as 2 and the differential reflection peak intensity value at the 550nm reflection wavelength as 1; the differential reflection peak intensity value of pixel B at the 450nm reflection wavelength is -3 and the differential reflection peak intensity value at the 550nm reflection wavelength is -1. The preset differential reflection peak intensity threshold is 1.5 (this threshold is determined by analyzing the differential reflection peak intensity values ​​of a large number of scratch-free and scratched red flexographic labels at wavelengths of 450nm and 550nm). Comparing the differential reflection peak intensity value of each pixel with the threshold, the differential reflection peak intensity value of pixel A at the 450nm wavelength is greater than 1.5, and the differential reflection peak intensity value of pixel A at the 550nm wavelength is less than 1.5. Therefore, pixel A is judged to be a pixel related to a scratch defect. The differential reflection peak intensity values ​​of pixel B at both reflection wavelengths are less than 1.5, and it is judged to be a normal pixel. If there are also pixels C and D in the global surface image, where pixel C has a differential reflection peak intensity of 1.8 at a reflection wavelength of 450nm and 1.2 at a reflection wavelength of 550nm, it is also judged to be a pixel related to scratch defects. Furthermore, if pixel A and pixel C are continuous, then pixel A and pixel C constitute the scratch defect pixel region.

[0032] Step 40: Based on the correspondence between the pixel region of the scratch defect and the pixel position of the global surface image, determine the defect region in the global surface image where scratches exist.

[0033] Optionally, the online defect detection system determines the correspondence between the pixel region of the scratch defect and the pixel position of the global surface image. The pixel position correspondence refers to the specific coordinate position relationship of each pixel in the scratch defect pixel region in the global surface image, that is, each scratch defect pixel has a unique and determined position coordinate in the global surface image.

[0034] Furthermore, the online defect detection system utilizes the correspondence between the pixel region of the scratch defect and the pixel position of the global surface image. That is, each scratch defect pixel has a clear position coordinate in the global surface image. The system finds the image region corresponding to the scratch defect pixel region in the global surface image. This image region is the defect area where the scratch exists on the flexographic label surface. Therefore, the scratch defect area refers to the actual image region in the global surface image that corresponds to the pixel position of the scratch defect pixel region. The scratch defect area intuitively reflects the specific location and range of the scratch on the flexographic label surface.

[0035] In one embodiment, it is assumed that the scratch defect pixel region determined in step 30 includes pixel A (position coordinates (100, 200)) and pixel C (position coordinates (101, 200)). Based on these position coordinates, the image region corresponding to coordinates (100, 200) and (101, 200) is found in the global surface image of the flexographic label. This image region corresponding to these two coordinate points and the surrounding possibly continuous scratch defect pixels is the defect region in the global surface image of the flexographic label where scratches exist. Through this region, the specific location and approximate length range of the scratch on the label surface can be clearly seen.

[0036] This invention employs differential analysis between the original reflectance spectral data corresponding to the full-area surface image of a flexographic label and preset standard reflectance spectral data to obtain differential reflectance spectral data. This initially offsets the spectral baseline shift caused by background interference such as material color difference and printing pattern brightness difference across the entire area. Next, based on the differential reflectance spectral data, the spectral features of each pixel in the full-area surface image are analyzed to accurately capture the essential differences between defect features and background interference features, thereby determining the target wavelength that maximizes the highlighting of defect features and improving defect feature recognition. Then, based on the differential reflectance spectral data, the differential reflectance peak intensity value of each pixel at the target wavelength is analyzed and compared with a threshold to determine the scratch defect pixel region. Since the target wavelength excludes invalid spectral ranges caused by background interference, the pixels corresponding to the real defects can be accurately screened, avoiding false positives or false negatives caused by background interference. Finally, the defect region is determined based on the correspondence between the scratch defect pixel region and the pixel position of the full-area surface image, ensuring the accuracy of defect location. This solves the problem of low feature recognition and high false positive / false negative rates caused by background interference, improving the accuracy of scratch defect detection in the production process of flexographic labels.

[0037] Optionally, steps 201 to 203 include: Step 201: Based on the differential reflection intensity information of each pixel in the differential reflectance spectral data at each wavelength, perform peak and valley feature analysis to obtain the peak features corresponding to the peaks of each pixel at each wavelength, and the valley features corresponding to the valleys at each wavelength.

[0038] Optionally, for each pixel, the online defect detection system extracts the differential reflection intensity values ​​of the pixel at different wavelengths in order of increasing (or decreasing) wavelength according to the differential reflectance spectral data, and associates these differential reflection intensity values ​​with the corresponding wavelength values ​​to obtain the differential reflectance spectral curve of the pixel.

[0039] Next, the online defect detection system identifies local extrema for each differential reflectance spectrum curve: starting from the beginning of the curve, it compares the differential reflectance intensity values ​​at adjacent wavelengths. When the differential reflectance intensity value at a certain wavelength is greater than the differential reflectance intensity values ​​at the two wavelengths to its left and right, the wavelength is determined to be a peak wavelength, and the corresponding differential reflectance intensity value is the peak reflectance intensity value. Together, they constitute the peak feature of the pixel at that wavelength. Similarly, when the differential reflectance intensity value at a certain wavelength is less than the differential reflectance intensity values ​​at the two wavelengths to its left and right, the wavelength is determined to be a trough wavelength, and the corresponding differential reflectance intensity value is the trough reflectance intensity value. Together, they constitute the trough feature of the pixel at that wavelength. Thus, the peak and trough features of each pixel at each wavelength are obtained.

[0040] Therefore, it can be understood that the peak feature refers to the core feature corresponding to the local maximum value of the differential reflection intensity information of a certain pixel in differential reflectance spectral data as the wavelength changes. This includes the peak wavelength (i.e., the wavelength value when the local maximum occurs) and the peak reflection intensity value (i.e., the differential reflection intensity value corresponding to the local maximum). The trough feature refers to the core feature corresponding to the local minimum value of the differential reflectance intensity information of a certain pixel in differential reflectance spectral data as the wavelength changes. This includes the trough wavelength (i.e., the wavelength value when the local minimum occurs) and the trough reflection intensity value (i.e., the differential reflection intensity value corresponding to the local minimum).

[0041] In one embodiment, in step 10, the differential reflectance spectral data of pixel A in the global surface image of the red flexographic label has been obtained: the differential reflectance intensity value is 1.2 at a wavelength of 400nm, 1.5 at 420nm, 1.8 at 440nm, 2.0 at 450nm, 1.7 at 460nm, 1.4 at 480nm, 1.1 at 500nm, 0.9 at 520nm, 0.7 at 540nm, 1.0 at 550nm, 1.3 at 560nm, 1.6 at 580nm, and 1.4 at 600nm.

[0042] The online defect detection system processes these data for pixel A, associating the intensity values ​​in ascending order of wavelength to form a spectral curve. Comparing the intensity values ​​of adjacent wavelengths: the intensity value of 2.0 at 450nm is greater than that of the adjacent wavelengths of 440nm (1.8) and 460nm (1.7), therefore the peak characteristic of pixel A at 450nm is determined to be "peak wavelength 450nm, peak reflection intensity value 2.0"; the intensity value of 0.7 at 540nm is less than that of the adjacent wavelengths of 520nm (0.9) and 550nm (1.0), therefore the trough characteristic of pixel A at 540nm is determined to be "trough wavelength 540nm, trough reflection intensity value 0.7". In the same way, the system can obtain the peak features (if any) and valley features (if any) of pixel A at other wavelengths. For example, the intensity value of 1.6 at 580nm is greater than that at 560nm (1.3) and 600nm (1.4), and its peak feature is "peak wavelength 580nm, peak reflection intensity value 1.6". At the same time, it can also obtain the peak features and valley features of other pixels (such as pixels B, C, and D) in the global surface image at various wavelengths.

[0043] Step 202: Analyze the spectral variation trend based on the differential reflection intensity information of each pixel at each wavelength in the differential reflectance spectral data, and obtain the differential reflectance spectral derivative of each pixel at each wavelength.

[0044] Optionally, the online defect detection system performs spectral trend analysis based on differential reflectance spectral data and the differential reflectance spectral curve of each pixel. Specifically, it calculates the first and second derivatives of each pixel at various wavelengths to obtain the differential reflectance spectral derivatives of each pixel at each wavelength. The first derivative reflects the rate of change of differential reflectance intensity with wavelength near that wavelength (positive values ​​indicate increasing intensity with increasing wavelength, negative values ​​indicate decreasing intensity with increasing wavelength, and larger absolute values ​​indicate more drastic changes). The second derivative reflects the rate of change of the first derivative with wavelength and can further characterize the concavity / convexity of the spectral curve (positive values ​​indicate a convex curve at that wavelength, negative values ​​indicate a concave curve).

[0045] Optionally, for calculating the first derivative: For the spectral curve of each pixel, the online defect detection system selects a target wavelength, then selects the wavelength adjacent to the left (left wavelength) and the wavelength adjacent to the right (right wavelength), and extracts the differential reflection intensity values ​​corresponding to the left wavelength (left intensity) and the right wavelength (right intensity). The first derivative at the target wavelength is calculated using the central difference method: first, the difference between the right intensity and the left intensity is calculated; then, the difference between the right wavelength and the left wavelength is calculated; finally, the intensity difference is divided by the wavelength difference, and the result is the first derivative of that pixel at the target wavelength.

[0046] Optionally, for calculating the second derivative Based on the obtained first-order derivative data, the online defect detection system selects the first-order derivative values ​​corresponding to the left and right adjacent wavelengths (referred to as the left first-order derivative and right first-order derivative, respectively) for each pixel's target wavelength. The second-order derivative at the target wavelength is then calculated using the central difference method: first, the difference between the right and left first-order derivatives is calculated; then, the difference between the right and left wavelengths is calculated; finally, the difference in first-order derivatives is divided by the wavelength difference, and the result is the second-order derivative of that pixel at the target wavelength.

[0047] In one embodiment, taking pixel A as an example, some wavelengths and corresponding intensity values ​​in its differential reflectance spectral data are as follows: 440nm (1.8), 450nm (2.0), 460nm (1.7), 540nm (0.7), 550nm (1.0), 560nm (1.3).

[0048] For calculating the first derivative: Calculate the first derivative of pixel A at 450nm: Select a wavelength of 440nm on the left (intensity 1.8 on the left) and a wavelength of 460nm on the right (intensity 1.7 on the right); intensity difference = 1.7 - 1.8 = -0.1, wavelength difference = 460nm - 440nm = 20nm, therefore the first derivative = -0.1 / 20nm = -0.005 (intensity unit / nanometer).

[0049] Calculate the first derivative of pixel A at 550nm: Select a wavelength of 540nm on the left (intensity 0.7 on the left) and a wavelength of 560nm on the right (intensity 1.3 on the right); the intensity difference = 1.3 - 0.7 = 0.6, the wavelength difference = 560nm - 540nm = 20nm, therefore the first derivative = 0.6 / 20nm = 0.03 (intensity unit / nanometer).

[0050] Similarly, the first derivative at 440nm (supplementing the intensity data at 430nm, assuming it is 1.6, then the first derivative = (1.8-1.6) / (440-430) = 0.02), the first derivative at 460nm (supplementing the intensity at 470nm, 1.5, then the first derivative = (1.5-1.7) / (470-460) = -0.02), the first derivative at 540nm (supplementing the intensity at 530nm, 0.8, then the first derivative = (0.7-0.8) / (540-530) = -0.01), and the first derivative at 560nm (supplementing the intensity at 570nm, 1.5, then the first derivative = (1.5-1.3) / (570-560) = 0.02) can be calculated.

[0051] For calculating the second derivative: Calculate the second derivative of pixel A at 450nm: Select a wavelength of 440nm on the left (first derivative of the left side is 0.02) and a wavelength of 460nm on the right (first derivative of the right side is -0.02); the difference in first derivatives = -0.02 - 0.02 = -0.04, the difference in wavelengths = 460nm - 440nm = 20nm, therefore, the second derivative = -0.04 / 20nm = -0.002 (intensity units / nanometer). 2 ).

[0052] Calculate the second derivative of pixel A at 550nm: Select a wavelength of 540nm on the left (first derivative of the left side -0.01) and a wavelength of 560nm on the right (first derivative of the right side 0.02); the difference in first derivatives = 0.02 - (-0.01) = 0.03, the wavelength difference = 560nm - 540nm = 20nm, therefore, the second derivative = 0.03 / 20nm = 0.0015 (intensity units / nanometer). 2 ).

[0053] The first and second derivatives of pixel A at other wavelengths can be obtained in the same way, as can the first and second derivatives of the differential reflectance spectra of other pixels such as B, C, and D at various wavelengths.

[0054] Step 203: Perform difference analysis based on the peak features, trough features and differential reflectance spectral derivatives of each pixel at various wavelengths to obtain the reflection wavelength.

[0055] Optionally, a difference analysis is performed based on the peak features, trough features, and differential reflectance spectral derivatives of each pixel at various wavelengths to obtain the reflection wavelength, as described in steps 2031 to 2034.

[0056] The embodiments of the present invention can accurately screen out the reflection wavelengths that are sensitive to defects, providing a highly recognizable wavelength basis for subsequent accurate identification of scratch defect pixel areas. From the perspective of spectral feature analysis, it improves the accuracy of identifying scratch defects in flexographic labels and the ability to resist interference, thereby improving the accuracy of scratch defect detection in the production process of flexographic labels.

[0057] Optionally, the process of steps 2031 to 2034 includes: Step 2031: Determine the peak frequency based on the proportion of pixels whose wavelengths belong to the peak wavelengths of each pixel, and determine the trough frequency based on the proportion of pixels whose wavelengths belong to the trough wavelengths of each pixel.

[0058] Optionally, the online defect detection system determines the total number of pixels in the global surface image, selects a target wavelength, traverses all pixels in the global surface image, and counts the number of pixels whose target wavelength belongs to the peak wavelength of each pixel (i.e., peak pixel count) and the number of pixels whose target wavelength belongs to the trough wavelength of each pixel (i.e., trough pixel count). Then, the peak frequency of the target wavelength is obtained by dividing the peak pixel count by the total number of pixels, and the trough frequency of the target wavelength is obtained by dividing the trough pixel count by the total number of pixels. Following the above process, calculations are performed sequentially for all wavelengths involved in the detection, ultimately obtaining the peak and trough frequencies corresponding to each wavelength.

[0059] In one embodiment, assuming the total number of pixels in the global surface image of the red flexographic label is 1000, the wavelengths involved in the detection include 450nm, 540nm, and 580nm. Selecting the target wavelength of 450nm, after traversing 1000 pixels, it is found that 200 pixels have a peak wavelength of 450nm, therefore the peak frequency of 450nm = 200 / 1000 = 0.2 (i.e., 20%); simultaneously, it is found that 50 pixels have a trough wavelength of 450nm, therefore, the trough frequency of 450nm = 50 / 1000 = 0.05 (i.e., 5%). When selecting the target wavelength of 540nm, it is found that 80 pixels have a peak wavelength of 540nm, with a peak frequency = 80 / 1000 = 0.08 (i.e., 8%); and 300 pixels have a trough wavelength of 540nm, with a trough frequency = 300 / 1000 = 0.3 (i.e., 30%). When the target wavelength is selected as 580nm, it is found that there are 150 pixels with a peak wavelength of 580nm, and the peak frequency is 150 / 1000=0.15 (i.e., 15%); there are 60 pixels with a trough wavelength of 580nm, and the trough frequency is 60 / 1000=0.06 (i.e., 6%).

[0060] Step 2032: Calculate the standard deviation of the derivative of each wavelength based on the first derivative of each wavelength at each pixel.

[0061] Optionally, for each target wavelength, the online defect detection system sums the first derivative values ​​of that wavelength at all pixels to obtain the sum of the first derivatives, and then divides the sum of the first derivatives by the total number of pixels to calculate the average value of the next derivative value for that wavelength.

[0062] Furthermore, the online defect detection system calculates the difference between the first derivative value of each pixel at that wavelength and the average value, and then squares each difference to obtain the squared difference value.

[0063] Furthermore, the online defect detection system sums the squared differences of all pixels to obtain the total sum of squared differences, and divides the total sum of squared differences by the total number of pixels to obtain the variance.

[0064] Furthermore, the online defect detection system performs a square root operation on this variance, and the result is the standard deviation of the derivative for that target wavelength. Following the above steps, the standard deviation of the derivative is calculated for each wavelength involved in the detection. Therefore, the standard deviation of the derivative refers to the dispersion of the first derivative values ​​at all pixels in the global surface image at a specific wavelength. This index is obtained by calculating the degree of difference between all first derivative values ​​and their average value. A larger value indicates a more significant difference in the first derivative values ​​at that wavelength, while a smaller value indicates a weaker difference. In one embodiment, for a global surface image (total number of pixels 1000), taking a target wavelength of 450nm as an example, step 202 has already obtained the first derivative values ​​of the 1000 pixels at this wavelength. Assuming the sum of these values ​​is -5 (intensity units / nanometer), then the average value of the first derivative values ​​= -5 / 1000 = -0.005 (intensity units / nanometer). The squared difference between the first derivative value of each pixel and the average value is calculated, assuming the sum of all squared differences is 0.1 (intensity units). 2 / nanometer 2 If the variance is 0.1 / 1000, then the variance is 0.0001 (unit of intensity). 2 / nanometer 2 Taking the square root of this variance, the standard deviation of the derivative at 450nm is 0.01 (intensity units / nanometer). For a target wavelength of 540nm, the sum of the first derivative values ​​for 1000 pixels is -10 (intensity units / nanometer), the average value is -10 / 1000 = -0.01 (intensity units / nanometer), and the sum of all squared differences is 0.02 (intensity units). 2 / nanometer 2 Variance = 0.02 / 1000 = 0.00002 (unit of intensity) 2 / nanometer 2The standard deviation of the derivative is 0.0045 (intensity units per nanometer).

[0065] Taking a target wavelength of 580nm as an example, the sum of the first derivative values ​​of its 1000 pixels is 3 (intensity units / nanometer), the average value is 3 / 1000 = 0.003 (intensity units / nanometer), and the sum of all squared differences is 0.08 (intensity units). 2 / nanometer 2 Variance = 0.08 / 1000 = 0.00008 (unit of intensity) 2 / nanometer 2 The standard deviation of the derivative is 0.0089 (intensity units per nanometer).

[0066] Step 2033: The wavelength range in which the peak frequency is greater than a preset peak frequency threshold, the trough frequency is less than a preset trough frequency threshold, and the standard deviation of the derivative is greater than a preset standard deviation threshold is determined as the candidate wavelength range for defect features. The wavelength range in which the peak frequency is less than a preset peak frequency threshold, the trough frequency is greater than a preset trough frequency threshold, and the standard deviation of the derivative is less than a preset standard deviation threshold is determined as the candidate wavelength range for interference features.

[0067] Optionally, the preset peak frequency threshold refers to the critical value of the peak frequency used to determine whether a wavelength may belong to a wavelength related to defect characteristics, and is determined through statistical analysis of the peak frequency data of a large number of defect-free and defective flexographic labels. The preset trough frequency threshold refers to the critical value of the trough frequency used to determine whether a wavelength may belong to a wavelength related to defect characteristics, and this threshold is determined through statistical analysis of the trough frequency data of a large number of defect-free and defective flexographic labels. The preset standard deviation threshold refers to the critical value of the derivative standard deviation used to determine whether a wavelength may belong to a wavelength related to defect characteristics, and this threshold is determined through statistical analysis of the derivative standard deviation data of a large number of defect-free and defective flexographic labels.

[0068] Optionally, the online defect detection system performs conditional judgments on each wavelength: if the peak frequency of the wavelength is greater than a preset peak frequency threshold, the trough frequency is less than a preset trough frequency threshold, and the standard deviation of the derivative is greater than a preset standard deviation threshold, then the wavelength is marked as a candidate wavelength for defect features. If the peak frequency of the wavelength is less than a preset peak frequency threshold, the trough frequency is greater than a preset trough frequency threshold, and the standard deviation of the derivative is less than a preset standard deviation threshold, then the wavelength is marked as a candidate wavelength for interference features.

[0069] Furthermore, the online defect detection system performs a continuity judgment on the wavelengths of all defect feature candidate wavelengths, and determines the range of continuous defect feature candidate wavelengths as the defect feature candidate wavelength interval; similarly, the range of continuous interference feature candidate wavelengths is determined as the interference feature candidate wavelength interval.

[0070] In one embodiment, the preset peak frequency threshold is 0.12, the preset trough frequency threshold is 0.1, and the preset standard deviation threshold is 0.008. Each wavelength is judged as follows: 450nm has a peak frequency of 0.2 (greater than 0.12), a trough frequency of 0.05 (less than 0.1), and a derivative standard deviation of 0.01 (greater than 0.008), satisfying the defect feature candidate wavelength condition and is marked as a defect feature candidate wavelength; 540nm has a peak frequency of 0.08 (less than 0.12), a trough frequency of 0.3 (greater than 0.1), and a derivative standard deviation of 0.0045 (less than 0.008), satisfying the interference feature candidate wavelength condition and is marked as an interference feature candidate wavelength; 580nm has a peak frequency of 0.15 (greater than 0.12), a trough frequency of 0.06 (less than 0.1), and a derivative standard deviation of 0.0089 (greater than 0.008), satisfying the defect feature candidate wavelength condition and is marked as a defect feature candidate wavelength. Since 450nm and 580nm are not continuous wavelengths (assuming there are wavelengths such as 460nm-570nm in between, and these wavelengths are judged not to meet the candidate wavelength conditions for defect or interference characteristics), the candidate wavelength range for defect characteristics is determined to be the 450nm range (only 450nm) and the 580nm range (only 580nm); the candidate wavelength range for interference characteristics is the 540nm range (only 540nm).

[0071] Step 2034: Based on the candidate wavelength range of defect features, the candidate wavelength range of interference features, and the second derivative, perform difference analysis to obtain the reflection wavelength.

[0072] Optionally, the reflection wavelength can be obtained by performing a difference analysis based on the candidate wavelength range of the defect features, the candidate wavelength range of the interference features, and the second derivative, as described in steps 20341 to 20343.

[0073] The embodiments of the present invention can accurately screen out the reflection wavelengths that are sensitive to defects, providing a highly recognizable wavelength basis for subsequent accurate identification of scratch defect pixel areas. From the perspective of spectral feature analysis, it improves the accuracy of identifying scratch defects in flexographic labels and the ability to resist interference, thereby improving the accuracy of scratch defect detection in the production process of flexographic labels.

[0074] Optionally, the processes of steps 20341 to 20343 include: Step 20341: For each pixel, take any wavelength within the candidate wavelength range of defect features as the first wavelength and any wavelength within the candidate wavelength range of interference features as the second wavelength, calculate the absolute difference between the second derivative of each pixel at the first wavelength and the second derivative at the second wavelength, and obtain the second derivative difference value.

[0075] Optionally, the online defect detection system arbitrarily selects a wavelength from the candidate wavelength range of defect features as the first wavelength and an arbitrarily selects a wavelength from the candidate wavelength range of interference features as the second wavelength. It then obtains the second derivative values ​​of each pixel in the global surface image at the first wavelength and at the second wavelength. Further, for each pixel, the online defect detection system subtracts the second derivative value at the second wavelength from the second derivative value at the first wavelength and takes the absolute value to obtain the second derivative difference value for that pixel. This process is repeated for all pixels in the global surface image to obtain the second derivative difference value for each pixel.

[0076] In one embodiment, the candidate wavelength range for defect features determined in step 2033 includes 450nm and 580nm, and the candidate wavelength range for interference features includes 540nm. The online defect detection system selects 450nm as the first wavelength from the candidate wavelength range for defect features and 540nm as the second wavelength from the candidate wavelength range for interference features. Step 202 has obtained the second derivative value of pixel A at 450nm as -0.002 (intensity units / nanometer). 2 The second derivative at 540 nm is assumed to be 0.001 (intensity units per nanometer). 2 For pixel A, first calculate the difference: -0.002 - 0.001 = -0.003 (intensity unit / nanometer). 2 Then, taking the absolute value of this difference, we obtain the second derivative difference value of pixel A as 0.003 (intensity units / nanometer). 2 Taking pixel B as an example, its second derivative at 450nm is -0.0015 (intensity units per nanometer). 2 The second derivative at 540 nm is 0.0008 (intensity units per nanometer). 2 ), calculate the difference: -0.0015 - 0.0008 = -0.0023 (intensity units / nanometer) 2 The absolute value of the difference in the second derivative of pixel B is 0.0023 (intensity units per nanometer). 2 ).

[0077] Step 20342: Calculate the absolute difference between the peak reflection intensity value and the trough reflection intensity value of each pixel at the first wavelength and the second wavelength to obtain the first reflection intensity difference value.

[0078] Optionally, the online defect detection system acquires the peak reflection intensity value at the first wavelength and the trough reflection intensity value at the second wavelength for each pixel in the global surface image (if the first wavelength is the peak wavelength of the pixel, the corresponding peak reflection intensity value is directly used; if the first wavelength is not the peak wavelength of the pixel, the equivalent peak reflection intensity value at that wavelength is calculated by spectral curve interpolation) for each pixel in the global surface image.

[0079] Furthermore, for each pixel, the online defect detection system subtracts the peak reflection intensity value at the first wavelength from the trough reflection intensity value at the second wavelength and takes the absolute value to obtain the first reflection intensity difference value corresponding to that pixel. This process is repeated for all pixels in the global surface image to obtain the first reflection intensity difference value for each pixel.

[0080] In one embodiment, the first wavelength in step 20341 is 450nm and the second wavelength is 540nm. Step 201 has already obtained the peak reflection intensity value of pixel A at 450nm as 2.0 (arbitrary reflection intensity unit) and the trough reflection intensity value at 540nm as 0.7 (arbitrary reflection intensity unit). For pixel A, the difference is first calculated: 2.0 - 0.7 = 1.3 (arbitrary reflection intensity unit), and then the absolute value of this difference is taken to obtain the first reflection intensity difference value of pixel A as 1.3 (arbitrary reflection intensity unit). For pixel B, its peak reflection intensity value at 450nm (calculated by interpolation) is 1.8 (arbitrary reflection intensity unit), and its trough reflection intensity value at 540nm (calculated by interpolation) is 0.6 (arbitrary reflection intensity unit). The difference is calculated: 1.8 - 0.6 = 1.2 (arbitrary reflection intensity unit), and the absolute value is taken to obtain the first reflection intensity difference value of pixel B as 1.2 (arbitrary reflection intensity unit).

[0081] Step 20343: Perform difference analysis based on the difference value of the second derivative of each pixel and the difference value of the first reflection intensity to obtain the reflection wavelength.

[0082] Optionally, the online defect detection system performs difference analysis based on the difference value of the second derivative of each pixel and the difference value of the first reflection intensity to obtain the reflection wavelength, as described in steps a to c.

[0083] The embodiments of the present invention can accurately obtain the reflection wavelength that is highly sensitive to defect features and is minimally affected by interference, providing a basis for identifying the pixel area of ​​scratch defects, improving the identification accuracy and anti-interference ability of scratch defects in flexographic labels, thereby improving the accuracy of scratch defect detection in flexographic labels during the production process.

[0084] Optionally, the processes from steps a to c include: Step a: For any first candidate wavelength within the defect feature candidate wavelength range and any second candidate wavelength within the interference feature candidate wavelength range, the first difference is obtained by taking the average value of the peak reflection intensity of the first pixel point whose peak wavelength includes the first candidate wavelength and the average value of the valley reflection intensity of the second pixel point whose valley wavelength includes the second candidate wavelength.

[0085] Optionally, the online defect detection system arbitrarily selects a wavelength from the defect feature candidate wavelength range as the first candidate wavelength and arbitrarily selects a wavelength from the interference feature candidate wavelength range as the second candidate wavelength. It then filters out all first pixels whose peak wavelengths contain the first candidate wavelength, extracts and sums the peak reflection intensity values ​​of these first pixels to obtain the total intensity of the first pixels. This total is then divided by the number of first pixels to obtain the average peak reflection intensity value of the first pixels. Simultaneously, it filters out all second pixels whose trough wavelengths contain the second candidate wavelength, extracts and sums the trough reflection intensity values ​​of these second pixels to obtain the total intensity of the second pixels. This total is then divided by the number of second pixels to obtain the average trough reflection intensity value of the second pixels.

[0086] Furthermore, the online defect detection system subtracts the average value of the reflection intensity of the trough of the second pixel from the average value of the peak reflection intensity of the first pixel to obtain the first difference.

[0087] In one embodiment, the candidate wavelength range for defect features includes 450nm and 580nm, and the candidate wavelength range for interference features includes 540nm. The online defect detection system selects 450nm as the first candidate wavelength and 540nm as the second candidate wavelength. A total of 200 first pixel points with a peak wavelength of 450nm are selected (corresponding to a peak frequency of 0.2 at 450nm in step 2031). The sum of the peak reflection intensity values ​​of these first pixel points is 360 (any unit of reflection intensity), so the average value of the peak reflection intensity values ​​of the first pixel points = 360 / 200 = 1.8 (any unit of reflection intensity). A total of 300 second pixel points with a trough wavelength of 540nm are selected (corresponding to a trough frequency of 0.3 at 540nm in step 2031). The sum of the trough reflection intensity values ​​of these second pixel points is 210 (any unit of reflection intensity), so the average value of the trough reflection intensity values ​​of the second pixel points = 210 / 300 = 0.7 (any unit of reflection intensity). Therefore, the first difference is 1.8 - 0.7 = 1.1.

[0088] Similarly, if 580nm is selected as the first candidate wavelength and 540nm as the second candidate wavelength, there are 150 first-pixel points (peak wavelength 580nm), with a total intensity of 255 and an average value of 255 / 150 = 1.7; the average value of the second-pixel points remains 0.7, and the first difference is 1.7 - 0.7 = 1.0. Step b: A second difference is obtained by subtracting the average value of the second derivative of the first candidate wavelength at each pixel and the average value of the second derivative of all second candidate wavelengths at each pixel. A third difference is obtained by subtracting the average value of the second derivative of the second candidate wavelength at each pixel and the average value of the second derivative of all first candidate wavelengths at each pixel.

[0089] Optionally, the online defect detection system obtains the second derivative values ​​of each wavelength at all pixels, as well as the candidate wavelength range for defect features (including all first candidate wavelengths) and the candidate wavelength range for interference features (including all second candidate wavelengths).

[0090] For calculating the second difference: Calculate the average value of the second derivative of the first candidate wavelength: extract the second derivative values ​​of the first candidate wavelength at all pixels and sum them to obtain the sum of the second derivatives of the first candidate wavelength. Divide this sum by the total number of pixels to obtain the average value of the second derivative of the first candidate wavelength.

[0091] Calculate the average of the second derivatives of all second candidate wavelengths: If there is only one second candidate wavelength within the interference characteristic candidate wavelength interval, directly use the average of the second derivatives of that second candidate wavelength (calculated in the same way as the first candidate wavelength); if there are multiple second candidate wavelengths within the interval, calculate the average of the second derivatives of each second candidate wavelength separately, then sum these averages and divide by the number of second candidate wavelengths to obtain the average of the second derivatives of all second candidate wavelengths. Subtract the average of the second derivatives of all second candidate wavelengths from the average of the second derivatives of the first candidate wavelength to obtain the second difference.

[0092] For calculating the third difference: Calculate the average value of the second derivative of the second candidate wavelength: extract the second derivative values ​​of the second candidate wavelength at all pixels and sum them to obtain the sum of the second derivatives of the second candidate wavelength. Divide this sum by the total number of pixels to obtain the average value of the second derivative of the second candidate wavelength.

[0093] Calculate the average of the second derivatives of all first candidate wavelengths: Calculate the average of the second derivatives of each first candidate wavelength separately (in the same way as the first candidate wavelength), then sum these averages and divide by the number of first candidate wavelengths to obtain the average of the second derivatives of all first candidate wavelengths. Subtract the average of the second derivatives of all first candidate wavelengths from the average of the second derivatives of the second candidate wavelengths to obtain the third difference.

[0094] In one embodiment, the candidate wavelength range for defect features includes two first candidate wavelengths, 450 nm and 580 nm, and the candidate wavelength range for interference features includes one second candidate wavelength, 540 nm.

[0095] (1) Calculate the second difference: The sum of the second derivatives of the first candidate wavelength (450 nm) is -2 (intensity units per nanometer). 2 If the second derivative average value is -2 / 1000 = -0.002 (intensity units per nanometer), then its average second derivative value is -2 / 1000 = -0.002. 2 ).

[0096] The sum of the second derivatives of all second candidate wavelengths (540 nm only) is 1 (intensity units / nanometer). 2 If the second derivative average value is 1 / 1000 = 0.001 (intensity unit / nanometer), then its average value is 1 / 1000 = 0.001. 2 ).

[0097] The second difference = -0.002 - 0.001 = -0.003 (intensity units per nanometer) 2 ).

[0098] (2) Calculate the third difference The average second derivative of the second candidate wavelength (540 nm) is 0.001 (intensity units per nanometer).2 ).

[0099] The average of the second derivatives of all first candidate wavelengths: The sum of the second derivatives at 580 nm is -1.5 (intensity units per nanometer). 2 Its average value is -1.5 / 1000 = -0.0015 (intensity units per nanometer). 2 Then the average of the second derivatives of all first candidate wavelengths = (-0.002 + (-0.0015)) / 2 = -0.00175 (intensity units per nanometer). 2 The third difference = 0.001 - (-0.00175) = 0.00275 (intensity units per nanometer). 2 ).

[0100] Step c involves performing a difference analysis based on the second derivative difference value, the first reflection intensity difference value, the first difference value, the second difference value, and the third difference value to obtain the reflection wavelength.

[0101] Optionally, the online defect detection system performs difference analysis based on the second derivative difference value, the first reflection intensity difference value, the first difference value, the second difference value, and the third difference value to obtain the reflection wavelength, as described in steps c1 to c4.

[0102] The embodiments of the present invention can obtain a reflection wavelength with extremely high specificity for identifying defect features, providing the highest precision wavelength basis for subsequent identification of scratch defect pixel areas. By improving the identification accuracy and anti-interference ability of scratch defects in flexographic labels from the spectral feature screening stage, the accuracy of scratch defect detection in flexographic labels during the production process is improved.

[0103] Optionally, the process from steps c1 to c4 includes: Step c1: Determine the target wavelength group of defect features based on wavelengths where the first difference is greater than a first preset multiple of the first reflection intensity difference value and the second difference is greater than a first preset multiple of the second derivative difference value.

[0104] Optionally, for each wavelength, the online defect detection system determines whether its corresponding first difference is greater than "the average difference in first reflection intensity across the entire domain * a first preset multiple", and whether the absolute value of its corresponding second difference is greater than "the average difference in second derivative across the entire domain * a first preset multiple". Wavelengths that simultaneously meet both conditions are included in the defect feature target wavelength group.

[0105] In one embodiment, assuming the first reflection intensity difference value is 0.9 (any reflection intensity unit), and the first preset multiple is 1.2 times, then the judgment threshold = 0.9 * 1.2 = 1.08; the second derivative difference value is 0.002 (intensity unit / nanometer). 2 The threshold value is calculated as 0.002 * 1.2 = 0.0024. Wavelength 450nm: The first difference 1.1 > 1.08, and the absolute value of the second difference 0.003 > 0.0024, meet the conditions and are included in the defect feature target wavelength group; Wavelength 580nm: The first difference 1.0 < 1.08, which does not meet the condition, is not included; Therefore, the target wavelength group for defect characteristics is {450nm}.

[0106] Step c2: Based on wavelengths where the first difference is less than a second preset multiple of the first reflection intensity difference value and the third difference is less than a second preset multiple of the second derivative difference value, determine the target wavelength group for defect features.

[0107] Optionally, for each wavelength, the online defect detection system determines whether its corresponding first difference is less than "the average difference in first reflection intensity across the entire domain * a second preset multiple", and whether the absolute value of its corresponding third difference is less than "the average difference in second derivative across the entire domain * a second preset multiple". Wavelengths that simultaneously satisfy both conditions are retained to obtain the defect feature target wavelength group.

[0108] In one embodiment, the first reflection intensity difference value is 0.9, the second preset multiple is 0.8, and the judgment threshold is 0.9 * 0.8 = 0.72; the second derivative difference value is 0.002, the judgment threshold is 0.002 * 0.8 = 0.0016, the first difference for wavelength 560 is 0.66, and the third difference is 0.0013. Wavelength 540nm: The first difference 0.66 < 0.72 and the third difference 0.0013 < 0.0016 meet the conditions and are included in the target wavelength group of defect characteristics.

[0109] Therefore, the target wavelength group for defect characteristics remains {540nm}.

[0110] Step c3: For any first target wavelength in the defect feature target wavelength group, obtain a second reflection intensity difference value based on the absolute value of the difference between the differential reflection intensity of each pixel at the first target wavelength and each second target wavelength, and average the second reflection intensity difference values ​​of each pixel to obtain the average reflection intensity difference value. The second target wavelength is any wavelength in the defect feature target wavelength group.

[0111] Optionally, the online defect detection system selects one wavelength from the final defect feature target wavelength group as the first target wavelength, and then selects another wavelength from the group as the second target wavelength (if there is only one wavelength in the group, the wavelength can be selected along with itself or a related wavelength from the supplementary screening). Based on the differential reflectance spectral data, the system extracts the differential reflectance intensity value of each pixel at the first target wavelength and the differential reflectance intensity value at the second target wavelength, calculates the absolute difference between the two intensity values, and obtains the second reflectance intensity difference value for each pixel. The system sums the second reflectance intensity difference values ​​of all pixels and divides them by the total number of pixels to obtain the average reflectance intensity difference value corresponding to the first target wavelength. The above operation is repeated for each first target wavelength in the group to obtain the average reflectance intensity difference value for each first target wavelength.

[0112] In one embodiment, taking a first target wavelength of 450nm and a second target wavelength of 540nm as an example: The differential reflection intensity of pixel A at the first target wavelength of 450nm and the second target wavelength of 540nm is: I 450 =2.0, I 540 =0.7, the second reflection intensity difference value =|2.0-0.7|=1.3; The differential reflection intensity of pixel B at the first target wavelength of 450nm and the second target wavelength of 540nm is: I 450 =1.8, I 540 =0.6, second reflection intensity difference value =1.2; Assume the sum of the differences in the second reflection intensity of 1000 pixels is 1100; The average difference in reflection intensity = 1100 / 1000 = 1.1 (any unit of reflection intensity).

[0113] In another embodiment, assuming that wavelength 580nm also satisfies the condition of the defect feature target wavelength group (i.e., the defect feature target wavelength group includes {450nm, 580nm}), then the average difference in reflection intensity between 580nm and 540nm needs to be calculated: The differential reflection intensity of pixel A at the first target wavelength of 580nm and the second target wavelength of 540nm is: I 580 =1.6, I 540 =0.7, second reflection intensity difference value =0.9; The differential reflection intensity of pixel B at the first target wavelength of 580nm and the second target wavelength of 540nm is: I 580 =1.5, I 540 =0.6, second reflection intensity difference value =0.9; Assume the sum of the second reflection intensity differences of 1000 pixels is 950; The average difference in reflection intensity at 580nm is 950 / 1000 = 0.95.

[0114] Step c4: Determine the minimum value of the average reflection intensity difference for each first target wavelength, and determine the first target wavelength whose minimum value is greater than the preset wavelength difference intensity threshold as the reflection wavelength.

[0115] Optionally, the online defect detection system traverses the set of mean values ​​for each first target wavelength and extracts the minimum value (e.g., the minimum value for 450nm is 1.1, and the minimum value for 580nm is 0.95). Furthermore, the online defect detection system compares the minimum mean value of each first target wavelength with a preset wavelength difference intensity threshold (e.g., 0.8): If the minimum mean value is greater than the preset threshold, meaning the first target wavelength meets the defect identification requirements, the online defect detection system will include the first target wavelength in the candidate reflection wavelengths; if the minimum mean value is less than or equal to the preset threshold, meaning the first target wavelength cannot effectively distinguish between defects and interference, it will be excluded.

[0116] If only one first target wavelength meets the condition, then that wavelength is a monochromatic reflection wavelength; if multiple wavelengths meet the condition, then these wavelengths together form a multicolor reflection wavelength (used for multidimensional defect detection).

[0117] In one embodiment, the defect feature target wavelength group is {450nm, 580nm}; the interference feature target wavelength group is {540nm}; and the preset wavelength difference intensity threshold is 0.8. The mean set for 450nm: {1.1} (combined only with 540nm); The mean set for 580nm is {0.95} (combined only with 540nm). The minimum mean value at 450nm is 1.1; The minimum mean value at 580nm is 0.95; 1.1 > 0.8, 450nm meets the condition; 0.95 > 0.8, 580nm meets the condition; The reflection wavelengths are determined as follows: 450nm and 580nm both meet the conditions, therefore the final reflection wavelengths are multicolor wavelengths, namely {450nm, 580nm}.

[0118] In another embodiment, if the target wavelength group of the defect feature contains only 450nm and its minimum mean value of 1.1 > 0.8, then the reflected wavelength is a monochromatic wavelength {450nm}.

[0119] The embodiments of the present invention can obtain a reflection wavelength with extremely high specificity for identifying defect features, providing the highest precision wavelength basis for subsequent identification of scratch defect pixel areas. By improving the identification accuracy and anti-interference ability of scratch defects in flexographic labels from the spectral feature screening stage, the accuracy of scratch defect detection in flexographic labels during the production process is improved.

[0120] Optionally, the processes of steps 301 to 303 include: Step 301: If the reflection wavelength is a monochromatic wavelength, then the differential reflection intensity information of each pixel in the global surface image under the monochromatic wavelength is determined as the differential reflection peak intensity value.

[0121] Optionally, the online defect detection system determines whether the reflected wavelength is a monochromatic wavelength (i.e., the set of reflected wavelengths contains only one wavelength). If it is determined to be a monochromatic wavelength, the online defect detection system extracts the differential reflection intensity information of each pixel at that monochromatic wavelength from the differential reflectance spectrum data of each pixel in the global surface image, and determines it as the differential reflection peak intensity value corresponding to that pixel.

[0122] In one embodiment, the reflection wavelength is a monochromatic wavelength {450nm}, and step 10 has obtained the differential reflection intensity information of each pixel at 450nm in the global surface image (total number of pixels 1000): For pixel A, its differential reflection intensity information at 450nm is 2.0 (any reflection intensity unit), and 2.0 is directly determined as the differential reflection peak intensity value of pixel A; For pixel B, its differential reflection intensity information at 450nm is 0.7 (any reflection intensity unit), and 0.7 is directly determined as the differential reflection peak intensity value of pixel B; For pixel C, its differential reflection intensity information at 450nm is 0.9 (any unit of reflection intensity), and 0.9 is directly determined as the differential reflection peak intensity value of pixel C.

[0123] Step 302: If the reflected wavelength is a multicolor wavelength, then determine the weighting coefficient of each wavelength based on the wavelength range of the multicolor wavelength and the wavelength distance between two adjacent wavelengths.

[0124] Optionally, if the wavelengths are determined to be multicolor, the online defect detection system sorts the multicolor wavelengths in ascending order of wavelength value, calculates the wavelength range (maximum wavelength - minimum wavelength), and calculates the wavelength distance between two adjacent wavelengths (the next wavelength after sorting - the previous wavelength). For each wavelength, if it is the first wavelength after sorting, its associated distance is "the distance with the second wavelength"; if it is the last wavelength, its associated distance is "the distance with the second-to-last wavelength"; if it is an intermediate wavelength, its associated distance is "the average of the two adjacent distances". The system then calculates the "proportion of the associated distance to the sum of the total distances" for each wavelength.

[0125] Optionally, since "the smaller the wavelength spacing, the denser the defect information," this embodiment of the invention adopts a "reverse mapping" logic—the wavelength with a smaller correlation spacing ratio has a larger weight coefficient. The specific calculation method is as follows: the online defect detection system calculates "1 - correlation spacing ratio" for each wavelength to obtain a preliminary weight value; then, all preliminary weight values ​​are summed, and the preliminary weight value of each wavelength is divided by the total preliminary weight value to obtain the final weight coefficient (ensuring that the sum of the coefficients is 1).

[0126] Step 303: Based on the differential reflection intensity information of each pixel in the global surface image at each wavelength in the multicolor wavelength, and the weight coefficient of each wavelength in the multicolor wavelength, determine the differential reflection peak intensity value of each pixel in the global surface image at the multicolor wavelength.

[0127] Optionally, the online defect detection system performs weighted calculations based on the differential reflection intensity information of each pixel in the global surface image at each wavelength in the multicolor wavelength, and the weight coefficient of each wavelength in the multicolor wavelength, to obtain the differential reflection peak intensity value of each pixel in the global surface image at the multicolor wavelength.

[0128] The embodiments of the present invention can accurately determine the differential reflection peak intensity value of each pixel in the global surface image under multicolor wavelengths. Therefore, the pixel region of scratch defects can be accurately identified based on the differential reflection peak intensity value, which improves the recognition accuracy and stability of scratch defects in flexographic labels, thereby improving the accuracy of scratch defect detection in flexographic labels during the production process.

[0129] Furthermore, the online defect detection system for flexographic labels based on machine vision provided by the present invention will be described below. The online defect detection system for flexographic labels based on machine vision described below can be referred to in correspondence with the online defect detection method for flexographic labels based on machine vision described above.

[0130] Optionally, refer to Figure 2 , Figure 2This is a schematic diagram of the online defect detection system for flexographic labels based on machine vision provided by the present invention. The online defect detection system for flexographic labels based on machine vision includes: The spectral difference analysis module 210 is used to perform differential analysis on the original reflectance spectral data corresponding to the full-area surface image of the flexographic label acquired by the machine vision device and the preset standard reflectance spectral data to obtain differential reflectance spectral data. The spectral difference analysis module 220 is used to perform difference analysis on the spectral features of each pixel in the global surface image based on differential reflectance spectral data, so as to distinguish the spectral differences between defect features and background interference features and obtain the reflection wavelength. The scratch defect analysis module 230 is used to analyze the differential reflection peak intensity value of each pixel in the global surface image at the reflection wavelength based on differential reflectance spectral data, and to determine the scratch defect pixel area by comparing the differential reflection peak intensity value of each pixel with the differential reflection peak intensity threshold. The scratch defect localization module 240 is used to determine the defect area with scratches in the global surface image based on the correspondence between the pixel area of ​​the scratch defect and the pixel position of the global surface image.

[0131] This invention employs differential analysis between the original reflectance spectral data and preset standard reflectance spectral data corresponding to the full-area surface image of a flexographic label to obtain differential reflectance spectral data. This initially offsets the spectral baseline shift caused by background interference such as material color difference and printing pattern brightness difference across the entire area. Next, based on the differential reflectance spectral data, the spectral characteristics of each pixel in the full-area surface image are analyzed to accurately capture the essential differences between defect features and background interference features, thereby determining the target wavelength that maximizes the highlighting of defect features and improving defect feature recognition. Then, based on the differential reflectance spectral data, the differential reflectance peak intensity value of each pixel at the target wavelength is analyzed and compared with a threshold to determine the scratch defect pixel region. Since the target wavelength excludes invalid spectral ranges from background interference, the pixels corresponding to the real defects can be accurately screened, avoiding misjudgments or missed detections caused by background interference. Finally, the defect region is determined based on the correspondence between the scratch defect pixel region and the pixel position of the full-area surface image, ensuring the accuracy of defect location. This solves the problem of low feature recognition and high false positive / missed detection rates caused by background interference, improving the accuracy of scratch defect detection in the production process of flexographic labels.

[0132] Please see Figure 3 , Figure 3 An embodiment diagram of an electronic device provided in accordance with the present invention. For example... Figure 3As shown, an embodiment of the present invention provides an electronic device 300, including a memory 310, a processor 320, and a computer program 311 stored in the memory 310 and executable on the processor 320. When the processor 320 executes the computer program 311, it implements the processes of steps 10 to 40.

[0133] Please see Figure 4 , Figure 4 An embodiment diagram of a computer-readable storage medium provided in accordance with an embodiment of the present invention is shown. Figure 4 As shown, this embodiment provides a computer-readable storage medium 400 on which a computer program 311 is stored. When the computer program 311 is executed by a processor, it implements the processes of steps 10 to 40.

[0134] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the online defect detection method for flexographic labels based on machine vision provided by the above methods, which includes steps 10 to 40.

[0135] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0136] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0137] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A machine vision-based online defect detection method for flexographic labels, characterized in that, include: Differential reflectance spectral data is obtained by performing differential analysis between the original reflectance spectral data corresponding to the full-area surface image of the flexographic label acquired by the machine vision device and the preset standard reflectance spectral data. Based on the differential reflectance spectral data, the spectral features of each pixel in the global surface image are analyzed to distinguish the spectral differences between defect features and background interference features, and the reflected wavelength is obtained. Based on the differential reflectance spectral data, the differential reflectance peak intensity value of each pixel in the global surface image at the reflection wavelength is analyzed, and the differential reflectance peak intensity value of each pixel is compared with the differential reflectance peak intensity threshold to determine the pixel region of the scratch defect. Based on the correspondence between the pixel region of the scratch defect and the pixel position of the global surface image, the defect region in the global surface image containing scratches is determined.

2. The online defect detection method for flexographic labels based on machine vision according to claim 1, characterized in that, The differential reflectance spectral data includes differential reflectance intensity information of each pixel in the global surface image at various wavelengths; The steps for determining the reflected wavelength include: Based on the differential reflection intensity information of each pixel in the differential reflectance spectral data at each wavelength, peak and valley feature analysis is performed to obtain the peak features corresponding to the peaks of each pixel at each wavelength, and the valley features corresponding to the valleys at each wavelength. Based on the differential reflectance intensity information of each pixel at each wavelength in the differential reflectance spectral data, the spectral variation trend is analyzed to obtain the differential reflectance spectral derivative of each pixel at each wavelength. The reflection wavelength is obtained by performing difference analysis based on the peak and trough characteristics and differential reflectance spectral derivative of each pixel at various wavelengths.

3. The online defect detection method for flexographic labels based on machine vision according to claim 2, characterized in that, The peak characteristics include the peak wavelength and the peak reflection intensity value; the trough characteristics include the trough wavelength and the trough reflection intensity value; the differential reflection spectrum derivative includes the first derivative and the second derivative. The difference analysis based on the peak and trough characteristics and differential reflectance spectral derivative of each pixel at various wavelengths yields the reflection wavelength, including: The peak frequency is determined based on the percentage of pixels whose wavelengths belong to the peak wavelengths of each pixel, and the trough frequency is determined based on the percentage of pixels whose wavelengths belong to the trough wavelengths of each pixel. The standard deviation of the derivative of each wavelength is calculated based on the first derivative of each wavelength at each pixel. The wavelength range with peak frequencies greater than a preset peak frequency threshold, trough frequencies less than a preset trough frequency threshold, and derivative standard deviation greater than a preset standard deviation threshold is determined as the candidate wavelength range for defect features. The wavelength range with peak frequencies less than a preset peak frequency threshold, trough frequencies greater than a preset trough frequency threshold, and derivative standard deviation less than a preset standard deviation threshold is determined as the candidate wavelength range for interference features. The reflection wavelength is obtained by performing a difference analysis based on the candidate wavelength range of the defect features, the candidate wavelength range of the interference features, and the second derivative.

4. The online defect detection method for flexographic labels based on machine vision according to claim 3, characterized in that, The difference analysis based on the candidate wavelength range of the defect features, the candidate wavelength range of the interference features, and the second derivative is used to obtain the reflection wavelength, including: For each pixel, take any wavelength within the candidate wavelength range of defect features as the first wavelength and any wavelength within the candidate wavelength range of interference features as the second wavelength. Calculate the absolute difference between the second derivative of each pixel at the first wavelength and the second derivative at the second wavelength to obtain the second derivative difference value. The absolute difference between the peak reflection intensity value at the first wavelength and the trough reflection intensity value at the second wavelength for each pixel is calculated to obtain the first reflection intensity difference value. The reflection wavelength is obtained by performing a difference analysis based on the difference value of the second derivative of each pixel and the difference value of the first reflection intensity.

5. The online defect detection method for flexographic labels based on machine vision according to claim 4, characterized in that, The difference analysis based on the second derivative difference value and the first reflection intensity difference value of each pixel is used to obtain the reflection wavelength, including: For any first candidate wavelength within the defect feature candidate wavelength range and any second candidate wavelength within the interference feature candidate wavelength range, a first difference is obtained by subtracting the average value of the peak reflection intensity of the first pixel point whose peak wavelength includes the first candidate wavelength and the average value of the trough reflection intensity of the second pixel point whose trough wavelength includes the second candidate wavelength. The second difference is obtained by subtracting the average of the second derivatives of the first candidate wavelength at each pixel and the average of the second derivatives of all second candidate wavelengths at each pixel. The third difference is obtained by subtracting the average of the second derivatives of the second candidate wavelength at each pixel and the average of the second derivatives of all first candidate wavelengths at each pixel. The reflection wavelength is obtained by performing difference analysis based on the difference value of the second derivative, the difference value of the first reflection intensity, the first difference value, the second difference value, and the third difference value.

6. The online defect detection method for flexographic labels based on machine vision according to claim 5, characterized in that, The difference analysis based on the second derivative difference value, the first reflection intensity difference value, the first difference value, the second difference value, and the third difference value yields the reflection wavelength, including: Based on wavelengths where the first difference is greater than a first preset multiple of the first reflection intensity difference value and the second difference is greater than a first preset multiple of the second derivative difference value, the target wavelength group for defect features is determined. Based on wavelengths where the first difference is less than a second preset multiple of the first reflection intensity difference and the third difference is less than a second preset multiple of the second derivative difference, the interference characteristic target wavelength group is determined. For any first target wavelength in the defect feature target wavelength group, a second reflection intensity difference value is obtained based on the absolute value of the difference between the differential reflection intensity of each pixel at the first target wavelength and each second target wavelength, and the average reflection intensity difference value of each pixel is obtained by averaging the second reflection intensity difference value; the second target wavelength is any wavelength in the interference feature target wavelength group. The minimum value of the average difference in reflection intensity for each first target wavelength is determined, and the first target wavelength whose minimum value is greater than a preset wavelength difference intensity threshold is determined as the reflection wavelength.

7. The online defect detection method for flexographic labels based on machine vision according to any one of claims 1 to 6, characterized in that, The step of analyzing the differential reflection peak intensity value of each pixel in the global surface image at the reflection wavelength based on the differential reflectance spectral data includes: If the reflection wavelength is a monochromatic wavelength, then the differential reflection intensity information of each pixel in the global surface image under the monochromatic wavelength is determined as the differential reflection peak intensity value; If the reflected wavelength is a multicolor wavelength, then the weighting coefficient of each wavelength is determined based on the wavelength range of the multicolor wavelength and the wavelength spacing between two adjacent wavelengths. Based on the differential reflection intensity information of each pixel in the global surface image at each wavelength of the multicolor wavelength, and the weighting coefficient of each wavelength of the multicolor wavelength, the differential reflection peak intensity value of each pixel in the global surface image at the multicolor wavelength is determined.

8. A machine vision-based online defect detection system for flexographic labels, characterized in that, The method is applied to the online defect detection method for flexographic labels based on machine vision as described in any one of claims 1 to 7; the online defect detection system for flexographic labels based on machine vision includes: The spectral difference analysis module is used to perform differential analysis between the original reflectance spectral data corresponding to the full-area surface image of the flexographic label acquired by the machine vision device and the preset standard reflectance spectral data to obtain differential reflectance spectral data. The spectral difference analysis module is used to perform difference analysis on the spectral features of each pixel in the global surface image based on the differential reflectance spectral data, so as to distinguish the spectral differences between defect features and background interference features and obtain the reflection wavelength. The scratch defect analysis module is used to analyze the differential reflection peak intensity value of each pixel in the global surface image at the reflection wavelength based on the differential reflectance spectral data, and to determine the scratch defect pixel region by comparing the differential reflection peak intensity value of each pixel with the differential reflection peak intensity threshold. The scratch defect localization module is used to determine the defect area in the global surface image where scratches exist based on the correspondence between the pixel area of ​​the scratch defect and the pixel position of the global surface image.

9. An electronic device, comprising: Memory, used to store computer software programs; A processor for reading and executing the computer software program, characterized in that, when the processor executes the computer software program, it implements the machine vision-based online defect detection method for flexographic labels as described in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium, wherein a computer software program is stored therein, characterized in that, When the computer software program is executed by the processor, it implements the machine vision-based online defect detection method for flexographic labels as described in any one of claims 1 to 7.