Method, device and color sensor for determining color consistency

By dynamically selecting the appropriate mathematical model based on the application scenario of the color sensor, especially the stretched ellipsoidal model, the problem of misjudgment by the color sensor in complex environments is solved, and the accuracy and adaptability of color consistency determination are improved.

CN122156328APending Publication Date: 2026-06-05OMRON SHANGHAI

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
OMRON SHANGHAI
Filing Date
2026-02-26
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing color sensors are prone to misjudgment in complex environments, making it difficult to meet the requirements for high-precision color consistency determination. This is mainly due to the non-uniformity of color change rate in different directions in the CIELab color space.

Method used

The appropriate mathematical model is dynamically selected based on the application scenario of the color sensor, including the stretched ellipsoidal model, to determine the consistency between the current color and the reference color, adapting to complex scenarios such as changes in brightness and the influence of stains.

Benefits of technology

By dynamically selecting an adaptive mathematical model, the misjudgment rate of color determination caused by environmental interference is reduced, and the accuracy and adaptability of color consistency determination are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122156328A_ABST
    Figure CN122156328A_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a color consistency determination method, device and color sensor, the method comprises the following steps: according to the use scene of the color sensor, dynamically select a mathematical model corresponding to the use scene from the preset color consistency determination mathematical model, the preset color consistency determination mathematical model includes at least one color coordinate axis stretched ellipsoid model;Based on the mathematical model, determine whether the current color detected by the color sensor is consistent with the reference color. Therefore, according to the use scene, the mathematical model suitable for the current environment is selected to determine the color consistency, which can reduce the color determination misjudgment rate caused by environmental interference, and improve the accuracy and adaptability of color consistency determination in different use scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of color sensor technology, and in particular to a method, apparatus and color sensor for determining color consistency. Background Technology

[0002] In the field of color detection, color sensors are widely used in various scenarios such as industrial production and smart devices due to their advantages such as fast response and convenient operation. The core requirement is to accurately determine the consistency between the detected object and the reference color. The determination of color consistency usually relies on color difference calculation, that is, by quantifying the difference between the color to be measured and the reference color and comparing it with a preset threshold, so as to output the judgment result.

[0003] Existing methods for judging color consistency mainly rely on standardized color spaces and corresponding color difference calculation formulas. Among them, the CIE1976 Lab (hereinafter referred to as CIELab) color space has become a widely used color measurement standard in industrial inspection due to its high degree of matching with the uniformity perceived by human vision. In this space, color difference is usually evaluated by calculating the Euclidean distance or other forms of distance measurement between two color points.

[0004] The CIELab color space is a uniform color space based on human visual perception. It is a three-dimensional space composed of the L-axis, a-axis, and b-axis. The L-axis represents lightness (0 for black, 100 for white), the a-axis represents the green-red opposite (negative values ​​for green, positive values ​​for red), and the b-axis represents the blue-yellow opposite (negative values ​​for blue, positive values ​​for yellow). This color space design ensures a good correlation between the Euclidean distance between two points in the space and the color difference perceived by the human eye. Existing color difference calculation formulas use the spherical variance formula as the core algorithm. This algorithm treats the color change rate in all directions of the CIELab color space as uniform, using the teaching point as the center. It calculates the spatial distance between the detection point and the teaching point and compares it with a fixed threshold to determine color consistency.

[0005] It should be noted that the above description of the technical background is only for the purpose of providing a clear and complete explanation of the technical solutions of the present invention and facilitating understanding by those skilled in the art. It should not be assumed that the above technical solutions are known to those skilled in the art simply because they have been described in the background section of this invention. Summary of the Invention

[0006] The inventors of this application discovered that the detection environment of color sensors often contains complex interferences, such as changes in ambient brightness and stains on the surface of the object being detected. These interferences cause the color change rate in different directions in the CIELab color space to exhibit non-uniform characteristics. The spherical variance formula assumes that the change rate is uniform in all directions, which cannot adapt to the above-mentioned non-uniform variation scenarios. This leads to misjudgments during the detection process, significantly reducing the detection reliability of color sensors in complex environments and making it difficult to meet the high-precision requirements for color consistency determination in practical applications.

[0007] To address at least one of the above-mentioned problems or other similar issues, embodiments of this application provide a color consistency determination method, apparatus, and color sensor.

[0008] According to a first aspect of the embodiments of this application, a method for determining color consistency is provided, the method comprising:

[0009] Based on the usage scenario of the color sensor, a mathematical model corresponding to the usage scenario is dynamically selected from the preset color consistency determination mathematical models. The preset color consistency determination mathematical model includes at least one ellipsoidal model with stretched color coordinate axes.

[0010] Based on the mathematical model, it is determined whether the current color detected by the color sensor is consistent with the reference color.

[0011] In some embodiments, the usage scenarios include: a normal scenario, a brightness variation scenario, and a saturation variation scenario; the preset color consistency determination mathematical model includes: a first mathematical model, a second mathematical model, and a third mathematical model; wherein, the first mathematical model is a spherical model and corresponds to the normal scenario, the second mathematical model is an ellipsoidal model and corresponds to the brightness variation scenario, and the third mathematical model is an ellipsoidal model and corresponds to the saturation variation scenario.

[0012] In some embodiments, the preset color consistency determination mathematical model is based on a first color space, which has an L-axis, an a-axis, and a b-axis. The method further includes: determining the coordinates of the reference color as (L0, a0, b0) and the coordinates of the current color as (L1, a1, b1).

[0013] In some embodiments, the first mathematical model applies the standard spherical formula, which is ΔE = (L1-L0)² / D² + (a1-a0)² / D² + (b1-b0)² / D²; where D is the uniform color difference threshold, ΔE is the color difference value, and when ΔE < 1, it is determined that the current color is consistent with the reference color.

[0014] In some embodiments, the second mathematical model applies a first ellipsoidal formula for stretching the L-axis, the first ellipsoidal formula being ΔE = (L1-L0)² / LT² + (a1-a0)² / D² + (b1-b0)² / D²; where LT is a threshold greater than D corresponding to the L-axis, and when ΔE<1, it is determined that the current color is consistent with the reference color.

