Image Processing-Based Ink Printing Defect Detection Method

By fusing multispectral images with high-resolution grayscale images, adaptive neighborhood and dynamic thresholding are used to mark spectral anomalies. Combined with gradient component decomposition, high-precision detection and quantitative evaluation of gradient printing defects are achieved, solving the problems of low detection accuracy and insufficient defect quantification in existing technologies and improving the stability of printing quality.

CN121414680BActive Publication Date: 2026-07-17CHUXIONG HUALI PACKING IND CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHUXIONG HUALI PACKING IND CO LTD
Filing Date
2025-10-23
Publication Date
2026-07-17

AI Technical Summary

Technical Problem

Existing printing defect detection methods cannot adapt to the dynamic grayscale changes in gradient printing, resulting in low detection accuracy and a lack of quantitative assessment of defect severity. They also cannot be linked with the production process, leading to the recurrence of similar defects.

Method used

By fusing multispectral images with high-resolution grayscale images, gradual transition regions are determined through adaptive neighborhood and weighted confidence. Defects are identified by combining dynamic threshold marking of spectral anomalies and gradient component decomposition. The degree of defects is quantified through quality assessment coefficients, triggering production traceability signaling to analyze the root causes.

Benefits of technology

It improves the accuracy and quantification of gradient printing defect detection, reduces production costs and resource waste, and enhances the stability of printing quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121414680B_ABST
    Figure CN121414680B_ABST
Patent Text Reader

Abstract

This invention discloses an image processing-based method for detecting ink printing defects, specifically relating to the field of printing quality inspection technology. This invention integrates multispectral reflectance and high-resolution grayscale gradient features, employs adaptive neighborhood and weighted confidence to determine gradient regions, combines dynamic thresholding to mark spectral anomalies, and then uses gradient component decomposition and morphological screening to eliminate interference and determine the verification region. Using the verification region as a seed point, region growth is performed along the vertical gradient direction. If the area expansion rate after growth is higher than the reference expansion rate, it is determined to be a gradient ink layer unevenness defect. This method adapts to complex gradient scenarios and solves the problem of poor adaptability of traditional fixed thresholds in existing technologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of printing quality inspection technology, and more specifically, to an image processing-based method for detecting defects in ink printing. Background Technology

[0002] Ink printing technology is widely used in food packaging, book covers, commercial posters and other fields. With the upgrading of consumer market demand for visual effects, gradient printing has become one of the mainstream printing forms because it can present rich color transition effects. However, uneven ink layer defects are prone to occur in the gradient printing process. This defect is manifested as the local ink thickness deviating from the normal gradient in the gradient transition area. Specifically, it is reflected as local colors being too dark (thick ink layer) or too light (thin ink layer), which directly destroys the consistency of the appearance of the printed product. In severe cases, it may affect the brand image and product market competitiveness. Therefore, high-precision detection of this defect is the core requirement of printing quality control.

[0003] However, current industry methods for detecting printing defects still have the following shortcomings:

[0004] Current detection methods largely rely on fixed threshold segmentation for a single image modality, distinguishing defects from normal areas by setting fixed grayscale values ​​or spectral reflectance thresholds. However, the core characteristic of gradient printing is that grayscale / spectral density changes continuously and dynamically. Fixed thresholds cannot adapt to this dynamic range. If the threshold is set too high, minute defects will be missed; if the threshold is set too low, normal gradient areas will be misclassified as defects, resulting in generally low detection accuracy.

[0005] Existing technologies mostly focus on defect identification, lacking both a quantitative assessment mechanism for defect severity, such as quantitative analysis of defect deviation intensity and spatial impact range, making it impossible to scientifically determine product qualification level; moreover, they lack the ability to link and trace the production process, so when multiple sets of printed products have defects, it is impossible to link ink supply data and equipment parameters to locate the root cause, leading to the recurrence of similar defects, increasing production costs and wasting resources.

[0006] To address this, an image processing-based method for detecting defects in ink printing has been developed. Summary of the Invention

[0007] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide an ink printing defect detection method based on image processing.

[0008] To achieve the above objectives, the present invention provides the following technical solution:

[0009] Image processing-based methods for detecting defects in ink printing include:

[0010] S1: Acquire multispectral images and high-resolution grayscale images of printed materials, perform pixel-level registration on the two images, and obtain a registered fused image pair;

[0011] S2: Based on the registered fused image pairs, the constructed defect detection logic is used to determine the unevenness of the gradient ink layer in the image;

[0012] S3: For the uneven gradient ink layer defect of each group of printed materials, the quality assessment coefficient is obtained after evaluating the defect degree index. The printing result of the current printed material is determined based on the quality assessment coefficient; the printing result is qualified or unqualified.

[0013] S4: If the printing results of X consecutive groups of printed products are all judged to be unqualified, the production traceability signal will be triggered and the cause of defect prediction will be analyzed. The cause of defect prediction includes potential problems with ink supply coefficient and potential problems with printing equipment.

[0014] Specifically, in step S2, the constructed defect detection logic is used to determine the unevenness of the gradient ink layer in the image;

[0015] The Sobel operator is used to calculate the gradient vector of each pixel in a grayscale image. gradient direction angle ;

[0016] The variance of the orientation angle of each pixel within the adaptive neighborhood is calculated and denoted as . ;

[0017] for Regions smaller than a set threshold are marked as suspected gradient regions. The mean rate of change of direction angles within a set-size sliding window is calculated for these suspected gradient regions. ;

[0018] For suspected gradual change regions and rate of change After normalization, the confidence level of the suspected gradient region is obtained by weighted calculation logic. If the confidence level is lower than the preset confidence reference level, it is determined to be a gradient region.

[0019] Within the determined gradient region, samples are uniformly taken along the gradient direction, and after removing abnormal samples, a valid sample set is obtained.

[0020] For the effective sample set, the position-reflectivity baseline curve is obtained by fitting the one-dimensional coordinates along the gradient direction to the reflectivity.

[0021] Using a baseline curve combined with an effective sample set, spectral anomalies and gradient abrupt changes are identified.

[0022] Pixels that simultaneously satisfy spectral anomalies and gradient abruptness points are identified, and initial candidate regions M are obtained by labeling them with 8-neighbor connected components.

[0023] Calculate the screening coefficient of the initial candidate region M, and retain the regions with screening coefficients higher than the screening threshold coefficient as the validation regions;

[0024] Using the verification area as the seed point, the area is grown along the vertical gradient direction. If the area expansion rate after growth is higher than the reference expansion rate, it is determined to be a gradient ink layer unevenness defect.

[0025] Specifically, the adaptive neighborhood setting rules in step S2;

[0026] The adaptive neighborhood is set based on the gradient rate of change. Three sets of gradient rate of change intervals are set, and each set of intervals corresponds to a neighborhood size. The neighborhood size matched by the gradient rate of change is used as the adaptive neighborhood.

[0027] Specifically, in step S2, a baseline curve is used in conjunction with an effective sample set to mark spectral outliers;

[0028] The band g with the highest reflectance-ink thickness sensitivity was selected from the multispectral image;

[0029] In the effective sample set, the standard deviation of the benchmark curve over a defined neighborhood is calculated and denoted as . Then the dynamic threshold is set to ;

[0030] After projecting the pixels within the gradient region onto the gradient direction, the reflectivity deviation is calculated.

[0031] If the reflectance deviation is higher than the dynamic threshold, it is marked as a spectral anomaly.

[0032] Specifically, in step S2, the baseline curve is used in conjunction with the effective sample set to mark gradient mutation points;

[0033] The gradient vector for each pixel is decomposed into components along the gradient direction. and vertical components ;

[0034] Calculate within the specified neighborhood The mean of the mutation is denoted as the mutation mean, and it is used in the normal region. The mean value is denoted as the mutation threshold;

[0035] If the average mutation value of a pixel is greater than v × mutation threshold, it is marked as a gradient mutation point; where v is a preset threshold coefficient.

[0036] Specifically, in step S2, the screening coefficient of the initial candidate region M is calculated;

[0037] Calculate the morphological parameters of the initial candidate region M, including area, roundness, and elongation.

[0038] After normalizing the morphological parameters of the initial candidate regions, the selection coefficients are obtained by processing them using weighted calculation logic.

[0039] Specifically, the criteria for region growth are set in step S2;

[0040] Reflectivity deviation is higher than the dynamic threshold and the vertical component The absolute value is higher than the v× mutation threshold.

[0041] Specifically, in step S3, for each group of printed materials, the uneven gradient ink layer defect is evaluated by assessing the defect severity index to obtain a quality assessment coefficient.

[0042] The defect severity indicators include deviation intensity, spatial influence range, and gradient mutation degree;

[0043] The average reflectance deviation within the defect area is calculated as the deviation intensity;

[0044] The spatial impact range is obtained by calculating the ratio of the defect area to the total area of ​​the gradient region.

[0045] The gradient mutation degree is obtained by calculating the ratio between the mean mutation value of the defective region and the mutation threshold of the normal region.

[0046] After normalizing the deviation intensity, spatial influence range, and gradient mutation degree, the quality evaluation coefficient is obtained by using weighted calculation logic.

[0047] If the quality assessment coefficient is greater than the coefficient threshold, the printing result is deemed unqualified; otherwise, it is deemed qualified.

[0048] Specifically, in step S4, a production traceability signal is triggered and the cause of the defect is analyzed;

[0049] After triggering the production traceability signal, retrieve the ink viscosity data and ink supply pump pressure data of the X group of printed materials during the production period;

[0050] The standard deviation formula was used to calculate the ink viscosity data and ink supply pump pressure data during the production period. After calculation, the mean values ​​of X groups of printed products were taken to determine the viscosity fluctuation and pressure fluctuation.

[0051] The viscosity fluctuation and pressure fluctuation are processed using weighted calculation logic to obtain the ink supply coefficient;

[0052] If the ink supply coefficient is higher than the ink threshold coefficient, the defect prediction cause is determined to be a potential problem with the ink supply coefficient.

[0053] Conversely, the roller pressure data of the X group of printed materials during the production period is retrieved, and after dividing the area, the roller pressure data of the defective area during the printing process is identified. The standard deviation formula is used to calculate the standard deviation of the defective area of ​​the X group of printed materials during the printing process. The average value of the X group of printed materials is taken to obtain the roller fluctuation. The roller fluctuation is compared with the roller fluctuation allowable. If the roller fluctuation is higher than the roller fluctuation allowable, the defect is determined to be a hidden danger in the printing equipment.

[0054] The technical effects and advantages of this invention are as follows:

[0055] (1) By integrating multispectral reflectance and high-resolution gray-scale gradient features, the gradient region is determined by adaptive neighborhood and weighted confidence. The spectral anomaly points are marked by dynamic threshold. The verification region is determined by gradient component decomposition and morphological screening to eliminate interference. The verification region is used as the seed point and the region is grown along the vertical gradient direction. If the area expansion rate of the grown region is higher than the reference expansion rate, it is determined to be a gradient ink layer unevenness defect. It is suitable for complex gradient scenes and solves the problem of poor adaptability of traditional fixed threshold in the existing technology.

[0056] (2) By assessing defects from the perspectives of deviation intensity, spatial influence range, and gradient mutation degree, and by calculating the quality assessment coefficient by weighting, the qualified standards are clarified, providing a graded quality basis for different printed materials, making the testing process reproducible and the results quantifiable, and meeting the differentiated quality control needs of food packaging, high-end gift boxes, etc.

[0057] (3) When X groups of products are unqualified, first analyze the ink viscosity and ink supply pressure data to investigate potential ink problems, and then check the roller pressure positioning equipment. Quickly locate the root cause of the defect and guide production adjustments to avoid the recurrence of similar defects, reduce production costs and resource waste, and improve the stability of printing production quality. Attached Figure Description

[0058] Figure 1 This is a flowchart of the ink printing defect detection method based on image processing according to the present invention. Detailed Implementation

[0059] 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.

[0060] like Figure 1 As shown, the ink printing defect detection method based on image processing includes:

[0061] Multimodal image acquisition: Multispectral images and high-resolution grayscale images of printed materials are acquired simultaneously using a multispectral camera and a high-resolution CCD camera. The two images are then registered at the pixel level using a timestamp synchronization algorithm to obtain a registered fused image pair.

[0062] The encoder acquires the real-time speed of the printed material (e.g., 300 m / min) to trigger two cameras to capture images at the same timestamp (error ≤ ±1 ms), avoiding image misalignment caused by motion. The timestamp synchronization algorithm includes: calculating the time difference between the multispectral image and the high-resolution grayscale image. The spatial offset is obtained by combining the printing speed v. Pixel-level registration is achieved through bicubic interpolation;

[0063] Before registration, the multispectral image is denoised and spectrally corrected, and the high-resolution grayscale image is sharpened and contrast optimized.

[0064] The spectral correction uses the white-plate-dark-field correction method, and the calculation formula is as follows: ;in The corrected reflectivity. For the original multispectral image at wavelength Pixel value at that location, These are the pixel values ​​of the whiteboard image. These are the pixel values ​​of the dark field image.

[0065] Defect type detection: Based on the registered fused image pairs, the constructed defect detection logic is used to determine the uneven gradient ink layer defects in the image;

[0066] The specific steps for identifying uneven gradient ink layers are as follows:

[0067] The Sobel operator is used to calculate the gradient vector of each pixel in a grayscale image. gradient direction angle ;

[0068] The variance of the orientation angle of each pixel within the adaptive neighborhood is calculated and denoted as . The formula is expressed as Where N is the number of neighboring pixels, The average direction angle;

[0069] The adaptive neighborhood is set according to the gradient change rate. Three sets of gradient change rate intervals are set, and each interval corresponds to a neighborhood size. The neighborhood size matched by the gradient change rate is used as the adaptive neighborhood.

[0070] For example, if the local gradient change rate is <5% (gentle gradient), the neighborhood is 7×7; if 5% ≤ change rate <15% (medium gradient), the neighborhood is 5×5; if the change rate ≥15% (steep gradient), the neighborhood is 3×3.

[0071] for Regions smaller than a set threshold are marked as suspected gradient regions; the threshold setting should accommodate complex gradients; further calculate the mean change rate of the direction angle within the set-size sliding window. The size can be set to 10×10.

[0072] For suspected gradual change regions and rate of change After normalization, the confidence level of the suspected gradient region is obtained by weighted calculation logic. If the confidence level is lower than the preset confidence reference level, it is determined to be a gradient region.

[0073] The confidence level of the suspected gradient region is obtained using a weighted calculation logic, specifically as follows:

[0074] According to the formula S= ×r1+ The confidence score is calculated by multiplying by r2, where r1 and r2 are weights assigned to the importance of the two indicators, which can be set to 0.6 and 0.4 respectively. Additional notes: Local consistency is the basis for gradual change and has a slightly higher weight; global trend is used to exclude regions that are locally consistent but distorted overall.

[0075] The smaller the overall score S, the more the region conforms to the gradual change characteristics. Through a large number of sample tests, a judgment threshold St=0.7 is set: if S < St, it is judged as a gradual change region.

[0076] Example, Scenario 1: Ideal linear gradient region;

[0077] If the normalized results of variance and rate of change are 0.02 and 0.17 respectively, then the comprehensive score S = 0.6×0.02 +0.4×0.17 = 0.012 + 0.068 = 0.08 < 0.7, which is determined to be a gradual region.

[0078] Within the determined gradient region, samples are uniformly taken along the gradient direction to obtain a set of sample points. ; As coordinates, Multispectral reflectance;

[0079] After removing outliers, a valid sample set is obtained.

[0080] Additional explanation: Calculate the median absolute deviation of the reflectance at the sample points. Remove After the sample is processed, abnormal samples are removed.

[0081] For the effective sample set, one-dimensional coordinates are obtained along the gradient direction; one-dimensional coordinates are obtained by... Projecting onto the gradient direction yields the position-reflectivity baseline curve; fitting the reflectivity yields the position-reflectivity baseline curve.

[0082] Additional explanation: The formula is expressed as follows ,in The weights are Gaussian, and h is the window width, which is 15% of the total sample length. Let k be the number of samples within the window, and let k be the one-dimensional coordinates. The solution is obtained using the least squares method. , , Thus, the baseline curve is obtained.

[0083] Based on the characteristics of the target ink, the band g with the highest reflectance-ink thickness sensitivity is selected from the multispectral image; for example, 950nm is selected for black ink and 630nm for red ink, and the sensitivity is determined by the Pearson coefficient.

[0084] In the effective sample set, the standard deviation of the benchmark curve over a defined neighborhood is calculated and denoted as . A 3×3 neighborhood; the dynamic threshold is then set to... ;

[0085] To clarify, 10% is used as the lower limit to avoid misjudgment due to an excessively low threshold.

[0086] After projecting the pixels within the gradient region onto the gradient direction, the reflectivity deviation is calculated.

[0087] If the reflectance deviation is higher than the dynamic threshold, it is marked as a spectral anomaly.

[0088] The gradient vector for each pixel is decomposed into components along the gradient direction. and vertical components ;

[0089] Additional explanation, .

[0090] Calculate within the specified neighborhood The mean of the mutation is denoted as the mutation mean, and it is used in the normal region. The mean value is denoted as the mutation threshold; the normal region is the region of gradual change in spectrum without abnormalities.

[0091] If the average value of a pixel's abrupt change is greater than v × abrupt change threshold, it is marked as a gradient abrupt change point; where v is a preset threshold coefficient, set to 1.5 to adapt to gradients of different steepness.

[0092] Pixels that simultaneously satisfy spectral anomalies and gradient abruptness points are identified, and initial candidate regions M are obtained by labeling them with 8-neighbor connected components.

[0093] Calculate the morphological parameters of the initial candidate region M, including area, roundness, and elongation.

[0094] Additional explanation: the area is obtained by multiplying the number of pixels by the area of ​​a single pixel, and the circularity... L is the perimeter of the region, and the elongation rate = major axis length / short sleeve length. The elongation is more obvious along the vertical gradient direction.

[0095] After normalizing the morphological parameters of the initial candidate regions, the screening coefficients are obtained by using weighted calculation logic. Regions with screening coefficients higher than the screening threshold coefficients are retained as verification regions.

[0096] The specific process of obtaining the screening coefficients using weighted calculation logic is as follows:

[0097] The area, circularity, and elongation of the initial candidate region are respectively labeled as follows: Substitute into the formula The screening coefficient N is calculated; where Weighting coefficients are set for area, roundness, and elongation.

[0098] Using the verification area as the seed point, the area is grown along the vertical gradient direction. If the area expansion rate after growth is higher than the reference expansion rate (which can be set to 30%), it is determined to be a gradient ink layer unevenness defect.

[0099] The growth criterion is set as follows: reflectivity deviation is higher than the dynamic threshold and the vertical component... The absolute value is higher than the v× mutation threshold;

[0100] For example, the side of a food packaging box uses a red-to-light red gradient printing, but there is a defect where the ink layer is too thick in some areas (dark areas). This needs to be detected through multimodal image fusion.

[0101] The gradient vector (Gx, Gy) of each pixel in a grayscale image is calculated using the Sobel operator to obtain the gradient direction angle. (The red gradient direction is roughly horizontal to the right);

[0102] Calculate the local gradient change rate: The left side of the packaging box gradually flattens (change rate 3%) → neighborhood 7×7; the middle area has a change rate of 10% → neighborhood 5×5; the right side is steep (change rate 18%) → neighborhood 3×3;

