Color printing packaging pattern detection system and method based on image processing
By setting color and sharpness monitoring blocks during the printing process, and extracting color ink coverage and edge transition features to form a time series, the problem of lack of printing quality trend prediction in existing technologies is solved, enabling early fault warning and preventive maintenance, and improving the efficiency of printing quality control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 广东省威顿彩印有限公司
- Filing Date
- 2026-01-12
- Publication Date
- 2026-04-21
AI Technical Summary
Existing printing quality inspection methods lack the ability to predict the trend of quality changes during the printing process, making it difficult to issue early warnings in the early stages of failure, resulting in material waste and loss of production efficiency.
By setting color monitoring blocks and sharpness monitoring blocks, color ink coverage features and edge transition features are extracted to form a time series, and trend analysis is performed to determine the gradual change trend of printing quality.
It enables the prediction of printing quality, detects abnormal trends when printed materials are still within acceptable limits, provides a window for preventative maintenance, avoids the generation of batches of defective products, and reduces material waste and production efficiency losses.
Smart Images

Figure CN121904013A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image detection technology, and more specifically, to a system and method for detecting color printed packaging patterns based on image processing. Background Technology
[0002] With the increasing demands of the consumer market for product packaging quality, the printing quality of color packaging has become a crucial factor influencing product market competitiveness. Color packaging typically employs a four-color printing process, using the superposition and combination of four inks—cyan, magenta, yellow, and black—to create rich patterns and colors. During high-speed printing production, due to the influence of various factors such as equipment condition, material characteristics, and environmental conditions, printed materials may exhibit quality problems such as color difference, misregistration, blurred patterns, and uneven ink coverage. Traditional manual visual inspection methods are inefficient, subjective, and prone to fatigue, making them unsuitable for the quality control requirements of modern high-speed printing production lines. Therefore, automated printing quality inspection methods based on image processing technology have been widely researched and applied.
[0003] Existing printing image inspection methods are mainly divided into two categories: pixel-level inspection and feature-level inspection. Pixel-level inspection methods compare the sample image to be tested with a standard image pixel by pixel, identifying defect areas by calculating the differences between corresponding pixels. These methods have high accuracy and can accurately locate the position and extent of defects, but they require high image registration precision, involve large computational loads, and are difficult to implement. Feature-level inspection methods extract global or local features such as color, texture, and edges from the image, and determine quality by comparing the feature differences between the sample image and the standard image. These methods have high computational efficiency and relatively relaxed requirements for registration precision, making them more suitable for the online inspection needs of high-speed production lines.
[0004] However, both pixel-level and feature-level detection technologies primarily determine the pass / fail status of individual printed sheets, lacking the ability to predict quality trends during the printing process. Progressive faults exist in printing production, such as gradual plate wear, blanket aging, ink roller surface deterioration, and ink supply deviation. In their early stages, these faults have a relatively minor impact on print quality, and the results of individual sample inspections often fall within the acceptable range. By the time these progressive faults become identifiable by existing detection methods, a certain number of defective or near-defective products have already been generated, resulting in material waste and reduced production efficiency. The lack of trend analysis capabilities for continuous sample sequences makes it impossible to issue early warnings of faults in their early stages, hindering preventative maintenance. Summary of the Invention
[0005] To overcome the aforementioned problems of the prior art, this invention proposes a color printing packaging pattern detection system and method based on image processing to solve the above problems.
[0006] This invention provides the following technical solution: Image processing-based methods for detecting patterns on printed packaging include: Acquire four-color printed images and standard images; set four color monitoring blocks corresponding to the four color channels based on the four-color printed images; and set a sharpness monitoring block based on the standard image. Collect the sample image to be tested and register it with the standard image. Extract the image features of the standard image and the sample image to be tested respectively. Determine whether the sample image to be tested is qualified based on the differences between the image features. When the sample image to be tested is qualified, the sequence of sample images to be tested is obtained. For each sample image to be tested in the sequence, the color ink coverage features in the four color monitoring blocks are extracted to form four color ink coverage feature time series, and the edge transition features of the sharpness monitoring blocks are extracted to form an edge transition feature time series. Perform trend analysis on the time series of four color ink coverage features and edge transition features to determine whether there is a trend. If a trend is found, send the corresponding information.
[0007] Preferably, the step of setting four color monitoring blocks corresponding to the four color channels according to the four-color printed image includes: Set a sliding window of a preset size on the four-color printing image, and slide it on the four-color printing image with a preset step size. For each position of the sliding window, calculate the proportion of the four color channels of cyan, magenta, yellow and black in the window respectively. For each color channel, select the window position with the largest proportion of that color channel from all window positions as the color monitoring block for that color channel.
[0008] Preferably, setting a sharpness monitoring block based on a standard image includes: The standard image is converted to a grayscale image. A sliding window of a preset size is set on the grayscale image and slides on the grayscale image with a preset step size. For each position of the sliding window, the gradient magnitude of each pixel in the window is calculated using a gradient operator. The window position with the largest gradient magnitude is selected as the sharpness monitoring block among all window positions.
[0009] Preferably, the image features include color features, brightness features, texture features, edge distribution features, and spectral energy distribution features; wherein, color features are represented by color histograms, brightness features are represented by brightness histograms, texture features are represented by calculating the gray-level co-occurrence matrix and extracting texture statistics, edge distribution features are represented by performing gradient direction histogram statistics on the edge map after edge detection, and spectral energy distribution features are represented by performing a two-dimensional Fourier transform on the image and then statistically analyzing the energy proportion of each frequency band.
[0010] Preferably, the step of determining whether the sample image to be tested is qualified based on the differences between image features includes: For each image feature, the difference value of the corresponding feature between the standard image and the sample image to be tested is calculated; when the difference value of any image feature exceeds the corresponding preset threshold, the sample image to be tested is determined to be unqualified.
[0011] Preferably, the step of extracting the color ink coverage features includes: Acquire the image within the color monitoring block and convert the image into a four-color channel image of cyan, magenta, yellow, and black. Extract the histogram of the color channel corresponding to the color monitoring block. An adaptive threshold segmentation method based on histograms is used to determine the segmentation threshold. The proportion of pixels that are higher than or equal to the segmentation threshold is counted, and this proportion is used as the color ink coverage feature value.
[0012] Preferably, the step of extracting the edge transition features includes: Acquire images within the clarity monitoring area and convert them to grayscale images; Edge pixels are extracted within a grayscale image using an edge detection operator, and the normal direction of each edge pixel is determined based on the gradient direction. For each edge pixel, a one-dimensional grayscale profile is sampled along its normal direction within a preset length range, and the grayscale profile is normalized to a value range of 0 to 1. In the normalized grayscale profile, determine the two spatial positions corresponding to when the grayscale value is equal to the first preset percentage and the second preset percentage, and calculate the distance between the two spatial positions as the edge width corresponding to the edge pixel. Use the median of the edge widths corresponding to all edge pixels as the edge transition feature value.
[0013] Preferably, the trend analysis steps include: Obtain the sequence to be analyzed, denoted as the target sequence, and calculate the difference sequence of the target sequence; The total positive change is obtained by summing the values greater than zero in the difference sequence, and the total negative change is obtained by summing the absolute values of the values less than zero in the difference sequence. Calculate the difference between the total positive change and the total negative change, and use the ratio of this difference to the mean of the target sequence as a trend indicator. When the trend indicator is greater than a preset threshold, it is determined that the target sequence has a changing trend; otherwise, it is determined that the target sequence does not have a changing trend.
[0014] This invention also provides an image processing-based color printing packaging pattern detection system, used to implement an image processing-based color printing packaging pattern detection method, including: The monitoring block setting module is used to acquire four-color printing images and standard images, set four color monitoring blocks corresponding to the four color channels according to the four-color printing images, and set a sharpness monitoring block according to the standard image. The sample image judgment module is used to acquire the sample image to be tested and register it with the standard image, extract the image features of the standard image and the sample image to be tested respectively, and judge whether the sample image to be tested is qualified based on the difference between the image features. The feature sequence extraction module is used to obtain the sequence of the sample images to be tested when the sample image to be tested is qualified. For each sample image to be tested in the sequence, the color ink coverage features in the four color monitoring blocks are extracted to form four color ink coverage feature time series, and the edge transition features of the sharpness monitoring blocks are extracted to form an edge transition feature time series. The trend analysis and early warning module is used to perform trend analysis on the time series of four color ink coverage features and edge transition features to determine whether there is a changing trend, and send corresponding information when a changing trend is found.
[0015] This invention provides a system and method for detecting color printed packaging patterns based on image processing, which has the following beneficial effects: By setting color monitoring blocks corresponding to the four color channels based on the four-color printed images, and setting sharpness monitoring blocks based on standard images, color ink coverage features and edge transition features are extracted within each monitoring block to form a time series. Trend analysis of the time series enables the prediction of gradual changes in printing quality. By monitoring ink coverage trends in areas with the largest proportion of each color channel and edge sharpness trends in areas with the largest gradient amplitude, abnormal trends can be detected and warnings issued when printed products are still within acceptable limits. This provides operators with a window for preventative maintenance, preventing further escalation of faults and the generation of batches of defective products, thus reducing material waste and production efficiency losses. Attached Figure Description
[0016] Figure 1 This is a schematic flowchart of the color printing packaging pattern detection method based on image processing of the present invention; Figure 2 This is a schematic diagram of the module of the color printing packaging pattern detection system based on image processing of the present invention. Detailed Implementation
[0017] 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.
[0018] Please refer to the examples. Figure 1 In this embodiment, the image processing-based color printing packaging pattern detection method includes: S1. Obtain the four-color printing image and the standard image. Set four color monitoring blocks corresponding to the four color channels according to the four-color printing image. Set a sharpness monitoring block according to the standard image. The step of setting four color monitoring blocks corresponding to the four color channels according to the four-color printed image includes: Set a sliding window of a preset size on the four-color printing image, and slide it on the four-color printing image with a preset step size. For each position of the sliding window, calculate the proportion of the four color channels of cyan, magenta, yellow and black in the window respectively. For each color channel, select the window position with the largest proportion of that color channel from all window positions as the color monitoring block for that color channel.
[0019] The step of setting a sharpness monitoring block based on a standard image includes: The standard image is converted to a grayscale image. A sliding window of a preset size is set on the grayscale image and slides on the grayscale image with a preset step size. For each position of the sliding window, the gradient magnitude of each pixel in the window is calculated using a gradient operator. The window position with the largest gradient magnitude is selected as the sharpness monitoring block among all window positions.
[0020] In this embodiment, it should be noted that a four-color printed image refers to a printed image using the CMYK color model, where C represents cyan, M represents magenta, Y represents yellow, and K represents black. Four-color printing is the most commonly used printing method in the color printing and packaging industry. Rich color effects can be achieved through the superposition and combination of four color inks. A four-color printed image can be directly obtained from the CMYK color separation diagram of the printing design file, or it can be converted from an RGB image through color space conversion. A standard image refers to a qualified printed image that has been reviewed and confirmed, serving as a reference benchmark for subsequent quality inspection. It can originate from the image captured from the first qualified sample or from the standard output image of the printing design file.
[0021] It should be noted that the purpose of setting up color monitoring blocks is to select the most representative monitoring location for each color channel. Within the area with the largest proportion of that color channel, the ink coverage of that color is most concentrated. When the ink supply system malfunctions (such as insufficient ink supply or worn ink rollers), the color change in this area is most obvious, thus exhibiting the highest detection sensitivity. By selecting the area with the largest proportion for each of the four color channels, independent monitoring of the ink status of the four colors can be achieved.
[0022] It should be noted that the purpose of setting up a sharpness monitoring block is to select the area most sensitive to changes in image sharpness. Gradient amplitude characterizes the degree of spatial variation in image grayscale. Areas with large gradient amplitudes typically contain obvious edge structures, detailed textures, or text patterns. When factors affecting sharpness occur during the printing process (such as plate wear, registration misalignment, blanket aging, etc.), the edge sharpness of these high-gradient areas will first undergo noticeable degradation. Therefore, selecting the area with the largest gradient amplitude as the sharpness monitoring block enables sensitive monitoring of printed sharpness.
[0023] It should be noted that the size and step size of the sliding window can be set according to the image resolution and monitoring accuracy requirements. The window size is usually set to 5% to 15% of the image size, and the step size is usually set to 25% to 50% of the window size.
[0024] S2. Acquire the sample image to be tested and register it with the standard image. Extract the image features of the standard image and the sample image to be tested respectively. Determine whether the sample image to be tested is qualified based on the differences between the image features. The image features include color features, brightness features, texture features, edge distribution features, and spectral energy distribution features. Among them, color features are represented by color histograms, brightness features are represented by brightness histograms, texture features are represented by calculating the gray-level co-occurrence matrix and extracting texture statistics, edge distribution features are represented by performing gradient direction histogram statistics on the edge map after edge detection, and spectral energy distribution features are represented by performing a two-dimensional Fourier transform on the image and statistically analyzing the energy proportion of each frequency band.
[0025] The step of determining whether a sample image is qualified based on the differences between image features includes: For each image feature, the difference value of the corresponding feature between the standard image and the sample image to be tested is calculated; when the difference value of any image feature exceeds the corresponding preset threshold, the sample image to be tested is determined to be unqualified.
[0026] In this embodiment, it should be noted that the sample image to be tested is typically acquired by an industrial camera, and registration refers to the process of aligning the sample image to be tested with a standard image in spatial position. Registration methods can employ feature point matching or template matching.
[0027] It should be noted that malfunctions in the printing production process can be divided into two main categories: one is sudden malfunctions, such as ink supply system blockages, paper jams, and sudden damage to equipment components. These malfunctions usually lead to obvious quality defects in the printed materials, such as large-area color differences, missing patterns, and severe misregistration. The other is gradual malfunctions, such as gradual wear of the printing plate, gradual aging of the blanket, and gradual deterioration of the ink roller surface. These malfunctions are not obvious in the early stages but gradually worsen with the increase of equipment operating time. Comprehensive comparison of multiple image features is mainly used to detect obvious quality problems caused by sudden malfunctions. When there are significant differences in color features, brightness features, texture features, edge distribution features, or spectral energy distribution features between the sample image and the standard image, it indicates that the printed material has obvious quality defects and should be judged as unqualified, and the cause of the malfunction should be investigated in a timely manner. This detection step can effectively intercept printed materials with obvious defects and prevent batches of unqualified products from flowing into subsequent processes.
[0028] It should be noted that for progressive defects, because their initial impact on print quality is relatively minor, the differences in image features of individual sample prints are often within the normal fluctuation range, making it difficult to detect problems through direct comparison with standard images. However, if progressive defects are not detected and addressed in a timely manner, they will gradually worsen and eventually lead to batch quality incidents, resulting in material waste and production interruptions. Therefore, this solution, in addition to completing the single-print pass / fail inspection, further conducts time series trend analysis on the sequence of pass / fail prints to achieve early warning of progressive defects.
[0029] S3. When the sample image to be tested is qualified, obtain the sequence of sample images to be tested. For each sample image to be tested in the sequence, extract the color ink coverage features in the four color monitoring blocks to form four color ink coverage feature time series, and extract the edge transition features of the sharpness monitoring blocks to form an edge transition feature time series. The steps for extracting the color ink coverage features include: Acquire the image within the color monitoring block and convert the image into a four-color channel image of cyan, magenta, yellow, and black. Extract the histogram of the color channel corresponding to the color monitoring block. An adaptive threshold segmentation method based on histograms is used to determine the segmentation threshold. The proportion of pixels that are higher than or equal to the segmentation threshold is counted, and this proportion is used as the color ink coverage feature value.
[0030] The extraction steps for the edge transition features include: Acquire images within the clarity monitoring area and convert them to grayscale images; Edge pixels are extracted within a grayscale image using an edge detection operator, and the normal direction of each edge pixel is determined based on the gradient direction. For each edge pixel, a one-dimensional grayscale profile is sampled along its normal direction within a preset length range, and the grayscale profile is normalized to a value range of 0 to 1. In the normalized grayscale profile, determine the two spatial positions corresponding to when the grayscale value is equal to the first preset percentage and the second preset percentage, and calculate the distance between the two spatial positions as the edge width corresponding to the edge pixel. Use the median of the edge widths corresponding to all edge pixels as the edge transition feature value.
[0031] In this embodiment, it should be noted that the sequence of test sample images is generated by recording qualified test sample images. Each image in the sequence corresponds to the printing state at a certain point in time. By extracting the same feature value from each image in the sequence, a time series reflecting the change of that feature over time can be formed.
[0032] It should be noted that ink coverage characteristics are used to quantify the degree of coverage of a specific color ink within a monitored area. In four-color printing, each color ink is supplied by an independent ink supply system, including components such as the ink fountain, ink rollers, and transfer rollers. When a progressive failure occurs in the ink supply system for a particular color, such as a gradual decrease in ink level in the ink fountain, gradual wear on the ink roller surface leading to decreased ink transfer efficiency, or a gradual shift in ink roller pressure, the coverage of that color ink on the paper will gradually change. By continuously monitoring the ink coverage characteristics within the monitored area where that color has the largest proportion, this progressive change can be sensitively detected.
[0033] It should be noted that the extraction of color ink coverage features employs an adaptive threshold segmentation method, the principle of which is as follows: After converting the image within the color monitoring block to CMYK four-color channels, the grayscale image of the color channel corresponding to that block is extracted. Higher pixel values in this grayscale image indicate a denser ink coverage. The histogram of the channel image typically exhibits a bimodal or multimodal distribution, where low grayscale peaks correspond to areas with little or no ink coverage, and high grayscale peaks correspond to areas with normal ink coverage. The adaptive threshold segmentation method (such as the Otsu algorithm or a method based on histogram valleys) can automatically determine the optimal segmentation threshold based on the actual distribution of the histogram, classifying pixels into two categories: those with ink coverage and those without. The proportion of pixels with coverage higher than or equal to the segmentation threshold is the color ink coverage feature value. A higher feature value indicates more complete ink coverage, while a lower feature value indicates weaker ink coverage.
[0034] It's important to note that edge transition features are used to quantify the sharpness of printed image edges. In an ideal print, the edges of the image should be sharp and clear, with steep changes in grayscale values on both sides and a narrow transition area. When progressive defects affecting sharpness occur during the printing process, such as gradual wear of the printing plate, aging and deformation of the blanket surface, or gradual misalignment of registration accuracy, the image edges will gradually become blurred, the grayscale transition on both sides of the edge will become gentler, and the transition area will widen. Edge width directly reflects the degree of this edge sharpness degradation.
[0035] It should be noted that the edge transition feature extraction process is as follows: First, an edge detection operator (such as the Canny operator) is used to detect edge pixels in the grayscale image of the sharpness monitoring block, and the gradient direction at each edge pixel is obtained simultaneously. The gradient direction is perpendicular to the edge direction, which is the normal direction of the edge, and the direction along the normal direction is the direction of the most drastic grayscale change. For each edge pixel, a preset length (e.g., 5 to 10 pixels on each side) is extended along its normal direction, and a one-dimensional grayscale profile in that direction is sampled. The preset length should be sufficient to cover the edge transition area, but should not be too long to avoid sampling other pattern structures.
[0036] It should be noted that grayscale profile normalization linearly maps the sampled grayscale value sequence to the range of 0 to 1, where the grayscale value on the dark side of the edge is mapped to 0, and the grayscale value on the bright side of the edge is mapped to 1. Normalization eliminates the influence of absolute grayscale value differences at different edge locations, making the calculation of edge width comparable. In the normalized grayscale profile, two spatial locations are identified when the grayscale value equals a first preset percentage (e.g., 10%) and a second preset percentage (e.g., 90%). These two locations represent the start and end points of the edge transition, respectively. The distance between the two locations is the edge width corresponding to that edge pixel, in pixels. A smaller edge width indicates a steeper and sharper edge transition; a larger edge width indicates a smoother and more blurred edge transition.
[0037] It should be noted that the median of the edge widths corresponding to all edge pixels is used as the edge transition feature value instead of the mean because the median is more robust to outliers. In real images, some edge pixels may have abnormally large or small edge width calculations due to sampling locations at pattern intersections, noise interference, or other factors. Using the median can effectively suppress the influence of these outliers, making the feature value more stable and reliable in reflecting the overall edge sharpness level of the image.
[0038] It should be noted that ink coverage and edge transition features characterize the gradual changes in print quality from two dimensions: ink coverage and edge sharpness, respectively. Ink coverage features are primarily related to the operating status of the inking system, reflecting gradual deterioration in ink supply and transfer. Edge transition features are primarily related to the operating status of the printing plate and blanket, reflecting gradual deterioration in image wear and registration misalignment. These two types of features complement each other, forming a comprehensive monitoring system for the condition of key components of printing equipment. By analyzing the time series of these features, potential fault trends can be detected in advance before print quality shows significant deterioration, providing data support for preventative maintenance.
[0039] S4. Perform trend analysis on the time series of the four color ink coverage features and the time series of edge transition features to determine whether there is a changing trend. If there is a changing trend, send the corresponding information.
[0040] The steps of the trend analysis include: Obtain the sequence to be analyzed, denoted as the target sequence, and calculate the difference sequence of the target sequence; The total positive change is obtained by summing the values greater than zero in the difference sequence, and the total negative change is obtained by summing the absolute values of the values less than zero in the difference sequence. Calculate the difference between the total positive change and the total negative change, and use the ratio of this difference to the mean of the target sequence as a trend indicator. When the trend indicator is greater than a preset threshold, it is determined that the target sequence has a changing trend; otherwise, it is determined that the target sequence does not have a changing trend.
[0041] In this embodiment, it should be noted that the difference sequence refers to the sequence composed of the differences between two adjacent elements in the target sequence. Positive values in the difference sequence indicate that the feature value has increased relative to the previous time step, while negative values indicate that the feature value has decreased relative to the previous time step.
[0042] It should be noted that the total positive change represents the cumulative amount of all upward changes in the characteristic value throughout the entire observation period, while the total negative change represents the cumulative amount of all downward changes. If the sequence exhibits a clear unidirectional trend (whether upward or downward), there will be a significant difference between the total positive and negative changes; if the sequence fluctuates randomly around the mean without a clear trend, the total positive and negative changes will be roughly equivalent, with the difference approaching zero.
[0043] It should be noted that the preset threshold can be set based on actual production experience and equipment characteristics; the distribution range of trend indicators under normal fluctuation conditions can be calculated by statistical analysis of historical data collected during normal equipment operation, and an appropriate upper limit of the confidence interval can be selected as the threshold.
[0044] It should be noted that when the trend index of the ink coverage feature time series exceeds the threshold, it indicates that the ink coverage of the corresponding color channel shows a continuous changing trend, which may indicate a progressive failure in the ink supply system for that color. An ink supply anomaly warning message for the corresponding color channel should be sent. When the trend index of the edge transition feature time series exceeds the threshold, it indicates that the image edge sharpness shows a continuous changing trend, which may indicate problems such as plate wear or blanket aging. An image sharpness anomaly warning message should be sent.
[0045] Example 2: Please refer to Figure 2 This invention provides an image processing-based color printing packaging pattern detection system for implementing an image processing-based color printing packaging pattern detection method, comprising: The monitoring block setting module is used to acquire four-color printing images and standard images, set four color monitoring blocks corresponding to the four color channels according to the four-color printing images, and set a sharpness monitoring block according to the standard image. The sample image judgment module is used to acquire the sample image to be tested and register it with the standard image, extract the image features of the standard image and the sample image to be tested respectively, and judge whether the sample image to be tested is qualified based on the difference between the image features. The feature sequence extraction module is used to obtain the sequence of the sample images to be tested when the sample image to be tested is qualified. For each sample image to be tested in the sequence, the color ink coverage features in the four color monitoring blocks are extracted to form four color ink coverage feature time series, and the edge transition features of the sharpness monitoring blocks are extracted to form an edge transition feature time series. The trend analysis and early warning module is used to perform trend analysis on the time series of four color ink coverage features and edge transition features to determine whether there is a changing trend, and send corresponding information when a changing trend is found.
[0046] In the several embodiments provided by this invention, 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 one method, 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.
[0047] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
[0048] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for detecting color-printed packaging patterns based on image processing, characterized in that, include: Acquire four-color printed images and standard images; set four color monitoring blocks corresponding to the four color channels based on the four-color printed images; and set a sharpness monitoring block based on the standard image. Collect the sample image to be tested and register it with the standard image. Extract the image features of the standard image and the sample image to be tested respectively. Determine whether the sample image to be tested is qualified based on the differences between the image features. When the sample image to be tested is qualified, the sequence of sample images to be tested is obtained. For each sample image to be tested in the sequence, the color ink coverage features in the four color monitoring blocks are extracted to form four color ink coverage feature time series, and the edge transition features of the sharpness monitoring blocks are extracted to form an edge transition feature time series. Perform trend analysis on the time series of four color ink coverage features and edge transition features to determine whether there is a trend. If a trend is found, send the corresponding information.
2. The method for detecting color printed packaging patterns based on image processing according to claim 1, characterized in that, The step of setting four color monitoring blocks corresponding to the four color channels according to the four-color printed image includes: Set a sliding window of a preset size on the four-color printing image, and slide it on the four-color printing image with a preset step size. For each position of the sliding window, calculate the proportion of the four color channels of cyan, magenta, yellow and black in the window respectively. For each color channel, select the window position with the largest proportion of that color channel from all window positions as the color monitoring block for that color channel.
3. The image processing-based color printing packaging pattern detection method according to claim 2, characterized in that, The step of setting a sharpness monitoring block based on a standard image includes: The standard image is converted to a grayscale image. A sliding window of a preset size is set on the grayscale image and slides on the grayscale image with a preset step size. For each position of the sliding window, the gradient magnitude of each pixel in the window is calculated using a gradient operator. The window position with the largest gradient magnitude is selected as the sharpness monitoring block among all window positions.
4. The image processing-based color printing packaging pattern detection method according to claim 3, characterized in that, The image features include color features, brightness features, texture features, edge distribution features, and spectral energy distribution features. Among them, color features are represented by color histograms, brightness features are represented by brightness histograms, texture features are represented by calculating the gray-level co-occurrence matrix and extracting texture statistics, edge distribution features are represented by performing gradient direction histogram statistics on the edge map after edge detection, and spectral energy distribution features are represented by performing a two-dimensional Fourier transform on the image and statistically analyzing the energy proportion of each frequency band.
5. The image processing-based color printing packaging pattern detection method according to claim 4, characterized in that, The step of determining whether a sample image is qualified based on the differences between image features includes: For each image feature, the difference value of the corresponding feature between the standard image and the sample image to be tested is calculated; when the difference value of any image feature exceeds the corresponding preset threshold, the sample image to be tested is determined to be unqualified.
6. The image processing-based color printing packaging pattern detection method according to claim 5, characterized in that, The steps for extracting the color ink coverage features include: Acquire the image within the color monitoring block and convert the image into a four-color channel image of cyan, magenta, yellow, and black. Extract the histogram of the color channel corresponding to the color monitoring block. An adaptive threshold segmentation method based on histograms is used to determine the segmentation threshold. The proportion of pixels that are higher than or equal to the segmentation threshold is counted, and this proportion is used as the color ink coverage feature value.
7. The image processing-based color printing packaging pattern detection method according to claim 6, characterized in that, The extraction steps for the edge transition features include: Acquire images within the clarity monitoring area and convert them to grayscale images; Edge pixels are extracted within a grayscale image using an edge detection operator, and the normal direction of each edge pixel is determined based on the gradient direction. For each edge pixel, a one-dimensional grayscale profile is sampled along its normal direction within a preset length range, and the grayscale profile is normalized to a value range of 0 to 1. In the normalized grayscale profile, determine the two spatial positions corresponding to when the grayscale value is equal to the first preset percentage and the second preset percentage, and calculate the distance between the two spatial positions as the edge width corresponding to the edge pixel. Use the median of the edge widths corresponding to all edge pixels as the edge transition feature value.
8. The image processing-based color printing packaging pattern detection method according to claim 7, characterized in that, The steps of the trend analysis include: Obtain the sequence to be analyzed, denoted as the target sequence, and calculate the difference sequence of the target sequence; The total positive change is obtained by summing the values greater than zero in the difference sequence, and the total negative change is obtained by summing the absolute values of the values less than zero in the difference sequence. Calculate the difference between the total positive change and the total negative change, and use the ratio of this difference to the mean of the target sequence as a trend indicator. When the trend indicator is greater than a preset threshold, it is determined that the target sequence has a changing trend; otherwise, it is determined that the target sequence does not have a changing trend.
9. A color-printed packaging pattern detection system based on image processing, used to implement the color-printed packaging pattern detection method based on image processing as described in any one of claims 1-8, characterized in that, include: The monitoring block setting module is used to acquire four-color printing images and standard images, set four color monitoring blocks corresponding to the four color channels according to the four-color printing images, and set a sharpness monitoring block according to the standard image. The sample image judgment module is used to acquire the sample image to be tested and register it with the standard image, extract the image features of the standard image and the sample image to be tested respectively, and judge whether the sample image to be tested is qualified based on the difference between the image features. The feature sequence extraction module is used to obtain the sequence of the sample images to be tested when the sample image to be tested is qualified. For each sample image to be tested in the sequence, the color ink coverage features in the four color monitoring blocks are extracted to form four color ink coverage feature time series, and the edge transition features of the sharpness monitoring blocks are extracted to form an edge transition feature time series. The trend analysis and early warning module is used to perform trend analysis on the time series of four color ink coverage features and edge transition features to determine whether there is a changing trend, and send corresponding information when a changing trend is found.