High-precision tiny chromatic aberration detection method and device

By extracting the overall color characteristics, single color characteristics and color torque of the pupil image, calculate the color difference and comprehensively obtain the color similarity characteristics, solve the problem of inefficient and inaccurate detection of tiny color difference in the existing technology, and achieve high precision high precision , Stable and consistent color difference detection effect.

CN119339112AActive Publication Date: 2025-01-21SIGMA SQUARES (BEIJING) TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411474235.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-22
Publication Date
2025-01-21
Estimated Expiration
2044-10-22

AI Technical Summary

Technical Problem

The prior art is difficult to detect the tiny color difference in the contact lens pad printing pattern with high accuracy, resulting in low quality inspection efficiency and poor accuracy, and strong subjectivity of manual inspection, which is easy to cause errors.

Method used

Adopt a high -precision tiny color difference detection method. By obtaining the pupil image and template image, the overall color characteristics, single color characteristics and color torque are extracted after pre -processing, calculating the overall color difference, monochrome color difference and local color difference. Similarity characteristics.

Benefits of technology

It improves the detection capacity of tiny color difference, can adapt to a variety of color difference detection scenarios. As a result, it can reproduce, high stability and consistency, reduce labor costs, save time, and increase the yield of production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119339112A_ABST
    Figure CN119339112A_ABST
Patent Text Reader

Abstract

The invention relates to the field of machine vision, in particular to a high-precision small color difference detection method and device, which comprehensively obtains color similarity characteristic quantity by extracting monochromatic color difference, overall color difference and local color difference of a cosmetic contact lens image, and improves the detection capability of small color difference. The threshold value of the color similarity can be adjusted according to different patterns or different detection standards, so that the method adapts to various color difference detection scenes; the requirement on an imaging system is low, the result can be reproduced, and the stability and the consistency are high. Based on a machine vision method, a high-resolution color imaging method is utilized to obtain a casting mold image of a printed pattern, an image processing technology and a machine learning technology are utilized to analyze the image, and a method combining overall and local chromatic aberration is provided to simulate and quantify a judgment standard of human eyes. According to the method, the speed is high, the real-time performance is high, the consistency is good, the omission ratio is low, and the purposes of reducing the labor cost, saving the time and improving the production yield can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine vision, and in particular to a high-precision minute color difference detection method and device. Background Art

[0002] In recent years, colored contact lenses (cosmetic lenses) printed with colorful and diverse patterns have been very popular among consumers. Major contact lens manufacturers have begun to use cosmetic contact lenses as their main products. Compared with the production process of transparent contact lenses, the production process of cosmetic contact lenses has added a printing process. The designed pattern is transferred by pad printing equipment and printed in different colors onto the mold, and then the pattern is transferred to the lens through processes such as color fixing, filling and mold closing.

[0003] The pad printing process is a flexible printing process. It uses a curved pad printing head made of silicone material to dip the ink on the gravure plate onto the surface of the pad printing head. The pad printing machine takes the image on a laser-etched steel plate with a designed pattern, and then presses it on the surface of the convex mold to achieve a single-layer pattern transfer. By repeating this process, up to 6 color patterns can be printed on the surface of the male mold. Because the monochrome pattern of cosmetic contact lenses is usually composed of dot or line textures, it is subject to mechanical precision. Slight overprinting deviation and rotation are inevitable after multi-layer pattern overprinting. The color difference in this scenario is difficult to quantitatively measure using existing instruments such as colorimeters. Existing image-based color difference detection methods can only process single color blocks or patterns with very high overprinting accuracy. At present, color difference detection of contact lens molds after pad printing mainly relies on human eye recognition. Due to the complex color difference in this scenario, quality inspection workers on the production line usually need several months of training before they can perform color difference detection. In addition, due to efficiency requirements, hundreds of molds are usually observed at one time, and small color differences are easily missed. In addition, manual quality inspection is highly subjective, which can easily lead to inconsistent conclusions from each person, or even inconsistent conclusions from multiple observations by the same person. Therefore, color difference detection of contact lens pad-printed patterns has always been a difficult problem for manufacturers. Summary of the invention

[0004] In view of this, an object of the present invention is to provide a high-precision minute color difference detection method and device to solve the problems in the prior art.

[0005] In order to achieve the above object, the present invention adopts the following technical solutions:

[0006] A high-precision minute color difference detection method of the present invention comprises the steps of:

[0007] Acquire a beauty pupil image and a template image, and preprocess the beauty pupil image to obtain a first preprocessed image, and preprocess the template image to obtain a second preprocessed image;

[0008] Extracting the overall color features and the single color features of the first preprocessed image, extracting the overall color features and the single color features of the second preprocessed image, and extracting the color moment of the first preprocessed image and the color moment of the second preprocessed image;

[0009] Calculating the overall color difference between the beauty pupil image and the template image based on the overall color features of the first preprocessed image and the overall color features of the second preprocessed image, calculating the monochrome color difference between the beauty pupil image and the template image based on the single color features of the first preprocessed image and the single color features of the second preprocessed image, and judging whether there is local color difference in the beauty pupil image based on the color moment of the first preprocessed image and the color moment of the second preprocessed image, wherein when the difference between the color moment of the first preprocessed image and the color moment of the second preprocessed image is greater than a preset threshold, there is local color difference;

[0010] The beauty pupil image is detected based on the overall color difference, the monochromatic color difference and the local color difference.

[0011] In one embodiment of the present application, preprocessing the beauty pupil image to obtain a first preprocessed image, and preprocessing the template image to obtain a second preprocessed image, including:

[0012] Convert the beauty pupil image from RGB channels to LAB channels to obtain a first LAB image, and convert the template image from RGB channels to LAB channels to obtain a second LAB image;

[0013] Performing channel separation on the first LAB image to obtain a first L channel image, a first A channel image, and a first B channel image; and performing channel separation on the second LAB image to obtain a second L channel image, a second A channel image, and a second B channel image;

[0014] Gaussian filtering is performed on the first L channel image and the second L channel image to obtain a first L G Image and second L G image;