[0103] Calculate the variance of the orientation angle within the 7×7 neighborhood, which is 1.2°. 2 The mean change rate of the orientation angle within a 10×10 window is Δθ = 0.8° / mm.

[0104] Normalization: variance is 0.012, rate of change ≈ 0.27.

[0105] Confidence level S = 0.6 × 0.012 + 0.4 × 0.27 = 0.007 + 0.108 = 0.115 < 0.7 → determined to be a gradual transition region;

[0106] Uniform sampling along the horizontal gradient direction yields a sample point set P (containing coordinates and multispectral reflectance Ri, with the red sensitive band selected at 630nm).

[0107] By fitting the baseline curve R(t) with LOWESS (t is a one-dimensional coordinate in the horizontal direction), the normal gradual trend of "position → reflectivity" is obtained (e.g., reflectivity increases linearly from 30% to 70% from left to right).

[0108] Calculate the standard deviation of the 3×3 neighborhood of the baseline curve at 2%, and the dynamic threshold max(10%, 3×2%)=10%;

[0109] If the pixel reflectance of a certain local area is 35%, the reflectance of the corresponding reference curve position should be 45% → deviation = (35-45) / 45≈22%>10% → mark it as a spectral anomaly point;

[0110] Decompose the gradient vector: G1 (horizontal) along the gradient direction and G2 (vertical) in the vertical direction.

[0111] If the mean G2 value in the normal region is greater than 1.5 × the mutation threshold, it is marked as a gradient outlier.

[0112] Pixels that simultaneously satisfy spectral anomalies and gradient abrupt changes are labeled with 8 neighbor connected components to obtain an initial region M (area 0.1 mm²); morphological parameter analysis → meets the screening criteria;

[0113] Regional growth: After growing along the vertical direction, the area expands to 0.15 mm² (expansion rate 50% > 30%) → finally determined to be a gradient ink layer unevenness defect.

[0114] Defect severity quantification: For the uneven gradient ink layer defect of each group of printed materials, the quality assessment coefficient is obtained after evaluating the defect severity index. The printing result of the current printed material is determined based on the quality assessment coefficient; the printing result is either qualified or unqualified.

[0115] The defect severity indicators include deviation intensity, spatial influence range, and gradient mutation degree;

[0116] The average reflectance deviation within the defect area is calculated as the deviation intensity, reflecting the average degree to which the ink layer thickness deviates from the normal gradient.

[0117] Calculate the ratio of the defect area to the total area of ​​the gradient area to obtain the spatial impact range; this reflects the impact range of the defect on the overall appearance.

[0118] The gradient mutation degree is obtained by calculating the ratio between the mean mutation value of the defect area and the mutation threshold of the normal area; this reflects the severity of spatial mutations in the ink layer unevenness.

[0119] After normalizing the deviation intensity, spatial influence range, and gradient mutation degree, the quality evaluation coefficient is obtained by using weighted calculation logic.

[0120] The quality assessment coefficient is obtained using a weighted calculation logic, specifically as follows:

[0121] The normalized values ​​of deviation intensity, spatial influence range, and gradient mutation degree are labeled as e1, e2, and e3, respectively. They are substituted into the formula Z=e1×J1+e2×J2+e3×J3 to calculate the quality assessment coefficient Z; where J1, J2, and J3 are preset weight coefficients.

[0122] If the quality assessment coefficient is greater than the coefficient threshold, the printing result is deemed unqualified; otherwise, it is qualified.

[0123] Production traceability control: If the printing results of X consecutive groups of printed products are all judged to be unqualified, a production traceability signal will be triggered and the cause of defect prediction will be analyzed; where X>5; the specific value is set by technical personnel; the cause of defect prediction includes potential problems with ink supply coefficients and potential problems with printing equipment;

[0124] Specifically:

[0125] After triggering the production traceability signal, retrieve the ink viscosity data and ink supply pump pressure data of the X group of printed materials during the production period;

[0126] The standard deviation formula was used to calculate the ink viscosity data and ink supply pump pressure data during the production period. After calculation, the mean values ​​of X groups of printed products were taken to determine the viscosity fluctuation and pressure fluctuation.

