CN104679878B - Neighbour's color searching method and device based on NPsim matrixes - Google Patents
Neighbour's color searching method and device based on NPsim matrixes Download PDFInfo
- Publication number
- CN104679878B CN104679878B CN201510108710.0A CN201510108710A CN104679878B CN 104679878 B CN104679878 B CN 104679878B CN 201510108710 A CN201510108710 A CN 201510108710A CN 104679878 B CN104679878 B CN 104679878B
- Authority
- CN
- China
- Prior art keywords
- color
- mrow
- npsim
- msub
- matrixes
- 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.)
- Active
Links
Landscapes
- Spectrometry And Color Measurement (AREA)
- Image Analysis (AREA)
Abstract
Present invention relates particularly to a kind of neighbour's color searching method and device based on NPsim matrixes.Methods described includes:Obtain the color ColName for needing to search for neighbour's color0;According to the quantity K of orderly NPsim matrixes and preset search the neighbour's color pre-established, choose in the NPsim matrixes in order with the color ColName0The preceding K element of corresponding row;The color ColName is determined according to the K element of selection0Neighbour's color ColNamet, wherein t=1,2 ..., K.The present invention represents color by using spectral information, avoids uncertainty caused by " metamerism " phenomenon;Meanwhile the similitude of color space color data is calculated using NPsim, the precision of Similarity measures is improved, and then improve the accuracy of neighbour's color search;The far and near position relationship between color is further represented by orderly NPsim matrixes, only need to access K neighbour's color that orderly NPsim matrixes once can determine that given color, the efficiency of neighbour's color search is greatly improved.
Description
Technical field
The present invention relates to neighbour's color search technique field, and in particular to one kind is based on NPsim (Normalized
Partial Similarity, the similitude based on standardization local dimension evidence) matrix neighbour's color searching method and device.
Background technology
The search of neighbour's color refers in given color space, finds with given color similarity in the face of former
Color;The several color found, neighbour's color of referred to as given color.The search of neighbour's color is in color reparation, color design, face
The fields such as color identification have the function that important.
In neighbour's color search technique field, commonly using searching method includes following two kinds:
(1) neighbour's color search based on tristimulus values representation.Given color is found using tristimulus values representation
Neighbour's color, first have to establish index tree according to the tristimulus values of all colours in color space, then by traveling through index tree
Search and the closest some leaf nodes of given color, the color that these leaf nodes represent, be exactly the neighbour of given color
Color.It is generally poor with given three kinds of values components between color and Node color during building and traveling through index tree
Different sum (i.e. manhatton distance) represents the similitude of the two.
(2) neighbour's color search based on spectrum presentation.Neighbour's color of given color is found using spectrum presentation,
Spectrum is considered as to the vector of limited length first, then the vector according to corresponding to all colours spectrum establishes index tree, then
The closest some leaf nodes of color are searched and given by traveling through index tree, the color that these leaf nodes represent, are exactly
Neighbour's color of given color.During building and traveling through index tree, generally with given light between color and Node color
Euclidean distance, included angle cosine, coefficient correlation of vector etc. are composed to represent the similitude of the two.
However, when carrying out the search of neighbour's color using above two method, metamerism, similarity measurements accuracy of measurement be present
Difference, the shortcoming such as index efficiency is low.
The content of the invention
It is low for metamerism, similarity measurement low precision, index efficiency be present in existing neighbour's color searching method
Defect, the invention provides a kind of neighbour's color searching method and device based on NPsim matrixes.
On the one hand, a kind of neighbour's color searching method based on NPsim matrixes provided by the invention, including:
Obtain the color ColName for needing to search for neighbour's color0;
According to the quantity K of orderly NPsim matrixes and preset search the neighbour's color pre-established, choose described orderly
In NPsim matrixes with the color ColName0The preceding K element of corresponding row;
According to the K element of selection, the color ColName is determined0Neighbour's color ColNamet, wherein t=1,
2,…,K。
Further, the quantity K for orderly NPsim matrixes and preset search neighbour's color that the basis pre-establishes,
Choose in the NPsim matrixes in order with the color ColName0Before the step of preceding K element of corresponding row, in addition to:
Orderly NPsim matrixes are built using the NPsim values between any two kinds of color spectrum information vectors in color space.
Further, the NPsim values using between any two kinds of color spectrum information vectors in color space are built
The step of orderly NPsim matrixes, including:
Obtain the spectral information of all colours in color space;
For each color in the color space, light between whole colors is calculated in the color and the color space
The NPsim values of spectrum information;
NPsim matrixes are established according to the NPsim values, wherein described in each color corresponds in the color space
A line of NPsim matrixes, and each element of the NPsim matrixes include two kinds of color designations and described two colors it
Between the attribute of NPsim values three;
By the element in the NPsim matrixes per a line, arrange to obtain in order according to the NPsim values descending order
NPsim matrixes.
Further, the spectral information is represented using below equation:
Si={ Si1,Si2,…,Sij,…,Sin, i=1,2 ..., M, j=1,2 ..., n
Wherein, SiFor the spectral information of i-th kind of color in the color space, SijFor i-th kind of face in the color space
Spectral reflectance of the color at j-th of wavelength.
Further, it is described to be directed to each color in the color space, calculate in the color and the color space
Between whole colors the step of the NPsim values of spectral information, it is specially:
The NPsim values are calculated using following formula,
Wherein, SpFor the spectral information of pth kind color in the color space, SqFor q kind colors in the color space
Spectral information;SpjAnd SqjRespectively SpAnd SqIn the value of jth dimension;δ(Spj,Sqj) it is discriminant function, work as SpjAnd SqjIn same
Individual section [nj,mj] when, δ (Spj,Sqj)=1, otherwise, δ (Spj,Sqj)=0;mjAnd njIt is SpjAnd SqjIt is subordinate to the end in section jointly
Point;E(Sp,Sq) it is SpAnd SqNumber of dimensions in identical section.
On the other hand, the present invention also provides a kind of neighbour's color searcher based on NPsim matrixes, including:
Acquisition module, for obtaining the color ColName for needing to search for neighbour's color0;
Module is chosen, the quantity K of orderly NPsim matrixes and preset search the neighbour's color pre-established for basis,
Choose in the NPsim matrixes in order with the color ColName0The preceding K element of corresponding row;
Determining module, for the K element according to selection, determine the color ColName0Neighbour's color
ColNamet, wherein t=1,2 ..., K.
Further, described device also includes structure module, for using any two kinds of color spectrums letter in color space
NPsim values between breath vector build orderly NPsim matrixes.
Further, structure module is specifically used for:
Obtain the spectral information of all colours in color space;
For each color in the color space, light between whole colors is calculated in the color and the color space
The NPsim values of spectrum information;
NPsim matrixes are established according to the NPsim values, wherein described in each color corresponds in the color space
A line of NPsim matrixes, and each element of the NPsim matrixes include two kinds of color designations and described two colors it
Between the attribute of NPsim values three;
By the element in the NPsim matrixes per a line, arrange to obtain in order according to the NPsim values descending order
NPsim matrixes.
Further, spectral information is represented using below equation in the structure module:
Si={ Si1,Si2,…,Sij,…,Sin, i=1,2 ..., M, j=1,2 ..., n
Wherein, SiFor the spectral information of i-th kind of color in the color space, SijFor i-th kind of face in the color space
Spectral reflectance of the color at j-th of wavelength.
Further, the structure module is further additionally operable to, and the NPsim values are calculated using below equation:
Wherein, SpFor the spectral information of pth kind color in the color space, SqFor q kind colors in the color space
Spectral information;SpjAnd SqjRespectively SpAnd SqIn the value of jth dimension;δ(Spj,Sqj) it is discriminant function, work as SpjAnd SqjIn same
Individual section [nj,mj] when, δ (Spj,Sqj)=1, otherwise, δ (Spj,Sqj)=0;mjAnd njIt is SpjAnd SqjIt is subordinate to the end in section jointly
Point;E(Sp,Sq) it is SpAnd SqNumber of dimensions in identical section.
A kind of neighbour's color searching method and device based on NPsim matrixes provided by the invention, believe by using spectrum
Breath represents color, can reflect the color character of color in itself, one-to-one relationship is established between color, avoid " homochromy different
It is uncertain caused by spectrum " phenomenon;Meanwhile the similitude of color space color data is calculated using NPsim, data can be reduced
Influence of the sparse, isometry etc. " dimension disaster " to Similarity measures, improves the precision of Similarity measures, and then improve neighbour
The accuracy of color search;Further by orderly NPsim matrix organizations color space color data, color can be accurately represented
Between far and near position relationship, K neighbour's face of given color is once can determine that by directly accessing orderly NPsim matrixes
Color, and the neighbor search method based on index tree then needs to travel through index tree K times in the prior art, and neighbour's face is greatly improved
The efficiency of color search.
Brief description of the drawings
The features and advantages of the present invention can be more clearly understood by reference to accompanying drawing, accompanying drawing is schematically without that should manage
Solve to carry out any restrictions to the present invention, in the accompanying drawings:
Fig. 1 is the schematic flow sheet of neighbour's color searching method based on NPsim matrixes in one embodiment of the invention;
Fig. 2 is the schematic flow sheet that orderly NPsim matrixes are established in one embodiment of the invention;
Fig. 3 is the structural representation of multi-optical spectrum imaging system in one embodiment of the invention;
Fig. 4 is the relative mistake result schematic diagram of independent same distribution IID data in one embodiment of the invention;
Fig. 5 is the related relative mistake result schematic diagram with distribution Uniform data in one embodiment of the invention;
Fig. 6 is the relative mistake result schematic diagram of the same distribution DID data of dependent in one embodiment of the invention;
Fig. 7 is that the dependent based on Psim and NPsim in one embodiment of the invention shows with distribution DID data comparative effectiveness
It is intended to;
Fig. 8 is that the average response time result of neighbor search under three kinds of method different K values in one embodiment of the invention is shown
It is intended to;
Fig. 9 is the structural representation of neighbour's color searcher based on NPsim matrixes in one embodiment of the invention.
Embodiment
Technical solution of the present invention is further elaborated in conjunction with drawings and examples.
Existing neighbour's color search technique mainly includes neighbour's color search based on tristimulus values representation and is based on
Neighbour's color search of spectrum presentation.Above two method is primarily present following defect:
(1) metamerism.Color essence is the spectral reflectance curve of itself, and one group of different color of spectral reflectance curve exists
There is identical tristimulus values under certain observation and lighting condition, produce identical visual effect, but have under other circumstances
The visual effect differed, it is referred to as " metamerism " phenomenon.So the color with same or similar tristimulus values is not necessarily
Same color;Therefore, neighbour's color of given color is found using tristimulus values representation, may have and give color distortion
Larger spectral reflectance curve.It follows that neighbour's color searching method based on tristimulus values representation has necessarily not
Certainty.
(2) similarity measurement low precision.Because spectrum presentation can avoid " homochromy different existing for tristimulus values representation
Spectrum " problem, so neighbour's color searching method based on spectrum presentation is used widely.Spectrum is considered as vector, due to
Range of wavelengths is longer corresponding to spectrum, and the sampling interval is smaller, so vector length is from a few hundred to several thousand, belongs to high
Dimensional vector.Therefore, the basic operation of this neighbour's color searching method is to calculate the similitude of high dimension vector.At present, this method
In commonly use similarity calculation method include:Euclidean distance, included angle cosine, coefficient correlation, Hsim (Hamming
Similarity, the similitude based on Hamming distances), Gsim, Esim (E Similarity, the phase based on natural logrithm truth of a matter e
Like property), Psim (Partial Similarity, the similitude based on local dimension's evidence) etc..Wherein, Euclidean distance, more than angle
String, coefficient correlation all apply to the similarity calculation method of low-dimensional data, can not overcome that high dimensional data is sparse, dimension disaster is led
The equidistant sex chromosome mosaicism caused.Hsim, Gsim, Esim, Psim etc. apply to the similarity calculation method of high dimensional data, but there is also
Deficiency.Hsim performances are better than Euclidean distance, but do not account for the relative difference and noise profile of dimensional attribute;Gsim considers dimension
The relative difference of attribute, but do not account for its weight difference;Esim considers dimensional attribute size, but does not account for its noise point
Cloth;Psim is in view of factors such as the relative difference of dimensional attribute, noise profile, weight differences, but its codomain and vector dimension have
Close, therefore similitude of the data under different dimensions does not have comparativity, is unfavorable for Data Dimensionality Reduction.Drawbacks described above reduces color
The precision of spectral similarity measurement, easily cause during the search of neighbour color given color to its arest neighbors and farthest neighbour away from
From nearly identical under many circumstances, satisfactory neighbour's color can not be found.
(3) index efficiency is low.At present, index tree is the index structure for the search of neighbour's color, and its essence is a kind of face
Colour space partition tree, it entirely will be divided into some subspaces by color space, then continue to divide in each sub-spaces, until
Untill being divided into some specific color.It follows that the leaf node of index tree represents the specific color of color space, branch's section
Point representation space division threshold value.In tree research, binary tree is the most ripe and perfect, so index tree is y-bend mostly
Tree.At present, the conventional index tree of neighbour's color search has R trees, VP trees, M trees, SA trees etc..Although above-mentioned index tree can be used in
High dimensional data is retrieved, but efficiency is very low, and after data are more than tens dimensions, its performance is even below simplest sequential query algorithm.
Its reason is that the distance between Arbitrary Digit strong point linearly increases with the increase of dimension, and data point number is with dimension
Increase and be continuously increased;Therefore, Similarity measures time complexity and neighbor search scope are caused all with the raising of dimension
And be continuously increased, so as to reduce the performance of high dimensional data neighbor search.It follows that using index tree come tissue color space
Color data, carry out extremely time-consuming during the search of neighbour color.
As shown in figure 1, to solve the defects of above-mentioned metamerism, similarity measurement low precision and index efficiency is low,
The present embodiment provides a kind of neighbour's color searching method based on NPsim matrixes, including:
S11, obtain the color ColName for needing to search for neighbour's color0;
S12, according to the quantity K of orderly NPsim matrixes and preset search the neighbour's color pre-established, have described in selection
In sequence NPsim matrixes with the color ColName0The preceding K element of corresponding row;
S13, according to the K element of selection, determine the color ColName0Neighbour's color ColNamet, wherein t
=1,2 ..., K.
Further, before the S12, in addition to:
Orderly NPsim matrixes are built using the NPsim values between any two kinds of color spectrum information vectors in color space.
It is specifically, as shown in Fig. 2 described using between any two kinds of color spectrum information vectors in color space
NPsim values build the step of orderly NPsim matrixes, including:
S21, obtain the spectral information of all colours in color space;
S22, for each color in the color space, calculate the color and whole colors in the color space it
Between spectral information NPsim values;
S23, NPsim matrixes are established according to the NPsim values, wherein described in each color corresponds in the color space
A line of NPsim matrixes, and each element of the NPsim matrixes include two kinds of color designations and described two colors it
Between the attribute of NPsim values three;
Certainly, three attribute values of each element of the NPsim matrixes can also be two kinds of colors numbering and
NPsim values between described two colors.
S24, the element in the NPsim matrixes per a line arranges to obtain according to the NPsim values descending order
Orderly NPsim matrixes.
Wherein, the spectral information of color can use multi-optical spectrum imaging system or spectrometer to obtain.For example, in the present embodiment
The spectral information of whole colors in color space is obtained using multi-optical spectrum imaging system as shown in Figure 3.
Standard color card sample known to placing some spectral reflectance R respectively in the left side of optical filter first, obtains one group
The corresponding g of data signal of digital camera;Then formula Q=gR is utilized+Obtain the transition matrix Q of the multi-optical spectrum imaging system.Make
Used time, it would be desirable to which the color colour atla for obtaining spectral information is placed on the left of optical filter, is obtained using multi-optical spectrum imaging system every kind of
The data signal response g' of color, according to formula R'=Q+G' can be obtained by the spectral reflectance R' of this color.Wherein, R+
And Q+R and Q generalized inverse (pseudoinverse) is represented respectively.
The spectral information is the color vector that spectral reflectance is formed at different wave length, such as is including M kind colors
Color space in, spectral information of each color at n wavelength is expressed as:
Si={ Si1,Si2,…,Sij,…,Sin, i=1,2 ..., M, j=1,2 ..., n
Wherein, SiFor the spectral information of i-th kind of color in the color space, SijFor i-th kind of face in the color space
Spectral reflectance of the color at j-th of wavelength.
Get in color space after the spectral information of each color, calculate respectively in each color and color space
The NPsim values of spectral information between whole colors, specifically calculated using below equation:
Wherein, SpFor the spectral information of pth kind color in the color space, SqFor q kind colors in the color space
Spectral information;SpjAnd SqjRespectively SpAnd SqIn the value of jth dimension;δ(Spj,Sqj) it is discriminant function, work as SpjAnd SqjIn same
Individual section [nj,mj] when, δ (Spj,Sqj)=1, calculate SpAnd SqIn the similitude of jth dimension, otherwise δ (Spj,Sqj)=0, it is believed that Sp
And SqExcessive in the difference of jth dimension, jth dimension is noise dimension or sparse dimension, not calculates SpAnd SqIn the similitude of jth dimension;mjWith
njIt is SpjAnd SqjIt is subordinate to the end points in section jointly;E(Sp,Sq) it is SpAnd SqNumber of dimensions in identical section.
Searched for for the ease of follow-up neighbour's color, improve traversal efficiency, can also be further in the color space
Color be numbered, and the line number in the i.e. corresponding NPsim matrixes in order of the numbering of the color.Establish color name
Mapping relations one by one in title and the NPsim matrixes in order between line number.Matrix C olNameToNum, scale are built for this
For M × 2.Wherein, ColNameToNum effect is the NPsim matrixes in order as corresponding to color designation determines the color
Line number, the matrix the 1st row are the color designations arranged according to lexicographic order, and the 2nd row are corresponding line numbers.
Accordingly, if three attribute values of each element of NPsim matrixes in order are the numberings of two kinds of colors
And the NPsim values between described two colors, then further structure matrix N umToColName, scale is M × 2.Wherein,
NumToColName effect is to determine color designation by color code, and the matrix the 1st row are arranged according to order from small to large
Color code, the 2nd row be corresponding color designation.
Pass through on validity of the NPsim in Similarity measures illustrated below:
First, three kinds of different distributions categorical datas are generated using Matlab normrnd () function:Independent same distribution IID,
It is related that with being distributed, Uniform, dependent are same to be distributed DID.Each type according to dimension 10,30,50,100,150,200,250,
300th, 350,400 1000 data are respectively generated.Then, be respectively adopted manhatton distance, Euclidean distance, Hsim, Gsim,
Esim, Psim and NPsim calculate the similarity of all data under different dimensions, and use Dmaxn、Dminn、DavgnData are represented respectively
In the maximum, minimum, average similarity of n-dimensional space.Finally, calculated according to below equation with farthest adjacent and arest neighbors under dimension
Relative mistake:
According to Similarity Measure result feature, above-mentioned computational methods are divided into two classes.The first kind is several including manhatton distance, Europe
Reed distance, Hsim, Gsim, Esim;Second class includes Psim and NPsim.
Wherein, independent same distribution IID data relative mistake result as shown in figure 4, Fig. 4 a be first kind method result, figure
4b is the result of the second class method;The related relative mistake result with distribution Uniform data is as shown in figure 5, Fig. 5 a are the first kind
The result of method, Fig. 5 b are the result of the second class method;Dependent is with the relative mistake result for being distributed DID data as shown in fig. 6, figure
6a is the result of first kind method, and Fig. 6 b are the result of the second class method.
As can be seen that the second class method will be higher by two to three orders of magnitude than the relative mistake of first kind method, so second
The performance of class method is far superior to first kind method.
The effect of second class method can be compared by similarity codomain.Psim and NPsim is respectively adopted, calculates not
Similitude with dependent under dimension with distribution DID data, its maximum, minimum value and average value are as shown in fig. 7, wherein Fig. 7 a
For Psim result, Fig. 7 b are NPsim result.As can be seen that Psim codomain increases as dimension n increases, it is unfavorable for
Compare similitude of the data under different dimensions;And NPsim codomain is [0,1], do not influenceed by dimension n.
Under different dimensions, Psim similitudes are as shown in table 1 more than 1 number.Under each dimension, generate altogether
Ten thousand similitudes of 1000*1000=100, there is 6%~15% result more than 1 using Psim methods, cause under different dimensions
Similitude does not have comparativity.But the problem is but not present using NPsim methods, data can be compared under different dimensions
Similitude.
Table 1 is under different dimensions, number of Psim (X, Y) the method similitudes more than 1
Dimension | 10 | 30 | 50 | 100 | 150 | 200 | 250 | 300 | 350 | 400 |
Number | 159192 | 131236 | 112364 | 11456 | 97624 | 105570 | 74285 | 84341 | 50898 | 63114 |
Searched below by way of Meng Saier full glosses colour system to illustrate the present embodiment using NPsim matrixes progress neighbour's color
The validity of rope.Meng Saier full glosses colour system includes 1600 kinds of colors, and color naming form is HV/C, and H, V and C represent color respectively
Tune, brightness and saturation degree.The spectroscopic data of all colours comes from spectral color research center (http://www.uef.fi/fi/
Spectral/home), measuring apparatus is Perkin-Elmer Lambda 18UV/VIS spectrometers, and measurement range is 380-
780nm, measurement step-length is 1nm.Therefore, test data set includes 1600 spectrum, every spectrum be all length be 401 to
Amount.
Tested by using the present embodiment method, neighbour's color searching method based on KD trees and SR trees, and in speed
Degree and the aspect of precision two are compared.Experimental situation is as follows:Processor AMD Athlon (tm) II X2250Processor
3.01GHz, internal memory 2G, operating system Windows XP SP3, development environment VS 2008, not using parallel acceleration scheme.
On precision:Color is randomly choosed from Meng Saier colour systems and carries out neighbor search, compares the accurate of three kinds of methods
Property.By taking 5BG3/2 as an example, K=6 is made, the k nearest neighbor color that three kinds of algorithms obtain is as shown in table 2, table 3, table 4, for degree more directly perceived
Its heterochromia is measured, also calculates the distance (RGB component difference absolute value sum) of the color and its k nearest neighbor color in rgb space.From
Meng Saier can be seen that the nearest neighbor distance of neighbour's color searching algorithm acquisition based on NPsim matrixes apart from angle less than other
Two methods, and phenomenon of reverse order be present (relative rank of relative rank of the nearest neighbor distance in neighbour's sequence and its sequence number is not
Together, i.e., certain neighbour forerunner, neighbour are in itself in neighbour's sequence, neighbour is follow-up and the distance of inquiry color is unsatisfactory for being incremented by relation)
Neighbour's color number is also corresponding less, and the backward neighbour of table 2 has 2 (10BG3/2 and 5BG3/1), and the backward neighbour of table 3 has 4
(10BG3/2,2.5BG3/2,5B3/4 and 5G3/4), the backward neighbour of table 4 have 4 (10BG3/2,2.5BG3/2,7.5BG4/6
And 10G3/2).
Neighbour color searching algorithm result of the table 2 based on NPsim matrixes
Neighbour color searching algorithm result of the table 3 based on KD trees
Neighbour color searching algorithm result of the table 4 based on SR trees
On speed:1000 kinds of colors are selected from color space, neighbour's face is carried out under different K values using 3 kinds of methods
Color is searched for, and average performance times are as shown in Figure 8.As can be seen that neighbour's color searching algorithm response time based on NPsim matrixes
The order of magnitude is 10-6Left and right, and the order of magnitude of other two methods response times is 10-2Left and right, i.e., carried out by NPsim matrixes
The speed of neighbour's color search is 10,000 times of other two methods or so.
A kind of neighbour's color searching method based on NPsim matrixes that the present embodiment provides, by using spectral information table
Show color, the color character of color in itself can be reflected, one-to-one relationship is established between color, avoid " metamerism " existing
As caused uncertainty;Meanwhile using NPsim calculate color space color data similitude, can reduce Sparse,
Influence of the isometry etc. " dimension disaster " to Similarity measures, improves the precision of Similarity measures, and then improve neighbour's color
The accuracy of search;Further by orderly NPsim matrix organizations color space color data, can accurately represent between color
Far and near position relationship, K neighbour's color of given color is once can determine that by directly accessing orderly NPsim matrixes, and
Neighbour's color searcher rule based on index tree needs to travel through index tree K times in the prior art, and neighbour's face is greatly improved
The efficiency of color search.
On the other hand, as shown in figure 9, the present embodiment also provides a kind of neighbour's color searcher based on NPsim matrixes,
Including:
Acquisition module 101, for obtaining the color ColName for needing to search for neighbour's color0;
Module 102 is chosen, for the quantity according to orderly NPsim matrixes and preset search the neighbour's color pre-established
K, choose in the NPsim matrixes in order with the color ColName0The preceding K element of corresponding row;
Determining module 103, the color ColName is determined for the K element according to selection0Neighbour's color
ColNamet, wherein t=1,2 ..., K.
Further, described device also includes structure module, for using any two kinds of color spectrums letter in color space
NPsim values between breath vector build orderly NPsim matrixes.
Further, structure module is specifically used for:
Obtain the spectral information of all colours in color space;
For each color in the color space, light between whole colors is calculated in the color and the color space
The NPsim values of spectrum information;
NPsim matrixes are established according to the NPsim values, wherein described in each color corresponds in the color space
A line of NPsim matrixes, and each element of the NPsim matrixes include two kinds of color designations and described two colors it
Between the attribute of NPsim values three;
By the element in the NPsim matrixes per a line, arrange to obtain in order according to the NPsim values descending order
NPsim matrixes.
Further, spectral information is represented using below equation in the structure module:
Si={ Si1,Si2,…,Sij,…,Sin, i=1,2 ..., M, j=1,2 ..., n
Wherein, SiFor the spectral information of i-th kind of color in the color space, SijFor i-th kind of face in the color space
Spectral reflectance of the color at j-th of wavelength.
Further, the structure module is further additionally operable to, and the NPsim values are calculated using below equation:
Wherein, SpFor the spectral information of pth kind color in the color space, SqFor q kind colors in the color space
Spectral information;SpjAnd SqjRespectively SpAnd SqIn the value of jth dimension;δ(Spj,Sqj) it is discriminant function, work as SpjAnd SqjIn same
Individual section [nj,mj] when, δ (Spj,Sqj)=1, otherwise, δ (Spj,Sqj)=0;mjAnd njIt is SpjAnd SqjIt is subordinate to the end in section jointly
Point;E(Sp,Sq) it is SpAnd SqNumber of dimensions in identical section.
A kind of neighbour's color searcher based on NPsim matrixes that the present embodiment provides, by using spectral information table
Show color, the color character of color in itself can be reflected, one-to-one relationship is established between color, avoid " metamerism " existing
As caused uncertainty;Meanwhile using NPsim calculate color space color data similitude, can reduce Sparse,
Influence of the isometry etc. " dimension disaster " to Similarity measures, improves the precision of Similarity measures, and then improve neighbour's color
The accuracy of search;Further by orderly NPsim matrix organizations color space color data, can accurately represent between color
Far and near position relationship, K neighbour's color of given color is once can determine that by directly accessing orderly NPsim matrixes, and
Neighbour's color searcher rule based on index tree needs to travel through index tree K times in the prior art, and neighbour's face is greatly improved
The efficiency of color search.
Although being described in conjunction with the accompanying embodiments of the present invention, those skilled in the art can not depart from this hair
Various modifications and variations are made in the case of bright spirit and scope, such modifications and variations are each fallen within by appended claims
Within limited range.
Claims (6)
1. a kind of neighbour's color searching method based on NPsim matrixes, it is characterised in that methods described includes:
Obtain the color ColName for needing to search for neighbour's color0;
Orderly NPsim matrixes are built using the NPsim values between any two kinds of color spectrum information vectors in color space;
According to the quantity K of orderly NPsim matrixes and preset search the neighbour's color pre-established, the orderly NPsim is chosen
In matrix with the color ColName0The preceding K element of corresponding row;
According to the K element of selection, the color ColName is determined0Neighbour's color ColNamet, wherein t=1,
2,…,K;
Wherein, the NPsim values are calculated using following formula,
<mrow>
<mi>N</mi>
<mi>P</mi>
<mi>s</mi>
<mi>i</mi>
<mi>m</mi>
<mrow>
<mo>(</mo>
<msub>
<mi>S</mi>
<mi>p</mi>
</msub>
<mo>,</mo>
<msub>
<mi>S</mi>
<mi>q</mi>
</msub>
<mo>)</mo>
</mrow>
<mo>=</mo>
<munderover>
<mo>&Sigma;</mo>
<mrow>
<mi>j</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mi>n</mi>
</munderover>
<mfrac>
<mn>1</mn>
<mi>n</mi>
</mfrac>
<mo>&CenterDot;</mo>
<mi>&delta;</mi>
<mrow>
<mo>(</mo>
<msub>
<mi>S</mi>
<mrow>
<mi>p</mi>
<mi>j</mi>
</mrow>
</msub>
<mo>,</mo>
<msub>
<mi>S</mi>
<mrow>
<mi>q</mi>
<mi>j</mi>
</mrow>
</msub>
<mo>)</mo>
</mrow>
<mo>&CenterDot;</mo>
<mrow>
<mo>(</mo>
<mn>1</mn>
<mo>-</mo>
<mfrac>
<mrow>
<mo>|</mo>
<msub>
<mi>S</mi>
<mrow>
<mi>p</mi>
<mi>j</mi>
</mrow>
</msub>
<mo>-</mo>
<msub>
<mi>S</mi>
<mrow>
<mi>q</mi>
<mi>j</mi>
</mrow>
</msub>
<mo>|</mo>
</mrow>
<mrow>
<msub>
<mi>m</mi>
<mi>j</mi>
</msub>
<mo>-</mo>
<msub>
<mi>n</mi>
<mi>j</mi>
</msub>
</mrow>
</mfrac>
<mo>)</mo>
</mrow>
<mo>&CenterDot;</mo>
<mfrac>
<mrow>
<mi>E</mi>
<mrow>
<mo>(</mo>
<msub>
<mi>S</mi>
<mi>p</mi>
</msub>
<mo>,</mo>
<msub>
<mi>S</mi>
<mi>q</mi>
</msub>
<mo>)</mo>
</mrow>
</mrow>
<mi>n</mi>
</mfrac>
</mrow>
Wherein, SpFor the spectral information of pth kind color in the color space, SqFor the light of q kind colors in the color space
Spectrum information;SpjAnd SqjRespectively SpAnd SqIn the value of jth dimension;δ(Spj,Sqj) it is discriminant function, work as SpjAnd SqjIn same area
Between [nj,mj] when, δ (Spj,Sqj)=1, otherwise, δ (Spj,Sqj)=0;mjAnd njIt is SpjAnd SqjIt is subordinate to the end points in section jointly;E
(Sp,Sq) it is SpAnd SqNumber of dimensions in identical section;N represents the sum of dimension.
2. according to the method for claim 1, it is characterised in that described using any two kinds of color spectrums letter in color space
The step of NPsim values between breath vector build orderly NPsim matrixes, including:
Obtain the spectral information of all colours in color space;
For each color in the color space, calculate in the color and the color space that spectrum is believed between whole colors
The NPsim values of breath;
NPsim matrixes are established according to the NPsim values, wherein each color corresponds to the NPsim squares in the color space
A line of battle array, and each element of the NPsim matrixes is included between two kinds of color designations and described two colors
The attribute of NPsim values three;
By the element in the NPsim matrixes per a line, arrange to obtain in order according to the NPsim values descending order
NPsim matrixes.
3. according to the method for claim 2, it is characterised in that the spectral information is represented using below equation:
Si={ Si1,Si2,…,Sij,…,Sin, i=1,2 ..., M, j=1,2 ..., n
Wherein, SiFor the spectral information of i-th kind of color in the color space, SijExist for i-th kind of color in the color space
Spectral reflectance at j-th of wavelength.
4. a kind of neighbour's color searcher based on NPsim matrixes, it is characterised in that described device includes:
Acquisition module, for obtaining the color ColName for needing to search for neighbour's color0;
Module is built, for orderly using the NPsim values structure between any two kinds of color spectrum information vectors in color space
NPsim matrixes;
Module is chosen, for the quantity K according to orderly NPsim matrixes and preset search the neighbour's color pre-established, is chosen
In the NPsim matrixes in order with the color ColName0The preceding K element of corresponding row;
Determining module, for the K element according to selection, determine the color ColName0Neighbour's color ColNamet,
Wherein t=1,2 ..., K;
The NPsim values are calculated using following formula,
<mrow>
<mi>N</mi>
<mi>P</mi>
<mi>s</mi>
<mi>i</mi>
<mi>m</mi>
<mrow>
<mo>(</mo>
<msub>
<mi>S</mi>
<mi>p</mi>
</msub>
<mo>,</mo>
<msub>
<mi>S</mi>
<mi>q</mi>
</msub>
<mo>)</mo>
</mrow>
<mo>=</mo>
<munderover>
<mo>&Sigma;</mo>
<mrow>
<mi>j</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mi>n</mi>
</munderover>
<mfrac>
<mn>1</mn>
<mi>n</mi>
</mfrac>
<mo>&CenterDot;</mo>
<mi>&delta;</mi>
<mrow>
<mo>(</mo>
<msub>
<mi>S</mi>
<mrow>
<mi>p</mi>
<mi>j</mi>
</mrow>
</msub>
<mo>,</mo>
<msub>
<mi>S</mi>
<mrow>
<mi>q</mi>
<mi>j</mi>
</mrow>
</msub>
<mo>)</mo>
</mrow>
<mo>&CenterDot;</mo>
<mrow>
<mo>(</mo>
<mn>1</mn>
<mo>-</mo>
<mfrac>
<mrow>
<mo>|</mo>
<msub>
<mi>S</mi>
<mrow>
<mi>p</mi>
<mi>j</mi>
</mrow>
</msub>
<mo>-</mo>
<msub>
<mi>S</mi>
<mrow>
<mi>q</mi>
<mi>j</mi>
</mrow>
</msub>
<mo>|</mo>
</mrow>
<mrow>
<msub>
<mi>m</mi>
<mi>j</mi>
</msub>
<mo>-</mo>
<msub>
<mi>n</mi>
<mi>j</mi>
</msub>
</mrow>
</mfrac>
<mo>)</mo>
</mrow>
<mo>&CenterDot;</mo>
<mfrac>
<mrow>
<mi>E</mi>
<mrow>
<mo>(</mo>
<msub>
<mi>S</mi>
<mi>p</mi>
</msub>
<mo>,</mo>
<msub>
<mi>S</mi>
<mi>q</mi>
</msub>
<mo>)</mo>
</mrow>
</mrow>
<mi>n</mi>
</mfrac>
</mrow>
Wherein, SpFor the spectral information of pth kind color in the color space, SqFor the light of q kind colors in the color space
Spectrum information;SpjAnd SqjRespectively SpAnd SqIn the value of jth dimension;δ(Spj,Sqj) it is discriminant function, work as SpjAnd SqjIn same area
Between [nj,mj] when, δ (Spj,Sqj)=1, otherwise, δ (Spj,Sqj)=0;mjAnd njIt is SpjAnd SqjIt is subordinate to the end points in section jointly;E
(Sp,Sq) it is SpAnd SqNumber of dimensions in identical section;N represents the sum of dimension.
5. device according to claim 4, it is characterised in that structure module is specifically used for:
Obtain the spectral information of all colours in color space;
For each color in the color space, calculate in the color and the color space that spectrum is believed between whole colors
The NPsim values of breath;
NPsim matrixes are established according to the NPsim values, wherein each color corresponds to the NPsim squares in the color space
A line of battle array, and each element of the NPsim matrixes is included between two kinds of color designations and described two colors
The attribute of NPsim values three;
By the element in the NPsim matrixes per a line, arrange to obtain in order according to the NPsim values descending order
NPsim matrixes.
6. device according to claim 5, it is characterised in that spectral information uses below equation table in the structure module
Show:
Si={ Si1,Si2,…,Sij,…,Sin, i=1,2 ..., M, j=1,2 ..., n
Wherein, SiFor the spectral information of i-th kind of color in the color space, SijExist for i-th kind of color in the color space
Spectral reflectance at j-th of wavelength.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510108710.0A CN104679878B (en) | 2015-03-12 | 2015-03-12 | Neighbour's color searching method and device based on NPsim matrixes |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510108710.0A CN104679878B (en) | 2015-03-12 | 2015-03-12 | Neighbour's color searching method and device based on NPsim matrixes |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104679878A CN104679878A (en) | 2015-06-03 |
CN104679878B true CN104679878B (en) | 2018-04-10 |
Family
ID=53314920
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510108710.0A Active CN104679878B (en) | 2015-03-12 | 2015-03-12 | Neighbour's color searching method and device based on NPsim matrixes |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104679878B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105818518A (en) * | 2016-03-17 | 2016-08-03 | 江南大学 | Gravure printing four-color ink color-blending method for thermal-printing technology |
CN111537457A (en) * | 2020-05-18 | 2020-08-14 | 云南中烟工业有限责任公司 | Color difference analysis method based on ultraviolet and visible light similarity |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103761237A (en) * | 2013-12-04 | 2014-04-30 | 南京邮电大学 | Collaborative filtering recommending method based on characteristics and credibility of users |
CN104331447A (en) * | 2014-10-29 | 2015-02-04 | 邱桃荣 | Cloth color card image retrieval method |
-
2015
- 2015-03-12 CN CN201510108710.0A patent/CN104679878B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103761237A (en) * | 2013-12-04 | 2014-04-30 | 南京邮电大学 | Collaborative filtering recommending method based on characteristics and credibility of users |
CN104331447A (en) * | 2014-10-29 | 2015-02-04 | 邱桃荣 | Cloth color card image retrieval method |
Non-Patent Citations (2)
Title |
---|
基于近邻用户和近邻项目的协同过滤改进算法;张阳 等;《沈阳大学学报(自然科学版)》;20120731;第30卷(第3期);第382-385页 * |
高维数据聚类算法的研究;易莉桦;《中国优秀硕士学位论文全文数据库信息科技辑》;20121115(第11期);第28-30页 * |
Also Published As
Publication number | Publication date |
---|---|
CN104679878A (en) | 2015-06-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110084212B (en) | Spectral characteristic peak identification and positioning method based on improved sine and cosine algorithm | |
CN109858477A (en) | The Raman spectrum analysis method of object is identified in complex environment with depth forest | |
CN106778680B (en) | A kind of hyperspectral image band selection method and device based on critical bands extraction | |
CN109002859B (en) | Sensor array feature selection and array optimization method based on principal component analysis | |
CN102200999A (en) | Method for retrieving similarity shape | |
CN108154094A (en) | Hyperspectral image unsupervised waveband selection method based on subinterval division | |
CN108520310B (en) | Wind speed forecasting method of G-L mixed noise characteristic v-support vector regression machine | |
Yin et al. | Optimal band selection for hyperspectral image classification based on inter-class separability | |
CN104679878B (en) | Neighbour's color searching method and device based on NPsim matrixes | |
CN116595208A (en) | Classification method and device for hyperspectral images and electronic equipment | |
CN108920592A (en) | Database field correlating method and device | |
CN106023268A (en) | Color image graying method based on two-step parameter subspace optimization | |
US20030187616A1 (en) | Efficient near neighbor search (ENN-search) method for high dimensional data sets with noise | |
Zhang et al. | Hyperspectral image band selection via global optimal clustering | |
CN108647719B (en) | Non-surveillance clustering method for big data quantity spectral remote sensing image classification | |
Ghiyamat et al. | Airborne hyperspectral discrimination of tree species with different ages using discrete wavelet transform | |
Li et al. | SPFormer: Self-pooling transformer for few-shot hyperspectral image classification | |
CN104616027A (en) | Non-adjacent graph structure sparse face recognizing method | |
CN117112979A (en) | Error compensation optimization method in spectrum measurement process | |
CN105678229B (en) | A kind of Hyperspectral imaging search method | |
CN103927756B (en) | Spectral characteristic index extraction method based on spectral characteristic space centralization | |
CN105843555A (en) | Stochastic gradient descent based spectral hashing method in distributed storage | |
CN115331105A (en) | Hyperspectral image classification method and system | |
CN111918211B (en) | Indoor fingerprint positioning method based on KD tree and improved weighted KNN | |
CN107389071A (en) | A kind of improved indoor positioning KNN methods |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |