Corrugated carton printing pattern color difference detection method and system

Through image segmentation and feature matching technology, combined with adaptive sampling and unsupervised learning, the problems of low chromatic aberration detection efficiency and high cost in corrugated carton printing are solved, and efficient and accurate chromatic aberration detection and printing parameter optimization are achieved.

CN119048441AActive Publication Date: 2024-11-29FOSHAN BAOSHENG PRINTING MASCH MFG CO LTD

Patent Information

Application Number
CN202411074310.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-11-29
Estimated Expiration
2044-08-07

AI Technical Summary

Technical Problem

The color difference detection efficiency and high cost during the printing process of existing corrugated cartons are low in color and cannot adapt to large-scale promotion. The unified inspection method cannot meet the testing needs of different printing patterns.

Method used

Image segmentation technology is used to classify the printing patterns of corrugated cartons through the SVM algorithm, and different detection methods are adopted according to color uniformity and texture characteristics. The color difference detection is performed using the adaptive sampling density algorithm and the SIFT feature matching algorithm, and the printing parameters are adjusted through the unsupervised algorithm.

Benefits of technology

It improves the efficiency and accuracy of chromatic aberration detection, reduces the detection cost, adapts to the detection needs of different printing patterns, and achieves more efficient printing quality control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119048441A_ABST
    Figure CN119048441A_ABST
Patent Text Reader

Abstract

The invention discloses a corrugated carton printing pattern color difference detection method and system, and the method comprises the steps: carrying out the image segmentation of a to-be-detected corrugated carton printing pattern, and carrying out the classification through an SVM algorithm, and obtaining a first to-be-detected image and a second to-be-detected image; when the chromatic aberration of the first to-be-detected image is detected, obtaining the color uniformity of the first to-be-detected image, and judging whether a preset condition is met or not; if yes, selecting a preset number of first sampling points, and determining pattern color difference according to the first sampling points and the standard template; if not, performing partition sampling according to an adaptive sampling density algorithm, and determining pattern color difference according to an obtained second sampling point and the standard template; when the color difference of the second to-be-detected image is detected, SIFT features are obtained through feature extraction, feature matching is conducted on the SIFT features and the standard template through a feature point matching algorithm, and the pattern color difference is determined. According to the method, image division is carried out through image classification and uniformity, and targeted color difference detection is carried out on different images, so that the detection efficiency is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image detection, and in particular to a method and system for detecting color difference of a printed pattern on a corrugated paper box. Background Art

[0002] Color difference problems often occur during the printing process of corrugated boxes. This is because the paper's own absorbency, texture, and uneven thickness may lead to inconsistent ink distribution, which in turn causes color difference. Printing pressure, ink volume control, printing speed, and environmental factors may also cause color difference. In order to ensure the printing quality of corrugated boxes, a colorimeter is usually used to detect the color difference of the printed products. The colorimeter is a precision instrument based on the CIE color space theory that can accurately measure the color of the printed product and quantify its difference from the standard color sample, usually expressed as a ΔE value. However, this unified detection method is not only inefficient, but also has high equipment costs, and is not suitable for large-scale promotion. Summary of the invention

[0003] In order to solve at least one of the above-mentioned technical problems, the present invention provides a method and system for detecting color difference of printed patterns on corrugated paper boxes.

[0004] In a first aspect, the present invention provides a method for detecting color difference of a printed pattern on a corrugated box, the method comprising:

[0005] Perform image segmentation on the printed pattern of the corrugated box to be tested, and classify the segmented images by using the SVM algorithm to obtain a first image to be tested and a second image to be tested;

[0006] When detecting the color difference of the first image to be tested, obtaining the color uniformity of the first image to be tested, and determining whether the color uniformity meets a preset condition;

[0007] If yes, select a preset number of first sampling points on the first image to be tested, and determine the pattern color difference according to the first sampling points and the standard template;

[0008] If not, sampling is performed on the first image to be tested according to an adaptive sampling density algorithm to obtain second sampling points, and the pattern color difference is determined according to the second sampling points and the standard template;

[0009] When detecting the color difference of the second image to be tested, feature extraction is performed on the second image to be tested to obtain SIFT features, and feature matching is performed between the SIFT features and the standard template using a feature point matching algorithm to determine the pattern color difference.

[0010] Preferably, the method further comprises:

[0011] According to the color difference detection results of the first image to be tested and the second image to be tested, the color difference abnormality of the printed pattern of the corrugated box to be tested at the same detection position is calculated, and it is determined whether the color difference abnormality is greater than a preset threshold;

[0012] When it is determined that the color difference anomaly rate is greater than a preset threshold, an unsupervised algorithm is used to learn the current printing parameters and the corresponding color difference detection results, the current printing parameters are adaptively adjusted, and the updated printing parameters are used for the next printing process.

