Online colorimetry method for printed products based on machine vision

By using machine vision technology during the printing process, combined with the color characteristics of the CIE XYZ color space, the accurate registration area and pixel search are obtained, and the problem of printing color judgment error and low manual color comparison efficiency is solved, achieving high efficiency , accurate printing color comparison.

CN119251321BActive Publication Date: 2025-02-07WEINAN DADONG PRINTING PACKING MASCH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411759647.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-02-07
Estimated Expiration
2044-12-03

AI Technical Summary

Technical Problem

There may be errors in the judgment of the color of the printed product in the prior art, and traditional artificial colorimetrics are easily affected by subjective factors and have low efficiency.

Method used

Using machine vision-based printing color online color comparison method, the template image and image to be detected are analyzed, combined with the color characteristics of the CIE XYZ color space, the accurate registration area is obtained, and the range size and maximum registration area are The best search direction searches the corresponding pixel points to be measured in the image to be detected, and the color of the printed product is colored.

Benefits of technology

Improves the accuracy and efficiency of colorimetric results, reduces the amount of search calculations, and is suitable for real-time processing and online applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119251321B_ABST
    Figure CN119251321B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of image processing, and in particular to an online colorimetric method for printed product colors based on machine vision, the method comprising: collecting a template image of a printed product and an image to be detected; obtaining a plurality of closed edge regions in the template image; screening out a registration region from the plurality of closed edge regions; searching for a corresponding pixel point to be detected in the image to be detected for any pixel point in the template image according to the size of the registration region; obtaining a colorimetric result of the printed product color based on the color difference value of each pixel point and the corresponding pixel point to be detected; that is, the scheme of the present invention can accurately detect the color of the printed product.
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 processing, and more particularly to an online colorimetric method for printed product colors based on machine vision. Background Art

[0002] During the printing process, due to aging of printing equipment, improper printing process, differences in ink materials, etc., the color of the actual printed product will deviate from the color of the standard printed product. Traditional manual colorimetry is easily affected by subjective factors, the colorimetry results will have certain deviations and are time-consuming, labor-intensive and inefficient. Therefore, most people use machine vision technology to perform online colorimetry of printed products to improve the accuracy and efficiency of colorimetry.

[0003] At present, there are more and more studies on online detection of printed image colors using machine vision technology. For example, in the Journal of Xi'an University of Technology, Vol. 29, No. 2, 2013, there is an article titled "Design of Online Detection System for Printed Image Color Based on Machine Vision", which discloses the research on methods such as image registration, standard template establishment and color space conversion in the system. From the perspective of reducing detection time, a detection strategy combining rough inspection and fine inspection and a small neighborhood multi-region template registration method based on edge features are proposed.

[0004] Among them, the small neighborhood multi-region template registration method based on edge features in the above scheme can capture local feature changes in the image, which is particularly important for online color comparison. Since only edge and small neighborhood information is processed, this method usually has a small amount of calculation and is suitable for real-time processing and online applications.

[0005] However, the reference area for registration in the above scheme is a small sub-area with obvious edge areas in each area of ​​the standard template image (dividing the entire image into different areas) and selecting it as the reference area. That is, the edge pixels of the reference area are roughly selected, which may divide pixels of different colors together, thereby causing the subsequent registration and color comparison to be inaccurate. Summary of the invention

[0006] The purpose of the present invention is to propose an online colorimetric method for printed product based on machine vision, so as to solve the problem that there may be errors in the color judgment of printed products in the prior art.

[0007] The invention provides a method for online colorimetry of printed products based on machine vision, comprising:

[0008] Collect the template image of the printed product and the image to be detected;

[0009] Acquire multiple closed edge regions in the template image; filter out the registration region from the multiple closed edge regions;

[0010] According to the size of the registration area, the corresponding pixel to be tested in the image to be tested of any pixel in the template image is searched; based on the color difference value of each pixel and the corresponding pixel to be tested, the color comparison result of the printed product color is obtained;

[0011] The closed edge area is:

[0012] Calculate the probability of each pixel in the template image for:

[0013] ; ; is the total number of pixels in the template image, is a function, For the The number of neighboring pixels of a pixel, For the The semi-major axis of the MacAdam ellipse at the pixel, , Respectively Pixel point and the i-th neighboring pixel point The approximate index of the first Pixels and Neighboring Pixels similar situation; when the probability is greater than or equal to the set value, the corresponding pixel point is the key edge point; obtain the closed edge area surrounded by the key edge point and the corresponding target point; the target point is the neighborhood pixel point of the key edge point and is on or inside the MacAdam ellipse.

