Nothing Special   »   [go: up one dir, main page]

CN106683140A - Color recognition method and system - Google Patents

Color recognition method and system Download PDF

Info

Publication number
CN106683140A
CN106683140A CN201611169819.6A CN201611169819A CN106683140A CN 106683140 A CN106683140 A CN 106683140A CN 201611169819 A CN201611169819 A CN 201611169819A CN 106683140 A CN106683140 A CN 106683140A
Authority
CN
China
Prior art keywords
component
pixel point
target pixel
spectral
color
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201611169819.6A
Other languages
Chinese (zh)
Other versions
CN106683140B (en
Inventor
罗飞
肖旭斌
余江华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SHENZHEN WAYHO TECHNOLOGY Co Ltd
Original Assignee
SHENZHEN WAYHO TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SHENZHEN WAYHO TECHNOLOGY Co Ltd filed Critical SHENZHEN WAYHO TECHNOLOGY Co Ltd
Priority to CN201611169819.6A priority Critical patent/CN106683140B/en
Publication of CN106683140A publication Critical patent/CN106683140A/en
Priority to PCT/CN2017/114326 priority patent/WO2018107983A1/en
Application granted granted Critical
Publication of CN106683140B publication Critical patent/CN106683140B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Spectrometry And Color Measurement (AREA)
  • Color Image Communication Systems (AREA)

Abstract

The invention belongs to the technical field of machine vision and provides a color recognition method and system. The method is characterized in that the normalization color data of a target pixel point relative to a reference background is calculated, the correlation between the color value of the target pixel point and the color value of each standard sample in multiple pre-stored standard samples is calculated according to the normalization color data of the target pixel point and the normalization color data of the multiple pre-stored standard samples, and selecting the color value, with the highest correlation with the color value of the target pixel point, of the standard sample to serve as the real color value of the target pixel point. By the color recognition method, the color value of a target substance can be recognized in a good data stability, high accuracy and low cost manner.

Description

Color identification method and system
Technical Field
The invention belongs to the technical field of machine vision, and particularly relates to a color identification method and a color identification system.
Background
Color identification is an extremely important link in industrial and agricultural production. Color is essentially the integral effect of the spectral distribution of radiation or reflection of a substance with the human eye or photosensor. The color recognition of the human eye is not only dependent on ambient illumination, but also on photochemical neural processes and psychological responses, and it is often difficult to perform quantitative, standard descriptions of color. The color recognition of the photoelectric sensor not only depends on the illumination environment, but also is related to the response of the sensor and the sensor image algorithm, so that the stability of color data acquired in different illumination environments or different color recognition systems is poor, even the color data is difficult to distinguish due to color distortion, and slight color differences are difficult to recognize; moreover, when color recognition is performed by using a sensor, the light source and the like are usually required to be placed in a closed and low-reflection environment, high requirements are required on the stability of the light source and the ambient temperature and humidity, and the system is complex to operate, maintain and calibrate and high in cost.
Therefore, the existing color identification method has the problems of poor data stability, poor accuracy and high cost in the identification process of the color due to the influence of factors such as the change of the illumination environment, the difference of the sensor response, different sensor image algorithms and the like.
Disclosure of Invention
The invention aims to provide a color identification method and a color identification system, and aims to solve the problems of poor data stability, poor accuracy and high cost of a color in the process of searching and identifying due to the influences of factors such as illumination environment change, sensor response difference, different sensor image algorithms and the like in the conventional color identification method.
The present invention is achieved as such, a color recognition method comprising:
acquiring RGB values of target pixel points on a target substance and RGB values of a reference background;
calculating normalized color data of the target pixel point relative to the reference background according to the RGB value of the target pixel point and the RGB value of the reference background;
or acquiring a spectral function and a reference background spectral function of a target pixel point on a target substance;
calculating normalized color data of the target pixel point relative to the reference background according to the spectral function of the target pixel point and the spectral function of the reference background;
calculating the correlation between the color value of the target pixel point and the color value of each standard sample in the plurality of prestored standard samples according to the normalized color data of the target pixel point and the normalized color data of the plurality of prestored standard samples;
and selecting the color value of the standard sample with the maximum color value correlation with the target pixel point, and identifying the color value as the real color value of the target pixel point.
It is also an object of the present invention to provide a color recognition system, comprising:
the first acquisition unit is used for acquiring the RGB value of a target pixel point on a target substance and the RGB value of a reference background;
the first calculating unit is used for calculating the normalized color data of the target pixel point relative to the reference background according to the RGB value of the target pixel point and the RGB value of the reference background;
the second acquisition unit is used for acquiring a spectral function and a reference background spectral function of a target pixel point on a target substance;
the second calculation unit is used for calculating the normalized color data of the target pixel point relative to the reference background according to the spectral function of the target pixel point and the spectral function of the reference background;
the correlation calculation unit is used for calculating the correlation between the color value of the target pixel point and the color value of each standard sample in the plurality of pre-stored standard samples according to the normalized color data of the target pixel point and the normalized color data of the plurality of pre-stored standard samples;
and the color identification unit is used for selecting the color value of the standard sample with the maximum color value correlation with the target pixel point and identifying the color value as the real color value of the target pixel point.
According to the method, the normalized color data of the target pixel point relative to the reference background is calculated, the correlation between the color value of the target pixel point and the color value of each standard sample in the plurality of prestored standard samples is calculated according to the normalized color data of the target pixel point and the normalized color data of the plurality of prestored standard samples, the color value of the standard sample with the maximum correlation with the color value of the target pixel point is selected and identified as the real color value of the target pixel point, and therefore the color value of the target substance is identified under the conditions of good data stability, high accuracy and low cost.
Drawings
FIG. 1 is a block flow diagram of a color identification method provided by one embodiment of the present invention;
FIG. 2 is a block flow diagram of a color identification method provided by another embodiment of the invention;
FIG. 3 is a block diagram of a color recognition system provided by an embodiment of the present invention;
fig. 4 is a block diagram of a color recognition system according to another embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the description of the present invention, it is to be understood that the terms "first", "second" and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
As shown in fig. 1, an embodiment of the present invention provides a color recognition method, which includes:
step S1011: and acquiring the RGB value of a target pixel point on the target substance and the RGB value of the reference background.
In this embodiment, the target substance specifically refers to a monochromatic or chromatic substance that needs to identify a color and is selected by a user, and the target pixel point specifically refers to any pixel point on the target substance. For a monochromatic substance, the color of the target pixel point is equal to that of the target substance; for a color substance, the color of the target substance needs to be comprehensively analyzed after the colors of all pixel points with different colors on the target substance are identified, so as to obtain the color of the target substance.
In the present embodiment, the RGB values specifically refer to various colors obtained by changing three color channels of red (R), green (G), and blue (B) and superimposing them on each other, and include an R component corresponding to red light, a G component corresponding to green light, and a B component corresponding to blue light.
In the present embodiment, the reference background specifically refers to a standard color whose spectral function (including a spectral function of transmitted light and a spectral function of reflected light) does not change with an external factor while ignoring the influence of the lighting environment, the optical lens transmission spectrum, the image sensor spectral response difference, the algorithm difference of the image sensor, and the like.
In an embodiment of the present invention, step S1011 specifically includes:
selecting or setting a reference background in an image field of view, and acquiring an image containing a target substance and the reference background by using an image sensor;
obtaining R of target pixel point on target substancei、GiAnd BiNumerical value, while obtaining the reference background R0、G0And B0Numerical values, where i represents different pixel points.
Step S1021: and calculating the normalized color data of the target pixel point relative to the reference background according to the RGB value of the target pixel point and the RGB value of the reference background.
In an embodiment of the present invention, step S1021 specifically includes:
according to the formula:calculating normalized color data of the target pixel points;
wherein R isi、GiAnd BiR component, G component and B component of RGB value of target pixel point i respectively, R0、G0And B0Are respectively reference backgroundsR, G and B components of an RGB value of 0, Y1i、Y2iAnd Y3iNormalized color data of the R component, the G component, and the B component of the RGB value of the target pixel point i with respect to the R component, the G component, and the B component of the RGB value of the reference background 0, respectively.
In this embodiment, R of the target pixel pointi、GiAnd BiThe numerical values are specifically:
reference background R0、G0And B0The numerical values are specifically:
wherein S isiR(λ)、SiG(lambda) and SiB(lambda) is the red, green and blue spectral functions of the light transmitted or reflected by the target pixel point i, S0R(λ)、S0G(lambda) and S0B(λ) are the red, green and blue spectral functions, respectively, of the light transmitted or reflected via the reference background 0, QR(λ)、QG(lambda) and QB(λ) is a spectral response function of R, G and B components of RGB values output by the image sensor, respectively, F (λ) is a spectral function of the light source, and Δ λ is a spectral response range of the image sensor.
According to the formula:
then there are:
therefore, the formula for calculating the normalized color data of the target pixel point in step S1021 may also beCorrespondingly, in the present embodiment, step S1011 and step S1021 may be equivalently replaced by step S1012 and step S1022 at the same time.
Wherein, step S1012 is: and acquiring a spectral function and a reference background spectral function of a target pixel point on the target substance.
In this embodiment, the spectral function specifically means that under photopic vision conditions, human eyes have different perceptibility to radiation with different wavelengths in a visible spectrum range of 380-780 nm, that is, various color lights.
Step S1022 is: and calculating the normalized color data of the target pixel point relative to the reference background according to the spectral function of the target pixel point and the spectral function of the reference background.
In a specific application, the spectral function comprises a red light spectral function, a green light spectral function and a blue light spectral function; in an embodiment of the present invention, step S1022 includes:
according to the formula:calculating normalized color data of the target pixel points;
wherein S isiR(λ)、SiG(lambda) and SiB(lambda) is the red light spectral function, the green light spectral function and the blue light spectral function of the light transmitted or reflected by the target pixel point respectively, S0R(λ)、S0G(lambda) and S0B(λ) are the red, green and blue spectral functions, respectively, of the light transmitted or reflected via the reference background 0, Y1i、Y2iAnd Y3iAre respectively eyesAnd marking normalized color data of the R component, the G component and the B component of the RGB value of the pixel point i relative to the R component, the G component and the B component of the RGB value of the reference background 0.
Step S103: and calculating the correlation between the color value of the target pixel point and the color value of each standard sample in the plurality of prestored standard samples according to the normalized color data of the target pixel point and the normalized color data of the plurality of prestored standard samples.
In this embodiment, the correlation refers to a proximity between the normalized color data of the target pixel point and the normalized color data of each of the plurality of pre-stored standard samples, and specifically reflects a similarity between the target pixel point and the color of each of the plurality of standard samples.
In an embodiment of the present invention, step S103 specifically includes:
according to the formula:calculating the correlation between the color value of the target pixel point and the color value of each standard sample in the plurality of prestored standard samples;
wherein, k ═ 1,2,3, k ═ 1 corresponds to the R component, k ═ 2 corresponds to the G component, and k ═ 3 corresponds to the B component; xκjNormalized color data for the kappa component of the RGB values of the standard sample j; y isκiNormalizing color data of a kappa component of an RGB value of a target pixel point i relative to a kappa component of an RGB value of a reference background 0; rijAnd the correlation coefficient between the color value of the target pixel point i and the color value of the standard sample j is obtained.
Step S104: and selecting the color value of the standard sample with the maximum color value correlation with the target pixel point, and identifying the color value as the real color value of the target pixel point.
In this embodiment, the real color value of the target pixel specifically means an actual color value of the target pixel under the condition of ignoring influences of an illumination environment, an optical lens transmission spectrum, an image sensor spectral response difference, an image sensor algorithm difference and the like, and the color value can be specifically measured by using an RGB value.
According to the method, the normalized color data of the target pixel point relative to the reference background is calculated, the correlation between the color value of the target pixel point and the color value of each standard sample in the plurality of prestored standard samples is calculated according to the normalized color data of the target pixel point and the normalized color data of the plurality of prestored standard samples, the color value of the standard sample with the maximum correlation with the color value of the target pixel point is selected and identified as the real color value of the target pixel point, and therefore the color value of the target substance is identified under the conditions of good data stability, high accuracy and low cost.
As shown in fig. 2, in an embodiment of the present invention, before step S103, the method includes:
step S201: the RGB value of any pixel point is obtained through an image sensor, and the spectral function of any pixel point and the spectral function of a light source used for irradiating any pixel point are obtained.
In this embodiment, any pixel point refers to any pixel point on any colored substance (including gray colors such as white and black).
In specific application, the light source can be any monochromatic light source.
Step S202: and calculating the spectral response function of the image sensor according to the RGB value of any pixel point, the spectral function of any pixel point and the spectral function of the light source.
In an embodiment of the present invention, step S202 specifically includes:
according to the formula:calculating a spectral response function of the image sensor;
wherein, I1、I2And I3Decimal expression forms of R component, G component and B component, Q, of any pixel point respectivelyR(λ)、QG(lambda) and QB(lambda) is the spectral response function of the R component, G component and B component of the image sensor, S (lambda) is the spectral function of any pixel point, F (lambda) is the spectral function of the light source, and the spectral response range of the delta lambda image sensor.
In this embodiment, the image sensor is specifically a device that converts an optical image into an electronic signal, and photosensitive elements are used as basic means for image capture, each photosensitive element corresponds to an image point in the image sensor, and RGB red, green and blue filters are covered above the photosensitive elements. When the image sensor works, the image sensor converts the information of each pixel into a digital signal after being processed by the analog-to-digital converter, the digital signal is compressed in a certain format and then stored in a buffer, and then the image data is output in the form of the digital signal and the video signal according to different requirements. I is1、I2And I3Which is substantially equal to the number of photoelectrons collected by each of the three primary color channels of the image sensor.
Step S203: spectral functions of a plurality of standard samples are acquired.
Step S204: and calculating and obtaining normalized color data of the plurality of standard samples according to the spectral response function of the image sensor and the spectral functions of the plurality of standard samples, and storing the normalized color data.
In an embodiment of the present invention, step S204 specifically includes:
according to the formula:calculating to obtain normalized color data of the plurality of standard samples;
wherein, X1j、X2jAnd X3jRespectively being the standards in the plurality of standard samplesNormalized color data for the R, G, and B components of the RGB values for sample j.
In one embodiment of the present invention, step S204 is preceded by:
step S2041: establishing a database;
step S2042: storing the normalized color data for the standard sample in the database.
In specific application, a corresponding relationship between the standard sample and the color value thereof may also be established and stored in the database, and the corresponding relationship may be specifically realized by establishing a hash table or establishing a form of a mapping relationship.
In an embodiment of the present invention, on the basis of steps S2041 and S2042, step S104 may be followed by step S2043:
and storing the real color values of the identified target pixel points in a database, and updating the database.
As shown in fig. 3, an embodiment of the present invention provides a color recognition system 100 for performing the method steps in the embodiment corresponding to fig. 1, which includes:
a first obtaining unit 1011, configured to obtain RGB values of a target pixel on a target substance and RGB values of a reference background;
a first calculating unit 1021, configured to calculate normalized color data of the target pixel with respect to the reference background according to the RGB values of the target pixel and the RGB values of the reference background;
a second obtaining unit 1012, configured to obtain a spectral function of a target pixel on a target substance and a reference background spectral function;
the second calculating unit 1022, configured to calculate normalized color data of the target pixel with respect to the reference background according to the spectral function of the target pixel and the spectral function of the reference background;
the correlation calculation unit 103 is configured to calculate, according to the normalized color data of the target pixel and the normalized color data of the pre-stored multiple standard samples, a correlation between the color value of the target pixel and the color value of each of the pre-stored multiple standard samples;
and the color identification unit 104 is configured to select a color value of the standard sample having the largest color value correlation with the target pixel point, and identify the color value as a true color value of the target pixel point.
In a specific application, the first obtaining unit 1011 may specifically adopt an image sensor; the second acquiring unit 1012 may specifically be a spectrometer.
In a specific application, when calculating the normalized color data of the target pixel point by using the RGB values, the color identification system 100 may only include the first obtaining unit 1011, the first calculating unit 1021, the correlation calculating unit 103, and the color identifying unit 104; when the spectral function is employed to calculate the normalized color data of the target pixel point, the color recognition system 100 may include only the second acquisition unit 1012, the second calculation unit 1022, the correlation calculation unit 103, and the color identification unit 104.
In an embodiment of the present invention, the first obtaining unit 1011 is specifically configured to:
selecting or setting a reference background in an image field of view, and acquiring an image containing a target substance and the reference background by using an image sensor;
obtaining R of target pixel point on target substancei、GiAnd BiNumerical value, while obtaining the reference background R0、G0And B0Numerical values, where i represents different pixel points.
In an embodiment of the present invention, the first calculating unit 1021 is specifically configured to:
according to the formula:calculating normalized color data of the target pixel points;
wherein R isi、GiAnd BiR component, G component and B component of RGB value of target pixel point i respectively, R0、G0And B0R, G and B components, Y, respectively, of RGB values of a reference background 01i、Y2iAnd Y3iNormalized color data of the R component, the G component, and the B component of the RGB value of the target pixel point i with respect to the R component, the G component, and the B component of the RGB value of the reference background 0, respectively.
In an embodiment of the present invention, the second calculating unit S1022 is specifically configured to:
according to the formula:calculating normalized color data of the target pixel points;
wherein S isiR(λ)、SiG(lambda) and SiB(lambda) is the spectral function of the R, G and B components of the target pixel point i, S0R(λ)、S0G(lambda) and S0B(λ) is a spectral function of the R, G and B components, respectively, of the reference background 0, Y1i、Y2iAnd Y3iNormalized color data of the R component, the G component, and the B component of the RGB value of the target pixel point i with respect to the R component, the G component, and the B component of the RGB value of the reference background 0, respectively.
In an embodiment of the present invention, the correlation calculation unit 103 is specifically configured to:
according to the formula:calculating the correlation between the color value of the target pixel point and the color value of each standard sample in the plurality of prestored standard samples;
wherein, k ═ 1,2,3, k ═ 1 corresponds to the R component, k ═ 2 corresponds to the G component, and k ═ 3 corresponds to the B component; xκjNormalized color data for the kappa component of the RGB values of the standard sample j; y isκiNormalizing color data of a kappa component of an RGB value of a target pixel point i relative to a kappa component of an RGB value of a reference background 0; rijAnd the correlation coefficient between the color value of the target pixel point i and the color value of the standard sample j is obtained.
According to the method, the normalized color data of the target pixel point relative to the reference background is calculated, the correlation between the color value of the target pixel point and the color value of each standard sample in the plurality of prestored standard samples is calculated according to the normalized color data of the target pixel point and the normalized color data of the plurality of prestored standard samples, the color value of the standard sample with the maximum correlation with the color value of the target pixel point is selected and identified as the real color value of the target pixel point, and therefore the color value of the target substance is identified under the conditions of good data stability, high accuracy and low cost.
As shown in fig. 4, in an embodiment of the present invention, corresponding to the method steps in the embodiment corresponding to fig. 2, the color recognition system 100 further includes:
a third obtaining unit 201, configured to obtain an RGB value of any pixel point through an image sensor, and obtain a spectral function of the any pixel point and a spectral function of a light source used for illuminating the any pixel point;
a third calculating unit 202, configured to calculate a spectral response function of the image sensor according to the RGB value of any pixel point, the spectral function of any pixel point, and the spectral function of the light source;
a fourth acquiring unit 203, configured to acquire spectral functions of a plurality of standard samples;
a fourth calculating unit 204, configured to calculate and obtain normalized color data of the multiple standard samples according to the spectral response function of the image sensor and the spectral functions of the multiple standard samples, and store the normalized color data.
In an embodiment of the present invention, the third calculating unit 202 is specifically configured to:
according to the formula:calculating a spectral response function of the image sensor;
wherein, I1、I2And I3Decimal expression forms of R component, G component and B component, Q, of any pixel point respectivelyR(λ)、QG(lambda) and QB(λ) is a spectral response function of R, G and B components of the RGB values output by the image sensor, S (λ) is a spectral function of any pixel, F (λ) is a spectral function of the light source, and Δ λ is a spectral response range of the image sensor.
In an embodiment of the present invention, the fourth calculating unit 204 is specifically configured to:
according to the formula:and calculating to obtain normalized color data of the plurality of standard samples.
Wherein, X1j、X2jAnd X3jNormalized color data of R, G, and B components of the RGB values of standard sample j in the plurality of standard samples, respectively.
In one embodiment of the present invention, the color recognition system 100 further comprises:
the establishing unit is used for establishing a database;
and the storage unit is used for storing the normalized color data of the standard sample in the database.
In an embodiment of the present invention, the color recognition system 100 may further include:
and the updating unit is used for storing the real color values of the identified target pixel points in a database and updating the database.
In a specific application, all operations related to acquiring RGB values in the above embodiment may be completed by using the same image sensor, and all operations related to acquiring a spectral function may be completed by using the same spectrometer, and by this means, errors caused by different devices may be eliminated, so that influences of an illumination environment, an optical lens transmission spectrum, an image sensor spectral response, an image sensor algorithm, and the like may be ignored.
In this embodiment, a reference basis can be provided for subsequently calculating the color value of the target pixel point by calculating the spectral response function of the image sensor, and calculating and storing the normalized color data of the plurality of standard samples according to the spectral response function of the image sensor and the spectral functions of the plurality of standard samples. In specific application, spectral functions of more standard samples should be acquired as much as possible to calculate normalized color data of more standard samples, so as to provide data support for calculating color values of target pixels.
In a specific application, the color identification method and system provided by the embodiment of the invention can be applied to the following fields, which include:
(1) medical test paper reaction color identification
And (3) reacting the standard solution with known concentration with the test paper, and establishing a reaction color database with known concentration by using the white background of the test paper as a reference background. The RGB value of a target pixel point on a target substance and the RGB value of a white reference background of the test paper are obtained simultaneously in an imaging mode, normalized color data of the target pixel point relative to the reference background are obtained through calculation, correlation detection is carried out on the normalized color data of the target pixel point and reaction color data with known concentration, and the most relevant color is searched to serve as a detection result.
By using the color identification method, the influence of factors such as illumination environment influence, difference of quantum efficiency of different sensors, difference of sensor algorithms and the like in the imaging process can be eliminated, the universality is strong, and the reaction color of the test paper can be timely and accurately searched and identified in a complex illumination environment by using a mobile terminal such as a color camera of a smart phone.
(2) Impurity metal identification in electric vehicle battery production line
The method comprises the steps of carrying out spectral analysis on several main impurity metals such as copper, aluminum, steel and the like in a laboratory to obtain spectral functions of a plurality of standard samples of the copper, the aluminum, the steel and the like, simultaneously measuring a spectral response function of an image sensor, calculating normalized color data of the plurality of standard samples of the copper, the aluminum, the steel and the like according to the spectral response function of the image sensor and the spectral functions of the plurality of standard samples of the copper, the aluminum, the steel and the like, and taking the normalized color data as color values of the standard samples of the impurity metals (the copper, the aluminum, the steel and the like) irrelevant to the illumination environment.
The same diffuse reflection white board is arranged on a production line, the RGB value of a target pixel point on a target substance and the RGB value of the diffuse reflection white board are obtained simultaneously through a color industrial camera, normalized color data of the target pixel point relative to the diffuse reflection white board are obtained through calculation, correlation detection is carried out on the normalized color data and the color value of an impurity metal standard sample, and impurity metals in products are searched and identified.
By utilizing the color identification method, the influence of factors such as illumination environment influence, difference of quantum efficiency of different sensors, difference of sensor algorithms and the like in the imaging process can be eliminated, and the fine color difference of different impurity metals can be searched and identified with high precision.
(3) Color identification of automotive bodies
In different lighting environments, the color information of the automobile body will generate large differences. And calculating to obtain the normalized color data of the aluminum alloy hub by measuring the spectral response function of the image sensor and the spectral function of the aluminum alloy hub. When the color of the automobile body is searched and identified, the RGB value of the automobile body and the RGB value of the aluminum alloy hub are obtained by using the image sensor, the normalized color data of the automobile body relative to the aluminum alloy hub is calculated, correlation detection is carried out on the normalized color data of the automobile body relative to the aluminum alloy hub obtained by actual photographing and the normalized color data of the aluminum alloy hub, and the real color value of the automobile body, which is irrelevant to the illumination environment and photographic equipment, is determined by using the maximum correlation coefficient.
The present invention is not limited to the above preferred embodiments, and any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A color recognition method, characterized in that the color recognition method comprises:
acquiring RGB values of target pixel points on a target substance and RGB values of a reference background;
calculating normalized color data of the target pixel point relative to the reference background according to the RGB value of the target pixel point and the RGB value of the reference background;
or acquiring a spectral function and a reference background spectral function of a target pixel point on a target substance;
calculating normalized color data of the target pixel point relative to the reference background according to the spectral function of the target pixel point and the spectral function of the reference background;
calculating the correlation between the color value of the target pixel point and the color value of each standard sample in the plurality of prestored standard samples according to the normalized color data of the target pixel point and the normalized color data of the plurality of prestored standard samples;
and selecting the color value of the standard sample with the maximum color value correlation with the target pixel point, and identifying the color value as the real color value of the target pixel point.
2. The color identification method of claim 1, wherein before calculating the correlation between the color value of the target pixel and the color value of each of the plurality of pre-stored standard samples based on the normalized color data of the target pixel and the normalized color data of the plurality of pre-stored standard samples, the method comprises:
acquiring an RGB value of any pixel point through an image sensor, and acquiring a spectral function of any pixel point and a spectral function of a light source for irradiating any pixel point;
calculating a spectral response function of the image sensor according to the RGB value of any pixel point, the spectral function of any pixel point and the spectral function of the light source;
acquiring spectral functions of a plurality of standard samples;
and calculating and obtaining normalized color data of the plurality of standard samples according to the spectral response function of the image sensor and the spectral functions of the plurality of standard samples, and storing the normalized color data.
3. The color identification method of claim 2, wherein the RGB values include an R component, a G component, and a B component, and the calculating the spectral response function of the image sensor based on the RGB values of the any one pixel point, the spectral function of the any one pixel point, and the spectral function of the light source comprises:
according to the formula:calculating a spectral response function of the image sensor;
wherein, I1、I2And I3Decimal expression forms of R component, G component and B component, Q, of any pixel pointR(λ)、QG(lambda) and QB(λ) is a spectral response function of R, G and B components of the RGB values output by the image sensor, respectively, S (λ) is a spectral function of any one of the pixel points, F (λ) is a spectral function of the light source, and Δ λ is a spectral response range of the image sensor;
the calculating normalized color data of the plurality of standard samples according to the spectral response function of the image sensor and the spectral functions of the plurality of standard samples includes:
according to the formula:calculating to obtain normalized color data of the plurality of standard samples;
wherein, X1j、X2jAnd X3jNormalized color data of R, G, and B components of the RGB values of standard sample j in the plurality of standard samples, respectively.
4. The color identification method of claim 1, wherein the RGB values include an R component, a G component, and a B component, and the calculating the normalized color data of the target pixel point with respect to the reference background based on the RGB values of the target pixel point and the RGB values of the reference background comprises:
according to the formula:calculating normalized color data of the target pixel points;
wherein,Ri、Giand BiR component, G component and B component of RGB value of target pixel point i respectively, R0、G0And B0R, G and B components, Y, respectively, of RGB values of a reference background 01i、Y2iAnd Y3iRespectively normalizing color data of an R component, a G component and a B component of the RGB value of the target pixel point i relative to the R component, the G component and the B component of the RGB value of the reference background 0;
the spectral functions include a red light spectral function, a green light spectral function and a blue light spectral function, and the calculating of the normalized color data of the target pixel point relative to the reference background according to the spectral function of the target pixel point and the spectral function of the reference background includes:
according to the formula:calculating normalized color data of the target pixel points;
wherein S isiR(λ)、SiG(lambda) and SiB(lambda) is the red, green and blue spectral functions of the light transmitted or reflected by the target pixel point i, S0R(λ)、S0G(lambda) and S0B(λ) are the red, green and blue spectral functions, respectively, of the light transmitted or reflected via the reference background 0, Y1i、Y2iAnd Y3iNormalized color data of the R component, the G component, and the B component of the RGB value of the target pixel point i with respect to the R component, the G component, and the B component of the RGB value of the reference background 0, respectively.
5. The color identification method of claim 4, wherein the calculating the correlation between the color value of the target pixel and the color value of each of the plurality of pre-stored standard samples according to the normalized color data of the target pixel and the normalized color data of the plurality of pre-stored standard samples comprises:
according to the formula:calculating the correlation between the color value of the target pixel point and the color value of each standard sample in the plurality of prestored standard samples;
wherein, k ═ 1,2,3, k ═ 1 corresponds to the R component, k ═ 2 corresponds to the G component, and k ═ 3 corresponds to the B component; xκjNormalized color data for the kappa component of the RGB values of the standard sample j; y isκiNormalizing color data of a kappa component of an RGB value of a target pixel point i relative to a kappa component of an RGB value of a reference background 0; rijAnd the correlation coefficient between the color value of the target pixel point i and the color value of the standard sample j is obtained.
6. A color recognition system, characterized in that the color recognition system comprises:
the first acquisition unit is used for acquiring the RGB value of a target pixel point on a target substance and the RGB value of a reference background;
the first calculating unit is used for calculating the normalized color data of the target pixel point relative to the reference background according to the RGB value of the target pixel point and the RGB value of the reference background;
the second acquisition unit is used for acquiring a spectral function and a reference background spectral function of a target pixel point on a target substance;
the second calculation unit is used for calculating the normalized color data of the target pixel point relative to the reference background according to the spectral function of the target pixel point and the spectral function of the reference background;
the correlation calculation unit is used for calculating the correlation between the color value of the target pixel point and the color value of each standard sample in the plurality of pre-stored standard samples according to the normalized color data of the target pixel point and the normalized color data of the plurality of pre-stored standard samples;
and the color identification unit is used for selecting the color value of the standard sample with the maximum color value correlation with the target pixel point and identifying the color value as the real color value of the target pixel point.
7. The color recognition system according to claim 6, wherein before the correlation calculation unit calculates the correlation, it comprises:
the third acquisition unit is used for acquiring the RGB value of any pixel point through the image sensor and acquiring the spectral function of any pixel point and the spectral function of a light source for irradiating any pixel point;
the third calculating unit is used for calculating a spectral response function of the image sensor according to the RGB value of any pixel point, the spectral function of any pixel point and the spectral function of the light source;
a fourth acquiring unit for acquiring spectral functions of the plurality of standard samples;
and the fourth calculating unit is used for calculating and obtaining the normalized color data of the plurality of standard samples according to the spectral response function of the image sensor and the spectral functions of the plurality of standard samples and storing the normalized color data.
8. The color identification system of claim 7 wherein said RGB values comprise an R component, a G component, and a B component, said calculating a spectral response function of said image sensor from said RGB values of said any pixel, said spectral function of said any pixel, and said spectral function of said light source comprises:
according to the formula:calculating a spectral response function of the image sensor;
wherein, I1、I2And I3Decimal expression forms of R component, G component and B component, Q, of any pixel pointR(λ)、QG(lambda) and QB(λ) is the spectral response function of the R, G, and B components of the RGB values output by the image sensor, respectively, S (λ) is the spectral function of any one of the pixel points, and F (λ) is the spectrum of the light sourceA function, Δ λ, is a spectral response range of the image sensor;
the calculating normalized color data of the plurality of standard samples according to the spectral response function of the image sensor and the spectral functions of the plurality of standard samples includes:
according to the formula:calculating to obtain normalized color data of the plurality of standard samples;
wherein, X1j、X2jAnd X3jNormalized color data of R, G, and B components of the RGB values of standard sample j in the plurality of standard samples, respectively.
9. The color identification system of claim 6 wherein said RGB values include an R component, a G component, and a B component, said calculating normalized color data for said target pixel point relative to said reference background based on said RGB value for said target pixel point and said RGB value for said reference background comprises:
according to the formula:calculating normalized color data of the target pixel points;
wherein R isi、GiAnd BiR component, G component and B component of RGB value of target pixel point i respectively, R0、G0And B0R, G and B components, Y, respectively, of RGB values of a reference background 01i、Y2iAnd Y3iRespectively normalizing color data of an R component, a G component and a B component of the RGB value of the target pixel point i relative to the R component, the G component and the B component of the RGB value of the reference background 0;
the spectral functions include a red light spectral function, a green light spectral function and a blue light spectral function, and the calculating of the normalized color data of the target pixel point relative to the reference background according to the spectral function of the target pixel point and the spectral function of the reference background includes:
according to the formula:calculating normalized color data of the target pixel points;
wherein S isiR(λ)、SiG(lambda) and SiB(lambda) is the red, green and blue spectral functions of the light transmitted or reflected by the target pixel point i, S0R(λ)、S0G(lambda) and S0B(λ) are the red, green and blue spectral functions, respectively, of the light transmitted or reflected via the reference background 0, Y1i、Y2iAnd Y3iNormalized color data of the R component, the G component, and the B component of the RGB value of the target pixel point i with respect to the R component, the G component, and the B component of the RGB value of the reference background 0, respectively.
10. The color identification method of claim 9, wherein the calculating the correlation between the color value of the target pixel and the color value of each of the plurality of pre-stored standard samples according to the normalized color data of the target pixel and the normalized color data of the plurality of pre-stored standard samples comprises:
according to the formula:calculating the correlation between the color value of the target pixel point and the color value of each standard sample in the plurality of prestored standard samples;
wherein, k ═ 1,2,3, k ═ 1 corresponds to the R component, k ═ 2 corresponds to the G component, and k ═ 3 corresponds to the B component; xκjNormalized color data for the kappa component of the RGB values of the standard sample j; y isκiNormalizing color data of a kappa component of an RGB value of a target pixel point i relative to a kappa component of an RGB value of a reference background 0; rijThe color value of the target pixel point i and the color of the standard sample jCorrelation coefficient between color values.
CN201611169819.6A 2016-12-16 2016-12-16 Color identification method and system Active CN106683140B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201611169819.6A CN106683140B (en) 2016-12-16 2016-12-16 Color identification method and system
PCT/CN2017/114326 WO2018107983A1 (en) 2016-12-16 2017-12-01 Colour recognition method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611169819.6A CN106683140B (en) 2016-12-16 2016-12-16 Color identification method and system

Publications (2)

Publication Number Publication Date
CN106683140A true CN106683140A (en) 2017-05-17
CN106683140B CN106683140B (en) 2019-12-17

Family

ID=58870767

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611169819.6A Active CN106683140B (en) 2016-12-16 2016-12-16 Color identification method and system

Country Status (2)

Country Link
CN (1) CN106683140B (en)
WO (1) WO2018107983A1 (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018107983A1 (en) * 2016-12-16 2018-06-21 深圳市中达瑞和科技有限公司 Colour recognition method and system
CN109118549A (en) * 2018-07-20 2019-01-01 上海电力学院 A method of making object of reference with white printing paper and restores object color
CN109155071A (en) * 2017-06-30 2019-01-04 华为技术有限公司 A kind of method and terminal of color detection
CN109596606A (en) * 2018-12-12 2019-04-09 华南理工大学 A kind of ascorbic acid colorimetric detection method based on degradability nano enzyme
CN109991216A (en) * 2019-03-12 2019-07-09 深圳市象形字科技股份有限公司 A kind of uroscopy instrument test strips color identification method
CN110084808A (en) * 2019-05-06 2019-08-02 智影汇谱(宁波)科技有限公司 A kind of color solution mixing method and image processing apparatus for digital endoscope
CN110475036A (en) * 2019-06-28 2019-11-19 佛山市景瞳科技有限公司 A kind of multispectral section of ceramic spectrum reduction system and method
CN110525872A (en) * 2019-08-27 2019-12-03 张紫薇 Automatic sorting replenishing method and system
CN111340896A (en) * 2020-02-21 2020-06-26 北京迈格威科技有限公司 Object color identification method and device, computer equipment and storage medium
CN112474411A (en) * 2020-09-27 2021-03-12 江苏金卫机械设备有限公司 Product detection automatic processing control system based on flexible production line
CN117379033A (en) * 2023-12-13 2024-01-12 深圳市宗匠科技有限公司 Skin pigment detection method, device, computer equipment and storage medium

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111229649B (en) * 2020-01-20 2023-09-01 湖北民族大学 Article grading method and automatic grading system
CN111582290B (en) * 2020-05-13 2023-04-07 郑州轻工业大学 Computer image recognition method
CN112992039B (en) * 2021-03-27 2023-01-06 惠仁康宁(苏州)健康科技有限公司 Real-time acquisition method for optical radiation visual health information of display screen
CN113409221B (en) * 2021-06-30 2023-12-12 深圳万兴软件有限公司 Image color matting method, system, computer equipment and storage medium
CN116777942B (en) * 2023-06-08 2024-09-03 浙江大学 Method, system and equipment for automatically extracting pixels of crop leaves

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101282489A (en) * 2008-04-24 2008-10-08 北京中星微电子有限公司 Light source detection apparatus and method as well as image processing method
CN103973980A (en) * 2014-04-25 2014-08-06 杭州电子科技大学 Method for acquiring multispectral images based on digital camera
JP2014185958A (en) * 2013-03-25 2014-10-02 Seiko Epson Corp Coloration measuring device
CN104964973A (en) * 2015-07-08 2015-10-07 邓双胜 Test paper reading and analyzing method and system based on mobile terminal camera
EP3008722A2 (en) * 2013-06-10 2016-04-20 The University of Mississippi Medical Center Medical image processing method
CN105551052A (en) * 2016-01-08 2016-05-04 青岛农业大学 White board calibration system and calibration method of digital image data
CN105865629A (en) * 2016-03-25 2016-08-17 上海电机学院 Object color recognition method for robot

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3970052B2 (en) * 2002-02-27 2007-09-05 キヤノン株式会社 Image processing device
CN101334835B (en) * 2008-07-28 2011-01-12 上海高德威智能交通系统有限公司 Color recognition method
CN102184413B (en) * 2011-05-16 2013-06-12 浙江大华技术股份有限公司 Automatic vehicle body color recognition method of intelligent vehicle monitoring system
US9135719B1 (en) * 2014-06-26 2015-09-15 Amazon Technologies, Inc. Color name generation from images and color palettes
CN104713835B (en) * 2015-03-25 2017-09-29 上海烟草集团有限责任公司 A kind of tobacco leaf color quantizes recognition methods online
CN106683140B (en) * 2016-12-16 2019-12-17 深圳市中达瑞和科技有限公司 Color identification method and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101282489A (en) * 2008-04-24 2008-10-08 北京中星微电子有限公司 Light source detection apparatus and method as well as image processing method
JP2014185958A (en) * 2013-03-25 2014-10-02 Seiko Epson Corp Coloration measuring device
EP3008722A2 (en) * 2013-06-10 2016-04-20 The University of Mississippi Medical Center Medical image processing method
CN103973980A (en) * 2014-04-25 2014-08-06 杭州电子科技大学 Method for acquiring multispectral images based on digital camera
CN104964973A (en) * 2015-07-08 2015-10-07 邓双胜 Test paper reading and analyzing method and system based on mobile terminal camera
CN105551052A (en) * 2016-01-08 2016-05-04 青岛农业大学 White board calibration system and calibration method of digital image data
CN105865629A (en) * 2016-03-25 2016-08-17 上海电机学院 Object color recognition method for robot

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
景娜: "车身颜色识别中的几个重要方法的研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
郑芝寰: "颜色成像中的反射分量分离及光谱测量研究", 《中国博士学位论文全文数据库 信息科技辑》 *

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018107983A1 (en) * 2016-12-16 2018-06-21 深圳市中达瑞和科技有限公司 Colour recognition method and system
CN109155071B (en) * 2017-06-30 2021-01-29 华为技术有限公司 Color detection method and terminal
CN109155071A (en) * 2017-06-30 2019-01-04 华为技术有限公司 A kind of method and terminal of color detection
US11284013B2 (en) 2017-06-30 2022-03-22 Huawei Technologies Co., Ltd. Color detection method and terminal
CN109118549A (en) * 2018-07-20 2019-01-01 上海电力学院 A method of making object of reference with white printing paper and restores object color
CN109596606A (en) * 2018-12-12 2019-04-09 华南理工大学 A kind of ascorbic acid colorimetric detection method based on degradability nano enzyme
CN109991216A (en) * 2019-03-12 2019-07-09 深圳市象形字科技股份有限公司 A kind of uroscopy instrument test strips color identification method
CN110084808A (en) * 2019-05-06 2019-08-02 智影汇谱(宁波)科技有限公司 A kind of color solution mixing method and image processing apparatus for digital endoscope
CN110475036A (en) * 2019-06-28 2019-11-19 佛山市景瞳科技有限公司 A kind of multispectral section of ceramic spectrum reduction system and method
CN110475036B (en) * 2019-06-28 2021-08-27 佛山市景瞳科技有限公司 Multi-spectral-band ceramic spectrum reduction system and method
CN110525872A (en) * 2019-08-27 2019-12-03 张紫薇 Automatic sorting replenishing method and system
CN111340896A (en) * 2020-02-21 2020-06-26 北京迈格威科技有限公司 Object color identification method and device, computer equipment and storage medium
CN111340896B (en) * 2020-02-21 2023-10-27 北京迈格威科技有限公司 Object color recognition method, device, computer equipment and storage medium
CN112474411A (en) * 2020-09-27 2021-03-12 江苏金卫机械设备有限公司 Product detection automatic processing control system based on flexible production line
CN117379033A (en) * 2023-12-13 2024-01-12 深圳市宗匠科技有限公司 Skin pigment detection method, device, computer equipment and storage medium
CN117379033B (en) * 2023-12-13 2024-02-20 深圳市宗匠科技有限公司 Skin pigment detection method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
WO2018107983A1 (en) 2018-06-21
CN106683140B (en) 2019-12-17

Similar Documents

Publication Publication Date Title
CN106683140B (en) Color identification method and system
US10200582B2 (en) Measuring device, system and program
JP6673833B2 (en) Analysis equipment
US10643099B2 (en) Multi-agent training of a color identification neural network
Skandarajah et al. Quantitative imaging with a mobile phone microscope
US10514335B2 (en) Systems and methods for optical spectrometer calibration
US10571506B2 (en) Multi-fiber identification using jacket color
CN110222698B (en) Method and system for water quality analysis based on color information processing
CN106991679A (en) One kind quantifies recognition methods based on cloud platform urine test paper physical signs
Nixon et al. Accurate device-independent colorimetric measurements using smartphones
CN114503097A (en) Method and apparatus for color lookup using mobile device
JPH10221036A (en) Method and apparatus for automatically identifying kind of part
US20170264876A1 (en) Method for correcting a color reproduction of a digital microscope and digital microscopee
Stanco et al. Computer graphics solutions for pottery colors specification
CN107101955A (en) A kind of LED cottons chromatic measuring system and a kind of LED cottons method for measuring color
CN112461762B (en) Solution turbidity detection method, medium and image processing system based on HSV model
CN114527116A (en) Ambient light correction array type colorimetric analysis system and method based on intelligent equipment
CN112200200B (en) LED light color detection method
JP2005189119A (en) Color measuring method and color measuring device
CN208350647U (en) A kind of visual sensor device for realizing substance qualitative and quantitative detection based on chrominance response
Kautsar et al. Estimating SPAD, Nitrogen Concentration, and Chlorophyll Content in Rice Leaves using Calibrated Smartphone Digital Image
JP2024101878A (en) Spectroscopic measurement method, spectroscopic measurement device, and spectroscopic measurement program
CN115824982A (en) Optical POCT color interpretation method, system and device
CN115019059A (en) Secretion test paper image identification method based on color correction mode
CN110969596A (en) Product color correction method and product color correction system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A method and system of color recognition

Effective date of registration: 20210520

Granted publication date: 20191217

Pledgee: Shenzhen SME financing Company limited by guarantee

Pledgor: SHENZHEN WAYHO TECHNOLOGY Co.,Ltd.

Registration number: Y2021980003843

PE01 Entry into force of the registration of the contract for pledge of patent right
PC01 Cancellation of the registration of the contract for pledge of patent right

Granted publication date: 20191217

Pledgee: Shenzhen SME financing Company limited by guarantee

Pledgor: SHENZHEN WAYHO TECHNOLOGY Co.,Ltd.

Registration number: Y2021980003843

PC01 Cancellation of the registration of the contract for pledge of patent right