[0013] Preferably, the classifying the segmented images by using a SVM algorithm comprises:

[0014] Preprocessing the segmented images, including format unification and median filtering;

[0015] Perform color space conversion on several preprocessed images, including conversion into HSV color space and Lab color space respectively;

[0016] Separate the channels of the HSV color space, calculate the local brightness ratio based on the separated single-channel image, and segment the single-channel image according to the size of the local brightness ratio;

[0017] Based on the segmented single-channel image and Lab color space, feature extraction is performed respectively, and the extracted features are classified using the SVM algorithm.

[0018] Preferably, the method further comprises: using a trained convolutional neural network model to identify the color uniformity of the first image to be tested.

[0019] Preferably, the selecting a preset number of first sampling points on the first image to be tested, and determining the pattern color difference according to the first sampling points and a standard template includes:

[0020] In the first image to be tested, the vertices and the center point of the four corners of the image are used as the first sampling points;

[0021] The first target color difference between each first sampling point in the Lab color space and the standard template in the Lab color space is calculated, and the average value of the first target color differences is calculated as the color difference of the first image to be tested.

[0022] Preferably, the step of performing partition sampling on the first image to be tested according to an adaptive sampling density algorithm to obtain second sampling points, and determining the pattern color difference according to the second sampling points and a standard template includes:

[0023] Identify a color uniform region and a color non-uniform region of the first image to be tested, and use an adaptive sampling density algorithm to collect sampling points with different densities in the color uniform region and the color non-uniform region as second sampling points;

[0024] The second target color difference between each second sampling point in the Lab color space and the standard template in the Lab color space is calculated, and the root mean square error of the second target color difference is calculated as the color difference of the first image to be measured.

[0025] Preferably, the method of matching the SIFT features with the standard template using a feature point matching algorithm to determine the pattern color difference includes:

[0026] The FLANN algorithm is used to match the feature descriptor of SIFT features with the feature descriptor of the standard template, and outliers are removed to obtain matching pairs;

[0027] Calculate the Euclidean distance between matching pairs, and select matching pairs whose Euclidean distance is less than the confidence threshold as target matching pairs;

[0028] Extracting corresponding image regions from the second image to be tested and the standard template respectively based on the target matching pair, converting the image regions into Lab color space, and generating matching regions;

[0029] The color difference of each matching area is calculated, and the corresponding color difference average value is calculated according to the color difference of each matching area as the color difference of the second image to be tested.

[0030] In a second aspect, the present invention further provides a system for detecting color difference of a printed pattern on a corrugated box, the system comprising:

[0031] An image segmentation unit is used to perform image segmentation on the printed pattern of the corrugated box to be tested, and classify the segmented images by using a SVM algorithm to obtain a first image to be tested and a second image to be tested;

[0032] A first image color difference detection unit is used to obtain the color uniformity of the first image to be tested when detecting the color difference of the first image to be tested, and to determine whether the color uniformity meets a preset condition;

[0033] If yes, select a preset number of first sampling points on the first image to be tested, and determine the pattern color difference according to the first sampling points and the standard template;

[0034] If not, sampling is performed on the first image to be tested according to an adaptive sampling density algorithm to obtain second sampling points, and the pattern color difference is determined according to the second sampling points and the standard template;

[0035] The second image color difference detection unit is used to extract features from the second image to be tested to obtain SIFT features when detecting the color difference of the second image to be tested, and to perform feature matching between the SIFT features and the standard template using a feature point matching algorithm to determine the pattern color difference.

[0036] In a third aspect, the present invention further provides an electronic device comprising: a processor and a memory, wherein the memory is used to store computer program code, wherein the computer program code comprises computer instructions, and when the processor executes the computer instructions, the electronic device executes the method as described in the first aspect above and any possible implementation thereof.

[0037] In a fourth aspect, the present invention further provides a computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, wherein the computer program includes program instructions, and when the program instructions are executed by a processor of an electronic device, the processor executes the method as described in the first aspect above and any possible implementation thereof.

[0038] Compared with the prior art, the present invention has the following beneficial effects:

[0039] 1) The present invention provides a method for detecting color difference of printed patterns on corrugated paper boxes. First, the printed patterns on the corrugated paper boxes to be tested are segmented, and the segmented images are classified by the SVM algorithm to obtain a first image to be tested and a second image to be tested. By classifying the images, the background color of a large area with similar colors and the complex pattern can be distinguished, and different detection methods can be used to avoid the problems of waste of resources and poor detection effect caused by using only one detection method.

