A method for detecting printing defects of cryptic ink based on image processing

By calculating the physical presence intensity and functional response characteristics of ink in normal and excited state images, the problem of distinguishing between chemical misprints and background in the detection of defects in coded ink printing is solved, and more accurate detection is achieved.

CN121883496BActive Publication Date: 2026-06-19CHANGSHA MINGXIANG PRINTING CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHANGSHA MINGXIANG PRINTING CO LTD
Filing Date
2026-03-20
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately distinguish defects in coded ink printing under conditions of chemical misprinting and background interference, leading to false positives and false negatives.

Method used

By acquiring the region of interest and background region in normal and excited state images, the physical presence intensity characteristic value and functional response characteristic value of ink are calculated. Combined with gradient, grayscale variation coefficient and difference index, the target defect index value is obtained to identify chemical printing defects.

Benefits of technology

It improves the ability to detect and identify chemical misprints in coded inks, enhances detection accuracy and robustness, and reduces false detections and missed detections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121883496B_ABST
    Figure CN121883496B_ABST
Patent Text Reader

Abstract

This invention relates to the field of defect detection technology, specifically to a method for detecting defects in coded ink printing based on image processing. The method includes: acquiring the physical intensity characteristic value of ink corresponding to normal pixels and the functional response characteristic value of ink corresponding to excited pixels; obtaining the target defect index value for each normal pixel based on the physical intensity characteristic value of ink corresponding to each normal pixel and the functional response characteristic value of ink corresponding to excited pixels with the same position coordinates as the corresponding normal pixels; and detecting and identifying coded ink printing defects in the printed matter to be inspected based on the target defect index value. Furthermore, this invention can improve the ability to discriminate or identify chemical malfunctions in coded ink printing, or can improve the detection accuracy and robustness of chemical malfunctions in coded ink printing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of defect detection technology, and specifically to a method for detecting defects in cryptographic ink printing based on image processing. Background Technology

[0002] In fields such as anti-counterfeiting printing, high-end packaging, and secure documents, coded ink is widely used due to its information concealment. Its printing quality is directly related to the anti-counterfeiting effectiveness and brand reputation of products. Therefore, it is crucial to detect defects in coded ink printing on printed materials.

[0003] Existing technologies generally rely on excitation light single-modal imaging to detect defects in coded ink printing. For example, absolute fluorescence brightness and threshold values ​​are used to detect and identify defects in coded ink printing. However, in complex situations where chemical misprints (functional failure of ink) coexist with background fluctuations, existing defect detection methods that depend on single-modal signals (fluorescence intensity) and fixed thresholds are prone to poor detection results. Chemical misprints are characterized by a decrease in fluorescence quantum efficiency due to ink aging, degradation, or insufficient chemical stability. Under excitation light (such as ultraviolet light), the output fluorescence intensity is significantly weakened, appearing as a low-brightness area in the image. At the same time, background interference such as uneven texture and local defects of the printing substrate itself can also produce local low-brightness areas similar to chemical misprints under the same imaging conditions. The two are highly similar in image spatial distribution and brightness characteristics. Therefore, absolute fluorescence brightness cannot distinguish between ink failure and background or between chemical misprints and the printing substrate background, which can easily lead to false detections and false negatives. Therefore, how to improve the discrimination or identification ability of chemical misprints when detecting defects in coded ink printing has become an urgent problem to be solved. Summary of the Invention

[0004] To address the aforementioned problems, this invention provides a method for detecting defects in cryptographic ink printing based on image processing. The specific technical solution adopted is as follows:

[0005] One embodiment of the present invention provides a method for detecting defects in cryptographic ink printing based on image processing, comprising the following steps:

[0006] Obtain the normal region of interest and normal background region on the normal image of the target printed matter to be inspected, and the excited state region of interest and excited state background region on the excited state image of the target;

[0007] Based on the gradient of normal pixels in the normal region of interest, the gray-level variation coefficient of the preset local region of normal pixels, and the gray-level mean of the normal background region, the physical presence intensity characteristic value of ink corresponding to normal pixels in the normal region of interest is obtained. Based on the difference index value of excited pixels in the excited region of interest and the gradient calculated based on the difference index value of excited pixels, the functional response characteristic value of ink corresponding to excited pixels in the excited region of interest is obtained. The difference index value of excited pixels is the absolute value of the difference between the gray level of the corresponding excited pixel and the gray-level mean of the excited background region. Based on the physical presence intensity characteristic value of ink corresponding to each normal pixel and the functional response characteristic value of ink corresponding to the excited pixel with the same position coordinates as the corresponding normal pixel, the target defect index value of each normal pixel is obtained.

[0008] Based on the target defect index value, the printing defects of the coded ink on the printed matter to be inspected are detected and identified.