[0127] The viscosity fluctuation and pressure fluctuation are processed using weighted calculation logic to obtain the ink supply coefficient;

[0128] The ink supply coefficient is obtained using a weighted calculation logic, specifically as follows:

[0129] The viscosity fluctuation and pressure fluctuation are labeled as q1 and q2 respectively, and the quality assessment coefficient Z is obtained by substituting them into the formula D=q1×h1+e2×h2; where h1 and h2 are preset weight coefficients.

[0130] If the ink supply coefficient is higher than the ink threshold coefficient, the defect prediction cause is determined to be a potential problem with the ink supply coefficient.

[0131] Conversely, the roller pressure data of the X group of printed materials during the production period is retrieved, and after dividing the area, the roller pressure data of the defective area during the printing process is identified. The standard deviation formula is used to calculate the standard deviation of the defective area of ​​the X group of printed materials during the printing process. The average value of the X group of printed materials is taken to obtain the roller fluctuation. The roller fluctuation is compared with the roller fluctuation allowable. If the roller fluctuation is higher than the roller fluctuation allowable, the defect is determined to be a hidden danger in the printing equipment.

[0132] The above formulas are all dimensionless calculations. Dimensionless calculations can be performed using various methods such as standardization, which will not be elaborated here. The formulas are derived from software simulations based on a large amount of collected data, and the preset parameters in the formulas can be set by those skilled in the art according to the actual situation.

[0133] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, ATA hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. The semiconductor medium can be a solid-state ATA hard disk.

[0134] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0135] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0136] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0137] 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; they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0138] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0139] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable ATA hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0140] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for detecting ink printing defects based on image processing, characterized in that, include: S1: Acquire multispectral images and high-resolution grayscale images of printed materials, perform pixel-level registration on the two images, and obtain a registered fused image pair; S2: Based on the registered fused image pairs, the constructed defect detection logic is used to determine the unevenness of the gradient ink layer in the image; The Sobel operator is used to calculate the gradient vector of each pixel in a grayscale image. gradient direction angle ; The variance of the orientation angle of each pixel within the adaptive neighborhood is calculated and denoted as . ; for Regions smaller than a set threshold are marked as suspected gradient regions. The mean rate of change of direction angles within a set-size sliding window is calculated for these suspected gradient regions. ; For suspected gradual change regions and rate of change After normalization, the confidence level of the suspected gradient region is obtained by weighted calculation logic. If the confidence level is lower than the preset confidence reference level, it is determined to be a gradient region. Within the determined gradient region, samples are uniformly taken along the gradient direction, and after removing abnormal samples, a valid sample set is obtained. For the effective sample set, the position-reflectivity baseline curve is obtained by fitting the one-dimensional coordinates along the gradient direction to the reflectivity. Spectral anomalies and gradient abrupt changes are identified using a baseline curve combined with an effective sample set. Pixels that simultaneously satisfy spectral anomalies and gradient abruptness points are identified, and initial candidate regions M are obtained by labeling them with 8-neighbor connected components. Calculate the screening coefficient of the initial candidate region M, and retain the regions with screening coefficients higher than the screening threshold coefficient as the validation regions; Using the verification area as the seed point, the area is grown along the vertical gradient direction. If the area expansion rate after growth is higher than the reference expansion rate, it is judged as a gradient ink layer unevenness defect. S3: For the uneven gradient ink layer defect of each group of printed materials, the quality assessment coefficient is obtained after evaluating the defect degree index. The printing result of the current printed material is determined based on the quality assessment coefficient; the printing result is qualified or unqualified. S4: If the printing results of X consecutive groups of printed products are all judged to be unqualified, the production traceability signal will be triggered and the cause of defect prediction will be analyzed. The cause of defect prediction includes potential problems with ink supply coefficient and potential problems with printing equipment.