[0040] 2) When detecting the color difference of the first image to be tested, the color uniformity of the first image to be tested is obtained to determine whether the color uniformity meets the preset conditions; if so, a preset number of first sampling points are selected on the first image to be tested, and the pattern color difference is determined according to the first sampling points and the standard template; if not, partition sampling is performed on the first image to be tested according to the adaptive sampling density algorithm to obtain second sampling points, and the pattern color difference is determined according to the second sampling points and the standard template. The first image to be tested is usually a background color with a large area of ​​similar colors visually, and the texture features are simple. However, in order to ensure the accuracy of the detection, the present invention distinguishes the first image to be tested by first detecting the uniformity, thereby determining the sampling method and sampling density, which can greatly improve the detection efficiency.

[0041] 3) When detecting the color difference of the second image to be tested, feature extraction is performed on the second image to be tested to obtain SIFT features, and feature matching is performed between the SIFT features and the standard template using a feature point matching algorithm to determine the color difference of the pattern. Since the second image to be tested is usually a printed pattern with relatively complex texture features, when detecting the second image to be tested, SIFT features are mainly extracted, and the color difference of the pattern is detected by feature matching, thereby improving the accuracy of color difference detection when the texture features are relatively complex. Compared with the prior art that does not consider the situation of the detection object and only adopts a unified detection method, the present invention reduces the detection cost while improving the detection efficiency and detection accuracy.

[0042] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the background technology, the drawings required for use in the embodiments of the present invention or the background technology will be described below.

[0044] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.

[0045] Figure 1 A schematic flow chart of a method for detecting color difference of a printed pattern on a corrugated paper box provided in one embodiment of the present invention;

[0046] Figure 2 A schematic flow chart of a method for detecting color difference of a printed pattern on a corrugated paper box provided by another embodiment of the present invention;

[0047] Figure 3 A schematic diagram of the structure of a system for detecting color difference of printed patterns on corrugated paper boxes provided by an embodiment of the present invention;

[0048] Figure 4 A schematic structural diagram of a system for detecting color difference of printed patterns on corrugated paper boxes according to another embodiment of the present invention. DETAILED DESCRIPTION

[0049] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0050] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.

[0051] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.

[0052] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0053] In addition, in order to better illustrate the present invention, numerous specific details are provided in the following specific embodiments. It should be understood by those skilled in the art that the present invention can be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present invention.

[0054] At present, a unified detection method, i.e., a colorimeter, is usually used for color difference detection of printed patterns on corrugated paperboards. This method is not only costly but also inefficient. To this end, the present invention aims to provide a color difference detection method for printed patterns on corrugated paperboards, which can distinguish different detection images to match appropriate detection methods, thereby reducing costs and improving detection quality and efficiency.

[0055] See also Figure 1 , Figure 1 The present invention provides a flowchart of a method for detecting color difference of a printed pattern on a corrugated paper box. Figure 1 As shown, a method for detecting color difference of a printed pattern on a corrugated box comprises the following steps:

[0056] S10, performing image segmentation on the printed pattern of the corrugated paper box to be tested, and classifying the segmented images by using a SVM algorithm to obtain a first image to be tested and a second image to be tested.

[0057] The printed patterns on corrugated boxes are rich and varied, usually including text information, such as brand logos, manufacturer information, instructions for use, etc.; large color blocks, such as background fill, use one or more colors to form a unified or gradient visual effect to increase the overall aesthetics of the packaging; complex patterns and textures, such as pattern texture effects, gloss effects, decorative graphics to beautify the packaging, etc. If the types of printed patterns are not distinguished, only a unified color difference detection method is used, which usually leads to the inability to guarantee the detection accuracy, because different types of printed patterns have different sensitivities to color difference. Large areas of uniform background are very sensitive to color uniformity and color difference, while complex patterns or texture areas may pay more attention to the layering and contrast of colors. Using a single color difference detection standard cannot meet the needs of both situations at the same time, resulting in inaccurate detection results.

[0058] In this embodiment, the corrugated box printing pattern is first segmented, so that the pattern area to be detected at one time can be reduced, so that the color difference detection process of patterns in different areas can be processed in parallel, which improves efficiency. After segmentation, the segmented images are classified by the SVM algorithm to obtain the first image to be tested and the second image to be tested; wherein the first image to be tested is mainly the background color of a large area of ​​color blocks, and the second image to be tested is mainly complex patterns and textures. By training the support vector machine (SVM) algorithm in advance, the segmented images are subjected to a binary classification operation to obtain the first image to be tested and the second image to be tested, so that different types of printed patterns can be distinguished to provide a targeted color difference detection method.

[0059] S20, when detecting the color difference of the first image to be tested, obtaining the color uniformity of the first image to be tested, and determining whether the color uniformity meets a preset condition;

[0060] S201: If yes, select a preset number of first sampling points on the first image to be tested, and determine the pattern color difference according to the first sampling points and the standard template;

[0061] S202: If not, perform sampling on the first image to be tested according to an adaptive sampling density algorithm to obtain second sampling points, and determine the pattern color difference according to the second sampling points and the standard template.