[0015] In some embodiments, the third mathematical model applies a second ellipsoidal formula for stretching the a-axis, the second ellipsoidal formula being ΔE = (L1-L0)² / D² + [(a1-a0) cos (θ)-(b1-b0) sin (θ)]² / aT² + [(a1-a0) sin (θ)+(b1-b0) cos (θ)]² / D²; where aT is a threshold greater than D corresponding to the a-axis, and when ΔE<1, it is determined that the current color is consistent with the reference color; or, the third mathematical model applies a third ellipsoidal formula for simultaneously stretching the a-axis and b-axis, with different degrees of stretching between the a-axis and b-axis, the third ellipsoidal formula being ΔE = (L1-L0)² / D² + [(a1-a0) cos (θ)-(b1-b0) sin (θ)]² / aT² + [(a1-a0) sin (θ)+(b1-b0) cos (θ)]² / aT² + [(a1-a0) sin (θ)+(b1-b0) cos (θ)]² / D². (θ)]² / bT²; where aT is the threshold greater than D corresponding to the a-axis, bT is the threshold greater than D corresponding to the b-axis, and aT>bT. When ΔE<1, it is determined that the current color is consistent with the reference color; or, the third mathematical model applies the fourth ellipsoid formula that stretches both the a-axis and b-axis to the same degree, and the fourth ellipsoid formula is ΔE = (L1-L0)² / D² + (a1-a0)² / aT² + (b1-b0)² / bT²; where aT is the threshold greater than D corresponding to the a-axis, bT is the threshold greater than D corresponding to the b-axis, and aT = bT. When ΔE<1, it is determined that the current color is consistent with the reference color.

[0016] In some embodiments, θ is the angle at which the a-axis rotates counterclockwise about the L-axis to the projection point of the coordinate point of the reference color onto the ab-plane, where the ab-plane is the plane containing the a-axis and the b-axis.

[0017] In some embodiments, selecting a mathematical model corresponding to the use case includes:

[0018] The most recent preset number of records is determined by the color coordinates that are consistent with the reference color;

[0019] Calculate the first variance of the color coordinates corresponding to the L-axis, the second variance of the a-axis, and the third variance of the b-axis for the preset number of times;

[0020] Calculate the first difference, which is the value obtained by subtracting the second variance and the third variance from the first variance;

[0021] When the first difference is less than the first threshold, the third mathematical model is selected;

[0022] When the first difference is not less than the first threshold and greater than the second threshold, the second mathematical model is selected;

[0023] When the first difference is not less than the first threshold and not greater than the second threshold, the first mathematical model is selected.

[0024] According to a second aspect of the embodiments of this application, a color consistency determination device is provided, applied to a color sensor, the device comprising:

[0025] The selection unit dynamically selects a mathematical model corresponding to the usage scenario from a preset color consistency determination mathematical model, based on the usage scenario of the color sensor. The preset color consistency determination mathematical model includes at least one ellipsoidal model with stretched color coordinate axes.

[0026] The determination unit, based on the mathematical model, determines whether the current color detected by the color sensor is consistent with the reference color.

[0027] According to a third aspect of the embodiments of this application, a color sensor is provided, the color sensor including a color consistency determination device, the color consistency determination device applying the color consistency determination method described in any one of the embodiments of the first aspect above.

[0028] One of the beneficial effects of this application's embodiments includes: selecting a mathematical model suitable for the current environment based on the usage scenario for color consistency determination can reduce the misjudgment rate of color determination caused by environmental interference and improve the accuracy and adaptability of color consistency determination in different usage scenarios.

[0029] Specific embodiments of this application are disclosed in detail with reference to the following description and accompanying drawings, indicating how the principles of this application can be adopted. It should be understood that the embodiments of this application are not limited in scope. Within the scope of the appended claims, embodiments of this application include many changes, modifications, and equivalents.

[0030] Features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, combined with features in other embodiments, or substituted for features in other embodiments. It should be emphasized that the term "comprising / including" as used herein refers to the presence of a feature, integral, step, or component, but does not exclude the presence or addition of one or more other features, integrals, steps, or components. Attached Figure Description

[0031] The accompanying drawings, which form part of the specification, are used to provide a further understanding of the embodiments of this application and illustrate the implementation methods of this application, together with the textual description, to explain the principles of this application. Obviously, the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without creative effort. In the drawings:

[0032] Figure 1 This is a schematic diagram of the color consistency determination method provided in the embodiments of this application;

[0033] Figure 2 This is a schematic diagram illustrating the correspondence between the usage scenarios of this application embodiment and the preset color consistency determination mathematical model;

[0034] Figure 3 This is a schematic diagram of the first color space according to an embodiment of this application;

[0035] Figure 4 This is another schematic diagram of the color consistency determination method provided in the embodiments of this application;

[0036] Figure 5 This is a schematic diagram of the first mathematical model of the embodiment of this application;

[0037] Figure 6 This is a schematic diagram of the second mathematical model of the embodiment of this application;

[0038] Figure 7 This is a schematic diagram of the third mathematical model of the present application embodiment;

[0039] Figure 8 This is a schematic diagram of an ellipse that is rotated and stretched along axis a in an embodiment of this application;

[0040] Figure 9 This is a schematic diagram of the mathematical model selected in an embodiment of this application;

[0041] Figure 10 This is another schematic diagram illustrating the mathematical model selected in the embodiments of this application;

[0042] Figure 11This is a schematic diagram of a color consistency determination device provided in an embodiment of this application. Detailed Implementation

[0043] Referring to the accompanying drawings, the foregoing and other features of this application will become apparent from the following description. Specific embodiments of this application are specifically disclosed in the description and drawings, illustrating partial implementations in which the principles of this application can be adopted. It should be understood that this application is not limited to the described embodiments; rather, it includes all modifications, variations, and equivalents falling within the scope of the appended claims. Various embodiments of this application are described below with reference to the accompanying drawings. These embodiments are merely exemplary and not intended to limit the scope of this application.