[0009] Beneficial effects: This invention first obtains the normal region of interest (ROI) and normal background region on the target normal image of the printed matter to be inspected, and the excited state ROI and excited state background region on the target excited state image; then, based on the gradient of normal pixels in the normal ROI, the gray-level variation coefficient of a preset local region of normal pixels, and the gray-level mean of the normal background region, the physical presence intensity characteristic value of ink corresponding to normal pixels in the normal ROI is obtained; and based on the difference index value of excited pixels in the excited state ROI and the gradient calculated based on the difference index value of excited pixels, the functional response characteristic value of ink corresponding to excited pixels in the excited state ROI is obtained; then, based on the physical presence intensity characteristic value of ink corresponding to each normal pixel and the functional response characteristic value of ink corresponding to the excited state pixel with the same position coordinates as the corresponding normal pixel, the target defect index value of each normal pixel is obtained; finally, based on the target defect index value, the coded ink printing defects of the printed matter to be inspected are detected and identified. Furthermore, based on the ink physical presence intensity characteristic value and ink functional response characteristic value calculated under two modes, this invention can distinguish between chemical bleeds and background or areas not covered by ink, thereby improving the ability to identify or recognize chemical bleeds in printed materials, or improving the detection accuracy and robustness of chemical bleeds in printed materials. Attached Figure Description

[0010] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 This is a flowchart of a method for detecting defects in cryptographic ink printing based on image processing, according to the present invention. Detailed Implementation

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

[0013] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art.

[0014] This embodiment provides a method for detecting defects in cryptographic ink printing based on image processing, detailed below:

[0015] like Figure 1 As shown, the method for detecting defects in coded ink printing includes the following steps:

[0016] Step S001: Obtain the normal region of interest and normal background region on the target normal image of the printed matter to be detected, and the excited state region of interest and excited state background region on the target excited state image.

[0017] This embodiment primarily relies on two characteristics—the physical presence intensity of ink and the functional response of ink—in the actual area corresponding to the pixels on the acquired printed image to detect and identify chemical bleeds in the printed material's coded ink. This enables the differentiation between chemical bleeds and background or areas not covered by ink, thereby improving the ability to judge or identify chemical bleeds in the printed material's coded ink. The physical presence intensity of ink reflects the presence of ink in the corresponding actual area, while the functional response of ink reflects whether the ink is effective or whether the ink's luminescent function is normal. Areas not covered by ink are also areas where coded ink printing has not been performed.

[0018] This embodiment will subsequently describe the process of identifying chemical malfunctions in the chemical ink of any printed material that requires chemical ink malfunction detection or identification, denoted as the printed material to be inspected, which has already undergone chemical ink printing. Then, under visible light illumination, an industrial camera is controlled to acquire images of the printed material to be inspected, and the acquired images are recorded as the original normal image. Subsequently, the visible light source is turned off, and the printed material to be inspected is again acquired under excitation light of a specific wavelength (such as 365nm ultraviolet light), and the acquired images are recorded as the original excited-state image. The field of view and position of the industrial camera are the same when acquiring the original normal image and the original excited-state image. The normal image is used to obtain the overall appearance of the printed material and the physical distribution traces of the ink, while the excited-state image is used to capture the fluorescence response signal of the chemical ink. The acquisition process of the normal and excited-state images is a known technique.

[0019] Next, image registration and image enhancement are performed on the original normal image and the original excited-state image. First, a sub-pixel-level image registration algorithm based on feature points (such as printing marks and pattern corner points) spatially aligns the original normal image and the original excited-state image. Then, the two spatially aligned images are filtered (e.g., Gaussian filtering). The original normal image and the original excited-state image after image registration and filtering are denoted as the target normal image and the target excited-state image, respectively. The target normal image and the target excited-state image are then grayscaled to obtain the grayscale values ​​of the pixels in the target normal image and the target excited-state image. The purpose of image registration is to eliminate pixel-level positional deviations that may be caused by camera micro-motion or time-division acquisition, ensuring accurate feature value calculation for pixels at the same physical location, or ensuring that pixels with the same coordinates in the two registered images correspond to the same physical location or the same actual region. The purpose of filtering (e.g., Gaussian filtering) on ​​the two spatially aligned images is to enhance the image and suppress random noise. The above image registration and image enhancement are well-known techniques.

[0020] Next, the preset template or design file of the printed matter to be inspected is extracted. Based on the location of the coded information on the preset template or design file, the region of interest containing the coded information is located and extracted in the target normal image and recorded as the normal region of interest in the target normal image. The area in the target normal image other than the normal region of interest is recorded as the normal background area. Then, the normal region of interest is mapped onto the target excited-state image to obtain the excited-state region of interest in the target excited-state image. The area in the target excited-state image other than the excited-state region of interest is recorded as the excited-state background area. Since the target normal and excited-state images are taken of the same printed matter and have the same spatial coordinates, accurately mapping the coordinates of the normal region of interest onto the target excited-state image can ensure that the extracted position is completely corresponding, that is, the position of the excited-state region of interest in the target excited-state image is the same as the position of the normal region of interest in the target normal image.

[0021] The specific process for extracting the normal region of interest typically involves: using a preset template or design file of the printed material to be inspected as a reference to determine the theoretical position of the code on the printed material; and using image registration technology to align the actual captured normal image with the preset template to eliminate deviations caused by factors such as shooting angle and scaling.

[0022] In the aligned image, the initial ROI is delineated using rectangles, polygons, etc., based on the positions marked in the template. Edge detection and morphological processing are then performed on the delineated area to further pinpoint the actual boundary of the cipher, ultimately obtaining the normal region of interest. The extraction process of the normal region of interest is also a well-known technique.

[0023] Therefore, this embodiment can obtain the normal region of interest and normal background region on the target normal image of the printed matter to be detected, and the excited state region of interest and excited state background region on the target excited state image through the above process. The pixels in the normal region of interest are called normal pixels, and the pixels in the excited state region of interest are called excited state pixels.