[0062] In this embodiment, when detecting the color difference of the first image to be tested, the color uniformity of the first image to be tested is first determined to determine whether the color uniformity meets the preset conditions. If the preset conditions are met, only a preset number of sampling points can be collected to calculate the pattern color difference. If the preset conditions are not met, it means that the uniformity of the first image to be tested does not meet the requirements. At this time, in order to ensure the accuracy of color difference detection, it is necessary to perform sampling on the first image to be tested according to the adaptive sampling density algorithm. The overall color uniformity is poor before the partitioning, but after the partitioning, the positions with relatively uniform and uneven colors can be obtained. In this way, sampling points with different densities can be selected and collected in different partitions through the adaptive sampling density algorithm to calculate the pattern color difference.

[0063] In a preferred embodiment, the color uniformity of the first image to be tested is identified using a trained convolutional neural network model.

[0064] When training a convolutional neural network model, it is necessary to collect a large number of images with uniform and uneven colors as training sets, and then label the categories for each image. By rotating, scaling, flipping, and other operations on the images, the sample diversity of the training set is increased to improve the generalization ability of the model. Then, the CNN infrastructure built with the ResNet module is used to train the model using the training set, and the loss function is constructed using the cross entropy loss. After multiple rounds of iterative training, the classification accuracy and recall rate of the model are evaluated, thereby optimizing the model network structure and finally obtaining a trained convolutional neural network model. When identifying the color uniformity of an image, it only needs to be output to the convolutional neural network model to quickly output the uniformity recognition result.

[0065] S30 , when detecting the color difference of the second image to be tested, extracting features from the second image to be tested to obtain SIFT features, and matching the SIFT features with the standard template using a feature point matching algorithm to determine the pattern color difference.

[0066] The first image to be tested is mainly a large area of ​​background color, so the sampling points collected in the above method are used to detect color difference. In this step, the second image to be tested is mainly a complex pattern texture. In order to ensure detection efficiency and accuracy, feature extraction is performed on the second image to be tested to obtain SIFT features.

[0067] Specifically, when extracting SIFT features, we first perform scale extreme value space detection, apply Gaussian difference pyramid to identify potential points of interest with scale and direction invariance, and extract local extreme value points at different scales in the image through Gaussian difference. These extreme value points are used as key points of SIFT algorithm; then direction assignment, for each key point, calculate its gradient direction and assign it to its gradient direction histogram; finally, key point descriptor, in the area around each key point, measure local gradients at the selected scale, these gradients are transformed into a representation, with the key point as the center, construct a 4×4 window, calculate the gradient amplitude and direction of each pixel in the window, and assign it to the statistical histogram, and finally obtain the 128-dimensional SIFT feature vector of the key point. After obtaining SIFT features, feature matching is performed between SIFT features and standard templates using feature point matching algorithm, so that the pattern color difference of the second image to be tested can be determined.

[0068] Therefore, the color difference detection method provided in this embodiment performs image segmentation on the printed pattern of the corrugated box to be tested, and classifies the segmented images through the SVM algorithm to obtain a first image to be tested and a second image to be tested. By classifying the images, the background color of a large area with similar colors and the complex pattern can be distinguished first, so that different detection methods can be used to avoid the problems of waste of resources and poor detection effect caused by using only one detection method.

[0069] In addition, when detecting the color difference of the first image to be tested, the image type is distinguished by color uniformity as an indicator. If the color uniformity meets the preset conditions, a preset number of first sampling points are selected on the first image to be tested, and the pattern color difference is determined according to the first sampling points and the standard template; otherwise, the first image to be tested is sampled in partitions according to the adaptive sampling density algorithm to obtain second sampling points, and the pattern color difference is determined according to the second sampling points and the standard template. The first image to be tested is distinguished by color uniformity, thereby determining the sampling method and sampling density, which can greatly improve the detection efficiency. When detecting the color difference of the second image to be tested, the extracted SIFT features are matched with the standard template using a feature point matching algorithm to determine the pattern color difference. This can improve the accuracy of color difference detection when the texture features are relatively complex. Compared with the existing method that only uses a unified detection method, the detection method of this embodiment reduces the detection cost while improving the detection efficiency and detection accuracy.

[0070] See also Figure 2 In some embodiments, the method further comprises:

[0071] S40, calculating the color difference abnormality of the printed pattern of the corrugated box to be tested at the same detection position according to the color difference detection results of the first image to be tested and the second image to be tested, and determining whether the color difference abnormality is greater than a preset threshold;

[0072] S50. When it is determined that the color difference anomaly rate is greater than a preset threshold, an unsupervised algorithm is used to learn the current printing parameters and the corresponding color difference detection results, the current printing parameters are adaptively adjusted, and the updated printing parameters are used for the next printing process.