[0044] In the embodiments of this application, the terms "first," "second," "upper," "lower," etc., are used to distinguish different elements by their names, but do not indicate the spatial arrangement or temporal order of these elements, and these elements should not be limited by these terms. The term "and / or" includes any one or more of the terms listed in connection with the application and all combinations thereof. The terms "comprising," "including," "having," etc., refer to the presence of the stated features, elements, components, or assemblies, but do not exclude the presence or addition of one or more other features, elements, components, or assemblies.

[0045] In the embodiments of this application, the singular forms "a," "the," etc., including the plural forms, should be broadly understood as "a kind" or "a class" rather than limited to the meaning of "an." Furthermore, the term "the" should be understood to include both the singular and plural forms, unless the context explicitly indicates otherwise. Additionally, the term "according to" should be understood as "at least partially based on…," and the term "based on" should be understood as "at least partially based on…," unless the context explicitly indicates otherwise.

[0046] This application provides a color consistency determination method, which is applied to a color sensor.

[0047] Figure 1 This is a schematic diagram of a color consistency determination method provided in an embodiment of this application. For example... Figure 1 As shown, the color consistency determination method includes:

[0048] 101: Based on the usage scenario of the color sensor, dynamically select a mathematical model corresponding to the usage scenario from the preset color consistency determination mathematical models, wherein the preset color consistency determination mathematical model includes at least one ellipsoidal model with the color coordinate axis stretched.

[0049] 102: Based on the mathematical model, determine whether the current color detected by the color sensor is consistent with the reference color.

[0050] It is worth noting that the above appendix Figure 1 The embodiments described herein are merely illustrative and are not limited thereto. For example, the execution order of various operations can be appropriately adjusted, and additional operations can be added or some operations can be removed. Those skilled in the art can make appropriate modifications based on the above description, and are not limited to the above-described embodiments. Figure 1 The records.

[0051] Therefore, selecting a mathematical model suitable for the current environment based on the usage scenario for color consistency determination can reduce the misjudgment rate of color determination caused by environmental interference and improve the accuracy and adaptability of color consistency determination in different usage scenarios.

[0052] For step 101, based on the usage scenario of the color sensor, a mathematical model corresponding to the usage scenario is dynamically selected from the preset color consistency determination mathematical models. The preset color consistency determination mathematical models include at least one ellipsoidal model with stretched color coordinate axes.

[0053] For example, based on the actual usage scenario of the color sensor, the system dynamically selects a mathematical model from a set of preset color consistency judgment mathematical models that matches the scenario for judgment. This set of preset models includes at least one ellipsoidal model with stretched color coordinate axes. For example, it might stretch the lightness axis (L-axis) according to changes in illumination, or adjust the length and direction of the ellipsoid's principal axes in the chromaticity plane (ab-plane) according to the impact of pollution. Through this dynamic selection mechanism, the threshold of the judgment model is no longer fixed but can adapt to specific directional interference from the external environment. This allows the color sensor to significantly improve the accuracy and robustness of judgments in diverse real-world working environments, avoiding misjudgments caused by a single fixed model, and thus better meeting the detection needs of complex application scenarios.

[0054] For step 102, based on the selected mathematical model, it is determined whether the current color detected by the color sensor is consistent with the reference color.

[0055] For example, based on the selected mathematical model, the color difference quantization value between the current color and the reference color in the CIELab color space is calculated. Specifically, according to the coordinate axis threshold or rotation angle set by the model, the color component differences in the three dimensions of L, a, and b are weighted or transformed and mapped to a normalized color difference discrimination index. The system then determines whether the index falls within a preset threshold range. When the color difference index is less than or equal to the judgment threshold, the system outputs a color consistency recognition result; otherwise, it determines that the colors are inconsistent.

[0056] The mathematical model used in this application is described below.

[0057] Figure 2 This is a schematic diagram showing the correspondence between the usage scenarios of this application embodiment and the preset color consistency determination mathematical model.

[0058] like Figure 2 As shown, the usage scenario 210 includes: a normal scenario 211, a brightness change scenario 212, and a saturation change scenario 213; the preset color consistency determination mathematical model 220 includes: a first mathematical model 221, a second mathematical model 222, and a third mathematical model 223.

[0059] In some embodiments, the first mathematical model 221 is a spherical model and corresponds to a normal scene 211, the second mathematical model 222 is an ellipsoidal model and corresponds to a scene with changes in brightness 212, and the third mathematical model 223 is an ellipsoidal model and corresponds to a scene with changes in saturation 213.

[0060] In ideal conditions or when color distribution is isotropic, the color sensor detects color consistency under conventional scenario 211. Conventional scenario 211 refers to a situation where the external ambient light is relatively stable and the surface of the object being measured is clean and uncontaminated. In practical applications, the working environment of the color sensor is complex and variable. In this embodiment, considering the impact of scenario 210 on the color sensor's consistency determination, in addition to conventional scenario 211, scenario 210 can also be a brightness variation scenario 212 and a saturation variation scenario 213. Brightness variation scenario 212 refers to a scenario where the ambient light intensity changes significantly, and the main color change is reflected in the brightness (corresponding to the L-axis). Saturation variation scenario 213 refers to a scenario where the color saturation changes due to the influence of oil, water stains, or specific contaminants on the object's surface, and the color change is mainly reflected in the saturation (corresponding to the plane formed by the a-axis and b-axis) and has directionality.

[0061] Determining color consistency requires using a mathematical model to judge the color difference between the detection point and the teaching point. A mathematical model corresponding to the usage scenario 210 is selected from the preset color consistency determination mathematical models 220 for subsequent judgment. In the normal scenario 211, the first mathematical model 221 is used; this first mathematical model is a spherical model. If the color to be tested falls within the threshold range of this spherical model, it is judged as consistent. This method assumes that the color change in the three dimensions of L (brightness), a (red-green axis), and b (yellow-blue axis) is uniform and isotropic. When the color change caused by environmental interference exhibits significant non-uniformity and directionality, i.e., in the brightness change scenario 212 and saturation change scenario 213, the second mathematical model 222 and the third mathematical model 223 are used respectively. Both the second mathematical model 222 and the third mathematical model 223 are ellipsoidal models, and at least one color coordinate axis is stretched. For example, in the second mathematical model 222, the L-axis is stretched, meaning it is assumed that the change in color along the L (brightness) dimension is greater than the changes along the a (red-green axis) and b (yellow-blue axis) dimensions, in order to counteract changes in brightness. Similarly, in the third mathematical model 223, the a-axis is stretched, meaning it is assumed that the change in color along the a (red-green axis) dimension is greater than the changes along the L (brightness) and b (yellow-blue axis) dimensions, in order to counteract changes in saturation caused by stains.