[0024] Step S002: Based on the gradient of normal pixels in the normal region of interest, the gray-level variation coefficient of the preset local region of normal pixels, and the gray-level mean of the normal background region, the physical presence intensity characteristic value of ink corresponding to normal pixels in the normal region of interest is obtained. Based on the difference index value of excited pixels in the excited region of interest and the gradient calculated based on the difference index value of excited pixels, the functional response characteristic value of ink corresponding to excited pixels in the excited region of interest is obtained. The difference index value of excited pixels is the absolute value of the difference between the gray level of the corresponding excited pixel and the gray-level mean of the excited background region. Based on the physical presence intensity characteristic value of ink corresponding to each normal pixel and the functional response characteristic value of ink corresponding to the excited pixel with the same position coordinates as the corresponding normal pixel, the target defect index value of each normal pixel is obtained.

[0025] In this embodiment, to distinguish between ink failure and the background of the printing substrate, or to distinguish between chemical malfunctions and areas not covered by ink, the embodiment will next analyze the region of interest on the acquired dual-modal image to quantify the physical presence intensity characteristic value of ink (characterizing the presence of ink) and the functional response characteristic value of ink (characterizing the effectiveness of ink). Combining the physical presence intensity characteristic value and the functional response characteristic value of ink can distinguish between chemical malfunctions and the background of the printing substrate. That is, subsequent analysis of the physical presence intensity characteristic value and the functional response characteristic value of ink can obtain defect index values ​​that characterize the possibility of chemical malfunctions. Therefore, it can be seen that this embodiment needs to first analyze and obtain the physical presence intensity characteristic value and the functional response characteristic value of ink.

[0026] Because the ink forms a slightly raised, more uniform and regular ink film on the substrate (such as paper or plastic) after drying, while the uncovered areas such as paper fibers and plastic textures retain their original rough structure, under oblique light, the ink film produces local shadows due to the height difference. Statistically, the surface of the ink-covered area appears more uniform and regular, while the fiber area or the uncovered substrate area exhibits uneven grayscale distribution due to scattering. In other words, there is a slight height difference between the ink and the substrate under oblique light; the paper fibers or other substrates in the ink-covered area are flatter, and the local grayscale is more uniform. Furthermore, the pixel gradient energy in the target normal image can quantify the height difference between the ink and the substrate under oblique light, and the local grayscale variation coefficient of the pixels in the target normal image can quantify the grayscale uniformity of the local pixel area. To ensure regularity, this embodiment will next obtain the ink physical presence intensity feature value corresponding to the normal pixels within the normal region of interest (ROI) on the target normal image, based on the gradient of the normal pixels, the gray-level variation coefficient of the preset local region of the normal pixels, and the gray-level mean of the normal background region. The gray-level standard deviation is used to ensure that the calculated ink physical presence intensity feature value is not affected by the light intensity, thus more fairly determining where ink may be present. The specific process of obtaining the ink physical presence intensity feature value corresponding to the normal pixels within the normal region of interest based on the gradient of the normal pixels within the normal region of interest, the gray-level variation coefficient of the preset local region of the normal pixels, and the gray-level mean of the normal background region on the target normal image is as follows:

[0027] First, the average grayscale value of all pixels within the normal background area is obtained and recorded as the average grayscale value of the normal background area. Then, the gradient magnitude of each normal pixel within the normal background area is calculated, based on the grayscale value. Next, the gradient magnitude of each normal pixel within the normal region of interest is calculated by adding a preset constant to the average grayscale value of the normal background area and recording it as the physical deposition characterization value of the corresponding normal pixel. Then, a rectangular local window with a preset length w is constructed centered on each normal pixel within the normal region of interest. The local window constructed centered on each normal pixel is recorded as the local window of the corresponding normal pixel. The area formed by the pixels within the local window of each normal pixel belonging to the normal region of interest is recorded as the preset local area of ​​the corresponding normal pixel. That is, the preset local area of ​​a pixel is usually constructed with the pixel as the center and a preset length w as the side length. In specific applications, the implementer can set the value of w according to the actual situation such as the preset physical size of the ink. For example, in this embodiment, w can be set to 5, so the maximum number of pixels in the preset local area of ​​the pixel is 25. Next, the coefficient of variation of the set of gray values ​​of all pixels within the preset local region of each normal pixel is calculated and denoted as the gray value variation coefficient of the preset local region of the corresponding normal pixel. The negative correlation mapping result of the gray value variation coefficients of the preset local regions of each normal pixel is denoted as the region regularization characterization value of the corresponding normal pixel. Here, the negative correlation mapping is achieved by subtracting the gray value variation coefficient from the constant 1. In this embodiment, the gray value variation coefficient is the result of adding the mean of the set of gray values ​​of all pixels within the preset local region to the preset constant and then dividing by the set standard deviation. The sigmoid normalization result after subtracting the bias factor after weighted summation of the ink physical deposition characterization value of each normal pixel within the normal region of interest and the region regularization characterization value of the corresponding normal pixel is used as the ink physical presence intensity characteristic value corresponding to the corresponding normal pixel. The specific expression for the ink physical presence intensity characteristic value corresponding to the j-th normal pixel within the normal region of interest is:

[0028]