[0073] It should be noted that the scenario targeted by this embodiment is mainly to detect the color difference of the printed patterns of a batch of corrugated cardboard boxes after the printing of the batch of corrugated cardboard boxes is completed. Assuming that a batch of corrugated cardboard boxes contains n boxes, the color difference detection is performed on the n boxes using the detection method of the above embodiment. According to the detection results, the color difference abnormality of the printed pattern of the corrugated cardboard boxes to be tested at the same detection position can be calculated.

[0074] For example, there are n cartons, and the image of each carton is divided into m blocks, labeled N1-1, N1-2, …, N1-m, …, N2-1, N2-2, …, N2-m, …, Nn-1, Nn-2, …, Nn-m; among them, Ni-j represents the j-th image block of the ith box, the value range of i is [1,n], and the value range of j is [1,m].

[0075] When calculating the color difference anomaly rate, taking N1-1 as an example, the image at the same position in the second box is N2-1, the image at the same position in the third box is N3-1, and so on, the image at the same position in the nth box is Nn-1. At this time, we only need to obtain the number of color difference anomalies in these n pictures. Assuming that n is 30, there are 3 blocks with color difference anomalies, then it can be said that the color difference anomaly rate of the image at the same position is 3 / 30=10%.

[0076] Further, it is determined whether the color difference anomaly rate is greater than a preset threshold. If not, it means that the color difference problem is within the tolerance range and no special treatment is required. The cartons with problems only need to be removed. If yes, it means that the color difference problem is relatively serious, which may be caused by improper printing parameters. At this time, in order to ensure that the color difference problem is reduced in the next printing process, this embodiment will use an unsupervised algorithm to learn the current printing parameters and the corresponding color difference detection results, adaptively adjust the current printing parameters, and use the updated printing parameters for the next printing process.

[0077] Specifically, printing parameters include but are not limited to ink concentration, printing speed, printing pressure and drying temperature. In order to reduce the difficulty of calculation during learning, 2 or more parameters can be selected for learning, such as printing speed and pressure. Unsupervised learning can use clustering algorithms such as K-means and DBSCAN to analyze historical data, try to find the color difference pattern under different printing parameter configurations, cluster similar printing results into one category, and then identify the best printing parameter cluster, and predict or recommend new printing parameter settings based on this. The printing parameters optimized by the above model are applied to the next round of printing, and color difference detection is performed again. Then, new data is collected and fed back to the model, and continuous iterative optimization is performed to form a closed-loop control, so that the printing process gradually approaches the ideal state and the quality of the printed product is getting better and better.

[0078] After detecting the color difference problem of a batch of corrugated box printing patterns, this embodiment collects statistics on the color difference abnormality and then compares it with the preset threshold to determine whether feedback is needed to adjust the printing parameters. When it is determined that adjustment is needed, the printing parameters are adaptively adjusted through unsupervised learning, and the updated printing parameters are used in the next printing process, which can greatly reduce the color difference problem of the next printing, thereby improving the quality of the finished products of the entire production line.

[0079] In some embodiments, the classifying the segmented images by using the SVM algorithm includes:

[0080] 1) Preprocessing the segmented images, including format unification and median filtering;

[0081] 2) performing color space conversion on the preprocessed images, including converting them into HSV color space and Lab color space respectively;

[0082] 3) Separate the channels of the HSV color space, calculate the local brightness ratio based on the separated single-channel image, and segment the single-channel image according to the size of the local brightness ratio;

[0083] 4) Based on the segmented single-channel image and Lab color space, feature extraction is performed respectively, and the extracted features are classified using the SVM algorithm.

[0084] HSV color space uses hue H, saturation S, and brightness V to describe color. Compared with RGB space, the three components of HSV color space are not related, and HSV color space has a great advantage in segmenting specific color areas. Lab color space is established according to international standards for measuring color. Unlike other color spaces, this color space is irrelevant to the device, and the colors therein are richer than RGB colors. Not only can all colors in RGB space be expressed, but also the colors of other models can be expressed, and the color distribution is uniform. The present embodiment takes into account the color features under HSV color space and Lab color space, and combines them into feature vectors, and then performs feature recognition and classification.

[0085] Furthermore, when performing channel separation on the HSV color space, the local brightness ratio is calculated based on the separated single-channel image, and the single-channel image is segmented according to the size of the local brightness ratio. In order to improve the robustness of the algorithm, each separated single-channel image can be subjected to a threshold segmentation process, and several threshold images, for example, 3 images, can be obtained. Then, the threshold image with the largest local brightness ratio can be selected from the obtained 3 threshold images to complete the segmentation. Among them, the calculation formula of the local brightness ratio is:

[0086]

[0087] Where s represents the local brightness ratio, are the mean values ​​of pixels in the foreground and background regions, respectively.