[0015] The first L G The image, the first A channel image and the first B channel image are fused to obtain a first L G AB image, and the second L G The image, the second A channel image and the second B channel image are fused to obtain the second L G AB image;

[0016] For the first L G AB image and the second L GThe image is segmented by threshold value to obtain a first mask image of the color ring in the printed area of ​​the cosmetic pupil image and a second mask image of the color ring in the printed area of ​​the template image;

[0017] The beauty pupil image is morphologically eroded based on the first mask image to obtain a first preprocessed image; and the template image is morphologically eroded based on the second mask image to obtain a second preprocessed image.

[0018] In one embodiment of the present application, extracting the overall color features of the first preprocessed image and extracting the overall color features of the second preprocessed image include:

[0019] extracting a first image histogram of the first preprocessed image, and extracting a second image histogram of the second preprocessed image;

[0020] The first image histogram is smoothed, and the smoothed first image histogram is used as the overall color feature of the first preprocessed image; the second image histogram is smoothed, and the smoothed second image histogram is used as the overall color feature of the second preprocessed image.

[0021] In one embodiment of the present application, extracting a single color feature of the first preprocessed image and extracting a single color feature of the second preprocessed image include:

[0022] Convert the first preprocessed image and the second preprocessed image into v space to obtain a first HSV image of the beauty pupil image and a second HSV image of the template image;

[0023] The V channel and the S channel of the first HSV image are subtracted to obtain a first difference image I V-S , and subtract the V channel and S channel of the second HSV image to obtain a second difference image I V-S ';

[0024] The first difference image I V-S and the second difference image I V-S 'Perform adaptive threshold segmentation to obtain the first difference image I V-S Binarized background image I B and the second difference image I V-S 'The binary background image I B ';

[0025] For the binary background image I B and the binary background image I B ' Take the inversion to obtain the first mask image I of the color point area of ​​the first pre-processed image MFand a second mask image I of the color point area of ​​the second preprocessed image MF ';

[0026] Extract the first mask image I MF The intersection area with the first pre-processed image is obtained to obtain a first color image I of the color point area of ​​the first pre-processed image D , take the second mask image I MF 'The intersection area with the first pre-processed image is used to obtain a second color image I of the color point area of ​​the second pre-processed image D ';

[0027] For the first color image I D and the second color image I D ' to cluster the non-zero pixel sequence in the image to obtain multiple colors and multiple color centers; and to segment the image using the multiple color centers as the origin to obtain the first color image I D and the second color image I D ', wherein each color category includes a plurality of pixels;

[0028] The proportion, pixel density, color center brightness, and color center of each color category are counted to obtain a single color feature of the first preprocessed image and a single color feature of the second preprocessed image.

[0029] In one embodiment of the present application, extracting the color moment of the first preprocessed image and the color moment of the second preprocessed image includes:

[0030] Extract the binary background image I B The first pre-processed image is obtained by intersecting the first color image I D as the first foreground image of the first preprocessed image; and extracting the binary background image I B ' and the intersection area of ​​the second pre-processed image, obtain the second background image of the second pre-processed image, and convert the second color image I D 'A second foreground image as the second preprocessed image;

[0031] Calculate the first-order color moment E of multiple partitions of the target image i and the second-order color moment σ i , wherein the target image includes the first foreground image, the second foreground image, the first background image and the second background image, and the multiple partitions are multiple areas equally divided by the width of the color ring of the beauty contact lens;

[0032]

[0033]

[0034] Where P ij is the pixel value of the pixel with coordinates (i, j), and N is the number of pixels in the partition.

[0035] In one embodiment of the present application, calculating the overall color difference between the beauty pupil image and the template image based on the overall color features of the first preprocessed image and the overall color features of the second preprocessed image includes:

[0036] A histogram difference ΔH and a histogram similarity C between the overall color features of the first preprocessed image and the overall color features of the second preprocessed image are calculated to obtain an overall color difference.

[0037] In one embodiment of the present application, calculating the monochromatic color difference between the beauty pupil image and the template image based on the single color feature of the first preprocessed image and the single color feature of the second preprocessed image includes:

[0038] The color center brightness difference ΔL, the color center color difference ΔE, and the density difference ΔD of each color category in the first preprocessed image and the corresponding color category in the second preprocessed image are calculated to obtain a monochromatic color difference.

[0039] In one embodiment of the present application, the beauty pupil image is detected based on the overall color difference, the monochromatic color difference and the local color difference, including:

[0040] Calculating the color similarity between the beauty pupil image and the template image based on the monochromatic color difference and the overall color difference;

[0041] When the color similarity is greater than or equal to a preset similarity threshold, it is determined that there is no overall color difference and monochromatic color difference, and the beauty pupil image is detected whether there is local color difference to obtain a detection result;

[0042] When the color similarity is less than a preset similarity threshold, comparing the histogram similarity C with a preset correlation threshold;

[0043] When the histogram similarity C is less than a preset correlation threshold, it is determined that there is an overall color difference; when the histogram similarity C is greater than or equal to the preset correlation threshold, the histogram difference ΔH is compared with a preset difference threshold;

[0044] When the histogram difference ΔH is greater than or equal to a preset difference threshold, the histogram distance between the histogram and a preset histogram template is calculated; when the histogram distance is less than the preset distance threshold, it is determined that only monochromatic color difference exists; when the histogram distance is greater than or equal to the preset distance threshold, it is determined that there is overall color difference and monochromatic color difference and the single color with color difference is determined; when the histogram difference ΔH is less than the preset difference threshold, it is determined that there is no overall color difference and monochromatic color difference, and the beauty pupil image is detected whether there is local color difference to obtain a detection result.

[0045] In one embodiment of the present application, calculating the color similarity between the beauty pupil image and the template image based on the monochromatic color difference and the overall color difference includes:

[0046] The color similarity z is constructed based on the histogram difference ΔH, the histogram similarity C, the color center brightness difference ΔL, the color center color difference ΔE and the density difference ΔD. The mathematical expression of the color similarity z is:

[0047] z=w 0 +w 1 ΔH+w 2 C+w 3 ΔL+w 4 ΔE+w 5 ΔD