[0029] in, Let be the physical presence intensity characteristic value of the ink corresponding to the j-th normal pixel within the normal region of interest, and sigmoid() be the sigmoid normalization function. First weighting factor, As the second weighting factor, Let the gradient magnitude be the value of the j-th normal pixel. The average gray level of the background area is the average gray level. This is a preset constant, used to prevent the denominator from being zero. Let be the standard deviation of the set of grayscale values ​​of all pixels within a preset local region of the j-th normal pixel. The mean of the set of gray values ​​of all pixels within a preset local region of the j-th normal pixel is given. This is a bias factor; in specific applications, implementers need to set the value of the weighting factor according to the actual situation, such as the setting in this embodiment. ; Used to adjust the center of the sigmoid function. In this embodiment, sigmoid normalization is used to suppress extreme outliers by utilizing its high saturation. Since the result within the parentheses of the sigmoid function in the above equation is itself greater than 0, an offset is required to ensure the resolution and stability after normalization. In this embodiment, Set it to 0.5.

[0030] Because gradients are generated at the edges of ink due to abrupt changes in height, and also within the ink itself due to possible slight thickness variations in the coating, gradient amplitude can capture minute height differences between the ink and the substrate. In other words, gradient amplitude can capture significant surface deformation or gloss changes caused by the physical deposition of ink. However, in this embodiment, to ensure the calculation results are unaffected by light intensity and to more fairly determine where ink might be present, the average grayscale value of the normal background area needs to be considered. The denominator is the illumination invariance normalization, which eliminates gradient changes caused by different illumination levels by quantifying the background mean. In other words, the denominator primarily ensures the calculation results are unaffected by light intensity, allowing for a fairer assessment of where ink might be present. The numerator is key to characterizing whether the j-th normal pixel exhibits significant surface deformation or gloss changes caused by ink physical deposition, or whether the j-th normal pixel is located within an ink-containing region. Furthermore, the larger the gradient magnitude of the j-th normal pixel, the more... The larger the value, the greater the probability that the j-th normal pixel is located in an ink-containing area, or the more likely the j-th normal pixel is to be located in an ink-containing area. Uncovered substrate areas typically exhibit random, non-uniform microstructures (such as interwoven fibers or uneven filler distribution). Ink coverage forms a continuous, relatively uniform film on top of this random structure, making the surface of the ink-containing area statistically more uniform and regular. Therefore, the ink-covered area is more uniform and regular. Furthermore, because the grayscale variation coefficient of the preset local area of ​​the j-th normal pixel... The smaller the value, the more uniform and regular the preset local area of ​​the j-th normal pixel is, and the greater the probability that the j-th normal pixel is located in an ink-containing area, or that the j-th normal pixel is more likely to be located in an ink-containing area. smaller and When it is larger, The larger, and The larger the value, the more likely there is a significant surface deformation or gloss change caused by ink physical deposition at the j-th normal pixel; the more the j-th normal pixel matches the coverage characteristics of the ink film; or in other words, the greater the likelihood that the j-th normal pixel is located in an ink-containing area; and the more likely the j-th normal pixel is to be an ink-containing area. Conversely, a smaller value indicates a lower value. The smaller the value, the less likely the j-th normal pixel is to be an area where ink is present.

[0031] However, relying solely on the calculated physical presence intensity characteristic value of the ink is insufficient to accurately identify chemical bleeds, or in other words, it is insufficient to accurately distinguish between the background and chemical bleeds. To ensure the accuracy of chemical bleed identification in this embodiment, after obtaining the physical presence intensity characteristic value of the ink reflecting the presence of ink, it further obtains the ink functional response characteristic value reflecting the effectiveness of the ink. Since the local signal-to-noise ratio of the preset local region of the excited-state pixel in the target excited-state region of interest can reflect the significance of the brightness or the intensity of the luminous signal at the corresponding excited-state pixel location, the larger the value... The more complete the ink printing, the more stable the fluorescence response, and the better the ink luminescence function at the corresponding excited-state pixel location, or the more effective the ink at the corresponding excited-state pixel location, the better. Since the true ink fluorescence signal is spatially continuous and smoothly varied (due to the continuity of ink coating), while random noise is isolated and abrupt, the smaller the gradient amplitude calculated based on the absolute value of the difference between the grayscale of the excited-state pixel and the average grayscale of the excited-state background region relative to the average absolute value of the difference between the grayscale of all excited-state pixels and the average grayscale of the excited-state background region, the more likely the corresponding excited-state pixel location is to belong to the true excited-state region. The better the ink signal or the ink luminescence function at the corresponding location, the more effective the ink. The aforementioned local signal-to-noise ratio is characterized by the absolute value of the difference between the pixel gray level in the preset local area of ​​the excited-state pixel and the average gray level of the excited-state background area. Therefore, based on the above analysis, it can be seen that the absolute value of the difference between the gray level of the excited-state pixel and the average gray level of the excited-state background area is the key to obtaining the ink function response feature value. Therefore, in this embodiment, the difference index value of each excited-state pixel in the target excited-state region of interest is obtained first. The difference index value of any excited-state pixel is the difference between the gray level of the corresponding excited-state pixel and the average gray level of the excited-state background area. The absolute value of the difference in values, the absolute value of the difference in the mean gray level of the excited-state background region, and the mean gray level of all pixels in that region are used. Then, based on the difference index value of the excited-state pixels in the excited-state region of interest and the gradient calculated based on the difference index value of the excited-state pixels, the ink functional response feature value corresponding to the excited-state pixels in the excited-state region of interest is obtained. The specific process of obtaining the ink functional response feature value corresponding to the excited-state pixels in the excited-state region of interest based on the difference index value of the excited-state pixels in the excited-state region of interest and the gradient calculated based on the difference index value of the excited-state pixels is as follows:

[0032] First, a preset local region of excited-state pixels within the excited-state region of interest is obtained. The method for obtaining the preset local region of excited-state pixels is the same as that for obtaining the preset local region of normal pixels. The standard deviation of the difference index values ​​of all pixels within the preset local region of each excited-state pixel within the excited-state region of interest is calculated and recorded as the standard deviation of the difference index values ​​of the corresponding excited-state pixel. That is, the standard deviation of the difference index values ​​of any excited-state pixel is the standard deviation of the difference index values ​​of all pixels within the preset local region of that excited-state pixel. The ratio of the standard deviation of the difference index values ​​of each excited-state pixel plus a preset constant to the difference index value of the corresponding excited-state pixel is calculated and recorded as the local signal-to-noise ratio of the corresponding excited-state pixel. The gradient magnitude calculated based on the difference index values ​​of the excited-state pixels within the excited-state region of interest is recorded as the gradient magnitude of the index value of the corresponding excited-state pixel, i.e., the excited-state region of interest... The grayscale values ​​of pixels in the region of interest are replaced with the difference index values ​​of the corresponding pixels to obtain the replacement region. Then, the gradient magnitude calculated based on the difference index values ​​of the pixels in the replacement region is the gradient magnitude of the index value of the corresponding excited-state pixel. The calculation process of the gradient magnitude is a known technique. The mean of the difference index values ​​of all excited-state pixels in the excited-state region of interest is calculated, and then divided by the gradient magnitude of the index value of each excited-state pixel. The negative correlation mapping result is recorded as the spatial continuous smoothness index value of the corresponding excited-state pixel. Here, the negative correlation mapping is implemented using a negative exponential function with a base of constant e. The normalized result of multiplying the local signal-to-noise ratio of each excited-state pixel in the excited-state region of interest with the spatial continuous smoothness index value of the corresponding excited-state pixel is recorded as the ink functional response feature value corresponding to the corresponding excited-state pixel. Here, the hyperbolic tangent function is used to implement the normalization. The specific expression of the ink functional response feature value corresponding to the j-th excited-state pixel in the excited-state region of interest is:

[0033]

[0034] in, Let be the ink functional response feature value corresponding to the j-th excited-state pixel within the excited-state region of interest, and tanh be the hyperbolic tangent function. Let j be the difference index value of the j-th excited state pixel. Let be the standard deviation of the difference index values ​​of all pixels within a preset local region of the j-th excited-state pixel, and exp() be an exponential function with base e. Let the gradient magnitude of the index value of the j-th excited state pixel be denoted as . The mean of the difference index values ​​of all excited state pixels in the excited state region of interest; saturated nonlinear normalization based on the tanh() function can take advantage of its characteristic of changing slowly when the input value is large, thus enhancing the stability of high-intensity fluorescence signals. Let be the local signal-to-noise ratio of the j-th excited-state pixel. Let be the spatial continuity smoothness index value of the j-th excited state pixel; The larger the value, the more significant the brightness or the higher the luminous signal intensity at the j-th excited state pixel location. It also indicates that the ink printing at the j-th excited state pixel location is complete, the fluorescence response is stable, and the ink luminescence function is better. smaller or The larger the value, the more obvious the continuous smooth features of the local region of the j-th excited-state pixel, the more obvious the true ink fluorescence signal features of the j-th excited-state pixel, and the better the ink printing, fluorescence response, and ink luminescence function at the j-th excited-state pixel position; while The greater the sum When it is larger, The larger, therefore The larger the value, the more likely the j-th excited-state pixel location is to be a real ink signal, or the better the ink's luminescence function and the more effective the ink. The greater the probability that the actual area where the j-th excited-state pixel is located is a normal ink printing area, and vice versa. The smaller the value, the worse the ink's luminescence function, and the greater the probability that the actual area where the j-th excited-state pixel is located is a background area or a chemically missed area. The coordinates of the j-th excited-state pixel in the excited-state region of interest and the j-th normal pixel in the normal region of interest are consistent in the target excited-state image and the target normal image, that is, the j-th excited-state pixel in the excited-state region of interest and the j-th normal pixel in the normal region of interest correspond to the same actual physical location or area.

[0035] Therefore, this embodiment can obtain the ink physical presence intensity characteristic value corresponding to the normal pixels in the normal region of interest and the ink functional response characteristic value corresponding to the excited state pixels in the excited region of interest through the above process. Then, based on the ink physical presence intensity characteristic value corresponding to each normal pixel and the ink functional response characteristic value corresponding to the excited state pixel with the same position coordinate as the corresponding normal pixel, the target defect index value of each normal pixel in the target normal region of interest is obtained. Based on the target defect index value of each normal pixel in the target normal region of interest, the coded ink printing defect of the printed matter to be inspected is detected and identified. As another implementation, the ink functional response characteristic value corresponding to each excited state pixel can also be used. The target defect index value of each excited-state pixel is obtained by using the eigenvalue and the physical presence intensity characteristic value of the ink corresponding to the normal pixel with the same position coordinate as the excited-state. The subsequent detection and identification of the coded ink printing defects of the printed matter to be tested is based on each excited-state pixel in the region of interest of the target excited-state. The specific process of obtaining the target defect index value of the excited-state pixel and detecting and identifying the coded ink printing defects of the printed matter to be tested based on each excited-state pixel in the region of interest of the target excited-state is the same as the specific process of obtaining the target defect index value of the normal pixel and detecting and identifying the coded ink printing defects of the printed matter to be tested based on each normal pixel in the target normal region of interest.