[0014] In the above scheme, the probability of the edge of each pixel in the template image is first analyzed. Compared with the existing edge detection algorithm, the color feature (distance) in the CIE XYZ color space is introduced to obtain an accurate registration area. Then, the pixel points in the image to be detected are searched purposefully according to the range of the registration area to find the pixel points to be detected that truly correspond to each pixel point in the template image, and the colorimetry of the printed product is performed. The above scheme not only improves the search efficiency, but also improves the accuracy of the colorimetry results.

[0015] Optionally, the process of acquiring the neighborhood pixels is as follows:

[0016] Obtain the approximate index between any pixel point in the template image and the remaining other pixels;

[0017] The other pixels corresponding to the approximate index being greater than or equal to the threshold are regarded as the neighborhood pixels.

[0018] The above scheme can accurately screen out neighboring pixel points that are close to any pixel point and belong to the same printing area through the approximate index.

[0019] Optionally, the approximate index for: ;

[0020] in, , Respectively The gradient value and gradient direction of the pixel point; , Respectively The gradient value and gradient direction of the pixel point, It is Pixel and The normalized Euclidean distance value of the pixel.

[0021] Optionally, the neighborhood pixel points are pixel points within four neighborhoods or pixel points within eight neighborhoods.

[0022] Optionally, the step of determining the best search direction is further included, specifically:

[0023] The optimal search direction is the angle between the line connecting the two centroids of the registration area and the area to be registered and the vertical axis in the image coordinate system; the area to be registered is:

[0024] A morphological dilation method is used to extract multiple regions to be detected in the image to be detected;

[0025] The area to be measured that meets at least two of the following conditions is used as the area to be registered;

[0026] Among them, condition one: the shapes of the area to be measured and the registration area are similar;

[0027] Condition 2: The absolute value of the difference between the number of pixels in the registration area and the number of pixels in the test area is less than the difference threshold;

[0028] Condition 3: The Euclidean distance between the centroid of the registration area and the centroid of the area to be measured is the smallest.

[0029] In the above scheme, the search efficiency can be further improved by determining the best search direction.

[0030] Optionally, the step of selecting a registration region from a plurality of closed edge regions comprises:

[0031] The shape regularity of each closed edge region is calculated, and the closed edge region with the maximum shape regularity is used as the registration region; the shape regularity is: ;

[0032] in, For the The shape regularity of the closed edge area, For the The total number of pixels in the closed edge area, It is The area of ​​the minimum enclosing rectangle of the closed edge area, Represents the normalization function.

[0033] In the above scheme, by analyzing the shapes of different closed edge regions, it is possible to obtain a registration region that is closest to the target in the printing process of the printed product.

[0034] Optionally, the searching for a corresponding pixel point to be detected in the image to be detected of any pixel point in the template image includes: taking any pixel point in the template image as a target pixel point;

[0035] Taking the initial position corresponding to the target pixel in the template image as the center, the pixel to be tested is searched in the image to be tested according to the area size of the registration area and the optimal search direction, the chromaticity difference between each pixel to be tested and any pixel is calculated, and the pixel to be tested whose chromaticity difference falls within the tolerance range is selected to correspond to the target pixel.

[0036] The above scheme introduces chromaticity difference, takes into account the influence of visual differences of human eyes on colors, and can accurately search for the pixel points to be tested corresponding to each pixel point in the template image.

[0037] Optionally, obtaining the colorimetric result of the printed product based on the color difference value of each pixel point and the corresponding pixel point to be tested includes: calculating the color difference average of the color difference values ​​of all pixels and the corresponding pixel point to be tested, and in response to the color difference average being greater than or equal to a color difference threshold, the color of the printed product is unqualified.

[0038] Optionally, the MacAdam ellipse is obtained by converting key edge points in the template image from an RGB color space to a CIE XYZ color space.

[0039] Optionally, before calculating the gradient value and the gradient direction, a step of graying the template image is also included.

[0040] The beneficial effects of the present invention are:

[0041] The scheme of the present invention analyzes the template image and the image to be detected, and combines the color difference of the human eye to give a registration area to determine the area range for searching the pixel points to be detected and the optimal search direction. It can accurately find the pixel points to be detected corresponding to the pixel points in the template image to realize the colorimetry of the image to be detected of the printed product. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0043] Figure 1 The flowchart of the steps of the online colorimetric method of printed product based on machine vision is schematically shown;

[0044] Figure 2 The flowchart of the steps of obtaining the registration area of ​​the online colorimetric method of printed product color based on machine vision is schematically shown. DETAILED DESCRIPTION

[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are 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 those skilled in the art without creative work are within the scope of protection of the present invention.

[0046] like Figure 1 As shown, the online colorimetric method for printed product based on machine vision in this embodiment includes the following steps:

[0047] Step S1, obtaining a template image of a printed product and an image to be detected during printing. Specifically, an industrial camera is used to collect a surface image of a printed product on a printing production line, and the surface image is preprocessed to obtain a preprocessed image to be detected. The surface image reflects the instantaneous state of the actual printing process, including the presentation of colors and patterns, etc.

[0048] In this embodiment, when shooting, the lighting environment is required to be sufficient and uniform. At the same time, since the paper may have a certain degree of reflection, the printed details in the captured surface image may be blurred by the light reflection, and the internal components of the camera will generate thermal noise during the printing process. Therefore, the surface image needs to be pre-processed to improve the image quality.

[0049] The template image in this embodiment can be obtained by acquiring a standard image of a standard drawing. That is, the standard image is usually a printed sample, and its color, contrast, brightness and other parameters meet the predetermined quality standards. The standard image is preprocessed to obtain the template image.

[0050] In this embodiment, the standard image is used as a reference benchmark for subsequent comparison with the surface image of the actually printed product to evaluate the printing quality of the printed product.

[0051] The steps of preprocessing the acquired standard image and surface image are as follows: denoising by a mean filtering algorithm, edge enhancement by using a Prewitt operator, and resizing, applying different tone mapping curves to local areas of the image by a local tone mapping algorithm to adjust the brightness and reduce the influence of reflective areas, etc.; obtaining a template image and an image to be detected after the above preprocessing.

[0052] Among them, the mean filtering algorithm, the Prewitt operator and the local tone mapping algorithm all belong to the existing technology and will not be described in detail here.

[0053] Step S2, extracting the registration area in the template image.

[0054] like Figure 2 As shown, the specific steps of extracting the registration area of ​​the template image in this embodiment are:

[0055] Step S21, obtaining key edge points in the template image.

[0056] In this embodiment, the process of obtaining key edge points is as follows:

[0057] First, the neighborhood pixels of each pixel in the template image are determined.

[0058] In one embodiment, the neighborhood pixel points may be pixel points within four neighborhoods or pixel points within eight neighborhoods.

[0059] Of course, as another method, the neighborhood pixel points in this embodiment can also obtain the gradient value and gradient direction of each pixel point in the template image, and then obtain the approximate index according to the gradient difference (gradient value difference and gradient direction difference) between any pixel point and the remaining other pixel points and the Euclidean distance. When the approximate index is greater than or equal to the threshold, the other pixel points corresponding to the approximate index are the neighborhood pixel points. At this point, all the neighborhood pixel points of any pixel point and the approximate index of each of its neighborhood pixel points can be obtained.

[0060] Before calculating the gradient value, the template image needs to be converted into a grayscale image, and the Sobel operator is used to obtain the gradient value of each edge pixel. The gradient value reflects the degree of brightness change of these edge pixels.

[0061] The template image Pixel point is used as an example for analysis. The pixel point is taken as the center, and the other pixels in the template image are calculated Approximate index of pixels.

[0062] In this embodiment, The pixel belongs to The approximate index within the neighborhood of a pixel is: ;

[0063] in, , Respectively The gradient value and gradient direction of the pixel point; , Respectively The gradient value and gradient direction of the pixel point, It is Pixel and The normalized Euclidean distance value of the pixel.

[0064] Indicates Normalized value of the gradient value difference of the pixel; Indicates The normalized value of the gradient direction difference of the pixel. The smaller the value of The pixel belongs to The greater the probability of a pixel being a neighboring pixel.

[0065] when When The pixel belongs to The pixel's neighborhood pixels. The above threshold The value can be 0.5, or it can be determined according to actual conditions.

[0066] In the above embodiment, according to The three features of pixel gradient value, gradient direction difference and Euclidean distance can determine the pixel with the first The pixels may visually belong to the same printed area.

[0067] Secondly, a MacAdam ellipse is constructed for each pixel point to determine the semi-major axis of the MacAdam ellipse corresponding to each pixel point.

[0068] In this embodiment, each pixel in the template image is converted from the RGB color space to the CIE XYZ color space, and the CIE XYZ coordinates corresponding to each pixel are obtained and converted into chromaticity coordinates, where X and Z both represent the chromaticity value in the CIE XYZ color space, and are also the horizontal and vertical coordinates in the CIE XYZ color space, and Y represents brightness.

[0069] In this embodiment, Take pixel points as an example for analysis:

[0070] (1) The RGB color value of the pixel is converted into the chromaticity value in the CIE XYZ color space. The RGB color value of the pixel is normalized to obtain , using the transformation matrix Convert normalized RGB values ​​to XYZ colorimetric values.

[0071] The conversion process is:

[0072] ;

[0073] (2) Normalize the obtained XYZ chromaticity value and calculate the corresponding CIE XY chromaticity value , : ;

[0074] (3) Based on CIE XY chromaticity value , , obtain the The MacAdam ellipse of the pixel point, where the MacAdam ellipse expression is: Among them, The chromaticity coordinates of the pixels are: , is the semi-major axis, is the semi-minor axis.

[0075] The above-mentioned conversion of pixels from RGB color space to CIE XYZ color space is prior art, so the conversion of each pixel is not described in detail. Meanwhile, the acquisition of MacAdam ellipse is prior art.

[0076] Then, based on the number of pixels in the neighborhood of each pixel, the semi-major axis corresponding to each pixel, and the Euclidean distance between each pixel and any pixel in its neighborhood, the probability of the corresponding pixel is calculated; when the probability is greater than the set value, the corresponding pixel is a key edge point.

[0077] First The pixel and its neighborhood Taking pixel points as an example, The probability that a pixel belongs to a key edge point is:

[0078] ;

[0079] in, For the The probability that a pixel belongs to a key edge point, is the total number of pixels in the template image, is a function whose value reflects the relationship between the a-th pixel and the i-th neighboring pixel. The Euclidean distance of the a-th pixel is different from the color feature of the semi-major axis. For the The number of pixels in the neighborhood of a pixel. For the The semi-major axis of the MacAdam ellipse at the pixel, , Respectively Pixel point and the i-th neighboring pixel point The approximate index of , the distance in the CIE XYZ color space, and i is the serial number of the pixel in the neighborhood.

[0080] in, Indicates The pixel point and the neighborhood The Euclidean distance between the chromaticity coordinates of the pixels converted from the RGB color space to the CIEXYZ color space.

[0081] It is The number of pixels n in the neighborhood of a pixel and the total number of pixels in the template image The ratio reflects the The ratio of the number of pixels that may visually belong to the same printed area to the total image. Indicates Semi-major axis and Euclidean distance of pixel points The difference may be positive (the semi-major axis is greater than , then it is proved that the i-th neighborhood pixel In the ellipse, the difference in color features between two pixels is small), or it may be negative (the i-th neighboring pixel The pixel is outside the ellipse, and the color difference between the two pixels is large). is the semi-major axis, which serves as a threshold; therefore, the probability needs to be calculated in different cases, where When it is less than 0, The value is ;when When it is greater than or equal to 0, The value of is 0. Means to take the average of the sum of the differences.

[0082] when Less than 0, The larger the value, the greater the probability that the a-th pixel belongs to a key edge point. When is larger, the difference between the a-th pixel and its neighboring pixels is greater, and the probability that the a-th pixel belongs to a key edge point is greater.

[0083] In this embodiment, the probability is compared with the set value to determine whether the pixel point corresponding to the probability is a key edge point. For example, when When , the ath pixel can be considered as a key edge point. The value can be 0.6, or it can be determined according to actual conditions.

[0084] According to the color difference between the ath pixel and its neighboring pixels (the distance between the chromaticity coordinates of the two pixels) and the gradient information, the probability that the ath pixel belongs to the key edge point is calculated, thereby determining the boundary of the corresponding printing area on the printed product surface.

[0085] Since conventional edge detection methods use gradient operators, they work well when processing images with obvious brightness changes. However, the rich pigments used in actual printing may result in little difference in color brightness on both sides of the edge, but the color itself is obviously different, which may make it impossible to effectively detect these edges by relying solely on the gradient operator. Therefore, in this embodiment, combining the color features of the pixel points in the CIE XYZ color space can avoid false detection and improve the accuracy of edge detection.

[0086] In this embodiment, the reason for extracting key edge points is that edge pixels are usually located in areas with significant color changes, which are crucial for image registration and color comparison. Therefore, using gradient features and color features can more accurately identify these edge pixels, thereby improving the efficiency of image processing.

[0087] Step S22: determining the closed edge region of each key edge point.

[0088] In this implementation, based on the determined key edge points, the closed edge region of the key edge points can be obtained. The specific process is as follows:

[0089] First, a target pixel point is obtained, where the target pixel point is a pixel point within the neighborhood of the key edge point and is on or inside the MacAdam ellipse.

[0090] Specifically, the For example, when the pixel Chromaticity coordinates of the pixel When substituting into the MacAdam ellipse expression of the a-th pixel, if , then it means If the chromaticity coordinates of a pixel point are within or on the MacAdam ellipse of the a-th pixel point, there is no edge between the two.

[0091] At this point, the number of pixels and pixels in the MacAdam ellipse of the a-th pixel among all the pixels in the neighborhood of the a-th pixel is obtained. .

[0092] The purpose of obtaining the target pixel point is to determine whether there is an edge between the pixel points in the neighborhood range of the a-th pixel point and the a-th pixel point, that is, whether there is color difference. If the pixel points in the neighborhood range are on or within the MacAdam ellipse, there is no color difference, otherwise, there is color difference.

[0093] Secondly, the positions of key pixels and target points in the template image are obtained, and the connected domain analysis method is used to obtain the closed edge area surrounded by the key pixels and multiple target points in the template image.

[0094] Exemplarily, taking the ath pixel point as an example, determine the target point (the target point is a pixel point on or inside the MacAdam ellipse of the ath pixel point among all the pixels in the neighborhood of the ath pixel point) and the coordinate position of the ath pixel point in the template image, and then use the connected domain analysis method to obtain the closed edge area enclosed by all the above pixel points.

[0095] Step S23: selecting a registration area from the multiple closed edge areas.

[0096] In one embodiment, any closed edge region may be randomly selected from a plurality of closed edge regions as the registration region.

[0097] As the most preferred embodiment, the specific process of selecting the registration area from multiple closed edge areas is as follows:

[0098] The shape regularity of each closed edge region is calculated, and the closed edge region with the highest shape regularity is used as the registration region in the template image.

[0099] Among them, the shape regularity is: ;

[0100] For the The shape regularity of the closed edge area, For the The total number of pixels (area) in the closed edge area, It is The area of ​​the minimum bounding rectangle that closes the edge region. Indicates normalization processing, sigmoid normalization can be used.

[0101] When the area of ​​the a-th closed edge region accounts for a larger area of ​​the minimum circumscribed rectangle of the a-th closed edge region, the shape regularity of the a-th closed edge region is greater.

[0102] The area of ​​the above minimum enclosing rectangle can be calculated using the boundingRect function in OPEN CV.

[0103] In this embodiment, the shape of each closed edge region is determined by setting a regularization threshold. Specifically, when the shape regularity of each closed edge region is greater than or equal to the regularization threshold, it is considered that the shape regularity of the corresponding closed edge region is high. When , it can be considered that the shape regularity of the ath closed edge region is high. The value of can be 0.6, and of course it can be determined according to actual conditions.

[0104] The acquisition of the above shape regularity mainly takes into account that the movement state of the printed product during the printing process is usually fixed, among which up and down, left and right translation is the most common printing method, and the edge area is slender and more like a rectangle, that is, the target of the printing area is closer to a rectangle. Therefore, a rectangle is used to measure the shape of each closed edge area. At the same time, because regular shapes are easier to find correspondence between images, the closed edge area with higher shape regularity has more reference significance for subsequent registration. The higher the shape regularity, the greater the possibility that the area is used as a registration area.

[0105] Step S3, searching for a corresponding pixel point to be detected in the image to be detected for any pixel point in the template image according to the size of the registration area.

[0106] In this embodiment, the pixel to be tested at the new position corresponding to each pixel in the template image in the image to be tested is searched according to the size of the area range of the registration area. For example, the position coordinates of pixel point A in the template image are , and the pixel point in the image to be detected that corresponds to the pixel point A in the template image may be the pixel point A' after the offset (at this time, the pixel points at the same position coordinates in the template image and the image to be detected no longer correspond). At this time, with the pixel point A as the center, according to the size of the area, the search is performed in different directions, and the chromaticity value of each traversed pixel point is compared with the chromaticity value of the pixel point A. When the difference is found to be within the tolerance range, the traversed corresponding point is recorded as the pixel point A'.

[0107] The above tolerance range is generally a 3rd-order MacAdam ellipse (3 times the standard deviation), where the MacAdam ellipse is usually described by "order", and "order" refers to the standard deviation. The 1st-order MacAdam ellipse refers to the standard deviation of the color matching result change that is 1 times the target color. By the same token, the meaning of the 3rd-order, 4th-order, etc.

[0108] Furthermore, in order to improve the search efficiency, the method also includes the step of determining the best search direction, specifically: obtaining the area to be registered of the image to be detected; and taking the angle between the line connecting the two centroids of the registration area and the area to be registered and the longitudinal axis in the image coordinate system as the best search direction.

[0109] The acquisition process of the area to be registered in the above is:

[0110] A morphological dilation method is used to extract multiple regions to be detected in the image to be detected;

[0111] The area to be measured that meets at least two of the following conditions is used as the area to be registered.

[0112] Among them, condition one: the shapes of the area to be tested and the registration area are similar. The above shape similarity can be determined by area, that is, the areas of the area to be tested and the registration area are calculated. When the areas are the same or close, the shapes of the area to be tested and the registration area are considered to be similar. The frequency domain characteristics of the shape can also be obtained by Fourier transforming the boundary between the area to be tested and the registration area to compare the similarity of the shapes.

[0113] Condition 2: The absolute value of the difference between the number of pixels in the registration area and the number of pixels in the test area is less than the difference threshold.

[0114] Condition 3: The Euclidean distance between the centroid of the registration region and the centroid of the region to be tested is the smallest. Specifically, the distance between each region to be tested and the registration region is the Euclidean distance between the centroid of the registration region and the centroid of each region to be tested, specifically: ; is the registration area to The Euclidean distance between the centroids of the regions to be tested, is the centroid of the registration region, For the The centroid of the area to be measured.

[0115] Among them, taking the kth area to be measured as the area to be registered as an example, the angle is: ; is the angle between the line from the registration area to the centroid of the area to be registered and the vertical axis in the image coordinate system, Represents the inverse tangent function.

[0116] It should be noted that this angle is the angle with the vertical direction. It represents the ratio of the difference between the ordinate and the abscissa of the centroids of the registration area and the area to be registered.

[0117] As another implementation, the angle between the line connecting the registration area and the centroid of each area to be measured and the vertical axis in the image coordinate system can be directly obtained (without obtaining the area to be registered), and the corresponding angle is used as the search direction, and all search directions are traversed in subsequent searches.

[0118] In this embodiment, the best direction for searching for matching can be the angle , can also be the angle range [ ,in, The value range of is 0.1°-0.5°, and the exemplary value is 0.5°, so as to ensure that the offset pixel point can be found within a certain range.

[0119] In this embodiment, the corresponding pixel to be tested of any pixel in the template image in the image to be tested is searched according to the size of the registration area and the optimal search direction. For example, with pixel A as the center, according to the optimal search range (the size of the registration area is taken as the optimal search range), the search is performed along the optimal search direction, and the chromaticity value of each pixel traversed is compared with pixel A. When the difference is found to be within the fixed tolerance, the traversed corresponding point is recorded as pixel A'.

[0120] Step S4, calculating the color difference between any pixel and the pixel to be detected at the position, and obtaining the average color difference of all the pixels to be detected. When the average color difference is greater than the color difference threshold, the color of the printed product is unqualified.

[0121] The calculation of the color difference value in this embodiment is a prior art and will not be described in detail here.

[0122] The scheme of the present invention analyzes the template image and the image to be detected to determine the area range and the optimal search direction for searching the pixel points to be detected, and can efficiently and accurately find the pixel points to be detected corresponding to the pixel points in the template image to achieve colorimetry of the image to be detected of the printed product.

[0123] In the description of this specification, “plurality” means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.

[0124] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.

Claims

1. A method for online colorimetry of printed products based on machine vision, characterized in that: include: Collect the template image of the printed product and the image to be detected; Obtain multiple closed edge regions in the template image; Screening out a registration region from a plurality of closed edge regions; According to the size of the registration area, the corresponding pixel to be tested in the image to be tested of any pixel in the template image is searched; based on the color difference value of each pixel and the corresponding pixel to be tested, the color comparison result of the printed product color is obtained; The closed edge area is: Calculate the probability of each pixel in the template image , specifically: ; ; is the total number of pixels in the template image, is a function, For the The number of neighboring pixels of a pixel, For the The semi-major axis of the MacAdam ellipse at the pixel, , Respectively Pixel and the i-th neighboring pixel The approximate index of the first Pixels and Neighboring Pixels Similar situations; When the probability is greater than or equal to the set value, the corresponding pixel point is a key edge point; the closed edge area surrounded by the key edge point and the corresponding target point is obtained; the target point is a neighboring pixel point of the key edge point and is on or inside the MacAdam ellipse; The process of obtaining the neighborhood pixels is as follows: Obtain the approximate index between any pixel point in the template image and the remaining other pixels; The other pixels corresponding to the approximate index being greater than or equal to the threshold are regarded as the neighborhood pixels; The approximate index for: ; in, , Respectively The gradient value and gradient direction of the pixel point; , Respectively The gradient value and gradient direction of the pixel point, It is Pixel and The normalized Euclidean distance value of the pixel.

2. The online colorimetric method for printed product based on machine vision according to claim 1, characterized in that: The neighborhood pixel points are pixel points within four neighborhoods or pixel points within eight neighborhoods.

3. The online colorimetric method for printed product based on machine vision according to claim 1, characterized in that: It also includes the step of determining the best search direction, specifically: The optimal search direction is the angle between the line connecting the two centroids of the registration area and the area to be registered and the vertical axis in the image coordinate system; the area to be registered is: A morphological dilation method is used to extract multiple regions to be detected in the image to be detected; The area to be measured that meets at least two of the following conditions is used as the area to be registered; Among them, condition one: the shapes of the area to be measured and the registration area are similar; Condition 2: The absolute value of the difference between the number of pixels in the registration area and the number of pixels in the test area is less than the difference threshold; Condition 3: The Euclidean distance between the centroid of the registration area and the centroid of the area to be measured is the smallest.

4. The online colorimetric method for printed product based on machine vision according to claim 1, characterized in that: The step of selecting a registration region from a plurality of closed edge regions comprises: The shape regularity of each closed edge region is calculated, and the closed edge region with the maximum shape regularity is used as the registration region; the shape regularity is: ; in, For the The shape regularity of the closed edge area, For the The total number of pixels in the closed edge area, It is The area of ​​the minimum enclosing rectangle of the closed edge area, Represents the normalization function.

5. The online colorimetric method for printed product based on machine vision according to claim 3, characterized in that: The searching for a corresponding pixel point to be detected of any pixel point in the template image in the image to be detected comprises: taking any pixel point in the template image as a target pixel point; Taking the initial position corresponding to the target pixel in the template image as the center, the pixel to be tested is searched in the image to be tested according to the area size of the registration area and the optimal search direction, the chromaticity difference between each pixel to be tested and any pixel is calculated, and the pixel to be tested whose chromaticity difference falls within the tolerance range is selected to correspond to the target pixel.

6. The online colorimetric method for printed product based on machine vision according to claim 1, characterized in that: The color comparison result of the printed product color is obtained based on the color difference value of each pixel point and the corresponding pixel point to be tested, including: calculating the color difference average of the color difference values ​​of all pixels and the corresponding pixel point to be tested, and in response to the color difference average being greater than or equal to the color difference threshold, the color of the printed product is unqualified.

7. The online colorimetric method for printed product based on machine vision according to claim 1, characterized in that: The MacAdam ellipse is obtained by converting key edge points in the template image from the RGB color space to the CIE XYZ color space.

8. The method for online colorimetry of printed products based on machine vision according to claim 1, characterized in that: Before calculating the gradient value and the gradient direction, the method also includes the step of graying the template image.

Citation Information

Patent Citations

  • Method and arrangement for the automatic verification of the visually perceived color impression of multi-color images

    CN102016555A

  • Printed circuit board welding spot abnormity detection method based on machine vision

    CN115184380A