[0048] In the formula, w 0 is the offset, w 1 is the first weighting coefficient, w 2 is the second weighting coefficient, w 3 is the third weighting coefficient, w 4 is the fourth weighting coefficient, w 5 is the fifth weighting coefficient; wherein the offset w 0 , the first weighting coefficient w 1 The second weighting coefficient w 2 , the third weighting coefficient w 3 , the fourth weighting coefficient w 4 and the fifth weighting coefficient w 5 Methods for determining include:

[0049] Acquire sample data, wherein the sample data includes a histogram difference ΔH', a histogram similarity C', a color center brightness difference ΔL', a color center color difference ΔE', a density difference ΔD' and a label of the sample image;

[0050] Constructing training data based on the sample data;

[0051] The logistic regression model is fitted based on the training data to obtain the offset w0 , the first weighting coefficient w 1 The second weighting coefficient w 2 , the third weighting coefficient w 3 , the fourth weighting coefficient w 4 and the fifth weighting coefficient w 5 , wherein the mathematical expression of the logistic regression model is:

[0052]

[0053] Where y is the label.

[0054] The present application also provides a high-precision minute color difference detection device, comprising:

[0055] An acquisition and preprocessing module, used for acquiring a beauty pupil image and a template image, and preprocessing the beauty pupil image to obtain a first preprocessed image, and preprocessing the template image to obtain a second preprocessed image;

[0056] a feature extraction module, configured to extract overall color features and single color features of the first preprocessed image, extract overall color features and single color features of the second preprocessed image, and extract color moments of the first preprocessed image and color moments of the second preprocessed image;

[0057] a calculation module, configured to calculate the overall color difference between the beauty pupil image and the template image based on the overall color features of the first preprocessed image and the overall color features of the second preprocessed image, calculate the monochrome color difference between the beauty pupil image and the template image based on the single color features of the first preprocessed image and the single color features of the second preprocessed image, and determine whether there is local color difference in the beauty pupil image based on the color moment of the first preprocessed image and the color moment of the second preprocessed image, wherein when the difference between the color moment of the first preprocessed image and the color moment of the second preprocessed image is greater than a preset threshold, there is local color difference;

[0058] A detection module is used to detect the beauty pupil image based on the overall color difference, the monochromatic color difference and the local color difference.

[0059] The beneficial effects of the present invention are as follows: a high-precision minute color difference detection method and device of the present invention obtains color similarity feature quantity by extracting the monochromatic color difference, overall color difference and local color difference of the beauty pupil image, thereby improving the detection ability of minute color difference; the color similarity threshold can be adjusted for different patterns or different detection standards, so as to adapt to a variety of color difference detection scenarios; the imaging system has low requirements, and the results are reproducible, stable and consistent. This application is based on a machine vision method, uses a high-resolution color imaging method to obtain a mold image of a printed pattern, uses image processing technology and machine learning technology to analyze the image, and proposes a method that combines overall and local color difference to simulate and quantify the judgment standard of the human eye, and judges whether the corresponding product has color difference. The method is fast, has high real-time performance, good consistency, and low missed detection rate, which can achieve the purpose of reducing labor costs, saving time, and improving production yield. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:

[0061] Figure 1 Schematic diagram of the slight color difference caused by the difference in printing density shown in this application;

[0062] Figure 2 is a flow chart of a high-precision minute color difference detection method shown in an embodiment of the present application;

[0063] Figure 3 Schematic diagram of the color difference detection process in one embodiment of the present application;

[0064] Figure 4 It is a structural diagram of a high-precision minute color difference detection device shown in one embodiment of the present application. DETAILED DESCRIPTION

[0065] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0066] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show the layers related to the present invention rather than being drawn according to the number, shape and size of the layers in actual implementation. In actual implementation, the type, quantity and proportion of each layer may be changed arbitrarily, and the layer layout may also be more complicated.

[0067] In the following description, numerous details are discussed to provide a more thorough explanation of embodiments of the present invention; however, it is apparent to one skilled in the art that embodiments of the present invention may be practiced without these specific details.

[0068] The existing technology for detecting beauty contact lens images has the following disadvantages:

[0069] 1: Color difference judgment based on manual naked eye observation is highly subjective, has poor consistency, and cannot be quantified;

[0070] 2: The colorimeter based on the principle of spectrophotometry has high requirements for conditions and can only detect the color difference of a single color block;

[0071] 3: The color difference detection method based on image analysis is applicable to simple scenarios and requires a single background, no overprinting or high overprinting accuracy.

[0072] 4: In the pad printing scenario of multi-color overprinting, if there is color difference in the color of the ink itself, the final printed product will show obvious differences that are very easy to distinguish with the naked eye. In more cases, color difference occurs when the ink itself has no color difference, but during the printing process, due to mechanical and process problems, there is a tiny color difference that can be distinguished by the naked eye. This color difference may be related to factors such as the pressure of the printing pad, the dryness and wetness of the ink and the environment, and the overprinting accuracy. Figure 1 This is a schematic diagram of the slight color difference caused by the printing density difference shown in this application, such as Figure 1 As shown (color difference caused by change in black density of the outer circle), at this time, it is difficult to distinguish this degree of color difference by relying solely on the ISO13655 color difference calculation standard.

[0073] Purpose of this application:

[0074] 1: This application is a high-precision color difference detection method based on image processing and machine learning, which has a great improvement effect on the existing detection methods with strong subjectivity and low detection accuracy. At the same time, the system can be widely used in color difference detection in the flexible printing industry, reducing the cost of manual re-inspection, improving production efficiency, and thus improving the final product yield.

[0075] This color difference detection method combines overall color difference evaluation and single color difference evaluation, and consists of the following processes:

[0076] Figure 2 is a flow chart of a high-precision slight color difference detection method shown in an embodiment of the present application. Figure 2 As shown in the figure, a high-precision minute color difference detection method of this embodiment may include the following steps:

[0077] S210, acquiring a beauty pupil image and a template image, and preprocessing the beauty pupil image to obtain a first preprocessed image, and preprocessing the template image to obtain a second preprocessed image;