[0088] Based on the segmented single-channel image and Lab color space, feature extraction is performed respectively, that is, the average color difference ΔH, ΔS, ΔV between the foreground and background areas is extracted in the threshold image of the segmented HSV color space, and the color difference values ​​ΔL, Δa, Δb are extracted in the Lab color space. Then, based on these 6 feature values, feature classification is performed using the SVM algorithm to obtain the first image to be tested and the second image to be tested.

[0089] Therefore, this embodiment considers the HSV color space and the Lab color space, performs threshold segmentation based on the local brightness ratio, and then extracts features in the two color spaces respectively, thereby greatly increasing the accuracy of the classification result.

[0090] In some embodiments, selecting a preset number of first sampling points on the first image to be tested, and determining the pattern color difference according to the first sampling points and a standard template includes:

[0091] In the first image to be tested, the vertices and the center point of the four corners of the image are used as the first sampling points;

[0092] The first target color difference between each first sampling point in the Lab color space and the standard template in the Lab color space is calculated, and the average value of the first target color differences is calculated as the color difference of the first image to be tested.

[0093] In this embodiment, since the color uniformity of the first image to be tested is good at this time, it is not necessary to test all pixels on the image. It is only necessary to use the vertices and the center point of the four corners of the image as the first sampling points, and respectively calculate the first target color difference between these five points and the corresponding position of the standard target in the Lab color space, and finally calculate the average value to characterize the color difference of the first image to be tested. In this way, the detection efficiency can be greatly improved while ensuring the detection accuracy.

[0094] In some embodiments, the step of sampling the first image to be tested according to the adaptive sampling density algorithm to obtain the second sampling points, and determining the pattern color difference according to the second sampling points and the standard template includes:

[0095] Identify a color uniform region and a color non-uniform region of the first image to be tested, and use an adaptive sampling density algorithm to collect sampling points with different densities in the color uniform region and the color non-uniform region as second sampling points;

[0096] The second target color difference between each second sampling point in the Lab color space and the standard template in the Lab color space is calculated, and the root mean square error of the second target color difference is calculated as the color difference of the first image to be measured.

[0097] When the uniformity of the first image to be tested does not meet the preset conditions, in order to improve the detection efficiency, the present embodiment will perform partition sampling, that is, identify the color uniform area and the color non-uniform area of ​​the first image to be tested, and use the adaptive sampling density algorithm to collect sampling points of different densities in the color uniform area and the color non-uniform area, for example, the sub-area with uniform color only needs to collect 2-3 pixels, while the non-uniform area needs to collect more than a dozen or even more, which mainly depends on the algorithm learning and the size of the partition range. Preferably, an adaptive oversampling algorithm of a probability density function can be used, and a probability density function such as Rayleigh distribution is used to guide the oversampling process, and the samples are divided into safety, boundary and noise samples, and new samples are adaptively generated according to their distribution density and characteristics to achieve the purpose of balancing the data set. After the second sampling point is determined, the second target color difference between each second sampling point in the Lab color space and the standard template in the Lab color space is calculated, and the root mean square error of the second target color difference is calculated as the color difference of the first image to be tested. Compared with the first image to be tested, where the color uniformity is good and the average value is used, here, for the case of color unevenness, partition sampling is performed with more sampling points, and the root mean square error can better express the color difference fluctuation, so as to improve the detection accuracy.

[0098] In some embodiments, the method of performing feature matching between the SIFT feature and the standard template using a feature point matching algorithm to determine the pattern color difference includes:

[0099] The FLANN algorithm is used to match the feature descriptor of SIFT features with the feature descriptor of the standard template, and outliers are removed to obtain matching pairs;

[0100] Calculate the Euclidean distance between matching pairs, and select matching pairs whose Euclidean distance is less than the confidence threshold as target matching pairs;

[0101] Extracting corresponding image regions from the second image to be tested and the standard template respectively based on the target matching pair, converting the image regions into Lab color space, and generating matching regions;

[0102] The color difference of each matching area is calculated, and the corresponding color difference average value is calculated according to the color difference of each matching area as the color difference of the second image to be tested.

[0103] In this embodiment, when the FLANN algorithm is used for descriptor matching, an efficient index structure is first constructed based on these descriptors, and then each SIFT feature descriptor in the image to be detected is used as a query item. First, outliers are removed, and then an approximate nearest neighbor search is performed on each query descriptor to find the most similar feature descriptor in the standard template. By setting a confidence threshold, matching pairs with too large distances are filtered to reduce mismatches, and matching pairs with Euclidean distances less than the confidence threshold are screened out as target matching pairs. Further, based on the target matching pair, corresponding image areas are extracted from the second image to be tested and the standard template, respectively, and the image areas are converted to Lab color space to generate matching areas; finally, the color difference of each matching area is calculated, and the corresponding color difference average value is calculated according to the color difference of each matching area as the color difference of the second image to be tested. Among them, when calculating the color difference of the matching area, the color difference detection method of the first image to be tested can be referred to, and no further description is given here.