[0062] Therefore, dedicated mathematical models are provided for two typical interference scenarios: changes in brightness and the effects of stains (saturation changes). These models are distinct from the mathematical models used in conventional scenarios, enabling the color sensor to more accurately identify and respond to specific environmental interferences, thereby enhancing the practicality and reliability of the system.

[0063] Figure 3 This is a schematic diagram of the first color space according to an embodiment of this application. For example... Figure 3 As shown, the first color space has an L-axis, an a-axis, and a b-axis.

[0064] In this embodiment, the preset color consistency judgment mathematical model 220 is based on a first color space. Therefore, by constructing a mathematical model based on the CIELab color space and utilizing its visual perception uniformity, color judgment becomes more consistent with human vision, improving the accuracy and consistency of the judgment.

[0065] The first color space is the CIELab color space, which includes three mutually perpendicular axes: L-axis, a-axis, and b-axis. The L-axis represents lightness, the a-axis represents red and green characteristics, and the b-axis represents yellow and blue characteristics. For example, the bottom of the L-axis represents the darkest black, corresponding to lightness L=0, and the top of the L-axis represents the brightest white, corresponding to lightness L=100. The a-axis and b-axis together represent the characteristics of color. The positive direction of the a-axis represents variations in red, and the negative direction represents variations in green. The positive direction of the b-axis represents variations in yellow, and the negative direction represents variations in blue. The values ​​of a and b represent the color components in color perception.

[0066] Figure 4 This is another schematic diagram of the color consistency determination method provided in the embodiments of this application. For example... Figure 4 As shown, in some possible implementations, in addition to steps 101 and 102, the color consistency determination method also includes:

[0067] 1012: The coordinates of the reference color are determined to be (L0, a0, b0), and the coordinates of the current color are (L1, a1, b1).

[0068] For example, before the color sensor begins to determine color consistency, it is necessary to first determine the numerical values ​​of the reference color (i.e., the standard color), i.e., to perform teaching. Combined with... Figure 3 As shown in this embodiment, the reference color is represented based on a first color space, using coordinates (L0, a0, b0). After the color sensor starts working, it detects the value of the current color (i.e., the color of the detected object). The current color is also represented based on the first color space, using coordinates (L1, a1, b1). Subsequently, color consistency is determined by calculating and comparing the color difference between the two color coordinates. Thus, the coordinates of the teaching point (i.e., the reference color) are determined through teaching, serving as a benchmark for color consistency determination. The color difference between the current color coordinates and the reference color coordinates is calculated to determine color consistency.

[0069] The following describes the specific application of the formula in the preset color consistency determination mathematical model 220.

[0070] Figure 5 This is a schematic diagram of the first mathematical model of the embodiment of this application.

[0071] like Figure 5 As shown, the first mathematical model 221 applies the standard spherical formula, which is:

[0072] ΔE = (L1-L0)² / D² + (a1-a0)² / D² + (b1-b0)² / D²;

[0073] Where D is the uniform color difference threshold, ΔE is the color difference value, and when ΔE<1, the current color is determined to be consistent with the reference color.

[0074] Therefore, a distance variance formula with a unified threshold is adopted to provide a simple and efficient color consistency determination scheme for common scenarios, ensuring the accuracy of determination in basic scenarios.

[0075] like Figure 5 As shown, the first mathematical model 221 has the following geometric form: a standard sphere 500 in the CIELab color space, centered at reference color coordinates (L0, a0, b0) and with a preset threshold D as its radius. Color difference is quantified by calculating the normalized Euclidean distance between the current color coordinates (L1, a1, b1) and the sphere's center. In this embodiment, the color difference value between two points is reflected as the square of the normalized Euclidean distance between these two points in the first color space, i.e., the right-hand side of the standard sphere formula.

[0076] When the color difference value is less than 1, that is, when the square of the normalized Euclidean distance between the reference color coordinates (L0, a0, b0) and the current color coordinates (L1, a1, b1) is less than 1, the current color is determined to be consistent with the reference color. Alternatively, the consistency between the current color and the reference color is determined by measuring the position of the current color coordinates (L1, a1, b1) relative to the standard sphere. For example, ... Figure 5 As shown, point 01 is located inside the standard sphere 500, and its ΔE calculated using the standard sphere formula is < 1. Therefore, the color corresponding to point 01 is determined to be consistent with the reference color. Point 02 is located outside the standard sphere 500, and its ΔE calculated using the standard sphere formula is > 1. Therefore, the color corresponding to point 02 is determined to be inconsistent with the reference color. For example, if the current color coordinates are located on the standard sphere 500, and the ΔE calculated using the standard sphere formula is 1, then the current color is determined to be inconsistent with the reference color.

[0077] In the standard spherical formula, D is a preset uniform color difference threshold, which may be manually set or a system-provided parameter. This application does not restrict the setting of the color difference threshold.

[0078] Figure 6 This is a schematic diagram of the second mathematical model of the embodiment of this application.

[0079] like Figure 6 As shown, the second mathematical model 222 applies the formula for the first ellipsoidal surface stretched along the L-axis. The formula for the first ellipsoidal surface is:

[0080] ΔE = (L1-L0)² / LT² + (a1-a0)² / D² + (b1-b0)² / D²;

[0081] Where LT is the threshold value greater than D corresponding to the L axis, and when ΔE < 1, it is determined that the current color is consistent with the reference color.

[0082] Therefore, the formula for stretching the L-axis to an ellipsoidal surface adapts to changes in brightness and darkness, and accurately addresses L-axis fluctuations through an independent threshold LT, reducing misjudgments caused by brightness and darkness interference.