[0078] S220, extracting the overall color features and the single color features of the first preprocessed image, extracting the overall color features and the single color features of the second preprocessed image, and extracting the color moment of the first preprocessed image and the color moment of the second preprocessed image;

[0079] S230, calculating the overall color difference between the beauty pupil image and the template image based on the overall color features of the first preprocessed image and the overall color features of the second preprocessed image, calculating the monochrome color difference between the beauty pupil image and the template image based on the single color features of the first preprocessed image and the single color features of the second preprocessed image, and judging whether there is local color difference in the beauty pupil image based on the color moment of the first preprocessed image and the color moment of the second preprocessed image, wherein when the difference between the color moment of the first preprocessed image and the color moment of the second preprocessed image is greater than a preset threshold, there is local color difference;

[0080] S240, detecting the beauty contact lens image based on the overall color difference, the monochromatic color difference and the local color difference.

[0081] The specific implementation process and principles are introduced as follows:

[0082] A. Image acquisition and preprocessing

[0083] Acquire a beauty pupil image and a template image, preprocess the beauty pupil image to obtain a first preprocessed image, and preprocess the template image to obtain a second preprocessed image;

[0084] The beauty contact lens images can be taken on-site or from a lower computer, and the template images can be acquired in advance;

[0085] The specific process of preprocessing includes:

[0086] A1. Convert the color-contact lens image from RGB channels to LAB channels to obtain a first LAB image, and convert the template image from RGB channels to LAB channels to obtain a second LAB image;

[0087] The LAB color model is a model that is more consistent with the human eye's perception of color, so the color image is converted from the RGB color space to the LAB color space;

[0088] A2, performing channel separation on the first LAB image to obtain a first L channel image, a first A channel image and a first B channel image; and performing channel separation on the second LAB image to obtain a second L channel image, a second A channel image and a second B channel image;

[0089] A3, Gaussian filtering is performed on the first L channel image and the second L channel image to obtain the first L G Image and second L G image;

[0090] A4, the first L G The image, the first A channel image and the first B channel image are fused to obtain the first L G AB image, and the second L G The image, the second A channel image and the second B channel image are fused to obtain the second L G AB image;

[0091] A5. For the first L G AB image and second L G The image is segmented by threshold value to obtain a first mask image of the color ring in the printed area of ​​the cosmetic image and a second mask image of the color ring in the printed area of ​​the template image;

[0092] A6. Perform morphological corrosion on the beauty contact lens image based on the first mask image to obtain a first preprocessed image; and perform morphological corrosion on the template image based on the second mask image to obtain a second preprocessed image.

[0093] In order not to lose color information, only the brightness image L is Gaussian filtered to obtain L G , and then L G , A, B are channel-fused to obtain the filtered image L G AB; extract L using threshold segmentation method G The mask image of the color ring in the AB printing area. In order to reduce the dispersion interference at the edge of the printed color point, the mask image is morphologically eroded, and the LAB image and the mask image are bitwise ANDed to obtain the color point image I cd , the same goes for the template image.

[0094] B. Extraction of overall color feature information

[0095] Extracting the overall color features of the first preprocessed image and extracting the overall color features of the second preprocessed image include:

[0096] B1, extracting a first image histogram of the first preprocessed image, and extracting a second image histogram of the second preprocessed image;

[0097] B2. Smoothing the first image histogram, and using the smoothed first image histogram as the overall color feature of the first preprocessed image; smoothing the second image histogram, and using the smoothed second image histogram as the overall color feature of the second preprocessed image.

[0098] The image histogram can reflect the overall distribution of the image grayscale or color, so the histogram can be used to characterize the overall color characteristics of the image. By comparing the histogram characteristics of the template and the product to be tested, the overall color difference can be obtained; the color histogram of the LAB image is calculated, and in order to reduce noise interference, the histogram is smoothed using a sliding window.

[0099] C. Single color feature information extraction

[0100] In this embodiment, a clustering method (any density clustering method can be selected) is used to perform a clustering operation on the color image to obtain the color center of each monochrome. In order to better extract and separate the color points printed by a single ink from the image, a foreground threshold segmentation method suitable for texture overprinting scenes is proposed. Due to the dispersion effect of color imaging, the neighborhood background area of ​​the unprinted color point will also appear in color instead of white, which makes it extremely difficult to accurately extract and separate the printed color area. In view of this, a color foreground threshold segmentation method and a monochrome color feature extraction method are proposed, which specifically include:

[0101] C1. Convert the first preprocessed image and the second preprocessed image into HSV space to obtain a first HSV image of the beauty pupil image and a second HSV image of the template image;

[0102] C2. Difference the V channel and S channel of the first HSV image to obtain the first difference image I V-S , and subtract the V channel and S channel of the second HSV image to obtain the second difference image I V-S ';

[0103] C3, for the first difference image I V-S and the second difference image I V-S 'Perform adaptive threshold segmentation to obtain the first difference image I V-S Binarized background image I B and the second difference image I V-S 'The binary background image I B ';

[0104] In steps C1-C3, since the color of the beauty pupil pattern is usually different in depth, but compared with the background, the color point usually has a higher saturation S and a lower brightness V. Conversely, the area with low S and high V is likely to be the background area. Based on this, if V is subtracted from S to obtain a new image I V-S , then I V-S The area with a larger gray value can be considered as the background area. The binary image I of the background can be obtained by using the adaptive threshold segmentation method. B , the same goes for the template image.

[0105] C4, binary background image I Band the binary background image I B ' Take the inversion to obtain the first mask image I of the color point area of ​​the first preprocessed image MF and a second mask image I of the color point area of ​​the second preprocessed image MF ';

[0106] C5. Extracting the first mask image I MF The intersection area with the first preprocessed image is used to obtain the first color image I of the color point area of ​​the first preprocessed image. D , take the second mask image I MF 'The intersection area with the first pre-processed image is used to obtain the second color image I of the color point area of ​​the second pre-processed image D ';

[0107] C6. For the first color image I D and the second color image I D ' to cluster the non-zero pixel sequence in the image to obtain multiple colors and multiple color centers; and to segment the image using the multiple color centers as the origin to obtain the first color image I D and the second color image I D ', wherein each color category includes a plurality of pixels;

