A method for color detection of digital printed images
Through the improved superpixel segmentation algorithm based on saliency and color information entropy, the problems of low detection efficiency and insufficient accuracy in printed image color detection are solved, and fast and accurate output of color difference area and color offset is achieved, which is consistent with the visual effects of the human eye.
Patent Information
- Application Number
- CN202411002283.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2044-07-25
AI Technical Summary
Existing printed image color detection methods have problems such as low detection efficiency, strong subjectivity, and inability to accurately reflect the relationship between color and spatial position in colorful printed images.
An improved superpixel segmentation algorithm based on saliency and color information entropy is adopted. The salient area is segmented by the image saliency detection algorithm, and the superpixel size is adaptively adjusted. The SLIC algorithm is combined for segmentation. Color correction and image registration are performed using printed qualified product samples. The color difference of the superpixel block is calculated to output the color difference area.
It realizes fast and accurate color detection of printed images, and can output color difference areas and color offsets, which conforms to the visual effects of the human eye and improves detection efficiency and accuracy.
Smart Images

Figure CN119338739B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of image data processing and image detection technology, and particularly relates to a method for detecting color of a digital printing image. Background Art
[0002] Printed image color detection methods are used to examine the color performance and color consistency of printed products and are an important criterion for measuring printed product quality. Printed image color detection provides timely feedback on color defects during the printing process, facilitating adjustments to output devices and improving production efficiency. With advancements in modern printing technology, printed products exhibit an unprecedented level of color richness. Traditional printed image color detection methods rely on manual labor and equipment such as colorimeters, which present numerous issues such as subjectivity, operational complexity, and low efficiency. Therefore, an autonomous printed image color detection method that combines machine vision and image processing technologies is crucial.
[0003] Research on color detection methods for printed images has made considerable progress and can be broadly categorized into the following: 1. Extracting the color histograms of printed images in different color spaces, converting them into feature vectors, and comparing them with the feature vectors of qualified products; 2. Using the color histograms of printed images as feature inputs for neural networks, training the neural networks for automatic color detection; and 3. Applying superpixel segmentation algorithms to printed images, obtaining the superpixel color mean, converting it into a one-dimensional vector, and then comparing color differences. The first category of methods can only qualitatively describe the presence of color differences in printed images. The color information of printed images cannot reflect the spatial relationship between pixels, making printed images with misplaced prints impossible to detect. The neural networks proposed in the second category are expensive to train and are suitable for small images, not for printed images. The third category of methods simply uses superpixel segmentation algorithms to detect color differences in printed images, failing to consider that superpixels in complex color regions may not fully reflect the color information of printed images. None of these methods have achieved satisfactory results for color detection of richly colored printed images.
[0004] The SLIC superpixel segmentation algorithm is a simple linear iterative clustering algorithm that clusters pixels with high similarity within a region into the same superpixel, achieving image segmentation. Superpixels reflect local color information, effectively representing how the human eye perceives that region. The SLIC algorithm generates uniformly sized and regular superpixel blocks for printed images. However, when inspecting printed image color, different regions cannot be treated the same. High-contrast areas require smaller superpixel blocks to accurately represent the color information of that region.
[0005] Saliency is an indicator used to evaluate the importance and stability of image regions. Image saliency detection using local contrast is helpful in identifying areas of human visual attention. The results obtained by image saliency detection algorithms are consistent with how the human eye observes areas of visual attention in images. Color information entropy is a metric used to measure the uniformity of image color distribution and the amount of information contained. Based on the concept of entropy in information theory, it describes the color richness of an image by calculating the uncertainty or disorder of the color distribution within the image. Summary of the Invention
[0006] In response to the above-mentioned problems existing in the prior art, the purpose of the present invention is to provide a printed image color detection method based on an improved superpixel segmentation algorithm based on saliency and color information entropy; it is more consistent with the observation results of the human eye, takes into account the relationship between color and spatial position, has a faster detection speed, and simultaneously outputs the area with color difference and color offset in the printed image.
[0007] The present invention provides the following technical solution: a method for detecting color of a digital printed image, comprising the following steps:
[0008] S1: Obtain a salient region map of the prepress image using an image saliency detection algorithm based on a convex hull prior, segment the foreground and background of the prepress image, and obtain a saliency mask map; any image saliency detection-related algorithm can be used in this application;
[0009] S2: Adaptively control the superpixel size based on the color information entropy of the salient area to optimize the original superpixel segmentation algorithm;
[0010] S3: Use the optimized superpixel algorithm to complete superpixel segmentation of the prepress image and save the image pixel position and corresponding superpixel label information;
[0011] S4: Use the sample image of the qualified printed product as the post-press standard pattern, perform color correction on the post-press standard pattern, and perform color correction and image registration on the post-press test pattern;
[0012] S5: Obtain the pixel at the corresponding position of the printed image according to the superpixel label, calculate the color mean of each superpixel area in the Lab color space, calculate the color difference of the same superpixel block using the color difference formula, and output the superpixel label that is greater than the threshold;
[0013] S6: Draw the superpixel boundary of the corresponding position on the post-printing standard image according to the output superpixel label, and save the deviation between the superpixel label value and the corresponding area in the three components of L, a, and b as a file.
[0014] Furthermore, the specific process of S1 is as follows:
[0015] S1.1: Obtain a salient region map of the prepress image using an image saliency detection algorithm;
[0016] S1.2: Utilize the Otsu method, an image processing technique for automatically determining the image binarization threshold, to automatically calculate the threshold by minimizing the intra-class variance or maximizing the inter-class variance, to distinguish the foreground from the background of the prepress image, and obtain a binary image of the salient area; set the salient area of the image to white and the non-salient area of the image to black.
[0017] Furthermore, the specific process of S2 is as follows:
[0018] S2.1: Extract the salient region M from the saliency binary image obtained in step S1.2; use the grayscale information of the prepress image to replace the number of colors in the color space dimension for measurement, and obtain the color information entropy E of the salient region:
[0019]
[0020] Where, L h Represents the number of gray levels contained in the image under the salient area, p i Represents the probability histogram at the i-th gray level;
[0021] S2.2: Set the superpixel area A of the salient region. The expression for A is as follows:
[0022]
[0023] Where n is the number of pixels in the salient region, r is the number of horizontal pixels in the image, c is the number of vertical pixels in the image, and ω2 is the control weight of the superpixel size, which is used to adjust the influence of color information entropy. In superpixel segmentation, the superpixel size l in the non-salient region can vary, and the salient region also varies accordingly. ω2 is solved using the following table:
[0024] ω2=5·l 2 .
[0025] Furthermore, the specific process of S3 is as follows:
[0026] S3.1: Use the improved superpixel segmentation algorithm to perform superpixel segmentation on the prepress image and construct the improved superpixel segmentation map G a (x,y);
[0027] G a (x,y)=(1-M(x,y))S na (x,y)+M(x,y)S ya (x,y)
[0028] Where S nais the superpixel segmentation map of the non-salient area, S ya is the superpixel segmentation map of the salient area; S(x,y) is the label of the superpixel area to which the pixel (x,y) belongs, S na (x,y), S ya (x, y) represents the pixel label value in its area; M(x, y) represents the pixels in the salient area, and 1-M(x, y) represents the pixels in the non-salient area;
[0029] S3.2: Use the simple linear clustering SLIC superpixel algorithm to obtain the pixel label S in the salient area ya (x,y); set the superpixel size under the salient area to The cluster centers under the salient regions are Search for similar pixels in the range and compare the similarity between the pixels and the cluster center in the Lab color space;
[0030] S3.3: Use the method in step S3.2 to perform superpixel segmentation on the non-salient area and obtain the pixel label S under the salient area na (x, y); the superpixel size in the non-salient area is l, and the cluster center searches for similar pixels in the range of 2l×2l; the superpixel label value of the non-salient area is connected after the label value of the salient area.
[0031] Furthermore, in S3, when the size of the pre-press image is inconsistent with the size of the post-press image, the super-pixel label of the pre-press image is interpolated according to the pixel size of the post-press image, so that the super-pixel label can reflect each pixel of the post-press image; each pixel in the post-press image is assigned to a corresponding label value; the super-pixel color reflection effect of the post-press image is the same as the super-pixel color of the pre-press image.
[0032] Furthermore, the specific process of S5 is as follows:
[0033] S5.1: Segment the image G based on the superpixels obtained in S3 a (x, y), obtain the color mean of each superpixel in the Lab color space corresponding to the post-printing standard image in the superpixel segmentation image; construct the feature vector E of the post-printing standard image, and obtain the feature vector F of the post-printing image to be tested in the same way. Vectors E and F are composed of multidimensional vectors, expressed as E=[E1,E2,...,E i ] and F=[F1,F2,...,F i ], where each E i and F i Is a three-dimensional vector representing the color mean of the corresponding superpixel;
[0034] S5.2: Calculate the difference D between two eigenvectors at the same position f, where D f The ΔE standard color difference calculation formula in Lab space is output as D f The position of the feature vector greater than the threshold is the corresponding superpixel label:
[0035]
[0036] In the formula is the number of pixels contained in the i-th superpixel in E, and p1 is a pixel under the corresponding superpixel. is the number of pixels contained in the i-th superpixel in F, and p2 is a pixel under the corresponding superpixel. L(p1), a(p1), and b(p1) represent the values of the three components of pixel p1 in the Lab color space; L(p2), a(p2), and b(p2) represent the values of the three components of pixel p2 in the Lab color space. is the mean of the three components L, a, and b of the i-th superpixel area in E; is the mean of the three components L, a, and b in the i-th superpixel area in F.
[0037] By adopting the above technology, compared with the prior art, the beneficial effects of the present invention are as follows:
[0038] The present invention combines image saliency with color information entropy to adaptively divide the superpixel size of salient and non-salient areas of printed images for printed image color detection by comparing superpixel color means; it can obtain more accurate color detection results that are consistent with human vision; the method of the present invention has a faster detection speed and can simultaneously output the color difference area position and color offset. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 Flow chart of the method of the present invention. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0041] On the contrary, the present invention covers any alternatives, modifications, equivalents, and solutions that fall within the spirit and scope of the present invention as defined by the claims. Furthermore, to facilitate a better understanding of the present invention, certain specific details are described in detail below in the detailed description of the present invention. Those skilled in the art will be able to fully understand the present invention without these details.
[0042] by Figure 1Taking the process of the printed image color detection method in [1] as an example, the whole process from pre-press image processing to post-press image color detection to the final output of the color difference area position and color offset is explained in detail. The specific steps are as follows:
[0043] S1: Obtain a salient region map of the pre-press image using an image saliency detection algorithm, segment the foreground and background of the image, and obtain a saliency mask map. The specific process is as follows:
[0044] S1.1: Obtain a salient region map of the prepress image through an image saliency detection algorithm based on a convex hull prior.
[0045] S1.2: Using the Otsu method, we automatically calculate the binarization threshold of the salient region image by minimizing the intra-class variance, distinguishing the foreground from the background of the image, and obtaining a binary image of the salient region. The salient regions of the image are white, and the non-salient regions of the image are black.
[0046] S2: Obtain a salient region M of the saliency image according to S1.2. Determine the richness of the region's content based on the color information contained in the prepress image corresponding to region M, and adaptively set the superpixel size for segmenting the region. The specific process is as follows:
[0047] S2.1: Extract the salient region M from the saliency binary image obtained in step S1.2. Select the prepress image region corresponding to M. Use the grayscale information of the prepress image region to calculate the information entropy and obtain the color information entropy E of the salient region:
[0048]
[0049] Where L h Represents the number of gray levels contained in the image under the salient area, p i Represents the probability histogram at the i-th gray level.
[0050] S2.2: Set the superpixel area A of the salient region. The expression for A is as follows:
[0051]
[0052] Where n is the number of pixels in the salient area, r is the number of horizontal pixels in the prepress image, and c is the number of vertical pixels in the prepress image.
[0053] S3: Use the improved superpixel algorithm to complete superpixel segmentation of the prepress image and save the image pixel position and corresponding superpixel label information; the specific process is as follows:
[0054] S3.1: Use the improved superpixel segmentation algorithm to perform superpixel segmentation on the prepress image and construct the improved superpixel segmentation map G a (x,y):
[0055] G a (x,y)=(1-M(x,y))S na (x,y)+M(x,y)S ya (x,y)
[0056] Where S na is the superpixel segmentation map of the non-salient area, S ya is the superpixel segmentation map of the salient area. S(x,y) is the label of the superpixel area to which the pixel (x,y) belongs, so S na (x,y), S ya (x, y) represents the pixel label value in its region. M(x, y) represents the pixels in the salient region, and 1-M(x, y) represents the pixels in the non-salient region.
[0057] S3.2: Use the simple linear clustering SLIC superpixel algorithm to obtain the pixel label S in the salient area ya (x,y). Set the superpixel size under the salient area to The cluster centers under the salient areas of the image are The similarity between the pixel and the cluster center is compared in Lab color space. Each similar pixel is assigned the same label as the cluster center.
[0058] S3.3: The same operation as S3.2, perform superpixel segmentation on the non-salient area of the image, and obtain the pixel label S under the salient area na (x, y). The superpixel size in the non-salient area is l, and the cluster center searches for similar pixels in the range of 2l×2l. The superpixel label value of the non-salient area is connected to the label value of the salient area, and the two are combined to obtain the complete G a (x,y).
[0059] S3.4: If the pre-press image size is inconsistent with the post-press image size, the superpixel labels of the pre-press image are interpolated based on the pixel size of the post-press image, so that the superpixel labels reflect every pixel in the post-press image. Each pixel in the post-press image is assigned a corresponding label value. The superpixel colors of the post-press image are reflected in the same way as the superpixel colors of the pre-press image.
[0060] S4: Perform color correction on the post-press standard pattern and color correction and registration on the post-press test pattern, where the post-press standard image is a sample image of a qualified printed product. The specific process is as follows:
[0061] S4.1: Use the Epson 12000XL scanner to collect data of the post-press standard pattern, and use the color correction function of the system to obtain the image data of the post-press standard image;
[0062] S4.2: Use the Epson 12000XL scanner to collect data on the post-printed pattern to be tested, and use the system's built-in color correction function to obtain image data of the post-printed defect image. Use the SIFT image registration algorithm to correct the post-printed defect image to ensure that the post-printed standard image and the post-printed defect image are aligned;
[0063] S5: Obtain the pixel at the corresponding position of the post-printing image based on the superpixel label, calculate the color mean of the area in the Lab color space, calculate the color difference of the same superpixel block using the color difference formula, and output the superpixel label that is greater than the threshold. The specific process is as follows:
[0064] S5.1: Segment the image G based on the superpixels obtained in S3 a (x, y), obtain the color mean of each superpixel in the standard image after printing in Lab color space. Construct the feature vector E of the standard image after printing. Obtain the feature vector F of the image to be tested after printing in the same way. Vectors E and F are composed of multidimensional vectors, expressed as E = [E1, E2, ..., E i ] and F=[F1,F2,...,F i ], where each E i and F i It is a three-dimensional vector representing the color mean of the corresponding superpixel.
[0065] S5.2: Calculate the difference D between two eigenvectors at the same position f , where D f The ΔE standard color difference calculation formula in Lab space is output as D f The position of the feature vector greater than the threshold is the corresponding superpixel label i:
[0066]
[0067] In the formula is the number of pixels contained in the i-th superpixel in E, and p1 is a pixel under the corresponding superpixel. is the number of pixels contained in the i-th superpixel in F, and p2 is a pixel under the corresponding superpixel. L(p1), a(p1), and b(p1) represent the values of the three components of pixel p1 in the Lab color space; L(p2), a(p2), and b(p2) represent the values of the three components of pixel p2 in the Lab color space. is the mean of the three components L, a, and b of the i-th superpixel area in E; is the mean of the three components L, a, and b in the i-th superpixel area in F.
[0068] S6: Draw the superpixel boundary of the corresponding position on the post-printing standard image according to the output superpixel label, and save the deviation of the three components L, a, and b in the area corresponding to the label value as a file. The specific process is as follows:
[0069] S6.1: Based on the output superpixel labels, draw the superpixel boundaries at the corresponding locations and present them on the standard image after printing. The resulting image is an outline of the color difference area marked on the standard image after printing. The outline is presented as the superpixel outline of the corresponding area, with larger outlines in non-salient areas and smaller outlines in salient areas.
[0070] S6.2: Save the deviation of the color mean of the area corresponding to the output superpixel label value in the three components L, a, and b as a file.
[0071] In this embodiment, the input pre-press image and super pixel size l are G obtained by S3.4. a (x, y), input the post-printing standard image and the post-printing test image according to G a (x, y) determines the superpixel feature vector E and superpixel feature vector F, and compares them according to the calculation method in S5.2. The calculation process of formula S5.2 is as follows: Get the superpixel E with the same label value of 31 31 With F 31 , calculated based on their mean in three parts f Due to D f If the value is greater than the set threshold, the label value of the corresponding superpixel is output as 31, and E 31 With F 31 The offsets of the three components L, a, and b are shown in Table 1. The relevant parameters in S5.2 are calculated during the execution of this method and are not used as output results.
[0072]
[0073] Table 1 Some examples of color deviation in superpixel regions
[0074]
[0075] 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 and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for detecting color of a digital printed image, characterized in that: The following steps are involved: S1: Obtain a salient region map of the prepress image through an image saliency detection algorithm based on a convex hull prior, segment the foreground and background of the prepress image, and obtain a saliency mask map; S2: Adaptively control the superpixel size based on the color information entropy of the salient area of the prepress image corresponding to the saliency mask map, and optimize the original superpixel segmentation algorithm; S3: Use the optimized superpixel algorithm to complete superpixel segmentation of the prepress image and save the image pixel position and corresponding superpixel label information; S4: Use the sample image of the qualified printed product as the post-press standard pattern, perform color correction on the post-press standard pattern, and perform color correction and image registration on the post-press test pattern; S5: Obtain the pixel at the corresponding position of the printed image according to the superpixel label, calculate the color mean of each superpixel area in the Lab color space, calculate the color difference of the same superpixel block using the color difference formula, and output the superpixel label that is greater than the threshold; S6: Draw the superpixel boundary of the corresponding position on the post-printing standard image according to the output superpixel label, and save the deviation between the superpixel label value and the corresponding area in the three components of L, a, and b as a file.
2. The method for color detection of a digital printed image according to claim 1, wherein: The specific process of S1 is as follows: S1.1: Obtain a salient region map of the prepress image using an image saliency detection algorithm; S1.2: Utilize the Otsu method, an image processing technique for automatically determining the image binarization threshold, to automatically calculate the threshold by minimizing the intra-class variance or maximizing the inter-class variance, to distinguish the foreground from the background of the prepress image, and obtain a binary image of the salient area.
3. The method for color detection of a digital printed image according to claim 2, wherein: The specific process of S2 is as follows: S2.1: Extract the salient region M from the saliency binary image obtained in step S1.2; select the prepress image region corresponding to M, and use the grayscale information of the prepress image to replace the number of colors in the color space dimension for measurement, and obtain the color information entropy E of the salient region: Where, L h Represents the number of gray levels contained in the image under the salient area, p i Represents the probability histogram at the i-th gray level; S2.2: Set the superpixel area A of the salient region. The expression for A is as follows: Where n is the number of pixels in the salient area, r is the number of horizontal pixels in the image, c is the number of vertical pixels in the image, and ω2 is the control weight of the superpixel size, which is used to adjust the influence of color information entropy. The following table is used to solve ω2: ω2=5·l 2 。 4. The method for color detection of a digital printed image according to claim 3, wherein: The specific process of S3 is as follows: S3.1: Use the improved superpixel segmentation algorithm to perform superpixel segmentation on the prepress image and construct an improved superpixel segmentation map; S3.2: Use the simple linear clustering SLIC superpixel algorithm to obtain the pixel label S in the salient area ya (x,y); set the superpixel size under the salient area to The cluster centers under the salient regions are Search for similar pixels in the range and compare the similarity between the pixels and the cluster center in the Lab color space; S3.3: Use the method in step S3.2 to perform superpixel segmentation on the non-salient area and obtain the pixel label S under the salient area na (x, y); the superpixel size in the non-salient area is l, and the cluster center searches for similar pixels in the range of 2l×2l; the superpixel label value of the non-salient area is connected after the label value of the salient area.
5. The method for detecting color of a digital printed image according to claim 4, wherein: In S3, when the size of the pre-press image is inconsistent with the size of the post-press image, the super-pixel label of the pre-press image is interpolated according to the pixel size of the post-press image, so that the super-pixel label can reflect each pixel of the post-press image; each pixel in the post-press image is assigned to a corresponding label value; the super-pixel color reflection effect of the post-press image is the same as the super-pixel color of the pre-press image.
6. The method for detecting color of a digital printed image according to claim 5, wherein: The specific process of S5 is as follows: S5.1: Based on the superpixel segmentation image obtained in S3, obtain the color mean of each superpixel corresponding to the post-press standard image in the superpixel segmentation image in the Lab color space; construct a feature vector E of the post-press standard image, and obtain a feature vector F of the post-press test image in the same manner; S5.2: Calculate the difference D between two eigenvectors at the same position f , where D f The ΔE standard color difference calculation formula in Lab space is output as D f The position of the feature vector greater than the threshold is the corresponding superpixel label.