[0104] Therefore, when detecting the second image to be tested, this embodiment mainly extracts SIFT features and detects pattern color difference through feature matching, thereby improving the accuracy of color difference detection when the texture features are relatively complex. Compared with the existing method of only using a unified detection method, the present invention first divides the image into a first image to be tested and a second image to be tested through SVM classification, and then provides a suitable color difference detection method for different images and different situations, thereby achieving a significant improvement in detection efficiency and detection accuracy while reducing detection costs.

[0105] See also Figure 3 In some embodiments, the present invention further provides a system for detecting color difference of printed patterns on corrugated paper boxes, the system comprising:

[0106] The image segmentation unit 100 is used to perform image segmentation on the printed pattern of the corrugated box to be tested, and classify the segmented images by using the SVM algorithm to obtain a first image to be tested and a second image to be tested;

[0107] The first image color difference detection unit 200 is used to obtain the color uniformity of the first image to be tested when detecting the color difference of the first image to be tested, and to determine whether the color uniformity meets a preset condition;

[0108] If yes, select a preset number of first sampling points on the first image to be tested, and determine the pattern color difference according to the first sampling points and the standard template;

[0109] If not, sampling is performed on the first image to be tested according to an adaptive sampling density algorithm to obtain second sampling points, and the pattern color difference is determined according to the second sampling points and the standard template;

[0110] The second image color difference detection unit 300 is used to extract features from the second image to be tested to obtain SIFT features, and to perform feature matching between the SIFT features and the standard template using a feature point matching algorithm to determine the pattern color difference when detecting the color difference of the second image to be tested.

[0111] See also Figure 4 In some embodiments, a system for detecting color difference of a printed pattern on a corrugated box further includes a parameter updating unit 400 for:

[0112] According to the color difference detection results of the first image to be tested and the second image to be tested, the color difference abnormality of the printed pattern of the corrugated box to be tested at the same detection position is calculated, and it is determined whether the color difference abnormality is greater than a preset threshold;

[0113] When it is determined that the color difference anomaly rate is greater than a preset threshold, an unsupervised algorithm is used to learn the current printing parameters and the corresponding color difference detection results, the current printing parameters are adaptively adjusted, and the updated printing parameters are used for the next printing process.

[0114] It can be understood that the functions or modules included in the system provided in this embodiment can be used to execute the method described in the above method embodiment. Its specific implementation can refer to the description of the above method embodiment. For the sake of brevity, it will not be repeated here.

[0115] The present invention also provides an electronic device, comprising: a processor and a memory, wherein the memory is used to store computer program code, the computer program code includes computer instructions, and when the processor executes the computer instructions, the electronic device executes a method as described in any possible implementation manner.

[0116] The present invention also provides a computer-readable storage medium, in which a computer program is stored. The computer program includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes a method as described in any possible implementation manner.

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

[0118] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. Those skilled in the art can also clearly understand that the descriptions of the various embodiments of the present invention have different focuses. For the convenience and brevity of description, the same or similar parts may not be repeated in different embodiments. Therefore, for parts not described or not described in detail in a certain embodiment, refer to the records of other embodiments.

[0119] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0120] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0121] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0122] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).

[0123] A person skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by a computer program to instruct the relevant hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned method embodiments. The aforementioned storage medium includes: a read-only memory (ROM) or a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

Claims

1. A method for detecting color difference of printed patterns on corrugated paper boxes, characterized in that: The method comprises: Perform image segmentation on the printed pattern of the corrugated box to be tested, and classify the segmented images by using the SVM algorithm to obtain a first image to be tested and a second image to be tested; When detecting the color difference of the first image to be tested, obtaining the color uniformity of the first image to be tested, and determining whether the color uniformity meets a preset condition; If yes, select a preset number of first sampling points on the first image to be tested, and determine the pattern color difference according to the first sampling points and the standard template; If not, sampling is performed on the first image to be tested according to an adaptive sampling density algorithm to obtain second sampling points, and the pattern color difference is determined according to the second sampling points and the standard template; When detecting the color difference of the second image to be tested, feature extraction is performed on the second image to be tested to obtain SIFT features, and feature matching is performed between the SIFT features and the standard template using a feature point matching algorithm to determine the pattern color difference.

2. The method for detecting color difference of printed patterns on corrugated paper boxes according to claim 1, characterized in that: The method further comprises: According to the color difference detection results of the first image to be tested and the second image to be tested, the color difference abnormality of the printed pattern of the corrugated box to be tested at the same detection position is calculated, and it is determined whether the color difference abnormality is greater than a preset threshold; When it is determined that the color difference anomaly rate is greater than a preset threshold, an unsupervised algorithm is used to learn the current printing parameters and the corresponding color difference detection results, the current printing parameters are adaptively adjusted, and the updated printing parameters are used for the next printing process.