2. The ink printing defect detection method based on image processing according to claim 1, characterized in that: Adaptive neighborhood setting rules in step S2; The adaptive neighborhood is set based on the gradient rate of change. Three sets of gradient rate of change intervals are set, and each set of intervals corresponds to a neighborhood size. The neighborhood size matched by the gradient rate of change is used as the adaptive neighborhood.

3. The ink printing defect detection method based on image processing according to claim 1, characterized in that: In step S2, a baseline curve is used in conjunction with an effective sample set to mark spectral outliers. The band g with the highest reflectance-ink thickness sensitivity was selected from the multispectral image; In the effective sample set, the standard deviation of the benchmark curve over a defined neighborhood is calculated and denoted as . Then the dynamic threshold is set to ; After projecting the pixels within the gradient region onto the gradient direction, the reflectivity deviation is calculated. If the reflectance deviation is higher than the dynamic threshold, it is marked as a spectral anomaly.

4. The ink printing defect detection method based on image processing according to claim 1, characterized in that: In step S2, the baseline curve is used in conjunction with the effective sample set to mark gradient abrupt changes; The gradient vector for each pixel is decomposed into components along the gradient direction. and vertical components ; Calculate within the specified neighborhood The mean of the mutation is denoted as the mutation mean, and it is used in the normal region. The mean value is denoted as the mutation threshold; If the average mutation value of a pixel is greater than v × mutation threshold, it is marked as a gradient mutation point; where v is a preset threshold coefficient.

5. The ink printing defect detection method based on image processing according to claim 1, characterized in that: In step S2, the screening coefficient of the initial candidate region M is calculated; Calculate the morphological parameters of the initial candidate region M, including area, roundness, and elongation. After normalizing the morphological parameters of the initial candidate regions, the selection coefficients are obtained by processing them using weighted calculation logic.

6. The ink printing defect detection method based on image processing according to claim 1, characterized in that: The criteria for region growth in step S2; Reflectivity deviation is higher than the dynamic threshold and the vertical component The absolute value is higher than the v× mutation threshold.

7. The ink printing defect detection method based on image processing according to claim 1, characterized in that: In step S3, for each group of printed materials, the uneven gradient ink layer defect is evaluated by assessing the defect severity index to obtain the quality evaluation coefficient. The defect severity indicators include deviation intensity, spatial influence range, and gradient mutation degree; The average reflectance deviation within the defect area is calculated as the deviation intensity; The spatial impact range is obtained by calculating the ratio of the defect area to the total area of ​​the gradient region. The gradient mutation degree is obtained by calculating the ratio between the mean mutation value of the defective region and the mutation threshold of the normal region. After normalizing the deviation intensity, spatial influence range, and gradient mutation degree, the quality evaluation coefficient is obtained by using weighted calculation logic. If the quality assessment coefficient is greater than the coefficient threshold, the printing result is deemed unqualified; otherwise, it is deemed qualified.

8. The ink printing defect detection method based on image processing according to claim 1, characterized in that: In step S4, a production traceability signal is triggered and the cause of the defect is analyzed. After triggering the production traceability signal, retrieve the ink viscosity data and ink supply pump pressure data of the X group of printed materials during the production period; The standard deviation formula was used to calculate the ink viscosity data and ink supply pump pressure data during the production period. After calculation, the mean values ​​of X groups of printed products were taken to determine the viscosity fluctuation and pressure fluctuation. The viscosity fluctuation and pressure fluctuation are processed using weighted calculation logic to obtain the ink supply coefficient; If the ink supply coefficient is higher than the ink threshold coefficient, the defect prediction cause is determined to be a potential problem with the ink supply coefficient. Conversely, the roller pressure data of the X group of printed materials during the production period is retrieved, and after dividing the area, the roller pressure data of the defective area during the printing process is identified. The standard deviation formula is used to calculate the standard deviation of the defective area of ​​the X group of printed materials during the printing process. The average value of the X group of printed materials is taken to obtain the roller fluctuation. The roller fluctuation is compared with the roller fluctuation allowable. If the roller fluctuation is higher than the roller fluctuation allowable, the defect is determined to be a hidden danger in the printing equipment.