CN107462330A - A kind of color identification method and system - Google Patents
A kind of color identification method and system Download PDFInfo
- Publication number
- CN107462330A CN107462330A CN201710705570.4A CN201710705570A CN107462330A CN 107462330 A CN107462330 A CN 107462330A CN 201710705570 A CN201710705570 A CN 201710705570A CN 107462330 A CN107462330 A CN 107462330A
- Authority
- CN
- China
- Prior art keywords
- color
- characteristic vector
- type
- spectroscopic data
- colour recognition
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 56
- 238000004611 spectroscopical analysis Methods 0.000 claims abstract description 48
- 238000001228 spectrum Methods 0.000 claims abstract description 27
- 238000012360 testing method Methods 0.000 claims description 36
- 230000037452 priming Effects 0.000 claims description 26
- 238000012549 training Methods 0.000 claims description 19
- 238000011156 evaluation Methods 0.000 claims description 12
- 238000005259 measurement Methods 0.000 claims description 12
- 239000003086 colorant Substances 0.000 claims description 10
- 238000012706 support-vector machine Methods 0.000 claims description 9
- 238000010521 absorption reaction Methods 0.000 claims description 7
- 239000011248 coating agent Substances 0.000 claims description 6
- 238000000576 coating method Methods 0.000 claims description 6
- 238000005070 sampling Methods 0.000 claims description 4
- 238000001514 detection method Methods 0.000 claims description 2
- 238000007789 sealing Methods 0.000 claims description 2
- 238000004040 coloring Methods 0.000 abstract description 5
- 238000005516 engineering process Methods 0.000 abstract description 4
- 230000006870 function Effects 0.000 description 18
- 230000000875 corresponding effect Effects 0.000 description 11
- 230000008569 process Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 4
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 210000004209 hair Anatomy 0.000 description 3
- 239000003973 paint Substances 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000003860 storage Methods 0.000 description 3
- 230000009471 action Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000008878 coupling Effects 0.000 description 2
- 239000006071 cream Substances 0.000 description 2
- JBRZTFJDHDCESZ-UHFFFAOYSA-N AsGa Chemical compound [As]#[Ga] JBRZTFJDHDCESZ-UHFFFAOYSA-N 0.000 description 1
- 244000248349 Citrus limon Species 0.000 description 1
- 235000005979 Citrus limon Nutrition 0.000 description 1
- 229910000661 Mercury cadmium telluride Inorganic materials 0.000 description 1
- XUIMIQQOPSSXEZ-UHFFFAOYSA-N Silicon Chemical compound [Si] XUIMIQQOPSSXEZ-UHFFFAOYSA-N 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- MCMSPRNYOJJPIZ-UHFFFAOYSA-N cadmium;mercury;tellurium Chemical compound [Cd]=[Te]=[Hg] MCMSPRNYOJJPIZ-UHFFFAOYSA-N 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000002596 correlated effect Effects 0.000 description 1
- 238000005034 decoration Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 229910052732 germanium Inorganic materials 0.000 description 1
- GNPVGFCGXDBREM-UHFFFAOYSA-N germanium atom Chemical compound [Ge] GNPVGFCGXDBREM-UHFFFAOYSA-N 0.000 description 1
- 239000011521 glass Substances 0.000 description 1
- 230000008676 import Effects 0.000 description 1
- 229910052738 indium Inorganic materials 0.000 description 1
- APFVFJFRJDLVQX-UHFFFAOYSA-N indium atom Chemical compound [In] APFVFJFRJDLVQX-UHFFFAOYSA-N 0.000 description 1
- 238000009776 industrial production Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000007935 neutral effect Effects 0.000 description 1
- 230000001151 other effect Effects 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 229910052710 silicon Inorganic materials 0.000 description 1
- 239000010703 silicon Substances 0.000 description 1
- 230000003595 spectral effect Effects 0.000 description 1
- OCGWQDWYSQAFTO-UHFFFAOYSA-N tellanylidenelead Chemical compound [Pb]=[Te] OCGWQDWYSQAFTO-UHFFFAOYSA-N 0.000 description 1
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01J—MEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
- G01J3/00—Spectrometry; Spectrophotometry; Monochromators; Measuring colours
- G01J3/46—Measurement of colour; Colour measuring devices, e.g. colorimeters
- G01J3/50—Measurement of colour; Colour measuring devices, e.g. colorimeters using electric radiation detectors
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01J—MEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
- G01J3/00—Spectrometry; Spectrophotometry; Monochromators; Measuring colours
- G01J3/28—Investigating the spectrum
- G01J3/2803—Investigating the spectrum using photoelectric array detector
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01J—MEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
- G01J3/00—Spectrometry; Spectrophotometry; Monochromators; Measuring colours
- G01J3/28—Investigating the spectrum
- G01J3/42—Absorption spectrometry; Double beam spectrometry; Flicker spectrometry; Reflection spectrometry
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01J—MEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
- G01J3/00—Spectrometry; Spectrophotometry; Monochromators; Measuring colours
- G01J3/46—Measurement of colour; Colour measuring devices, e.g. colorimeters
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
- G06F18/2411—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on the proximity to a decision surface, e.g. support vector machines
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01J—MEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
- G01J3/00—Spectrometry; Spectrophotometry; Monochromators; Measuring colours
- G01J3/28—Investigating the spectrum
- G01J3/42—Absorption spectrometry; Double beam spectrometry; Flicker spectrometry; Reflection spectrometry
- G01J2003/425—Reflectance
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01J—MEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
- G01J3/00—Spectrometry; Spectrophotometry; Monochromators; Measuring colours
- G01J3/46—Measurement of colour; Colour measuring devices, e.g. colorimeters
- G01J2003/467—Colour computing
Abstract
The embodiment of the present invention provides a kind of color identification method and system, is related to field of terminal technology.Wherein, this method includes:The spectroscopic data of color to be identified is obtained, the characteristic vector of color to be identified is extracted from spectroscopic data, characteristic vector is inputted to preset colour recognition model, obtains the color type of color to be identified.On the one hand, for the above method using the color spectrum data to be identified of acquisition, colouring information is comprehensive, on the other hand, the shortcomings that using colour recognition model RGB sensors being avoided to identify color, color type is directly obtained, greatly improves the precision of colour recognition.
Description
Technical field
The invention belongs to electronic technology field, more particularly to a kind of color identification method and system.
Background technology
High speed and automation with modern industrial production, the colour recognition work to be played a leading role with human eye will be more next
Substituted more by color sensor.Color sensor measures suitable for colorimeter, can by color by color sensor
To apply in each technical field, such as:Library is classified using color to document, can be greatly enhanced framed bent management
With statistics etc. work:In packaging industry, product different property or purposes can be represented using different colours or decoration.
Current color sensor is usually RGB (RGB) sensor, and it is mainly on independent photodiode
Red R, green G, blue B optical filter of the covering by amendment, are then handled output signal, could be known color signal accordingly
Do not come out.So, it is seen that object color, actually body surface absorbs the white light (daylight) being irradiated to above it
In a part of colored component, and reaction of another part colored light reflected in human eye.It is conspicuous according to roentgen
Mu Huozi three primary colors are theoretical to be understood, a variety of colors is mixed by the three primary colors (red, green, blue) of different proportion.White
It is to mix what is formed by the visible ray of various frequencies, that is to say, that the coloured light that a variety of colors is included in white light is (such as red
R, yellow Y, green G, blue or green V, blue B, purple P).
Currently used color sensor has two in actual applications, first, theoretically, white be by
What red, green and the blueness of equivalent mixed, but the three primary colors actually in white are not fully equal.Because RGB is passed
Sensor is different to the sensitiveness of these three Essential colour, causes RGB outputs unequal, it is then desired to carry out white balance before testing
Adjustment.However, blank level adjustment is easily disturbed by ambient light, caused by it is low to colour recognition precision the problem of.Secondly as
The resolution ratio of RGB sensors and the limited resolution of signal acquisition circuit, it is difficult to carry out careful accurate division to color.Due to
Above-mentioned reason, the precision for causing current color to identify are low.
The content of the invention
The present invention provides a kind of color identification method and system, it is intended to when solving to carry out colour recognition using RGB sensors
Need to carry out blank level adjustment, on the one hand because blank level adjustment is easily disturbed by ambient light, on the other hand because RGB is passed
The resolution ratio of sensor and the limited resolution of signal acquisition circuit, the precision of colour recognition caused by these two aspects reason is low to ask
Topic.
A kind of color identification method that first aspect present invention provides, including:
Obtain the spectroscopic data of color to be identified;
The characteristic vector of the color to be identified is extracted from the spectroscopic data;
The characteristic vector is inputted to preset colour recognition model, obtains the color type of the color to be identified.
A kind of Color Recognition System that second aspect of the present invention provides, including:Spectra collection device and terminal;
Wherein, the terminal is used for the color identification method for realizing first aspect, and the spectra collection device is used for institute
State terminal and spectroscopic data is provided;
The spectra collection device includes:Light emitting diode, detector, printed circuit board (PCB), light pipe and base, the hair
Optical diode and the detector are connected with the printed circuit board (PCB) respectively;
The light emitting diode, for launching light;
The light pipe be one end sealing hollow transparent pipe, wherein, the inwall of the sealed end of the light pipe with it is described
Detector is relative, and the pipe edge of the other end of the light pipe is relative with the light emitting diode, and the light pipe is except sealed end
Outside inner and outer wall, remaining inner and outer wall is coated with reflectance coating, and the light for the light emitting diode to be launched carries out anti-
Penetrate, with directive object under test;
The detector, for receiving the light of the object under test reflection by the sealed end of the light pipe;
The base, for fixing the printed circuit board (PCB) and the light pipe.
A kind of color identification method provided by the invention and system, the feature that will be obtained from the spectroscopic data of color to be identified
Vector is input to the type that preset colour recognition model can obtain color to be identified.On the one hand, this method is using obtaining
The color spectrum data to be identified taken, colouring information are comprehensive;On the other hand, RGB can be avoided to sense using colour recognition model
Device identifies the shortcomings that color, directly obtains color type, greatly improves the precision of colour recognition.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are only this
Some embodiments of invention.
Fig. 1 is a kind of implementation process schematic diagram for color identification method that first embodiment of the invention provides;
Fig. 2 is a kind of implementation process schematic diagram for color identification method that second embodiment of the invention provides;
Fig. 3 is relation of the different wave length with absorbing luminous intensity in each color type that second embodiment of the invention provides
Figure;
Fig. 4 is each feature in a kind of color type that second embodiment of the invention provides under 16 different wavelength
The histogram of the variance of value;
Fig. 5 is the color type for 25 SVMs colour recognition models output that second embodiment of the invention provides
The figure of error rate;
Fig. 6 is a kind of structural representation for Color Recognition System that third embodiment of the invention provides;
Fig. 7 is the structural representation for the spectra collection device that third embodiment of the invention provides;
Fig. 8 is the profile for the spectra collection device that third embodiment of the invention provides;
Fig. 9 is another profile for the spectra collection device that third embodiment of the invention provides.
Embodiment
To enable goal of the invention, feature, the advantage of the present invention more obvious and understandable, below in conjunction with the present invention
Accompanying drawing in embodiment, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described reality
It is only part of the embodiment of the present invention to apply example, and not all embodiments.Based on the embodiment in the present invention, people in the art
The every other embodiment that member is obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
Referring to Fig. 1, Fig. 1 is the implementation process schematic diagram for the color identification method that first embodiment of the invention provides, Fig. 1
The shown neck people's recognition methods that connects mainly includes the following steps that:
S101, the spectroscopic data for obtaining color to be identified;
Color to be identified is the color on object to be identified.Specifically, it is to be identified that spectra collection device can be utilized to gather
Color on object obtains the spectroscopic data of color to be identified, can also be obtained by inputting the spectroscopic data of color to be identified
Take.
S102, the characteristic vector for extracting from the spectroscopic data color to be identified;
Characteristic vector is the data for representing spectroscopic data color.
S103, this feature vector inputted into preset colour recognition model, obtain the color type of the color to be identified.
A kind of color identification method provided in an embodiment of the present invention, the feature that will be obtained from the spectroscopic data of color to be identified
Vector is input to the type that preset colour recognition model can obtain color to be identified.On the one hand, this method is using obtaining
The color spectrum data to be identified taken, colouring information are comprehensive;On the other hand, RGB can be avoided to sense using colour recognition model
Device identifies the shortcomings that color, directly obtains color type, greatly improves the precision of colour recognition.
Referring to Fig. 2, Fig. 2 is the implementation process schematic diagram for the color identification method that second embodiment of the invention provides, Fig. 2
Shown color identification method mainly includes the following steps that:
S201, the spectroscopic data for obtaining color to be identified;
Color to be identified is the color on object to be identified.Specifically, it is to be identified that spectra collection device can be utilized to gather
Color on object obtains the spectroscopic data of color to be identified, can also be obtained by inputting the spectroscopic data of color to be identified
Take.Generally, the spectroscopic data of each color is made up of the absorption luminous intensity of 16 different wave lengths, as shown in figure 3, Fig. 3 is paint film
Graph of a relation of the different wave length of 83 kinds of colors with absorbing luminous intensity in color standard card, show 16 different ripples of 83 kinds of colors
Long absorption luminous intensity.
S202, extract from the spectroscopic data different wave length absorption luminous intensity feature of the value as the spectroscopic data
Value;
As shown in figure 3, from Fig. 3 wavelength illustrated and the graph of a relation of absorption luminous intensity, the 16 of each color type is recorded
The value of luminous intensity, the characteristic value as the spectroscopic data of each color type are absorbed corresponding to individual wavelength.
S203, validity feature value is chosen from this feature value using variance threshold values method, and validity feature value is subjected to standard
Change handles to obtain the characteristic vector of the color to be identified;
As seen from Figure 3, in each color type, optical absorption intensity value is different corresponding to different wave length.In order to
Computational efficiency is improved, the quantity of characteristic value is reduced, validity feature value is selected using variance threshold values method, i.e. it is special to calculate each
The variance of value indicative, if variance is less than threshold value, illustrates that the information content that characteristic value includes is few, can cast out;If variance is more than threshold value,
Then illustrate that what characteristic value included contains much information, be validity feature value.As shown in figure 4, Fig. 4 shows in certain color type 16
Under different Wavelength strengths, the variance of each characteristic value, the line in figure represents the threshold value for absorbing luminous intensity.Specifically, extraction
Variance is more than preset characteristic value as validity feature value.
Further, validity feature value is standardized including:
Assuming that X ' is the characteristic vector after being standardized to validity feature value, X is made up of validity feature value
Validity feature value vector, μ are the average of validity feature value, and S is the standard difference vector of validity feature value, then,
S204, the spectroscopic data for obtaining multiple color types, and the spectroscopic data is respectively divided by stratified sampling method
For training set, checking collection and test set;
In the embodiment of the present invention, for 83 kinds of color types in paint film color standard card, selected from each color type
Take 20 groups of spectroscopic datas, and by 20 groups of spectroscopic datas according to the methods of stratified sampling method or chester sampling method be divided into training set,
Checking collection and test set.Herein, the specific division methods of spectroscopic data are not restricted.
S205, each color type is extracted respectively from the spectroscopic data in the training set, the checking collection and test set
Characteristic vector;
Further, each color type is extracted respectively from the spectroscopic data in the training set, the checking collection and test set
Characteristic vector, comprise the following steps:
Step 1: the absorption light of different wave length is extracted from the spectroscopic data in the training set, the checking collection and test set
Characteristic value of the value of intensity as the spectroscopic data in the training set, the checking collection and test set;
Step 2: choosing validity feature value from this feature value using variance threshold values method, and validity feature value is entered into rower
Quasi-ization handles to obtain the characteristic vector of each color type in the training set, the checking collection and test set.
The detail of above-mentioned steps one and step 2 is referred to step S202-S203, will not be repeated here.
S206, the color class as corresponding to the characteristic vector in the training set, the checking collection and test set and this feature vector
Type, obtain the colour recognition model;
Further, the face as corresponding to the characteristic vector in the training set, the checking collection and test set and this feature vector
Color type, the colour recognition model is obtained, specifically includes following steps:
Step 1: establishing supporting vector model using the characteristic vector in the training set, and change the SVMs mould
Kernel function and penalty coefficient in type, obtain multiple SVMs colour recognition models;
Wherein, α is Lagrange factor, and y represents color type, and C is penalty coefficient, and K (X, X ') is kernel function.Kernel function
Linear kernel function can be selected:K (X, X ')=(0+1*XTX′)1And gaussian kernel function:K (X, X ')=exp (- γ | | X-X ' |
|2).Penalty coefficient can be selected according to actual conditions, such as select 2,5,15,35 numerals.Following table is different kernel function
The combination formed with different penalty factors, by converting kernel function and penalty factor in supporting vector machine model, is obtained more
Individual SVMs colour recognition model.
Parameter combination | C=2 | C=5 | C=7 |
Linear kernel | Linear kernel, C=2 | Linear kernel, C=5 | Linear kernel, C=7 |
Gaussian kernel | Gaussian kernel, C=2 | Gaussian kernel, C=5 | Gaussian kernel, C=7 |
Step 2: the characteristic vector and the corresponding relation of color type concentrated using the training set and the checking, checking should
The accuracy of colour recognition Model Identification color type, and accuracy highest SVMs colour recognition model is defined as
Priming color identification model;
Characteristic vector corresponding to each color type has been obtained above by 83 kinds of color types of paint film color standard card.
Specifically, will verify that the characteristic vector for concentrating each color type is input in each SVMs color model, calculate
Color type, the color type calculated is compared with color type corresponding to characteristic vector, verifies each supporting vector
The accuracy of machine colour recognition model.As shown in figure 5, Fig. 5 show in the embodiment of the present invention checking collection checking it is multiple support to
The figure of amount machine model accuracy.Wherein, kernel function chooses linear kernel function and gaussian kernel function, and penalty coefficient is according to 1-50, step
A length of 2 carry out value, the error rate of the color type of obtained 50 SVMs colour recognition models output.Wherein, core
Function is that the supporting vector machine model of linear kernel function is 25, and kernel function is that the supporting vector machine model of gaussian kernel function is 25
It is individual.The minimum as accuracy highest priming color identification model of error rate.It should be noted that training set checking support to
The method of amount machine model accuracy refer to above-mentioned checking collection, will not be repeated here.
Step 3: being evaluated using the characteristic vector in the test set the priming color identification model, evaluated
Coefficient;
Further, step 3 comprises the following steps:
The characteristic vector of each color type in the test set is inputted into the priming color identification model, obtains multiple colors
Type;
Obtained color type is compared with color type corresponding to the characteristic vector in the test set, it is first to calculate this
The accuracy rate of beginning colour recognition Model Identification color, and using the accuracy rate as the evaluation coefficient.
Accuracy rate is the percentage that the number of the color of priming color identification model identification pair accounts for all identification color numbers.
If Step 4: the evaluation coefficient is more than default value, the priming color identification model is defined as into the color knows
Other model.
Optionally it is determined that colour recognition model also includes:
If the evaluation coefficient is more than default value, the color type of priming color identification model identification mistake is determined;
If the color type of identification and real color type are same colour system, it is determined that priming color identification model is face
Color identification model;
If the color of identification and real color are not same colour systems, the priming color model is modified, and
Revised priming color identification model is defined as colour recognition model.
It is corresponding with the characteristic vector inputted that characteristic vector is input to the color type drawn after priming color identification model
Color type difference when, priming color identification model identification mistake, now, color type corresponding to characteristic vector be identify
The color type of mistake, for example, feature vector, X is input in priming color identification model, obtained color type is lemon
Huang, but in fact color type corresponding to feature vector, X is cream colour, then the color type for identifying mistake is cream colour.
Optionally it is determined that colour recognition model also includes:
If evaluation coefficient is less than default value, the recall ratio and precision ratio of each color type are calculated, and it is complete using looking into
Rate and precision ratio calculate the F1 measurements of each color type;
Spectroscopic data of the F1 measurements less than the color type of default F1 measurements is obtained, and is repaiied using the spectroscopic data of acquisition
Positive priming color identification model, and revised priming color identification model is defined as colour recognition model.
When calculating the recall ratio and precision ratio of each color type, using each color type as positive example, remaining color
Type obtains the confusion matrix shown in following table as counter-example:
Positive example | Counter-example | |
Positive example | Real example (TP) | False counter-example (FN) |
Counter-example | False positive example (FP) | True counter-example (TN) |
According to precision ratio P and recall ratio R calculation formula:
The precision ratio and recall ratio of each color type can be calculated.
F1 measurements are calculated according to above-mentioned precision ratio and recall ratio:
Wherein, the performance metric index that F1 is an integrated survey precision ratio P and recall ratio R, the bigger explanation face of F1 are measured
The performance of color identification model identification color type is better.In actual applications, if evaluation coefficient is less than preset value, illustrate that color is known
The evaluation coefficient of other type is low, then can confirm that face by the measurement F1 for the color type for analyzing colour recognition Model Identification mistake
Performance of the color identification model for the color type of identification mistake.And by or take identification mistake color type spectroscopic data
To correct colour recognition model again, and using revised colour recognition model as the colour recognition model finally determined, with
Further improve the accuracy of identification color.During amendment can use following methods carry out, for example, increase some correlated characteristics or
It is uncorrelated to remove some, redundancy feature, carrys out training pattern using more spectroscopic datas, improves the generalization ability of model, or
Consider the more preferable modeling method of other effects, such as neutral net.The data for the color that increase is easily judged by accident are attempted, and using integrated
Then the thought of model, the color easily judged by accident for these are integrated and combined come locally fine point again.
Optionally it is determined that colour recognition model also includes:
The color type of priming color identification model identification mistake is determined, and it is complete to calculate looking into for the color type of identification mistake
Rate, precision ratio and F1 measurements;
Spectroscopic data of the F1 measurements less than the color type of default F1 measurements is obtained, and is repaiied using the spectroscopic data of acquisition
Positive priming color identification model, and revised priming color identification model is defined as colour recognition model.
Specific calculating process refer to the process of above-mentioned recall ratio, precision ratio and F1 measurements, will not be repeated here.
S207, this feature vector inputted into preset colour recognition model, obtain the color type of the color to be identified.
A kind of color identification method provided in an embodiment of the present invention, the feature that will be obtained from the spectroscopic data of color to be identified
Vector is input to the type that preset colour recognition model can obtain color to be identified.On the one hand, this method is using obtaining
The color spectrum data to be identified taken, colouring information are comprehensive;On the other hand, RGB can be avoided to sense using colour recognition model
Device identifies the shortcomings that color, directly obtains color type, greatly improves the precision of colour recognition.
Referring to Fig. 6, Fig. 6 is a kind of structural representation for Color Recognition System that third embodiment of the invention provides, it is
It is easy to illustrate, illustrate only the part related to the embodiment of the present invention.The Color Recognition System of Fig. 6 examples, mainly includes:Light
Compose harvester 601 and terminal 602;
Terminal 602 is used to realize first embodiment of the invention and the color identification method shown in second embodiment.
Spectra collection device 601 is used to provide spectroscopic data to terminal 602, referring to Fig. 7, Fig. 7 is spectra collection device
Structural scheme of mechanism, wherein, spectra collection device 701 includes:Light emitting diode 711, detector 721, printed circuit board (PCB) 731,
Light pipe 741 and base 751;
Light emitting diode 711 and detector 721 are connected with printed circuit board (PCB) 731 respectively.
Light emitting diode 711, for launching light.
Specifically, light emitting diode 711 can be one or more.The wave-length coverage for the light that light emitting diode 711 is sent
It can be determined according to the property of object under test.Preferably, light emitting diode 711 is multiple single color LEDs, i.e., more
The individual light emitting diode for sending preset range wavelength, and the wave-length coverage of light that each light emitting diode 711 is sent is different,
So, the light directive object under test surface of different wavelength range, the light that object under test surface is reflected can be made to include more spectrum
Information, and then improve the accuracy of spectral detection.
It should be noted that arrangement of the light emitting diode 711 on printed circuit board (PCB) 731 is not restricted.In the present invention's
In one embodiment, as shown in fig. 7, Fig. 7 shows multiple 711 rounded arrangements of light emitting diode, and with printed circuit board (PCB) 731
Connection.
Light pipe 741, the light for light emitting diode 711 to be launched are reflected, to inject object under test.
The hollow transparent pipe that light pipe 741 seals for one end, inwall and the phase of detector 721 of the sealed end of light pipe 741
Right, the pipe edge of the other end of light pipe 741 is relative with light emitting diode 711.Light pipe 741 removes the inner and outer wall of sealed end
Outside, remaining inner and outer wall is coated with reflectance coating.Fig. 8 is the profile of spectra collection device in the embodiment of the present invention, and Fig. 8 shows
The position of reflectance coating is gone out.As shown in figure 8, during the spectrum of collection object under test, by the sealed end and object under test of light pipe 741
Surface contact, now, because the pipe of light emitting diode 711 and light pipe 741 is along light relative, that light emitting diode 711 is launched
Reflectance coating continuous reflection on inner and outer wall through light pipe 741, the light that light emitting diode 711 is launched import object under test
Surface.Because sealed end does not have reflectance coating, the light of object under test reflection enters detector 721 through transparent sealed end.
It should be noted that the shape of the end face at the non-tight end of light pipe 741 is not restricted, as long as can make pipe edge and hair
Optical diode 711 is relative.Preferably, as shown in fig. 7, the cross sectional shape of the non-close end face of light pipe 101 is circle, and
The radius of non-close end face is identical with the circular radius that light emitting diode 711 is arranged in, in this way, the pipe edge of light pipe 741 can
With relative with light emitting diode 711.In addition, the pipe edge of light pipe 741 can be close to relatively with light emitting diode 711, can also
Reservation space is relative, and this is not restricted.Light pipe 741 can be the transparent pipe of other materials such as glass tube or plastic tube.
Detector 721, for receiving the light of object under test reflection by the sealed end of light pipe 741.
Specifically, detector 721 can select according to the launch wavelength of light emitting diode.Detector 102 can be by
Photodiode, phototriode or the array that the semi-conducting materials such as silicon, germanium, indium gallium arsenic, vulcanized lead or mercury cadmium telluride are formed are visited
Survey device.Wherein, detector 721 is relative with the inwall of light pipe 741, and so, the light of object under test reflection can be through transparent envelope
Closed end is injected in detector 721.In embodiment shown in Fig. 7, detector 721 is located at the centre of multiple light emitting diodes 711, leads to
Cross two pins to be connected with printed circuit board (PCB) 731, and be close to relatively with the inwall of light pipe 741.
Base 751, for fixing printed circuit plate 731 and light pipe 741.
It should be noted that the mode of the fixing printed circuit plate 731 of base 751 and light pipe 741 is not construed as limiting.Yu Benfa
A kind of shape graph for base 751 that bright one embodiment, Fig. 7 and Fig. 9 are provided, wherein, Fig. 7 shows the structure of base 751,
Fig. 9 is another profile of spectra collection device, shows the section of base, and base 751 is cylinder, the wherein side wall of cylinder
Opening, is inserted into base 751 from opening beneficial to printed circuit board (PCB) 731 and is fixed, in addition, in one end of base and leaded light
Pipe contacts, and light pipe can be fixed by buckle or screw thread.
Further, as shown in fig. 7, spectra collection device 701 also includes:Temperature sensor 761.
Temperature sensor 761 is fixed on printed circuit board (PCB) 103, for sensing the temperature in current environment.
Specifically, the signal of temperature is sent to spectra collection device by temperature sensor 761 by printed circuit board (PCB) 103
Processing unit so that processing unit can determine the accurate of the wavelength of the light of the object under test currently gathered according to current temperature
Scope, and then obtain accurate spectroscopic data.
The method that above-mentioned each terminal 602 realizes its function, specifically refer to first embodiment shown in earlier figures 1 and Fig. 2 and
Related content in the color identification method that second embodiment provides, here is omitted.
A kind of Color Recognition System provided in an embodiment of the present invention, terminal will obtain from the spectroscopic data of color to be identified
Characteristic vector is input to the type that preset colour recognition model can obtain color to be identified.On the one hand, this method uses
It is the color spectrum data to be identified obtained, colouring information is comprehensive;On the other hand, RGB can be avoided using colour recognition model
Sensor identifies the shortcomings that color, directly obtains color type, greatly improves the precision of colour recognition.
In multiple embodiments provided herein, it should be understood that disclosed systems, devices and methods, can be with
Realize by another way.For example, device embodiment described above is only schematical, for example, the module
Division, only a kind of division of logic function, can there is other dividing mode, such as multiple module or components when actually realizing
Another system can be combined or be desirably integrated into, or some features can be ignored, or do not perform.It is another, it is shown or
The mutual coupling discussed or direct-coupling or communication linkage can be the indirect couplings by some interfaces, device or module
Conjunction or communication linkage, can be electrical, mechanical or other forms.
The module illustrated as separating component can be or may not be physically separate, show as module
The part shown can be or may not be physical module, you can with positioned at a place, or can also be distributed to multiple
On mixed-media network modules mixed-media.Some or all of module therein can be selected to realize the mesh of this embodiment scheme according to the actual needs
's.
In addition, each functional module in each embodiment of the present invention can be integrated in a processing module, can also
That modules are individually physically present, can also two or more modules be integrated in a module.Above-mentioned integrated mould
Block can both be realized in the form of hardware, can also be realized in the form of software function module.
If the integrated module is realized in the form of software function module and is used as independent production marketing or use
When, it can be stored in a computer read/write memory medium.Based on such understanding, technical scheme is substantially
The part to be contributed in other words to prior art or all or part of the technical scheme can be in the form of software products
Embody, the computer software product is stored in a storage medium, including some instructions are causing a computer
Equipment (can be personal computer, server, or network equipment etc.) performs the complete of each embodiment methods described of the present invention
Portion or part steps.And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. are various can store journey
The medium of sequence code.
It should be noted that for foregoing each method embodiment, in order to which simplicity describes, therefore it is all expressed as a series of
Combination of actions, but those skilled in the art should know, the present invention is not limited by described sequence of movement because
According to the present invention, some steps can use other orders or carry out simultaneously.Secondly, those skilled in the art should also know
Know, embodiment described in this description belongs to preferred embodiment, and involved action and module might not all be this hairs
Necessary to bright.
In the above-described embodiments, the description to each embodiment all emphasizes particularly on different fields, and does not have the portion being described in detail in some embodiment
Point, it may refer to the associated description of other embodiments.
It is to connect neck people recognition methods, the description of apparatus and system to provided by the present invention above, for the skill of this area
Art personnel, according to the thought of the embodiment of the present invention, there will be changes in specific embodiments and applications, to sum up,
This specification content should not be construed as limiting the invention.
Claims (10)
1. a kind of color identification method, it is characterised in that methods described includes:
Obtain the spectroscopic data of color to be identified;
The characteristic vector of the color to be identified is extracted from the spectroscopic data;
The characteristic vector is inputted to preset colour recognition model, obtains the color type of the color to be identified.
2. according to the method for claim 1, it is characterised in that described that the face to be identified is extracted from the spectroscopic data
The characteristic vector of color, is specifically included:
Characteristic value of the value of the absorption luminous intensity of different wave length as the spectroscopic data is extracted from the spectroscopic data;
Validity feature value is chosen from the characteristic value using variance threshold values method, and validity feature value is standardized
To the characteristic vector of the color to be identified.
3. according to the method for claim 1, it is characterised in that described that the characteristic vector is inputted to preset colour recognition
Model, before obtaining the color type of the color to be identified, in addition to:
The spectroscopic data of multiple color types is obtained, and the spectroscopic data is respectively divided into training by stratified sampling method
Collection, checking collection and test set;
Extract the feature of each color type respectively from the spectroscopic data of the training set, the checking collection and the test set
Vector;
The color class as corresponding to the characteristic vector in the training set, the checking collection and the test set and the characteristic vector
Type, obtain the colour recognition model.
4. according to the method for claim 3, it is characterised in that it is described by the training set, it is described checking collection and the survey
Color type corresponding to the characteristic vector and the characteristic vector that examination is concentrated, obtains the colour recognition model, specifically includes:
Supporting vector machine model is established using the characteristic vector in the training set, and is changed in the supporting vector machine model
Kernel function and penalty coefficient, obtain multiple SVMs colour recognition models;
The characteristic vector and the corresponding relation of color type concentrated using the training set and the checking, verify the multiple branch
Hold the accuracy of vector machine colour recognition Model Identification color type, and by accuracy highest SVMs colour recognition mould
Type is defined as priming color identification model;
The priming color identification model is evaluated using the characteristic vector in the test set, obtains evaluation coefficient;
If the evaluation coefficient is more than default value, the priming color identification model is defined as the colour recognition mould
Type.
5. according to the method for claim 4, it is characterised in that the characteristic vector using in the test set is to described
Priming color identification model is evaluated, and obtains evaluation coefficient, is specifically included:
The characteristic vector of each color type in the test set is inputted into the priming color identification model, obtains multiple colors
Type;
Obtained color type is compared with color type corresponding to the characteristic vector in the test set, calculated described first
The accuracy rate of beginning colour recognition Model Identification color, and using the accuracy rate as the evaluation coefficient.
6. the method according to right will go 4, it is characterised in that the characteristic vector using in the test set is to described
Priming color identification model is evaluated, after obtaining evaluation coefficient, in addition to:
If the evaluation coefficient is less than default value, the recall ratio and precision ratio of each color type are calculated, and described in utilization
Recall ratio and the precision ratio calculate the F1 measurements of each color type;
Spectroscopic data of the F1 measurements less than the color type of default F1 measurements is obtained, and using described in the spectroscopic data amendment obtained
Priming color identification model, and revised priming color identification model is defined as the colour recognition model.
7. a kind of Color Recognition System, it is characterised in that the system includes:Spectra collection device and terminal, wherein, the end
Hold for realizing the color identification method in claim 1-6, the spectra collection device is used to provide spectrum to the terminal
Data;
The spectra collection device includes:Light emitting diode, detector, printed circuit board (PCB), light pipe and base, described luminous two
Pole pipe and the detector are connected with the printed circuit board (PCB) respectively;
The light emitting diode, for launching light;
The light pipe is the hollow transparent pipe of one end sealing, wherein, the inwall of the sealed end of the light pipe and the detection
Device is relative, and the pipe edge of the other end of the light pipe is relative with the light emitting diode, and the light pipe removes the inwall of sealed end
Outside outer wall, remaining inner and outer wall is coated with reflectance coating, and the light for the light emitting diode to be launched is reflected, with
Directive object under test;
The detector, for receiving the light of the object under test reflection by the sealed end of the light pipe;
The base, for fixing the printed circuit board (PCB) and the light pipe.
8. system according to claim 7, it is characterised in that the spectra collection device also includes:Temperature sensor;
The temperature sensor is connected with the printed circuit board (PCB), for sensing the temperature in current environment.
9. system according to claim 7, it is characterised in that the light emitting diode is multiple single color LEDs.
10. system according to claim 9, it is characterised in that the multiple single color LED is rounded to be arranged in
On the printed circuit board (PCB).
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710705570.4A CN107462330B (en) | 2017-08-17 | 2017-08-17 | Color recognition method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710705570.4A CN107462330B (en) | 2017-08-17 | 2017-08-17 | Color recognition method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107462330A true CN107462330A (en) | 2017-12-12 |
CN107462330B CN107462330B (en) | 2024-04-19 |
Family
ID=60549973
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710705570.4A Active CN107462330B (en) | 2017-08-17 | 2017-08-17 | Color recognition method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107462330B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110751053A (en) * | 2019-09-26 | 2020-02-04 | 高新兴科技集团股份有限公司 | Vehicle color identification method, device, equipment and storage medium |
CN111835561A (en) * | 2020-06-29 | 2020-10-27 | 中国平安财产保险股份有限公司 | Abnormal user group detection method, device and equipment based on user behavior data |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0737850A2 (en) * | 1995-04-15 | 1996-10-16 | JENOPTIK Aktiengesellschaft | Device for measuring of colours of non self-luminous objects |
US20060221341A1 (en) * | 2005-03-30 | 2006-10-05 | Xerox Corporation | Systems and methods for compensating for temperature induced spectral emission variations in LED based color parameter measuring devices |
JP2007114038A (en) * | 2005-10-20 | 2007-05-10 | Agilent Technol Inc | Color sensor system |
US20080133434A1 (en) * | 2004-11-12 | 2008-06-05 | Adnan Asar | Method and apparatus for predictive modeling & analysis for knowledge discovery |
US20100044441A1 (en) * | 2007-03-12 | 2010-02-25 | Moshe Cohen | Color sensing for a reader device and the like |
CN106203679A (en) * | 2016-06-27 | 2016-12-07 | 武汉斗鱼网络科技有限公司 | A kind of customer loss Forecasting Methodology and system |
CN106295696A (en) * | 2016-08-09 | 2017-01-04 | 中国科学院遥感与数字地球研究所 | A kind of multi-source Remote Sensing Images radiation normalization method |
-
2017
- 2017-08-17 CN CN201710705570.4A patent/CN107462330B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0737850A2 (en) * | 1995-04-15 | 1996-10-16 | JENOPTIK Aktiengesellschaft | Device for measuring of colours of non self-luminous objects |
US20080133434A1 (en) * | 2004-11-12 | 2008-06-05 | Adnan Asar | Method and apparatus for predictive modeling & analysis for knowledge discovery |
US20060221341A1 (en) * | 2005-03-30 | 2006-10-05 | Xerox Corporation | Systems and methods for compensating for temperature induced spectral emission variations in LED based color parameter measuring devices |
JP2007114038A (en) * | 2005-10-20 | 2007-05-10 | Agilent Technol Inc | Color sensor system |
US20100044441A1 (en) * | 2007-03-12 | 2010-02-25 | Moshe Cohen | Color sensing for a reader device and the like |
CN106203679A (en) * | 2016-06-27 | 2016-12-07 | 武汉斗鱼网络科技有限公司 | A kind of customer loss Forecasting Methodology and system |
CN106295696A (en) * | 2016-08-09 | 2017-01-04 | 中国科学院遥感与数字地球研究所 | A kind of multi-source Remote Sensing Images radiation normalization method |
Non-Patent Citations (1)
Title |
---|
刘志辉;宋丽梅;: "自动掳管机颜色识别系统研究", vol. 19, no. 6, pages 30 - 32 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110751053A (en) * | 2019-09-26 | 2020-02-04 | 高新兴科技集团股份有限公司 | Vehicle color identification method, device, equipment and storage medium |
CN110751053B (en) * | 2019-09-26 | 2022-02-22 | 高新兴科技集团股份有限公司 | Vehicle color identification method, device, equipment and storage medium |
CN111835561A (en) * | 2020-06-29 | 2020-10-27 | 中国平安财产保险股份有限公司 | Abnormal user group detection method, device and equipment based on user behavior data |
Also Published As
Publication number | Publication date |
---|---|
CN107462330B (en) | 2024-04-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109934093A (en) | A kind of method, computer-readable medium and identifying system identifying commodity on shelf | |
CN107462330A (en) | A kind of color identification method and system | |
CN102545847B (en) | Intelligent initiating explosive device equivalent device and pulse timing sequence signal measurement method | |
CN108520249A (en) | A kind of construction method of cell sorter, apparatus and system | |
CN108955901A (en) | A kind of infrared measurement of temperature method, system and terminal device | |
CN110346305A (en) | A kind of method and apparatus measuring plant leaf blade nitrogen content | |
CN110291382A (en) | Analysis system and analysis method | |
CN112965048A (en) | Laser ranging error correction method, device, electronic equipment and storage medium | |
US20210042563A1 (en) | Digital technology of cultural relics, calligraphy, painting and original commodities | |
CN106202971A (en) | Based on FOLIUM model leaf pigment remote sensing inversion method | |
CN113189021A (en) | Method for identifying rock color based on spectrum | |
CN113673264A (en) | UHF RFID tag performance grading evaluation method and evaluation system | |
CN208383717U (en) | Food-safety detecting instrument | |
CN115597726B (en) | Color temperature detection method and device and electronic equipment | |
CN106960188A (en) | Weather image sorting technique and device | |
CN108362650A (en) | Liquid coloration detection method and device | |
CN114913347A (en) | Clothes color identification method, system, equipment and storage medium | |
CN115236490A (en) | Integrated circuit pin detection system | |
CN207530916U (en) | A kind of unmanned plane camera system and unmanned plane | |
CN113807320A (en) | Human body skin color identification method and system based on multispectral imaging technology | |
CN112268901A (en) | Solution concentration identification method based on k-means algorithm | |
CN102637299A (en) | Method of using local extremum clustering to count light emitting diodes | |
CN104215333B (en) | Two dimension formula sequential type colorimeter detection method and this colorimeter | |
CN104568786B (en) | A kind of extracting method of spectral signature wavelength | |
CN110133668A (en) | Naval target infrared detection method and device |
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 |