3. The method for detecting color difference of printed patterns on corrugated paper boxes according to claim 1, characterized in that: The method of classifying the segmented images by using the SVM algorithm includes: Preprocessing the segmented images, including format unification and median filtering; Perform color space conversion on several preprocessed images, including conversion into HSV color space and Lab color space respectively; Separate the channels of the HSV color space, calculate the local brightness ratio based on the separated single-channel image, and segment the single-channel image according to the size of the local brightness ratio; Based on the segmented single-channel image and Lab color space, feature extraction is performed respectively, and the extracted features are classified using the SVM algorithm.

4. The method for detecting color difference of printed patterns on corrugated paper boxes according to claim 1, characterized in that: The method also includes: using a trained convolutional neural network model to identify the color uniformity of the first image to be tested.

5. The method for detecting color difference of printed patterns on corrugated paper boxes according to claim 1, characterized in that: The step of selecting a preset number of first sampling points on the first image to be tested and determining the pattern color difference according to the first sampling points and the standard template includes: In the first image to be tested, the vertices and the center point of the four corners of the image are used as the first sampling points; The first target color difference between each first sampling point in the Lab color space and the standard template in the Lab color space is calculated, and the average value of the first target color differences is calculated as the color difference of the first image to be tested.

6. The method for detecting color difference of printed patterns on corrugated paper boxes according to claim 1, characterized in that: The method of sampling the first image to be tested in a partitioned manner according to the adaptive sampling density algorithm to obtain a second sampling point, and determining the pattern color difference according to the second sampling point and the standard template includes: Identify a color uniform region and a color non-uniform region of the first image to be tested, and use an adaptive sampling density algorithm to collect sampling points with different densities in the color uniform region and the color non-uniform region as second sampling points; The second target color difference between each second sampling point in the Lab color space and the standard template in the Lab color space is calculated, and the root mean square error of the second target color difference is calculated as the color difference of the first image to be measured.

7. The method for detecting color difference of printed patterns on corrugated paper boxes according to claim 1, characterized in that: The method of using a feature point matching algorithm to perform feature matching on the SIFT feature and the standard template to determine the pattern color difference includes: The FLANN algorithm is used to match the feature descriptor of SIFT features with the feature descriptor of the standard template, and outliers are removed to obtain matching pairs; Calculate the Euclidean distance between matching pairs, and select matching pairs whose Euclidean distance is less than the confidence threshold as target matching pairs; Extracting corresponding image regions from the second image to be tested and the standard template respectively based on the target matching pair, converting the image regions into Lab color space, and generating matching regions; The color difference of each matching area is calculated, and the corresponding color difference average value is calculated according to the color difference of each matching area as the color difference of the second image to be tested.

8. A corrugated box printing pattern color difference detection system, characterized in that: The system comprises: An image segmentation unit is used to perform image segmentation on the printed pattern of the corrugated box to be tested, and classify the segmented images by using a SVM algorithm to obtain a first image to be tested and a second image to be tested; A first image color difference detection unit is used to obtain the color uniformity of the first image to be tested when detecting the color difference of the first image to be tested, and to determine whether the color uniformity meets a preset condition; If yes, select a preset number of first sampling points on the first image to be tested, and determine the pattern color difference according to the first sampling points and the standard template; If not, sampling is performed on the first image to be tested according to an adaptive sampling density algorithm to obtain second sampling points, and the pattern color difference is determined according to the second sampling points and the standard template; The second image color difference detection unit is used to extract features from the second image to be tested to obtain SIFT features when detecting the color difference of the second image to be tested, and to perform feature matching between the SIFT features and the standard template using a feature point matching algorithm to determine the pattern color difference.

9. An electronic device, characterized in that: include: A processor and a memory, wherein the memory is used to store computer program codes, wherein the computer program codes include computer instructions, and when the processor executes the computer instructions, the electronic device executes the method for detecting color difference of printed patterns of corrugated boxes as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes the method for detecting color difference of a printed pattern of a corrugated cardboard box according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for compensating chroma of images

    CN101771825A

  • Method for identifying vehicle color at traffic monitoring point

    CN106203420A

  • Method and device for automatically detecting color difference of label paper

    CN115829932A

  • Laser marking control method and system adaptive to marking workpiece surface attributes

    CN115837520A

  • Ceramic tile color difference detection method and device, electronic equipment and storage medium

    CN116580110A

Cited By

  • Corrugated carton chromatic aberration area detection method based on edge guiding and differential attention mechanism

    CN119741285A

  • Corrugated board strength detection method and system

    CN119860983A

  • A corrugated cardboard strength detection method and system

    CN119860983B