[0108] C7. Count the proportion, pixel density, color center brightness, and color center of each color category to obtain a single color feature of the first preprocessed image and a single color feature of the second preprocessed image.

[0109] I B is the binary background image, B Take the inversion to get image I F , which is the mask image I of the color point area MF , color image and I MF By taking the intersection, we can get the color image I of the color point area. D , I D is the input image of the clustering algorithm, D The non-zero pixel sequences in are clustered to obtain the color centers. The upper and lower thresholds are given with each color center as the origin, and the pixels belonging to each category are extracted by the color threshold segmentation method. The image is in the form of a binary image. The number of pixels of each category can be obtained by counting the non-zero pixels in the binary image obtained after the threshold segmentation of each single color center. From this, the proportion of each color and the density of the single color can be calculated. The same is true for the template image.

[0110] D. Color information storage

[0111] If the image is a template image without color difference, the template color information is converted into a feature data format and stored in a specific path on the hard disk. This step is skipped for the sample image to be tested.

[0112] E. Overall color difference calculation

[0113] The histogram difference ΔH and the histogram similarity C of the overall color feature of the first preprocessed image and the overall color feature of the second preprocessed image are calculated to obtain the overall color difference.

[0114] F. Calculation of monochromatic color difference

[0115] The monochromatic color difference is obtained by calculating the color center brightness difference ΔL, the color center color difference ΔE and the density difference ΔD of each color category in the first preprocessed image and the corresponding color category in the second preprocessed image.

[0116] In the present application, each color center of the template is matched one by one with each color center of the sample to be tested, and the brightness value of each color center of the template is subtracted from the brightness value of the color center of the product to be tested to obtain the brightness difference ΔL. The color difference value ΔE of each color center of the template and each color center of the product to be tested is calculated according to the color difference calculation standard in ISO13655. The number of pixels in each cluster of the template and the product to be tested is subtracted to obtain the density difference ΔD of each single color.

[0117] G. Partition local color difference calculation

[0118] The rotation or offset between multiple layers of color can also cause local color difference. There is also the possibility that one color of ink becomes lighter or darker, or a single layer of ink is missing. The overprinting rules of each layer of color are basically distributed along the radial direction. In order to improve the detection effect of this local color difference, a method for detecting color difference based on radial partitioning is proposed.

[0119] Color moment is a mathematical feature used to describe color distribution. For a random variable R, its probability distribution can be uniquely represented by its moments. Furthermore, if the color values ​​of all pixels in a digital image are regarded as a probability distribution, then the image can also be represented by its moments. A color image has 3 channels, each channel has three low-order moments, so the color moment of a color image has a total of 9 components. The first-order color moment uses the first-order origin moment, that is, the mean, to reflect the overall brightness of the image. The larger the value, the brighter the image. The second-order color moment uses the square root of the second-order center distance, that is, the standard deviation, to reflect the color distribution range of the image. The larger the value, the wider the color distribution range.

[0120] Specifically, extracting the color moment of the first preprocessed image and the color moment of the second preprocessed image includes:

[0121] G1. Extract binary background image I BThe intersection area with the first pre-processed image is obtained to obtain the first background image of the first pre-processed image, and the first color image I D As the first foreground image of the first preprocessed image; and extracting the binary background image I B 'The intersection area with the second pre-processed image, obtain the second background image of the second pre-processed image, and convert the second color image I D 'A second foreground image as a second pre-processed image;

[0122] G2, calculate the first-order color moment E of multiple partitions of the target image i and the second-order color moment σ i , wherein the target image includes a first foreground image, a second foreground image, a first background image, and a second background image, and the plurality of partitions are a plurality of regions equally divided by the width of the color ring of the beauty contact lens;

[0123]

[0124]

[0125] Where P ij is the pixel value of the pixel with coordinates (i, j), and N is the number of pixels in the partition.

[0126] This method proposes to calculate the foreground color moment and background color moment of the radial partition for the template and the product to be tested, and compare the two. If they exceed the given threshold, it is considered that there is a local color difference, otherwise it is a qualified product. The image used is a color image in the LAB space. The partition rule is to divide it equally according to the width of the color ring. The foreground image is the color image of the sub-ring area and the above I MF The mask image is intersected, and the background image is the color image of the sub-ring area and the above I B The intersection of the mask image is taken, and the same is true for the template image.

[0127] H. Color difference detection

[0128] Figure 3 Schematic diagram of the color difference detection process in an embodiment of the present application. Figure 3 As shown, in one embodiment of the present application, the beauty contact lens image is detected based on the overall color difference, the monochromatic color difference and the local color difference, including:

[0129] H1, initialization parameters, the color difference detection result is determined by two detection results, that is, the color difference result of each single color S And the overall color difference result W ;

[0130] H2, calculate the color similarity between the beauty lens image and the template image based on the monochromatic color difference and the overall color difference;

[0131] H3. When the color similarity is greater than or equal to the preset similarity threshold, it is determined that there is no overall color difference and monochromatic color difference, and the beauty contact lens image is detected to see if there is local color difference, and the detection result is obtained;

[0132] When the color similarity is greater than or equal to the preset similarity threshold, it is determined that there is no overall color difference and local color difference; at this time, Result S and Result W All are set as qualified; when there is no overall color difference and local color difference, if the color moment detection is turned on, further detect whether there is color difference in the local single layer color, and the whole process ends;

[0133] H4, when the color similarity is less than the preset similarity threshold, the histogram similarity C is compared with the preset correlation threshold;

[0134] When the color similarity is less than the preset similarity threshold, it indicates that there may be color difference, and further histogram similarity comparison is required.

[0135] H5. When the histogram similarity C is less than the preset correlation threshold, it is determined that there is an overall color difference; when the histogram similarity C is greater than or equal to the preset correlation threshold, the histogram difference ΔH is compared with the preset difference threshold;

[0136] When the histogram similarity is less than the preset correlation threshold, it is determined that there is an overall color difference and the Result W When the histogram similarity is greater than or equal to the preset correlation threshold, the histogram difference ΔH needs to be compared.