[0036] Furthermore, based on the physical intensity characteristic value of the ink corresponding to each normal pixel and the functional response characteristic value of the ink corresponding to the excited state pixel with the same position coordinates as the corresponding normal pixel, the specific process of obtaining the target defect index value of each normal pixel in the target normal region of interest is as follows:

[0037] First, excited-state pixels with the same position coordinates as each normal pixel are recorded as registered excited-state pixels corresponding to the normal pixels. Then, based on the ink physical presence intensity feature value corresponding to each normal pixel and the ink functional response feature value corresponding to the registered excited-state pixels of the corresponding normal pixels, the initial defect characterization value of each normal pixel in the normal region of interest is obtained. The specific process for obtaining the initial defect characterization value of each normal pixel in the normal region of interest is as follows: For the j-th normal pixel, the natural logarithm of the ink physical presence intensity feature value corresponding to the j-th normal pixel plus a preset constant, minus the natural logarithm of the ink functional response feature value corresponding to the j-th normal pixel plus a preset constant, is taken as the initial defect characterization value of the j-th normal pixel. The expression is as follows: The default constant here is to prevent the logarithm from being zero; ln() is the natural logarithm. Let be the physical intensity characteristic value of the ink corresponding to the j-th normal pixel. The j-th excited-state pixel is the ink functional response feature value corresponding to the j-th excited-state pixel; the j-th excited-state pixel is the registered excited-state pixel of the j-th normal pixel; the above logarithmic operation can amplify the ratio difference, and the logarithm itself is closer to the Gaussian distribution, which is beneficial for subsequent statistical analysis and threshold setting; and when big Hours, ratio A value much greater than 1 indicates a higher probability that this is a chemically missed area. big When the ratio is large, closer to 1, it indicates a higher probability that this area is a normal area for ink printing. Small Even when the ratio is small, it remains close to 1, indicating a higher probability that this area is background, theoretically meaning there is no... If the value of F is large, it may correspond to non-ink-related fluorescent contamination or other abnormalities. Therefore, the larger the initial defect characterization value of the j-th normal pixel, the greater the possibility that the actual location of the j-th normal pixel is a chemical bleed area, and vice versa.

[0038] Furthermore, since the initial defect characterization value is calculated pixel by pixel, it is easily affected by local random factors such as imaging noise and uneven ink micro-distribution, resulting in spatially isolated and scattered false peaks, leading to false alarms. To ensure detection and identification accuracy, this embodiment introduces a spatial continuity prior after calculating the initial defect characterization value to optimize K. The basis for this optimization is that genuine chemical printing defects, due to ink failure, usually exhibit a certain degree of regional continuity, manifesting as continuous and uniform abnormal patches in space. Random noise and other interferences, on the other hand, manifest as isolated and abrupt abnormal points. Therefore, this embodiment can obtain the confidence factor for each normal pixel based on the difference between the initial defect characterization value of each pixel within a preset local area of ​​each normal pixel and the local median of the corresponding normal pixel. The local median of any normal pixel is the median of the initial defect characterization values ​​of all normal pixels within the preset local area of ​​that normal pixel. The confidence factor reflects the statistical distribution of the primary defect coefficient within the local neighborhood (e.g., uniformity). (Continuity), and subsequently, based on the confidence factors of each normal pixel, the initial defect characterization value is used to obtain the final target defect index value; and the specific process of the confidence factor of the j-th normal pixel is as follows: obtain the absolute deviation of each normal pixel in the preset local area of ​​the j-th normal pixel, the absolute deviation of the a-th normal pixel in the preset local area of ​​the j-th normal pixel is the absolute value of the difference between the initial defect characterization value of the a-th normal pixel and the local median of the j-th normal pixel, the median of the absolute deviations of all normal pixels in the preset local area of ​​the j-th normal pixel is recorded as the absolute median difference of the j-th normal pixel, the negative correlation mapping result of the product of the absolute median difference of the j-th normal pixel and the preset proportional constant plus the preset constant divided by the absolute deviation of the j-th normal pixel is recorded as the confidence factor of the j-th normal pixel, here the negative correlation mapping is implemented by a negative exponential function with the constant e as the base; and the expression of the confidence factor of the j-th normal pixel is:

[0039]