[0083] like Figure 6 As shown, the geometric shape of the second mathematical model 222 is an ellipsoid stretched along the L-axis relative to the first mathematical model 221 in the CIELab color space. The surface of the ellipsoid is the first ellipsoidal surface 600. The reference color coordinates (L0, a0, b0) are the ellipsoidal center. The length of the L-axis semi-axis is greater than the lengths of the a-axis and b-axis semi-axis, forming a vertically flattened spherical shape.

[0084] Similar to the first mathematical model 221, for the second mathematical model 222, when the color difference value is less than 1, that is, when the value obtained by substituting the reference color coordinates (L0, a0, b0) and the current color coordinates (L1, a1, b1) into the right-hand side of the first ellipsoid formula is less than 1, it is determined that the current color is consistent with the reference color. Alternatively, it can be said that the consistency between the current color and the reference color is determined by determining the position of the current color coordinates (L1, a1, b1) relative to the first ellipsoid 600. For example, as... Figure 6 As shown, point 03 is located inside the first ellipsoid 600, and its ΔE calculated using the first ellipsoid formula is <1. Therefore, the color corresponding to point 03 is consistent with the reference color. Point 04 is located outside the first ellipsoid 600, and its ΔE calculated using the first ellipsoid formula is >1. Therefore, the color corresponding to point 04 is inconsistent with the reference color. For example, if the current color coordinates are located on the first ellipsoid 600, and the ΔE calculated using the first ellipsoid formula is =1, then the reference color of the determination point is inconsistent with the reference color.

[0085] LT is a threshold larger than D corresponding to the L-axis, thereby increasing the tolerance for color consistency determination on the L-axis. LT can be manually set or a system-provided parameter; this application does not restrict the setting of LT.

[0086] Figure 7 This is a schematic diagram of the third mathematical model in the embodiments of this application.

[0087] like Figure 7As shown, the third mathematical model 223 applies the second ellipsoid formula for stretching the a-axis. The second ellipsoid formula is ΔE = (L1-L0)² / D² + [(a1-a0) cos (θ)-(b1-b0) sin (θ)]² / aT² + [(a1-a0) sin (θ)+(b1-b0) cos (θ)]² / D²; where aT is the threshold value greater than D corresponding to the a-axis. When ΔE < 1, the current color is determined to be consistent with the reference color. Alternatively, the third mathematical model 223 applies the third ellipsoid formula for simultaneously stretching the a-axis and b-axis, with different degrees of stretching. The third ellipsoid formula is ΔE = (L1-L0)² / D² + [(a1-a0) cos (θ)-(b1-b0) sin(θ)]² / aT² + [(a1-a0) sin (θ)+(b1-b0) cos (θ)]² / aT² + [(a1-a0) sin (θ)+(b1-b0) cos (θ)]² / D². (θ)]² / bT²; where aT is the threshold greater than D corresponding to the a-axis, bT is the threshold greater than D corresponding to the b-axis, and aT>bT. When ΔE<1, the current color is determined to be consistent with the reference color; or, the third mathematical model applies the fourth ellipsoid formula that stretches both the a-axis and b-axis to the same degree, and the fourth ellipsoid formula is ΔE = (L1-L0)² / D² + (a1-a0)² / aT² + (b1-b0)² / bT²;

[0088] Where aT is the threshold value greater than D corresponding to the a-axis, bT is the threshold value greater than D corresponding to the b-axis, and aT = bT. When ΔE < 1, it is determined that the current color is consistent with the reference color.

[0089] Therefore, stretching the a-axis or b-axis adapts to the saturation changes caused by stains, and rotating the ab plane covers the range of coordinate fluctuations, reducing misjudgments caused by stains.

[0090] like Figure 7 As shown, the geometric shape of the third mathematical model 223 is an ellipsoid formed by stretching relative to the first mathematical model 221 along the a-axis and / or b-axis in the CIELab color space and rotating it by an angle θ in the ab plane. The surface of the ellipsoid is the second ellipsoid 700. The reference color coordinates (L0, a0, b0) are the ellipsoid center. The length of the half-axis of the a-axis is greater than the length of the half-axis of the L-axis and the b-axis, forming a horizontally flattened spherical shape.

[0091] Similar to the first mathematical model 221 and the second mathematical model 222, for the third mathematical model 223, when the color difference value is less than 1, that is, when the value obtained by substituting the reference color coordinates (L0, a0, b0) and the current color coordinates (L1, a1, b1) into the right-hand side of the second ellipsoid formula is less than 1, it is determined that the current color is consistent with the reference color. Alternatively, it can be said that the consistency between the current color and the reference color is determined by determining the position of the current color coordinates (L1, a1, b1) relative to the second ellipsoid 700. For example, as... Figure 7 As shown, point 05 is located inside the second ellipsoid 700, and its ΔE calculated using the second ellipsoid formula is <1. Therefore, the color corresponding to point 05 is consistent with the reference color. Point 06 is located outside the second ellipsoid 700, and its ΔE calculated using the second ellipsoid formula is >1. Therefore, the color corresponding to point 06 is inconsistent with the reference color. For example, if the current color coordinates are located on the second ellipsoid 700, and the ΔE calculated using the second ellipsoid formula is =1, then the reference color of the determination point is inconsistent with the reference color.

[0092] The application of the third and fourth ellipsoid formulas is similar to that of the second ellipsoid formula, and will not be repeated here.

[0093] For the reference color, when the stain causes the color saturation to decrease, the reference color coordinate point moves on the ab plane in the direction pointing to the origin of the first color space. Therefore, it is necessary to rotate the ab coordinate system and align the stretched major axis with the origin of the first color space. Stretching the major axis ensures the tolerance of judgment consistency in the direction of the major axis, while the unstretched minor axis maintains the original threshold strict judgment consistency.

[0094] The cases of stretching the a-axis and stretching the b-axis are similar, and this application will use stretching the a-axis as an example for explanation.