[0137] H6. When the histogram difference ΔH is greater than or equal to the preset difference threshold, the histogram distance between the histogram and the preset histogram template is calculated; when the histogram distance is less than the preset distance threshold, it is determined that only monochromatic color difference exists; when the histogram distance is greater than or equal to the preset distance threshold, it is determined that there is overall color difference and monochromatic color difference and the single color with color difference is determined; when the histogram difference ΔH is less than the preset difference threshold, it is determined that there is no overall color difference and monochromatic color difference, and the beauty contact lens image is detected whether there is local color difference to obtain the detection result.

[0138] When the histogram difference ΔH is less than the preset difference threshold, the overall color difference index between the histogram and the preset histogram template is calculated; when the overall color difference index is less than the preset color difference threshold, it is determined that only monochrome color difference exists; that is, Result W Set to Result S, indicating that the overall color difference is determined by the color difference of the single color at this time; when the histogram distance is greater than or equal to the preset distance threshold, it is determined that there is an overall color difference and the single color with color difference is determined; if the histogram distance is not less than the given threshold, the Result W It is judged that there is color difference, which means there is overall color difference. Then we further explore which color has the monochromatic color difference and calculate the result of that color. S Set it to have color difference and end the process.

[0139] The color similarity between the beauty lens image and the template image is calculated based on the monochromatic color difference and the overall color difference, including:

[0140] The color similarity z is constructed based on the histogram difference ΔH, the histogram similarity C, the color center brightness difference ΔL, the color center color difference ΔE and the density difference ΔD. The mathematical expression of the color similarity z is:

[0141] z=w 0 +w 1 ΔH+w 2 C+w 3 ΔL+w 4 ΔE+w 5 ΔD

[0142] In the formula, w 0 is the offset, w 1 is the first weighting coefficient, w 2 is the second weighting coefficient, w 3 is the third weighting coefficient, w 4 is the fourth weighting coefficient, w 5 is the fifth weighting coefficient; where the offset w 0 , the first weighting coefficient w 1 , the second weighting coefficient w 2 , the third weighting coefficient w 3 , the fourth weighting coefficient w 4 and the fifth weighting factor w 5 Methods for determining include:

[0143] Acquire sample data, wherein the sample data includes a histogram difference ΔH', a histogram similarity C', a color center brightness difference ΔL', a color center color difference ΔE', a density difference ΔD' and a label of the sample image;

[0144] Construct training data based on sample data;

[0145] Fit the logistic regression model based on the training data to get the offset w 0 , the first weighting coefficient w 1 , the second weighting coefficient w 2 , the third weighting coefficient w3 , the fourth weighting coefficient w 4 and the fifth weighting factor w 5 , where the mathematical expression of the logistic regression model is:

[0146]

[0147] Where y is the label.

[0148] In this embodiment, in order to quantitatively characterize the degree of color difference between the product to be tested and the template, a feature quantity named color similarity is proposed. The color similarity combines the influencing factors of the overall color difference and the influencing factors of the monochromatic color difference. Compared with the existing single color difference calculation formula, it integrates the difference between the histogram information and the monochromatic information. The calculation formula contains feature quantities such as ΔH, C, ΔL, ΔE, and ΔD. The above feature quantities are fitted with a logistic regression model. The logistic regression can be expressed as: Where z = w 0 +w 1 ΔH+w 2 C+w 3 ΔL+w 4 ΔE+w 5 ΔD, y is the probability of passing. The image data set manually classified as color difference and passing is used for training. The color difference product label is 0 and the passing product label is 1. The parameter sequence {w 0 ,w 1 ,w2,w3,w4,w5}. When predicting a new sample, we only need to calculate ΔH, C, ΔL, ΔE, ΔD of the image and substitute them into the trained parameter sequence to obtain the probability z of the sample being qualified. z is defined as the color similarity. For different batches and patterns, different similarity thresholds can be set for color difference detection.

[0149] A high-precision minute color difference detection method of the present invention obtains color similarity feature quantity by extracting the monochromatic color difference, overall color difference and local color difference of the beauty pupil image, thereby improving the detection ability of minute color difference; the color similarity threshold can be adjusted for different patterns or different detection standards, so as to adapt to a variety of color difference detection scenarios; the imaging system has low requirements, and the results are reproducible, stable and consistent. This application is based on a machine vision method, uses a high-resolution color imaging method to obtain a mold image of a printed pattern, uses image processing technology and machine learning technology to analyze the image, and proposes a method that combines overall and local color difference to simulate and quantify the judgment standard of the human eye, and judges whether the corresponding product has color difference. The method is fast, has high real-time performance, good consistency, and low missed detection rate, which can achieve the purpose of reducing labor costs, saving time, and improving production yield.

[0150] like Figure 4As shown, the present application also provides a high-precision small color difference detection device, comprising:

[0151] An acquisition and preprocessing module, used to acquire a beauty pupil image and a template image, and preprocess the beauty pupil image to obtain a first preprocessed image, and preprocess the template image to obtain a second preprocessed image;

[0152] A feature extraction module, for extracting the overall color features and single color features of the first preprocessed image, extracting the overall color features and single color features of the second preprocessed image, and extracting the color moment of the first preprocessed image and the color moment of the second preprocessed image;

[0153] A calculation module, used to calculate the overall color difference between the beauty pupil image and the template image based on the overall color features of the first preprocessed image and the overall color features of the second preprocessed image, calculate the monochrome color difference between the beauty pupil image and the template image based on the single color features of the first preprocessed image and the single color features of the second preprocessed image, and determine whether there is local color difference in the beauty pupil image based on the color moment of the first preprocessed image and the color moment of the second preprocessed image, wherein when the difference between the color moment of the first preprocessed image and the color moment of the second preprocessed image is greater than a preset threshold, there is local color difference;

[0154] The detection module is used to detect the beauty contact lens image based on the overall color difference, the monochromatic color difference and the local color difference.