[0040] in, Let be the confidence factor of the j-th normal pixel. Let j be the initial defect characterization value of the j-th normal pixel. Let j be the local median of the j-th normal pixel. Let $\frac{j}{j}$ be the absolute deviation of the j-th normal pixel. The preset proportionality constant is an estimated value that converts the absolute deviation into a value similar to the standard deviation. It is an empirical value, such as 1.4826. This is standardized variation, where the numerator is the absolute deviation. Using the median can prevent the influence of extreme noise and uneven distribution. The denominator is the normalization factor; using the absolute median difference can further reduce the influence of outliers. The formula itself can suppress isolated noise points and also provides appropriate suppression for actual defect edges, thus appropriately preserving the main signal. The smaller, the more it indicates A value close to the local median indicates strong consistency within the preset local region of the j-th normal pixel, or that the initial defect characterization values ​​of pixels within the preset local region of the j-th normal pixel are relatively continuous and uniform. This should make... The higher the reliability, the greater the contribution of the initial defect representation value of the j-th normal pixel when obtaining the target defect index value. The smaller, the more it indicates Since the j-th normal pixel deviates from the local median, it has a higher probability of being isolated noise and should be suppressed, i.e., it should be made so that... The lower the credibility, the less credible it is.

[0041] The product of the initial defect characterization value of each normal pixel and the confidence factor of the corresponding normal pixel is obtained as the target defect index value of the corresponding normal pixel. Then, the product of the initial defect characterization value of each normal pixel and the confidence factor of the corresponding normal pixel is calculated and used as the target defect index value of the corresponding normal pixel. The larger the target defect index value, the greater the probability that the actual area corresponding to the normal pixel is a chemically missing area. No units are introduced in the mathematical operations in this embodiment. The preset constant in this embodiment is a very small real number, which can be set by the implementer according to the actual situation, such as 0.01.

[0042] The specific process for detecting and identifying defects in the coded ink printing of printed materials based on the target defect index values ​​of each normal pixel within the normal region of interest is as follows: Pixels with target defect index values ​​greater than a preset defect identification threshold within the normal region of interest are marked as 1, otherwise marked as 0. A binary mask image is generated. Pixels with target defect index values ​​greater than the preset defect identification threshold are either chemically missing pixels or the actual area corresponding to pixels with target defect index values ​​greater than the preset defect identification threshold is a chemically missing area. The implementer can set the preset defect identification threshold according to the actual situation, such as using the 3-standard-deviation principle based on the normal distribution assumption or a non-parametric method based on percentiles, which are well-known techniques. Then, morphological operations are performed on the binary mask image, followed by connected component analysis. The connected components obtained from the analysis are recorded as regions to be screened, and the area of ​​each region to be screened is calculated. Areas smaller than a preset area threshold are designated as chemical printing defects in the code ink. Morphological operations optimize the shape of the defective areas and filter out obvious noise. Screening based on the preset area threshold aims to eliminate noise interference, reduce false detections, improve the reliability and practicality of the detection results, and further ensure the ability to identify or distinguish chemical printing defects in the code ink. In specific applications, implementers need to set the preset area threshold according to the actual situation. For example, in this embodiment, qualified printed materials with code ink can be selected as samples. Then, the screening area corresponding to each sample is obtained according to the above process in this embodiment. The area distribution of the screening area corresponding to the sample is statistically analyzed, and its 99.9th percentile can be taken as the preset area threshold. The number of samples can be set according to the detection and recognition accuracy requirements and the computational requirements. For example, it can be required that the higher the detection and recognition accuracy, the larger the number of samples.

[0043] Thus, this embodiment completes the detection and identification of chemical ink omission defects in the printed matter to be inspected; and based on the ink physical presence intensity characteristic value and ink functional response characteristic value calculated under two modes, this embodiment can distinguish between chemical omissions and background or areas not covered by ink, thereby improving the ability to judge or identify chemical omissions in the printed matter's code ink.

[0044] In summary, this embodiment first obtains the normal region of interest (ROI) and normal background region on the target normal image of the printed matter to be inspected, and the excited state ROI and excited state background region on the target excited state image. Then, based on the gradient of normal pixels in the normal ROI, the gray-level variation coefficient and mean of the preset local region of the normal pixels, and the gray-level mean of the normal background region, the physical presence intensity characteristic value of the ink corresponding to the normal pixels in the normal ROI is obtained. Based on the difference index value of the excited state pixels in the excited state ROI and the gradient calculated based on the difference index value of the excited state pixels, the functional response characteristic value of the ink corresponding to the excited state pixels in the excited state ROI is obtained. Then, based on the physical presence intensity characteristic value of the ink corresponding to each normal pixel and the functional response characteristic value of the ink corresponding to the excited state pixel with the same position coordinates as the corresponding normal pixel, the target defect index value of each normal pixel is obtained. Finally, based on the target defect index value, the coded ink printing defects of the printed matter to be inspected are detected and identified. Furthermore, based on the ink physical presence intensity characteristic value and ink functional response characteristic value calculated under two modes, this embodiment can distinguish between chemical bleeds and background or areas not covered by ink, thereby improving the ability to identify or recognize chemical bleeds in printed materials, or improving the detection accuracy and robustness of chemical bleeds in printed materials.

[0045] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application 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. Such 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 this application, and should all be included within the protection scope of this application.

Claims