[0095] Figure 8 This is a schematic diagram of an ellipse that is rotated and stretched along the a-axis according to an embodiment of this application. It schematically shows the case of rotating and stretching the ellipsoidal surface along the a-axis in the ab plane. Since the L-axis is not shown, only the projected ellipse of the ellipsoid on the ab plane is rotated.

[0096] like Figure 8 As shown, Figure 8The left side shows the case where the first ellipse 801 corresponding to the second ellipsoid 700 stretched along the a-axis is not rotated. The center point of the first ellipse 801 is the projection point (a0, b0) of the reference color coordinate point (L0, a0, b0) onto the ab plane. The major axis length of the first ellipse 801 is aT, and the minor axis length is bT. When only the a-axis is stretched, the minor axis length bT is equal to D. Corresponding to the formula for the second ellipsoid, aT is a threshold greater than D corresponding to the a-axis, thereby improving the tolerance for color consistency determination on the a-axis. aT can be manually set or a system-provided parameter; this application does not restrict the setting of aT.

[0097] like Figure 8 As shown, Figure 8 The right side shows the case where the first ellipse 801 is rotated counterclockwise (or clockwise if the b-axis is stretched) by an angle θ to become the second ellipse 802.

[0098] In some embodiments, θ is the angle at which the a-axis rotates counterclockwise around the L-axis to the projection point of the reference color coordinate point on the ab plane, where the ab plane is the plane containing the a-axis and the b-axis.

[0099] Since the reference color coordinates (L0, a0, b0) have components on the L-axis, in 3D space, θ is the angle of rotation of the a-axis about the L-axis. Alternatively, in the ab plane, θ is the angle of rotation of the a-axis about point O as the center of rotation, where point O is the projection point of the L-axis onto the ab plane. Therefore, by rotating with a specific angle θ and aligning with the central axis L, combined with stretching the a-axis, the accuracy and adaptability of color determination in scenarios with varying saturation are further improved.

[0100] For example, suppose the current L-axis coordinate component falls on the ab plane, such as Figure 8 As shown on the left, when the first ellipse 801 is not rotated, the projection point 07 of the current color on the ab plane is within the range of the first ellipse 801, meaning the current color is determined to be consistent with the reference color. However, due to the influence of stains, the saturation of this current color and the reference color changes, and it happens to fall within the determination range of the first ellipse 801. In fact, as... Figure 8 As shown on the right, after the first ellipse 801 is rotated into the second ellipse 802, the projection point 07 falls outside the range of the second ellipse 802, and is therefore determined to be inconsistent with the reference color. Thus, the rotated ellipse can reduce the false judgment rate.

[0101] In addition to stretching the a-axis or b-axis individually, it is also possible to stretch the a-axis and b-axis simultaneously. Simultaneous stretching of the a-axis and b-axis includes increasing the corresponding thresholds of the a-axis and b-axis synchronously or asynchronously. Synchronous increase means that the threshold aT corresponding to the a-axis is equal to the threshold bT corresponding to the b-axis, while asynchronous increase means that aT and bT are not equal.

[0102] refer to Figure 8As shown, the projection ellipse on the ab plane formed by simultaneously stretching the a-axis and b-axis to different degrees is similar to the first ellipse 801. aT is the length of the semi-major axis in the figure, and bT is the length of the semi-minor axis in the figure. aT > bT, and both aT and bT are greater than D. The rotation of the projection ellipse in this case is similar to the case where the first ellipse 801 rotates into the second ellipse 802, and will not be repeated in this application.

[0103] refer to Figure 8 As shown, when both the a-axis and b-axis are stretched to the same degree, the resulting ab plane projection is circular. In this case, no rotation is needed, or it can be considered that the rotation angle θ = 0, aT = bT, and both aT and bT are greater than D. aT and bT are considered the radii of the projected circle, and the fourth ellipsoid formula is used to determine color consistency. The ellipsoid corresponding to the fourth ellipsoid formula is similar to the second ellipsoid 700 with equal thresholds for the a-axis and b-axis. The color consistency determination process is similar and will not be elaborated further in this application.

[0104] The above describes the specific application of the formula in the preset color consistency determination mathematical model 220. The following describes how to select a mathematical model that corresponds to the use scenario 210.

[0105] In this embodiment of the application, selecting a mathematical model from the preset color consistency determination mathematical model 220 can be a static selection, a dynamic selection, or a combination of both.

[0106] Static selection can be achieved through manual selection of a usage scenario button. Each usage scenario 210 corresponds to a preset color consistency determination mathematical model 220. Pressing the corresponding usage scenario button allows the color sensor to apply the preset color consistency determination mathematical model 220 for that usage scenario 210. For example, the color sensor defaults to working in normal scenario 211. When the ambient light dims, manually pressing the button for brightness change scenario 212 will cause the color sensor to apply the second mathematical model 222 for color consistency determination. Similarly, when stains are detected on the object being detected, manually pressing the button for saturation change scenario 213 will cause the color sensor to apply the third mathematical model 223 for color consistency determination. The third mathematical model 223, for example, defaults to applying the second ellipsoidal formula, but users can also manually select the third or fourth ellipsoidal formula for further formula selection. The selection of other mathematical models is similar, and the static selection in this application is not limited to the examples. This application does not limit the implementation form of static selection; for example, it could also be a dial-based selection method.

[0107] Furthermore, the thresholds for the three dimensions L, a, and b of the mathematical model can be manually adjusted. For example, in a typical scenario 211, the color sensor uses the standard spherical formula corresponding to the first mathematical model 221, where the uniform color difference threshold D can be manually adjusted. The value of D can be one of three preset values, corresponding to low, medium, and high levels respectively, with the medium level being used by default. When higher accuracy is required for the detected object (the color that matches the reference color), it can be manually adjusted to low level, resulting in a smaller D value; when the accuracy requirement for the detected object decreases, it can be manually adjusted to high level, resulting in a larger D value. As another example, for the third mathematical model, after selecting the third ellipsoidal formula via a button, the thresholds aT corresponding to the a-axis and bT corresponding to the b-axis can be manually adjusted. The adjustment of aT and bT can be done by manually inputting new values, or by selecting a value corresponding to a certain level, similar to adjusting the D value. This application does not restrict the method of parameter adjustment.