[0155] The invention discloses a high-precision micro-color difference detection device, which obtains color similarity feature quantity by extracting monochromatic color difference, overall color difference and local color difference of beauty pupil image, thereby improving the detection capability of micro-color difference; the color similarity threshold can be adjusted for different patterns or different detection standards, so as to adapt to a variety of color difference detection scenarios; the imaging system has low requirements, and the results are reproducible, stable and consistent. This application is based on machine vision method, uses high-resolution color imaging method to obtain the mold image of the printed pattern, uses image processing technology and machine learning technology to analyze the image, and proposes a method of combining overall and local color difference to simulate and quantify the judgment standard of the human eye, and judge whether the corresponding product has color difference. The method is fast, has high real-time performance, good consistency, and low missed detection rate, which can achieve the purpose of reducing labor costs, saving time, and improving production yield.

[0156] This embodiment further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, any one of the methods in this embodiment is implemented, wherein the method is the execution logic of this system.

[0157] This embodiment also provides an electronic terminal, including: a processor and a memory;

[0158] The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the terminal executes any one of the methods in this embodiment.

[0159] The computer-readable storage medium in this embodiment can be understood by ordinary technicians in this field: all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to the computer program. The aforementioned computer program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes.

[0160] The electronic terminal provided in this embodiment includes a processor, a memory, a transceiver and a communication interface. The memory and the communication interface are connected to the processor and the transceiver and complete communication with each other. The memory is used to store computer programs, the communication interface is used to communicate, and the processor and the transceiver are used to run computer programs so that the electronic terminal executes each step of the above method.

[0161] In this embodiment, the memory may include a random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0162] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0163] In the above-mentioned embodiments, although the present invention has been described in conjunction with the specific embodiments of the present invention, many replacements, modifications and variations of these embodiments will be apparent to those of ordinary skill in the art based on the foregoing description. The embodiments of the present invention are intended to cover all such replacements, modifications and variations falling within the broad scope of the appended claims.

[0164] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. A high-precision minute color difference detection method, characterized in that: Includes steps: Acquire a beauty pupil image and a template image, and preprocess the beauty pupil image to obtain a first preprocessed image, and preprocess the template image to obtain a second preprocessed image; Extracting the overall color features and the single color features of the first preprocessed image, extracting the overall color features and the single color features of the second preprocessed image, and extracting the color moment of the first preprocessed image and the color moment of the second preprocessed image; Calculating the overall color difference between the beauty pupil image and the template image based on the overall color features of the first preprocessed image and the overall color features of the second preprocessed image, calculating the monochrome color difference between the beauty pupil image and the template image based on the single color features of the first preprocessed image and the single color features of the second preprocessed image, and judging whether there is local color difference in the beauty pupil image based on the color moment of the first preprocessed image and the color moment of the second preprocessed image, wherein when the difference between the color moment of the first preprocessed image and the color moment of the second preprocessed image is greater than a preset threshold, there is local color difference; The beauty pupil image is detected based on the overall color difference, the monochromatic color difference and the local color difference.

2. A high-precision minute color difference detection method according to claim 1, characterized in that: Preprocessing the beauty pupil image to obtain a first preprocessed image, and preprocessing the template image to obtain a second preprocessed image, including: Convert the beauty pupil image from RGB channels to LAB channels to obtain a first LAB image, and convert the template image from RGB channels to LAB channels to obtain a second LAB image; Performing channel separation on the first LAB image to obtain a first L channel image, a first A channel image, and a first B channel image; and performing channel separation on the second LAB image to obtain a second L channel image, a second A channel image, and a second B channel image; Gaussian filtering is performed on the first L channel image and the second L channel image to obtain a first L G Image and second L G image; The first L G The image, the first A channel image and the first B channel image are fused to obtain a first L G AB image, and the second L G The image, the second A channel image and the second B channel image are fused to obtain the second L G AB image; For the first L G AB image and the second L G The image is segmented by threshold value to obtain a first mask image of the color ring in the printed area of ​​the cosmetic pupil image and a second mask image of the color ring in the printed area of ​​the template image; The beauty pupil image is morphologically eroded based on the first mask image to obtain a first preprocessed image; and the template image is morphologically eroded based on the second mask image to obtain a second preprocessed image.

3. A high-precision minute color difference detection method according to claim 1, characterized in that: Extracting the overall color features of the first preprocessed image and extracting the overall color features of the second preprocessed image include: extracting a first image histogram of the first preprocessed image, and extracting a second image histogram of the second preprocessed image; The first image histogram is smoothed, and the smoothed first image histogram is used as the overall color feature of the first preprocessed image; the second image histogram is smoothed, and the smoothed second image histogram is used as the overall color feature of the second preprocessed image.

4. A high-precision minute color difference detection method according to claim 1, characterized in that: Extracting a single color feature of the first preprocessed image and extracting a single color feature of the second preprocessed image include: Convert the first preprocessed image and the second preprocessed image into HSV space to obtain a first HSV image of the beauty pupil image and a second HSV image of the template image; The V channel and the S channel of the first HSV image are subtracted to obtain a first difference image I V-S , and subtract the V channel and S channel of the second HSV image to obtain a second difference image I V-S '; The first difference image I V-S and the second difference image I V-S 'Perform adaptive threshold segmentation to obtain the first difference image I V-S Binarized background image I B and the second difference image I V-S 'The binary background image I B '; For the binary background image I B and the binary background image I B ' Take the inversion to obtain the first mask image I of the color point area of ​​the first pre-processed image MF and a second mask image I of the color point area of ​​the second preprocessed image MF '; Extract the first mask image I MF The intersection area with the first pre-processed image is obtained to obtain a first color image I of the color point area of ​​the first pre-processed image D , take the second mask image I MF 'The intersection area with the first pre-processed image is used to obtain a second color image I of the color point area of ​​the second pre-processed image D '; For the first color image I D and the second color image I D ' to cluster the non-zero pixel sequence in the image to obtain multiple colors and multiple color centers; and to segment the image using the multiple color centers as the origin to obtain the first color image I D and the second color image I D ', wherein each color category includes a plurality of pixels; The proportion, pixel density, color center brightness, and color center of each color category are counted to obtain a single color feature of the first preprocessed image and a single color feature of the second preprocessed image.