1. A method for detecting defects in a code ink print based on image processing, characterized in that, The method includes the following steps: Obtain the normal region of interest and normal background region on the normal image of the target printed matter to be inspected, and the excited state region of interest and excited state background region on the excited state image of the target; Based on the gradient of normal pixels in the normal region of interest, the gray-level variation coefficient of the preset local region of normal pixels, and the gray-level mean of the normal background region, the physical presence intensity characteristic value of ink corresponding to normal pixels in the normal region of interest is obtained. Based on the difference index value of excited pixels in the excited region of interest and the gradient calculated based on the difference index value of excited pixels, the functional response characteristic value of ink corresponding to excited pixels in the excited region of interest is obtained. The difference index value of excited pixels is the absolute value of the difference between the gray level of the corresponding excited pixel and the gray-level mean of the excited background region. Based on the physical presence intensity characteristic value of ink corresponding to each normal pixel and the functional response characteristic value of ink corresponding to the excited pixel with the same position coordinates as the corresponding normal pixel, the target defect index value of each normal pixel is obtained. Based on the target defect index value, the printing defects of the coded ink on the printed matter to be inspected are detected and identified; Methods for obtaining the physical strength characteristics of ink include: The result of adding a preset constant to the mean gray value of the normal background area and dividing it by the gradient magnitude of the normal pixel is recorded as the ink physical deposition characterization value of the corresponding normal pixel. The negative correlation mapping result of the gray value variation coefficient of the preset local area of ​​the normal pixel in the normal region of interest is recorded as the region regularization characterization value of the corresponding normal pixel. The sigmoid normalization result after subtracting the bias factor after weighted summation of the ink physical deposition characterization value of each normal pixel and the region regularization characterization value of the corresponding normal pixel is used as the ink physical presence intensity characteristic value of the corresponding normal pixel. Methods for obtaining ink functional response characteristic values ​​include: The standard deviation of the difference index values ​​of all pixels within a preset local region of the excited-state pixel in the excited-state region of interest is denoted as the difference standard deviation of the corresponding excited-state pixel. The ratio of the difference standard deviation of the excited-state pixel plus a preset constant to the difference index value of the corresponding excited-state pixel is denoted as the local signal-to-noise ratio of the corresponding excited-state pixel. The gradient magnitude calculated based on the difference index values ​​of the excited-state pixels in the excited-state region of interest is denoted as the index value gradient magnitude of the corresponding excited-state pixel. The negative correlation mapping result after adding a preset constant to the mean of the difference index values ​​of all excited-state pixels in the excited-state region of interest and dividing it by the index value gradient magnitude of the excited-state pixel is denoted as the spatial continuous smoothness index value of the corresponding excited-state pixel. The normalized result after multiplying the local signal-to-noise ratio of each excited-state pixel by the spatial continuous smoothness index value of the corresponding excited-state pixel is denoted as the ink functional response feature value corresponding to the corresponding excited-state pixel.

2. The method of claim 1, wherein the method is characterized by: Methods for obtaining regions of interest include: The target normal image is registered with the preset template of the printed matter to be detected. Based on the registration result, the region containing the theoretical position of the cipher is located and extracted in the target normal image and recorded as the normal region of interest. On the target excited state image, the region with the same coordinate position as the normal region of interest is recorded as the excited state region of interest.

3. The method of claim 1, wherein the method is characterized by: Methods for obtaining target defect index values ​​include: The excited state pixel with the same position coordinates as each normal pixel is recorded as the registered excited state pixel of the corresponding normal pixel. Based on the ink physical existence intensity characteristic value corresponding to each normal pixel and the ink functional response characteristic value corresponding to the registered excited state pixel of the corresponding normal pixel, the initial defect characterization value of each normal pixel is obtained. The median of the initial defect characterization values ​​of all normal pixels within the preset local area of ​​each normal pixel is taken as the local median of the corresponding normal pixel. The confidence factor of each normal pixel is obtained based on the difference between the initial defect characterization value of each pixel within the preset local area of ​​each normal pixel and the local median of the corresponding normal pixel. The product of the initial defect characterization value of each normal pixel and the confidence factor of the corresponding normal pixel is used as the target defect index value of the corresponding normal pixel.

4. The method of claim 3, wherein the image processing-based covert ink printing defect detection method is characterized by, The initial defect characterization value of any normal pixel is the result of adding a preset constant to the natural logarithm of the ink physical existence intensity characteristic value corresponding to the normal pixel, and subtracting the natural logarithm of the ink functional response characteristic value corresponding to the registered excited state pixel of the normal pixel plus a preset constant.

5. The method of image processing based secret ink printing defect detection according to claim 4, wherein, The method for obtaining the confidence factor of any normal pixel includes: The median of the absolute deviations of all normal pixels within a preset local region of the normal pixel is denoted as the absolute median difference of the normal pixel. The absolute deviation of the a-th normal pixel within the preset local region of the normal pixel is the absolute value of the difference between the initial defect characterization value of the a-th normal pixel and the local median of the normal pixel. The result of multiplying the absolute median difference of the normal pixel by a preset proportional constant, adding the preset constant, and dividing by the negative correlation of the absolute deviation of the normal pixel is denoted as the confidence factor of the normal pixel.

6. The method of image processing based secret ink printing defect detection according to claim 1, wherein, The preset local region of any pixel is a local window centered on the pixel and with a preset length as its side length.

7. The method of image processing based secret ink printing defect detection as claimed in claim 1 wherein, A method for detecting and identifying defects in the printing of coded inks on printed materials based on the target defect index value includes: Pixels in the normal region of interest whose target defect index value is greater than the preset defect identification threshold are marked as 1, otherwise as 0, and a binary mask image is generated; after performing morphological operations on the binary mask image, connected component analysis is performed to obtain the chemical printing defect area of ​​the coded ink.