[0108] Therefore, by allowing people to actively adjust or select the judgment mathematical model of the color sensor according to the actual working conditions, flexible intervention and precise adaptation can be achieved in complex and ever-changing non-standardized scenarios.

[0109] Dynamic selection, for example, involves color sensors automatically selecting and adjusting mathematical models based on the numerical values ​​of the detected objects measured over a period of time.

[0110] Figure 9 This is a schematic diagram of the mathematical model selected in an embodiment of this application. For example... Figure 9 As shown, selecting a mathematical model that corresponds to the usage scenario includes:

[0111] 901: The most recent preset number of records is determined by the color coordinates that are consistent with the reference color;

[0112] 902: Calculate the first variance corresponding to the L-axis, the second variance corresponding to the a-axis, and the third variance corresponding to the b-axis for the color coordinates of the preset number of times;

[0113] 903: Calculate the first difference, which is the value obtained by subtracting the average of the second and third variances from the first variance;

[0114] 904: When the first difference is less than the first threshold, the third mathematical model is selected;

[0115] 905: When the first difference is not less than the first threshold and greater than the second threshold, the second mathematical model is selected;

[0116] 906: When the first difference is not less than the first threshold and not greater than the second threshold, the first mathematical model is selected.

[0117] It is worth noting that the above appendix Figure 9 The embodiments described herein are merely illustrative and are not limited thereto. For example, the execution order of various operations can be appropriately adjusted, and additional operations can be added or some operations can be removed. Those skilled in the art can make appropriate modifications based on the above description, and are not limited to the above-described embodiments. Figure 9 The records.

[0118] Therefore, by statistically analyzing the three-axis variance and calculating the variance difference, a quantitative basis for mathematical model switching is provided to ensure the scientific and accurate nature of model switching; the corresponding switching rules between the variance difference and the threshold are clarified to achieve automatic model adaptation in different scenarios and ensure the consistency and reliability of color judgment.

[0119] For steps 901, 902, and 903, the data is recorded and processed to obtain the first difference. Therefore, by calculating and monitoring the difference in variance between the L-axis and the a and b axes of the most recent N detected volume coordinates in real time, the main directional characteristics of current environmental interference can be dynamically identified, thus providing a quantitative basis for adaptive switching or parameter adjustment.

[0120] First, the color coordinates of the most recent preset number of determinations that match the reference color are recorded. The preset number of determinations can be set manually; for example, a value can be entered to change the preset number of determinations, or a value corresponding to a specific level can be selected. This application does not restrict the method of setting the preset number of determinations. For example, recording the color coordinates of the most recent N determinations that match the reference color is equivalent to recording the coordinates of the most recent N detected entities.

[0121] Secondly, calculate the first variance corresponding to the L-axis, the second variance corresponding to the a-axis, and the third variance corresponding to the b-axis for the color coordinates of the preset number of times. Calculate the variance of the L-axis component of the N recorded coordinate values ​​to obtain the first variance; calculate the variance of the a-axis component of the N recorded coordinate values ​​to obtain the second variance; calculate the variance of the b-axis component of the N recorded coordinate values ​​to obtain the third variance. The method for calculating the variances is described in reference to relevant technologies and will not be elaborated upon here.

[0122] Finally, the first difference is calculated, which is the first variance minus the average of the second and third variances. The first difference is the difference between the L-axis variance and the ab-axis variance of the N recorded coordinate values, where the ab-axis variance is the average of the a-axis variance and the b-axis variance.

[0123] For steps 904, 905, and 906, a mathematical model is selected based on the magnitude of the first difference, the first threshold, and the second threshold. Thus, by hierarchically comparing the variance difference between the L-axis and the ab-axis with the preset first and second thresholds, the type and intensity of current environmental interference can be accurately identified, and the most suitable mathematical model can be automatically selected accordingly.

[0124] Figure 10 This is another schematic diagram of the mathematical model for selecting an embodiment of this application.

[0125] like Figure 10 As shown, when the first difference 10 is less than the first threshold 11, that is, the variance of the ab axis is large, and the influence of saturation change is large, the third mathematical model 223 is selected; when the first difference 10 is not less than the first threshold 11 but greater than the second threshold 12, that is, the variance of the L axis is large, and the influence of brightness change is large, the second mathematical model 222 is selected; when the first difference 10 is not less than the first threshold 11 and not greater than the second threshold 12, that is, the variance of the L axis and the variance of the ab axis are not much different, and the influence of brightness change and saturation change is not significant, the first mathematical model 221 is selected. The first threshold 11 and the second threshold 12 are both preset values, which can be values ​​set manually based on experience. This application does not restrict the setting method of the first threshold 11 and the second threshold 12.

[0126] When the third mathematical model 223 is selected, the corresponding formula is the second ellipsoid formula by default, or it will be automatically changed to the third ellipsoid formula or the fourth ellipsoid formula. The three formulas can be interchanged and selected, and this application does not restrict this.

[0127] Selecting a mathematical model from the preset color consistency determination mathematical models 220 can also be a combination of static and dynamic selection. For example, dynamic selection is used by default, while static selection is used when special adjustments are needed. This combines the on-site experience of professional operators with the intelligent decision-making strategy of the color sensor, further enhancing practicality and scenario coverage.

[0128] This application also provides a color consistency determination device. The implementation principle of this device is similar to the color consistency determination method in the previous embodiments, and the same content will not be described again.

[0129] Figure 11 This is a schematic diagram of a color consistency determination device provided in an embodiment of this application. Figure 11 As shown, the color consistency determination device 1100 includes: a selection unit 1101 and a determination unit 1102.

[0130] The selection unit 1101 dynamically selects a mathematical model corresponding to the usage scenario 210 from the preset color consistency determination mathematical model 220 according to the usage scenario 210 of the color sensor. The preset color consistency determination mathematical model 220 includes an ellipsoidal model with at least one color coordinate axis stretched. Based on the mathematical model, the determination unit 1102 determines whether the current color detected by the color sensor is consistent with the reference color.