5. A high-precision minute color difference detection method according to claim 4, characterized in that: Extracting a color moment of the first preprocessed image and a color moment of the second preprocessed image includes: Extract the binary background image I B The first pre-processed image is intersected with the first pre-processed image to obtain a first background image of the first pre-processed image, and the first color image ID is used as a first foreground image of the first pre-processed image; and the binary background image I is extracted B ' and the second pre-processed image, obtaining a second background image of the second pre-processed image, and using the second color image ID' as a second foreground image of the second pre-processed image; Calculate the first-order color moment E of multiple partitions of the target image i and the second-order color moment σ i , wherein the target image includes the first foreground image, the second foreground image, the first background image and the second background image, and the multiple partitions are multiple areas equally divided by the width of the color ring of the beauty contact lens; Where P ij is the pixel value of the pixel with coordinates (i, j), and N is the number of pixels in the partition.

6. A high-precision minute color difference detection method according to claim 3, characterized in that: Calculating the overall color difference between the beauty pupil image and the template image based on the overall color features of the first preprocessed image and the overall color features of the second preprocessed image includes: A histogram difference ΔH and a histogram similarity C between the overall color features of the first preprocessed image and the overall color features of the second preprocessed image are calculated to obtain an overall color difference.

7. A high-precision minute color difference detection method according to claim 6, characterized in that: Calculating the monochrome color difference between the beauty pupil image and the template image based on the single color feature of the first preprocessed image and the single color feature of the second preprocessed image includes: The color center brightness difference ΔL, the color center color difference ΔE, and the density difference ΔD of each color category in the first preprocessed image and the corresponding color category in the second preprocessed image are calculated to obtain a monochromatic color difference.

8. A high-precision minute color difference detection method according to claim 7, characterized in that: Detecting the beauty pupil image based on the overall color difference, the monochromatic color difference and the local color difference includes: Calculating the color similarity between the beauty pupil image and the template image based on the monochromatic color difference and the overall color difference; When the color similarity is greater than or equal to a preset similarity threshold, it is determined that there is no overall color difference and monochromatic color difference, and the beauty pupil image is detected whether there is local color difference to obtain a detection result; When the color similarity is less than a preset similarity threshold, comparing the histogram similarity C with a preset correlation threshold; When the histogram similarity C is less than a preset correlation threshold, it is determined that there is an overall color difference; when the histogram similarity C is greater than or equal to the preset correlation threshold, the histogram difference ΔH is compared with a preset difference threshold; When the histogram difference ΔH is greater than or equal to a preset difference threshold, the histogram distance between the histogram and a preset histogram template is calculated; when the histogram distance is less than the preset distance threshold, it is determined that only monochromatic color difference exists; when the histogram distance is greater than or equal to the preset distance threshold, it is determined that there is overall color difference and monochromatic color difference and the single color with color difference is determined; when the histogram difference ΔH is less than the preset difference threshold, it is determined that there is no overall color difference and monochromatic color difference, and the beauty pupil image is detected whether there is local color difference to obtain a detection result.

9. A high-precision minute color difference detection method according to claim 8, characterized in that: Calculating the color similarity between the beauty pupil image and the template image based on the monochromatic color difference and the overall color difference includes: The color similarity z is constructed based on the histogram difference ΔH, the histogram similarity C, the color center brightness difference ΔL, the color center color difference ΔE and the density difference ΔD. The mathematical expression of the color similarity z is: z=w0+w1ΔH+w2C+w3ΔL+w4ΔE+w5ΔD In the formula, w0 is an offset, w1 is a first weighting coefficient, w2 is a second weighting coefficient, w3 is a third weighting coefficient, w4 is a fourth weighting coefficient, and w5 is a fifth weighting coefficient; wherein the method for determining the offset w0, the first weighting coefficient w1, the second weighting coefficient w2, the third weighting coefficient w3, the fourth weighting coefficient w4, and the fifth weighting coefficient w5 includes: Acquire sample data, wherein the sample data includes a histogram difference ΔH', a histogram similarity C', a color center brightness difference ΔL', a color center color difference ΔE', a density difference ΔD' and a label of the sample image; Constructing training data based on the sample data; The logistic regression model is fitted based on the training data to obtain the offset w0, the first weighting coefficient w1, the second weighting coefficient w2, the third weighting coefficient w3, the fourth weighting coefficient w4 and the fifth weighting coefficient w5, wherein the mathematical expression of the logistic regression model is: Where y is the label.

10. A high-precision minute color difference detection device, characterized in that: include: An acquisition and preprocessing module, used for acquiring a beauty pupil image and a template image, and preprocessing the beauty pupil image to obtain a first preprocessed image, and preprocessing the template image to obtain a second preprocessed image; a feature extraction module, configured to extract overall color features and single color features of the first preprocessed image, extract overall color features and single color features of the second preprocessed image, and extract color moments of the first preprocessed image and color moments of the second preprocessed image; a calculation module, configured to calculate the overall color difference between the beauty pupil image and the template image based on the overall color features of the first preprocessed image and the overall color features of the second preprocessed image, calculate the monochrome color difference between the beauty pupil image and the template image based on the single color features of the first preprocessed image and the single color features of the second preprocessed image, and determine whether there is local color difference in the beauty pupil image based on the color moment of the first preprocessed image and the color moment of the second preprocessed image, wherein when the difference between the color moment of the first preprocessed image and the color moment of the second preprocessed image is greater than a preset threshold, there is local color difference; A detection module is used to detect the beauty pupil image based on the overall color difference, the monochromatic color difference and the local color difference.

Citation Information

Patent Citations

  • Image processing method, apparatus, computer device, and storage medium

    CN109300131A

  • Contact lens casting mold printing quality detection method and device

    CN114742752A

  • Textile surface color data processing and identification method and system

    CN114926661A

  • Yarn dyeing quality evaluation method and system based on adaptive mean shift clustering

    CN114972345A

  • Cosmetic contact lens detection method and apparatus, iris recognition method and apparatus, and readable storage medium and device

    WO2023088071A1