[0131] This application also provides a color sensor, which includes a color consistency determination device that applies the color consistency determination method described in any one of the above embodiments. Further details will not be provided here.

[0132] The apparatus and methods described above in this application can be implemented in hardware or in combination with software. This application relates to a computer-readable program that, when executed by a logic component, enables the logic component to implement the apparatus or components described above, or to implement the various methods or steps described above. This application also relates to storage media for storing the above programs, such as hard disks, magnetic disks, optical disks, DVDs, flash memory, etc.

[0133] The methods / apparatus described in conjunction with the embodiments of this application can be directly embodied in hardware, software modules executed by a processor, or a combination of both. For example, one or more and / or combinations of one or more functional block diagrams shown in the figures can correspond to various software modules in a computer program flow, or to various hardware modules. These software modules can correspond to the various steps shown in the figures, respectively. These hardware modules can be implemented, for example, using a field-programmable gate array (FPGA) to embed these software modules.

[0134] The present application has been described above with reference to specific embodiments. However, those skilled in the art should understand that these descriptions are exemplary and not intended to limit the scope of protection of the present application. Those skilled in the art can make various modifications and variations to the present application based on its principles, and these modifications and variations are also within the scope of the present application.

Claims

1. A method for determining color consistency, characterized in that, The method includes: Based on the usage scenario of the color sensor, a mathematical model corresponding to the usage scenario is dynamically selected from the preset color consistency determination mathematical models. The preset color consistency determination mathematical model includes at least one ellipsoidal model with stretched color coordinate axes. Based on the mathematical model, it is determined whether the current color detected by the color sensor is consistent with the reference color.

2. The method according to claim 1, characterized in that, The usage scenarios include: normal scenarios, scenarios with changes in brightness and scenarios with changes in saturation; The preset color consistency determination mathematical model includes: a first mathematical model, a second mathematical model, and a third mathematical model; Wherein, the first mathematical model is a spherical model and corresponds to the conventional scene, the second mathematical model is an ellipsoidal model and corresponds to the scene with changes in brightness and darkness, and the third mathematical model is an ellipsoidal model and corresponds to the scene with changes in saturation.

3. The method according to claim 2, characterized in that, The preset color consistency determination mathematical model is based on a first color space, which has an L-axis, an a-axis, and a b-axis. The method further includes: The coordinates of the reference color are determined to be (L0, a0, b0), and the coordinates of the current color are determined to be (L1, a1, b1).

4. The method according to claim 3, characterized in that, The first mathematical model applies the standard spherical formula, which is ΔE = (L1-L0)² / D² + (a1-a0)² / D² + (b1-b0)² / D². Where D is the uniform color difference threshold, ΔE is the color difference value, and when ΔE<1, it is determined that the current color is consistent with the reference color.

5. The method according to claim 4, characterized in that, The second mathematical model applies the first ellipsoid formula for stretching the L-axis, which is ΔE = (L1-L0)² / LT² + (a1-a0)² / D² + (b1-b0)² / D². Wherein, LT is the threshold value greater than D corresponding to the L axis, and when ΔE<1, it is determined that the current color is consistent with the reference color.

6. The method according to claim 4, characterized in that, The third mathematical model applies the second ellipsoid formula for stretching the a-axis, which is ΔE = (L1-L0)² / D² + [(a1-a0) cos (θ)-(b1-b0) sin (θ)]² / aT² + [(a1-a0) sin (θ)+(b1-b0) cos (θ)]² / D²; Where aT is the threshold value greater than D corresponding to the a-axis, and when ΔE<1, it is determined that the current color is consistent with the reference color; Alternatively, the third mathematical model applies a third ellipsoid formula that simultaneously stretches the a-axis and b-axis to different degrees. The third ellipsoid formula is ΔE = (L1-L0)² / D²+[(a1-a0) cos (θ)-(b1-b0) sin(θ)]² / aT²+[(a1-a0) sin (θ)+(b1-b0) cos (θ)]² / bT²; Where aT is the threshold value greater than D corresponding to the a-axis, bT is the threshold value greater than D corresponding to the b-axis, and aT>bT. When ΔE<1, it is determined that the current color is consistent with the reference color. Alternatively, the third mathematical model applies the fourth ellipsoid formula, which stretches both the a-axis and the b-axis to the same degree. The fourth ellipsoid formula is ΔE = (L1-L0)² / D² + (a1-a0)² / aT² + (b1-b0)² / bT². Where aT is the threshold value greater than D corresponding to the a-axis, bT is the threshold value greater than D corresponding to the b-axis, and aT = bT. When ΔE < 1, it is determined that the current color is consistent with the reference color.

7. The method according to claim 6, characterized in that, θ is the angle at which the a-axis rotates counterclockwise about the L-axis to the projection point of the reference color coordinate point on the ab plane, where the ab plane is the plane containing the a-axis and the b-axis.

8. The method according to claim 2, characterized in that, The step of selecting a mathematical model corresponding to the use case includes: The most recent preset number of records is determined by the color coordinates that are consistent with the reference color; Calculate the first variance of the color coordinates corresponding to the L-axis, the second variance of the a-axis, and the third variance of the b-axis for the preset number of times; Calculate the first difference, which is the value obtained by subtracting the second variance and the third variance from the first variance; When the first difference is less than the first threshold, the third mathematical model is selected; When the first difference is not less than the first threshold and greater than the second threshold, the second mathematical model is selected; When the first difference is not less than the first threshold and not greater than the second threshold, the first mathematical model is selected.

9. A color consistency determination device, applied to a color sensor, characterized in that, The device includes: The selection unit dynamically selects a mathematical model corresponding to the usage scenario from a preset color consistency determination mathematical model, based on the usage scenario of the color sensor. The preset color consistency determination mathematical model includes at least one ellipsoidal model with stretched color coordinate axes. The determination unit, based on the mathematical model, determines whether the current color detected by the color sensor is consistent with the reference color.

10. A color sensor, characterized in that, The color sensor includes a color consistency determination device, which applies the color consistency determination method according to any one of claims 1 to 8.