CN108804475A - The method and apparatus for searching for color similar pictures - Google Patents
The method and apparatus for searching for color similar pictures Download PDFInfo
- Publication number
- CN108804475A CN108804475A CN201710311228.6A CN201710311228A CN108804475A CN 108804475 A CN108804475 A CN 108804475A CN 201710311228 A CN201710311228 A CN 201710311228A CN 108804475 A CN108804475 A CN 108804475A
- Authority
- CN
- China
- Prior art keywords
- dimensional feature
- picture
- feature vectors
- dimension
- dimensional
- 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
Abstract
The present invention provides a kind of method and apparatus of search color similar pictures, can improve the accuracy of Similar color picture searching, and search process is simple and efficient, applicability is wide.This method includes:Receive input picture;Extract 3 dimensional feature vectors and M dimensional feature vectors of the input picture;Inquiry 3 dimensional feature vectors most like with 3 dimensional feature vectors of the input picture in 3 dimensional feature library, and obtain the corresponding first picture set of the 3 most like dimensional feature vectors;The first M dimensional feature vector set that the M dimensional feature vectors of the picture in the first picture set are constituted is obtained in M dimensional features library, and the M dimensional feature vector most like with the M dimensional feature vectors of the input picture is therefrom inquired, obtain the corresponding second picture set of the most like M dimensional feature vectors.
Description
Technical field
The present invention relates to field of computer technology more particularly to a kind of method and apparatus of search color similar pictures.
Background technology
With the rapid development of image recognition technology, in current e-commerce and other similar fields, Yong Hu
When searching for certain part commodity, search engine system can input picture according to user and scan for, and find in systems defeated with user
Enter the similar picture of picture, right rear line returns to corresponding similar merchandise news, and picture is utilized to realize to provide to the user
The function of commodity needed for search.
In realizing process of the present invention, inventor has found at least to deposit in the existing technology using picture searching approximation commodity
In following problem:For the commodity picture in the case of complex colors, existing searching algorithm is often searched for not accurate enough, and has
A little algorithms need to calculate the proportion in commodity picture shared by the color data of different color data and different colours, then again
Comprehensive similarity is calculated according to it, although improving accuracy to a certain extent, algorithm is too complicated, system processing
Efficiency is very low.
Therefore, there is an urgent need for a kind of accuracy that can improve Similar color picture searching, and search process is simple and efficient
The method for searching for color similar pictures.
Invention content
In view of this, the embodiment of the present invention provide a kind of search method, apparatus of color similar pictures, electronic equipment and
Computer-readable medium can improve the accuracy of Similar color picture searching, and search process is simple and efficient, applicability
Extensively.
To achieve the above object, according to an aspect of the invention, there is provided it is a kind of search color similar pictures method,
3 dimensional feature vectors and M dimensional feature vector of the method based on picture are searched for and given input picture color phase in picture library
As picture, wherein M is positive integer, and the corresponding picture library is predefined 3 dimensional feature libraries and M dimensional features library,
The method includes:
Receive input picture;
Extract 3 dimensional feature vectors and M dimensional feature vectors of the input picture;
Inquiry 3 dimensional feature vectors most like with 3 dimensional feature vectors of the input picture in 3 dimensional feature library,
And obtain the corresponding first picture set of the 3 most like dimensional feature vectors;
The first M that the M dimensional feature vectors of the picture in the first picture set are constituted is obtained in M dimensional features library
Dimensional feature vector set, and the therefrom inquiry M dimensional feature vector most like with the M dimensional feature vectors of the input picture, obtain
The corresponding second picture set of the most like M dimensional feature vectors.
Further, 3 dimensional feature vectors of one width picture of extraction include:It is maximum to count accounting in the background area of the picture
Color red R, green G and indigo plant B values, define R, G, B value be the picture 3 dimensional feature vectors,
The M dimensional feature vectors for extracting a width picture include:Each dimension in the M dimensional feature vectors is each configured with pre-
Definition condition, the initial value of each dimension are 0, whenever there are one tone H, the saturation degree S of pixel and bright in the picture
Degree I values meet the condition, then the corresponding dimension values of the condition add 1, each pixel in the picture are traversed, to generate
State M dimensional feature vectors.
Further, include the step of obtaining the first picture set:
3 WeiKDShu are built based on 3 dimensional feature library;
Using 3 dimensional feature vectors of the input picture as query point, K-NN search is carried out to 3 WeiKDShu, is obtained
3 dimensional feature vectors for obtaining the nearest neighbor point of 3 dimensional feature vectors of the input picture, to obtain the 3 most like Wei Te
Sign vector.
Further, include the step of obtaining the second picture set:
Based on the first M dimensional feature vector set structure M WeiKDShu;
Using the M dimensional feature vectors of the input picture as query point, K-NN search is carried out to the M WeiKDShu, is obtained
The M dimensional feature vectors for obtaining the nearest neighbor point of the M dimensional feature vectors of the input picture, to obtain the most like M Wei Te
Sign vector.
Optionally, the M values are 31.
Optionally, the predefined conditions of each dimension in 31 dimensional feature vector are:
1st dimension pI>238&pS<(3*pI-510), the 2nd dimension 33<pI<51&pS<255-3*pI, the 3rd dimension 16<pI<51&pS<
255-3*pI, the 4th dimension pI<51&pS<255-3*pI, the 5th dimension 176<pI<239&pS<(0.2*pI+0.5), the 6th dimension 112<pI<
177&pS<(0.2*pI+0.5), the 7th dimension 50<pI<113&pS<(0.2*pI+0.5), the 8th dimension 1<pH<10, the 9th dimension pH>352&
pH<2, the 10th dimension 344<pH<353, the 11st dimension 28<pH<38, the 12nd dimension 18<pH<29, the 13rd dimension 9<pH<19, the 14th dimension 63<pH
<76, the 15th dimension 49<pH<64, the 16th dimension 37<pH<50, the 17th dimension 75<pH<104, the 18th dimension 104<pH<133, the 19th dimension 132<
pH<161, the 20th dimension 160<pH<174, the 21st dimension 173<pH<188, the 22nd dimension 187<pH<201, the 23rd dimension 200<pH<227, the
24 dimensions 226<pH<255, the 25th dimension 254<pH<281, the 26th dimension 304<pH<316, the 27th dimension 291<pH<305, the 28th dimension 280<
pH<292, the 29th dimension 335<pH<345, the 30th dimension 324<pH<336, the 31st dimension 315<pH<325,
Wherein, pH is the tone H values of pixel, and pS is the saturation degree S values of pixel, and pI is the brightness I values of pixel.
Further, the background area be the picture by the leftmost side, the N row pixel of the rightmost side and top side, most
The frame region of the N row pixels composition of downside, wherein N is positive integer.
To achieve the above object, according to another aspect of the present invention, a kind of dress of search color similar pictures is provided
It sets, 3 dimensional feature vectors and M dimensional feature vector of the described device based on picture are searched for and given input picture color in picture library
Similar picture, wherein M is positive integer, and the corresponding picture library is predefined 3 dimensional feature libraries and M dimensional features library, described device
Including:Picture receiving module, characteristic vector pickup module, 3 dimensional feature enquiry modules and M dimensional feature enquiry modules,
The picture receiving module is for receiving input picture;
Described eigenvector extraction module is used to extract 3 dimensional feature vectors and M dimensional feature vectors of the input picture;
The 3 dimensional feature enquiry module in 3 dimensional feature library inquiry with it is described input picture 3 dimensional features to
3 most like dimensional feature vectors are measured, and obtain the corresponding first picture set of the 3 most like dimensional feature vectors;
The M dimensional features enquiry module is used to obtain the picture in the first picture set in M dimensional features library
M dimensional feature vectors constitute the first M dimensional feature vector set, and therefrom inquiry with it is described input picture M dimensional feature vectors
Most like M dimensional feature vectors obtain the corresponding second picture set of the most like M dimensional feature vectors.
Further, the 3 dimensional feature enquiry module includes:
3 WeiKDShu build submodule, for building 3 WeiKDShu based on 3 dimensional feature library;
3 dimension KD tree query submodules, for using 3 dimensional feature vectors of the input picture as query point, being tieed up to described 3
KD trees carry out K-NN search, obtain 3 dimensional feature vectors of the nearest neighbor point of 3 dimensional feature vectors of the input picture, to
Obtain the 3 most like dimensional feature vectors.
Further, the M dimensional features enquiry module includes:
M WeiKDShu build submodule, for based on the first M dimensional feature vector set structure M WeiKDShu;
M ties up KD tree query submodules, for using the M dimensional feature vectors of the input picture as query point, being tieed up to the M
KD trees carry out K-NN search, obtain the M dimensional feature vectors of the nearest neighbor point of the M dimensional feature vectors of the input picture, to
Obtain the most like M dimensional feature vectors.
To achieve the above object, according to another aspect of the present invention, a kind of electricity of search color similar pictures is provided
Sub- equipment, including:
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors so that one or more of processing
The method that device realizes search color similar pictures provided by the invention.
To achieve the above object, according to another aspect of the present invention, a kind of computer-readable medium is provided, is deposited thereon
Computer program is contained, the method that search color similar pictures provided by the invention are realized when described program is executed by processor.
Method, apparatus, electronic equipment and the computer for a kind of search color similar pictures that inventive embodiments provide can
Medium is read, ties up color characteristic and M dimension color characteristics by the 3 of picture to characterize the background color and global color of picture.It uses
KD trees nearest neighbor algorithm searches for picture identical with input picture background color in 3 dimensional feature libraries of picture library, to reduce
Then the search range of picture library carries out M dimensional feature search using KD tree nearest neighbor algorithms within the scope of the picture library of diminution, obtains
The picture most like with input picture global color is obtained, the search of Similar color picture is realized, Similar color picture can be improved
The accuracy of search, and search process is simple and efficient, applicability is wide.Also, the present invention provides carrying for 31 dimensional feature vectors
Mode is taken, the search of picture global color is carried out using 31 dimensional feature vectors, it can be in the premise for ensureing signature search accuracy
Under, the speed of signature search is improved to greatest extent.
Further effect possessed by above-mentioned non-usual optional mode adds hereinafter in conjunction with specific implementation mode
With explanation.
Description of the drawings
Attached drawing does not constitute inappropriate limitation of the present invention for more fully understanding the present invention.Wherein:
Fig. 1 is the method flow diagram of search color similar pictures provided in an embodiment of the present invention;
Fig. 2 is the schematic device of search color similar pictures provided in an embodiment of the present invention;
Fig. 3 is the schematic diagram of 3 dimensional feature enquiry module provided in an embodiment of the present invention;
Fig. 4 is the schematic diagram of M dimensional features enquiry module provided in an embodiment of the present invention;
Fig. 5 is adapted for the structural schematic diagram of the computer system of the electronic equipment for realizing the embodiment of the present application.
Specific implementation mode
It explains to the exemplary embodiment of the present invention below in conjunction with attached drawing, including the various of the embodiment of the present invention
Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize
It arrives, various changes and modifications can be made to the embodiments described herein, without departing from scope and spirit of the present invention.Together
The description to known function and structure is omitted for clarity and conciseness in sample in following description.
The embodiment of the present invention provides a kind of method of search color similar pictures, and this method utilizes the input figure that user gives
3 dimensional feature vectors and M dimensional feature vectors of piece search for picture similar with input picture color in picture library, wherein M is just
Integer.As shown in Figure 1, the method for search color similar pictures provided by the invention includes:Step 101, step 102, step 103
With step 104.
In a step 101, the input picture that user gives is received.
In a step 102, extraction input picture 3 dimensional feature vectors and M dimensional feature vectors, the present invention pass through picture 3
Dimension color characteristic and M tie up color characteristic to characterize picture, and extraction in this step inputs the features described above of picture, and then subsequently walks
In rapid, above two feature is gradually utilized to obtain color similar pictures of the input picture in picture library in picture library.
In the present invention, 3 dimensional feature vectors of one width picture of extraction include:Count in the background area of the picture accounting most
The red R of big color, green G, indigo plant B values define 3 dimensional feature vectors that R, G, B value are the picture.
In the present invention, background area is the N of the N row pixel and top side, lower side by the leftmost side, the rightmost side of picture
The frame region of row pixel composition, wherein N are positive integer.For example, setting N values are 3, then scanned picture is four wide up and down
Degree is the pixel value for the frame region that the width that the side of 3 row pixels forms is 3 row pixels.The value of N can be according to actual demand
It is adjusted, the N values the big, and the picture frame region being scanned is wider, and N values are smaller, the picture rim area being scanned
Domain is narrower.
For example, during extracting 3 dimensional feature vector of picture of a commodity, the background area of the commodity picture is scanned
The pixel value of all pixels point in domain, if the background area is pure white, in rgb space, statistics obtains the background area
The middle maximum color of accounting is pure white, and lily rgb value is (255,255,255), and then defines the 3 of the commodity picture
Dimensional feature vector is (255,255,255).
In a step 102, it is feature vector extracting mode using 3 that aforementioned present invention provides, extraction obtains user's input
3 dimensional feature vectors of picture.In subsequent step using input picture 3 dimensional feature vectors can in picture library initial search
To picture set identical with input picture background field color.
In the present invention, the M dimensional feature vectors of one width picture of extraction include:Each dimension difference in M dimensional feature vectors
Configured with predefined conditions, the initial value of each dimension is 0, whenever there are one pixel in the picture tone H, saturation degree S,
Brightness I values meet condition, then the corresponding dimension values of the condition add 1, each pixel in picture are traversed, to generate M dimensional features
Vector.
When extracting the M dimensional feature vectors of picture, picture is switched into the spaces HSI by rgb space, i.e., color-saturation degree-is bright
Spend space.The M dimensional feature vectors that the data of each dimension are 0 are built, then each pixel of scanned picture, often
When scanning through a pixel, it is corresponding each in M dimensional feature vectors to judge whether H, S, I spatial pixel values of the pixel meet
The predefined conditions of dimension configuration, i.e. M condition in total.When meeting any of which condition, the corresponding dimension values of the condition
Add 1, after scanning through all pixels point of the picture, obtained M dimension values are the M dimensional feature vectors of the picture.
For example, M values are 5, then the initial value of 5 dimensional feature vectors built is:
(0,0,0,0,0).
Correspondingly, 5 dimensional feature vectors are corresponding with 5 conditions, after scanning through in picture pixel, it is assumed that the picture
Vegetarian refreshments meets all 5 conditions, then 5 dimensional feature vector is updated to:
(1,1,1,1,1).
Then, next pixel is scanned, it is corresponding in the condition of satisfaction if next pixel meets 2 conditions
Add 1 in dimension values, obtains:
(1,2,1,2,1).
And so on, until scanning through all pixels point of picture, obtain 5 dimensional feature vectors of picture.
In the present invention, the value of M can be configured according to the actual needs, and characterization can be improved by increasing M values
Granularity so that the search result based on M dimensional feature vectors in subsequent step is more accurate, still, the time searched for accordingly
It can increase.
In a step 102, the M dimensional feature vector extracting modes provided using aforementioned present invention, extraction obtain user's input
The M dimensional feature vectors of picture.
After the completion of inputting 3 dimensional feature vectors and the extraction of M dimensional feature vectors of picture, in step 103, in 3 Wei Te
Levy most like 3 dimensional feature vectors of 3 dimensional feature vectors of inquiry and input picture in library, and obtain 3 most like dimensional features to
Measure corresponding first picture set.In the present invention, corresponding picture library is predefined has the 3 dimensional feature libraries, 3 dimensional feature libraries to include:Figure
3 dimensional feature vectors of each picture in valut.Each picture i.e. in picture library utilizes 3 dimensional features that aforementioned present invention provides
Vectorial extracting mode has carried out the extraction of 3 dimensional feature vectors, and 3 dimensional feature vectors of extraction correspond to picture library and form 3 dimensional feature libraries.
In this step, 3 dimensional feature vectors most like with 3 dimensional feature vectors of input picture are inquired in 3 dimensional feature libraries, then
The most like corresponding picture of 3 dimensional feature vectors is found in picture library.Due to 3 dimensional feature vectors characterization be picture the back of the body
Therefore, in picture library scape color may have many pictures to have same 3 dimensional feature vector, so this step inquires most
Similar 3 dimensional feature vector corresponds to a picture set in picture library, i.e. the first picture set.
In the present invention, it is specifically included in the step 103 for obtaining the first picture set:
First, 3 dimensional feature libraries are based on and build 3 WeiKDShu, the i.e. 3 dimensional feature vectors structure based on all pictures in picture library
Then KD trees using 3 dimensional feature vectors for inputting picture as query point, carry out K-NN search to 3 WeiKDShu of structure, obtain
3 dimensional feature vectors that the nearest neighbor point of 3 dimensional feature vectors of picture must be inputted, to obtain 3 most like dimensional feature vectors.This
In invention, the search of most like 3 dimensional feature is carried out in 3 dimensional feature libraries using KD trees nearest neighbor algorithm, search can be improved
Speed, and can ensure that the similar pictures background color returned is identical as retrieving image input by user.
Step 103 searches for acquisition picture identical with input picture background color in picture library, in actual application
In, by taking 100,000,000 picture database as an example, search is returned to by a sufficiently large picture set by this step, it is typically tens thousand of
A picture.
At step 104, the M dimensional feature vectors composition of the picture in the first picture set is obtained in M dimensional features library
First M dimensional feature vector set, and the therefrom inquiry M dimensional feature vector most like with the M dimensional feature vectors of input picture, obtain
The corresponding second picture set of most like M dimensional feature vectors.In the present invention, corresponding picture library is predefined M dimensional features library,
M dimensional features library includes:The M dimensional feature vectors of each picture in picture library.Each picture i.e. in picture library utilizes above-mentioned
The M dimensional feature vectors extracting mode that invention provides has carried out the extraction of M dimensional feature vectors, the M dimensional feature vector corresponding diagrams of extraction
Valut forms M dimensional features library.In this step, the first picture set that selecting step 103 inquires first in M dimensional features library
In picture M dimensional feature vectors, the first M dimensional feature vector set of composition, then in the first M dimensional feature vector set
The inquiry M dimensional feature vector most like with the M dimensional feature vectors of input picture, and then obtain corresponding to most like M in picture library
The picture set of dimensional feature vector, i.e. second picture set.This step is carried out in the first picture set that step 103 obtains
For the fine search of picture global characteristics, the range of second picture set can be reduced by increasing M values, and then improve the essence of search
Exactness.
In the present invention, include in the step 104 for obtaining second picture set:
First, it is based on the first M dimensional feature vector set and builds M WeiKDShu, i.e., based on all figures in the first picture set
The M dimensional feature vectors of piece build KD trees, then using the M dimensional feature vectors for inputting picture as query point, are carried out most to M WeiKDShu
NN Query obtains the M dimensional feature vectors of the nearest neighbor point of the M dimensional feature vectors of input picture, to obtain most like M dimensions
Feature vector.In the present invention, most like M dimensional features are carried out in the first M dimensional feature vector set using KD trees nearest neighbor algorithm
Search, in actual application, often choosing value is larger by M, therefore the search of M dimensional features is slower than the search of 3 dimensional features, but in step
In rapid 103 by the search of background color feature by the range shorter that picture global feature is searched for be the first picture set, from
And it ensure that the efficiency of step 104 fine search.
In a kind of specific implementation mode of the present invention, M values are 31, i.e., extraction inputs picture in the methods of the invention
31 dimensional feature vectors, and 31 dimensional feature libraries are built in advance for picture library picture.Each dimension in 31 dimensional feature vectors
Predefined conditions, that is, need the condition met, as shown in table 1 below, wherein pH be pixel tone H values, pS is pixel
Saturation degree S values, pI be pixel brightness I values.
Table 1
Current dimension is corresponding needs to meet for the M values 31 and each of 31 dimensional feature vectors that aforementioned present invention determines
Condition be according to experiment and it is empirically determined, under the premise of ensureing signature search accuracy, spy can be improved to greatest extent
Levy the speed of search.By taking 100,000,000 picture database as an example, step 103 search returns to the set of tens thousand of a pictures, in step 104
In 31 dimensional features carried out to the set of this tens thousand of a picture search element, can ensure to return in several milliseconds and search result.
The method of search color similar pictures provided in an embodiment of the present invention ties up color characteristic by the 3 of picture and M ties up face
Color characteristic characterizes the background color and global color of picture.Using KD trees nearest neighbor algorithm in 3 dimensional feature libraries of picture library
Search picture identical with input picture background color, to reduce the search range of picture library, then in the picture library of diminution
M dimensional feature search is carried out using KD tree nearest neighbor algorithms in range, obtains the picture most like with input picture global color, it is real
The search of existing Similar color picture, can improve the accuracy of Similar color picture searching, and search process is simple and efficient, fits
It is wide with property.Also, the present invention provides the extracting modes of 31 dimensional feature vectors, and picture overall situation face is carried out using 31 dimensional feature vectors
The search of color can improve the speed of signature search to greatest extent under the premise of ensureing signature search accuracy.
The embodiment of the present invention also provides a kind of device of search color similar pictures, and device utilizes the given input figure of user
3 dimensional feature vectors and M dimensional feature vectors of piece search for picture similar with input picture color in picture library, and M is positive integer,
Corresponding picture library is predefined to have the 3 dimensional feature libraries and M dimensional features library, 3 dimensional feature libraries to include:3 Wei Te of each picture in picture library
Sign vector, M dimensional features library includes:The M dimensional feature vectors of each picture in picture library extract 3 dimensional feature vectors of a width picture
Including:The red R, green G of the maximum color of accounting, indigo plant B values in the background area of picture are counted, 3 dimensions that R, G, B value are picture are defined
Feature vector, the M dimensional feature vectors for extracting a width picture include:Each dimension in M dimensional feature vectors is each configured with predetermined
The initial value of adopted condition, each dimension is 0, whenever the tone H there are one pixel in picture, saturation degree S, brightness I values meet
Condition, then the corresponding dimension values of the condition add 1, traverse each pixel in picture, to generate M dimensional feature vectors,
As shown in Fig. 2, the device of search color similar pictures provided by the invention includes:Picture receiving module 1, feature to
Measure extraction module 2,3 dimensional feature enquiry modules 3 and M dimensional features enquiry module 4.
Wherein, picture receiving module 1 is for receiving input picture.
Characteristic vector pickup module 2 is used to extract 3 dimensional feature vectors and M dimensional feature vectors of input picture;
3 dimensional feature enquiry modules 3 are for inquiry is most like with 3 dimensional feature vectors for inputting picture in 3 dimensional feature libraries 3
Dimensional feature vector, and obtain the corresponding first picture set of 3 most like dimensional feature vectors;
M dimensional features enquiry module 4 be used to obtain in M dimensional features library the M dimensional features of picture in the first picture set to
Measure the first M dimensional feature vector set constituted, and the therefrom inquiry M dimensional feature most like with the M dimensional feature vectors of input picture
Vector obtains the corresponding second picture set of most like M dimensional feature vectors.
In the present invention, as shown in figure 3,3 dimensional feature enquiry modules 3 include:3 WeiKDShu build submodule 31 and 3 and tie up KD
Tree query submodule 32.
Wherein, 3 WeiKDShu build submodule 31 and are used to build 3 WeiKDShu based on 3 dimensional feature libraries.
3 dimension KD tree queries submodules 32 for 3 dimensional feature vectors of picture will to be inputted as query point, to 3 WeiKDShu into
Row K-NN search obtains 3 dimensional feature vectors of the nearest neighbor point of 3 dimensional feature vectors of input picture, most like to obtain
3 dimensional feature vectors.
In the present invention, as shown in figure 4, M dimensional features enquiry module 4 includes:M WeiKDShu structure submodules 41 and M tie up KD
Tree query submodule 42
Wherein, M WeiKDShu build submodule 41 and are used for based on the first M dimensional feature vector set structure M WeiKDShu.
M dimensions KD tree queries submodule 42 for the M dimensional feature vectors of picture will to be inputted as query point, to M WeiKDShu into
Row K-NN search obtains the M dimensional feature vectors of the nearest neighbor point of the M dimensional feature vectors of input picture, most like to obtain
M dimensional feature vectors.
The device of search color similar pictures provided in an embodiment of the present invention ties up color characteristic by the 3 of picture and M ties up face
Color characteristic characterizes the background color and global color of picture.Using KD trees nearest neighbor algorithm in 3 dimensional feature libraries of picture library
Search picture identical with input picture background color, to reduce the search range of picture library, then in the picture library of diminution
M dimensional feature search is carried out using KD tree nearest neighbor algorithms in range, obtains the picture most like with input picture global color, it is real
The search of existing Similar color picture, can improve the accuracy of Similar color picture searching, and search process is simple and efficient, fits
It is wide with property.
Below with reference to Fig. 5, it illustrates the computer systems suitable for the electronic equipment for realizing the embodiment of the present application
Structural schematic diagram.Electronic equipment shown in Fig. 5 is only an example, should not be to the function and use scope of the embodiment of the present application
Bring any restrictions.
It, can be according to being stored in read-only storage as shown in figure 5, computer system includes central processing unit (CPU) v1
Program in device (ROM) v2 executes respectively from the program that storage section v8 is loaded into random access storage device (RAM) v3
Kind action appropriate and processing.In RAM v3, it is also stored with various programs and data needed for system operatio.CPU v1,ROM
V2 and RAM v3 are connected with each other by bus v4.Input/output (I/O) interface v5 is also connected to bus v4.
It is connected to I/O interfaces v5 with lower component:Importation v6 including keyboard, mouse etc.;Including such as cathode-ray
Manage the output par, c v7 of (CRT), liquid crystal display (LCD) etc. and loud speaker etc.;Storage section v8 including hard disk etc.;And
The communications portion v9 of network interface card including LAN card, modem etc..Communications portion v9 is via such as internet
Network executes communication process.Driver v10 is also according to needing to be connected to I/O interfaces v5.Detachable media v11, such as disk, light
Disk, magneto-optic disk, semiconductor memory etc. are mounted on driver v10 as needed, in order to from the computer read thereon
Program is mounted into storage section v8 as needed.
Particularly, according to embodiment disclosed by the invention, the process of flow chart description above may be implemented as computer
Software program.For example, embodiment disclosed by the invention includes a kind of computer program product comprising be carried on computer-readable
Computer program on medium, the computer program include the program code for method shown in execution flow chart.In this way
Embodiment in, which can be downloaded and installed by communications portion v9 from network, and/or is situated between from detachable
Matter v11 is mounted.When the computer program is executed by central processing unit (CPU) v1, executes and limited in the system of the application
Above-mentioned function.
It should be noted that computer-readable medium shown in the application can be computer-readable signal media or meter
Calculation machine readable storage medium storing program for executing either the two arbitrarily combines.Computer readable storage medium for example can be --- but not
Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or arbitrary above combination.Meter
The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to:Electrical connection with one or more conducting wires, just
It takes formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type and may be programmed read-only storage
Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device,
Or above-mentioned any appropriate combination.In this application, can be any include computer readable storage medium or storage journey
The tangible medium of sequence, the program can be commanded the either device use or in connection of execution system, device.And at this
In application, computer-readable signal media may include in a base band or as the data-signal that a carrier wave part is propagated,
Wherein carry computer-readable program code.Diversified forms may be used in the data-signal of this propagation, including but unlimited
In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can
Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for
By instruction execution system, device either device use or program in connection.Include on computer-readable medium
Program code can transmit with any suitable medium, including but not limited to:Wirelessly, electric wire, optical cable, RF etc. or above-mentioned
Any appropriate combination.
Flow chart in attached drawing and block diagram, it is illustrated that according to the system of the various embodiments of the application, method and computer journey
The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation
A part for a part for one module, program segment, or code of table, above-mentioned module, program segment, or code includes one or more
Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box
The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical
On can be basically executed in parallel, they can also be executed in the opposite order sometimes, this is depended on the functions involved.Also it wants
It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule
The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction
It closes to realize.
Being described in module involved in the embodiment of the present application can be realized by way of software, can also be by hard
The mode of part is realized.Described module can also be arranged in the processor, for example, can be described as:A kind of processor packet
Include picture receiving module, characteristic vector pickup module, 3 dimensional feature enquiry modules and M dimensional feature enquiry modules.Wherein, these
The title of module does not constitute the restriction to the module itself under certain conditions, for example, 3 dimensional feature enquiry modules can also quilt
Be described as " for inquiry and the input picture in 3 dimensional feature library most like 3 dimensional features of 3 dimensional feature vectors to
Amount, and obtain the corresponding first picture set of the 3 most like dimensional feature vectors ".
As on the other hand, present invention also provides a kind of computer-readable medium, which can be
Included in equipment described in above-described embodiment;Can also be individualism, and without be incorporated the equipment in.Above-mentioned calculating
Machine readable medium carries one or more program, when said one or multiple programs are executed by the equipment, makes
Obtaining the equipment includes:
Receive input picture;
Extract 3 dimensional feature vectors and M dimensional feature vectors of the input picture;
Inquiry 3 dimensional feature vectors most like with 3 dimensional feature vectors of the input picture in 3 dimensional feature library,
And obtain the corresponding first picture set of the 3 most like dimensional feature vectors;
The first M that the M dimensional feature vectors of the picture in the first picture set are constituted is obtained in M dimensional features library
Dimensional feature vector set, and the therefrom inquiry M dimensional feature vector most like with the M dimensional feature vectors of the input picture, obtain
The corresponding second picture set of the most like M dimensional feature vectors.
Above-mentioned specific implementation mode, does not constitute limiting the scope of the invention.Those skilled in the art should be bright
It is white, design requirement and other factors are depended on, various modifications, combination, sub-portfolio and replacement can occur.It is any
Modifications, equivalent substitutions and improvements made by within the spirit and principles in the present invention etc., should be included in the scope of the present invention
Within.
Claims (12)
1. a kind of method of search color similar pictures, which is characterized in that 3 dimensional feature vectors and M of the method based on picture
Dimensional feature vector searches for picture similar with given input picture color in picture library, wherein M is positive integer, described in correspondence
Picture library is predefined 3 dimensional feature libraries and M dimensional features library, the method includes:
Receive input picture;
Extract 3 dimensional feature vectors and M dimensional feature vectors of the input picture;
Inquiry 3 dimensional feature vectors most like with 3 dimensional feature vectors of the input picture in 3 dimensional feature library, and obtain
Obtain the corresponding first picture set of the 3 most like dimensional feature vectors;
The first M Wei Te that the M dimensional feature vectors of the picture in the first picture set are constituted are obtained in M dimensional features library
Sign vector set, and the M dimensional feature vector most like with the M dimensional feature vectors of the input picture is therefrom inquired, described in acquisition
The corresponding second picture set of most like M dimensional feature vectors.
2. according to the method described in claim 1, it is characterized in that, 3 dimensional feature vectors of one width picture of extraction include:Statistics should
The red R, green G of the maximum color of accounting and indigo plant B values in the background area of picture define 3 dimensions that R, G, B value is the picture
Feature vector,
The M dimensional feature vectors for extracting a width picture include:Each dimension in the M dimensional feature vectors is each configured with predefined
The initial value of condition, each dimension is 0, whenever tone H, the saturation degree S and brightness I values there are one pixel in the picture
Meet the condition, then the corresponding dimension values of the condition add 1, traverse each pixel in the picture, are tieed up to generate the M
Feature vector.
3. according to the method described in claim 2, it is characterized in that, including the step of obtaining the first picture set:
3 WeiKDShu are built based on 3 dimensional feature library;
Using 3 dimensional feature vectors of the input picture as query point, K-NN search is carried out to 3 WeiKDShu, obtains institute
State input picture 3 dimensional feature vectors nearest neighbor point 3 dimensional feature vectors, to obtain the 3 most like dimensional features to
Amount.
4. according to the method in claim 2 or 3, which is characterized in that wrapped in the step of obtaining the second picture set
It includes:
Based on the first M dimensional feature vector set structure M WeiKDShu;
Using the M dimensional feature vectors of the input picture as query point, K-NN search is carried out to the M WeiKDShu, obtains institute
State input picture M dimensional feature vectors nearest neighbor point M dimensional feature vectors, to obtain the most like M dimensional features to
Amount.
5. method according to claim 1 or 2, which is characterized in that the M values are 31.
6. according to the method described in claim 5, it is characterized in that, each dimension in 31 dimensional feature vector it is predefined
Condition is:
1st dimension pI>238&pS<(3*pI-510), the 2nd dimension 33<pI<51&pS<255-3*pI, the 3rd dimension 16<pI<51&pS<255-
3*pI, the 4th dimension pI<51&pS<255-3*pI, the 5th dimension 176<pI<239&pS<(0.2*pI+0.5), the 6th dimension 112<pI<177&
pS<(0.2*pI+0.5), the 7th dimension 50<pI<113&pS<(0.2*pI+0.5), the 8th dimension 1<pH<10, the 9th dimension pH>352&pH<2,
10th dimension 344<pH<353, the 11st dimension 28<pH<38, the 12nd dimension 18<pH<29, the 13rd dimension 9<pH<19, the 14th dimension 63<pH<76,
15th dimension 49<pH<64, the 16th dimension 37<pH<50, the 17th dimension 75<pH<104, the 18th dimension 104<pH<133, the 19th dimension 132<pH<
161, the 20th dimension 160<pH<174, the 21st dimension 173<pH<188, the 22nd dimension 187<pH<201, the 23rd dimension 200<pH<227, the 24th
Dimension 226<pH<255, the 25th dimension 254<pH<281, the 26th dimension 304<pH<316, the 27th dimension 291<pH<305, the 28th dimension 280<pH<
292, the 29th dimension 335<pH<345, the 30th dimension 324<pH<336, the 31st dimension 315<pH<325,
Wherein, pH is the tone H values of pixel, and pS is the saturation degree S values of pixel, and pI is the brightness I values of pixel.
7. method according to claim 1 or 2, which is characterized in that the background area be the picture by the leftmost side,
The frame region of the N row pixels composition of the N row pixel of the rightmost side and top side, lower side, wherein N is positive integer.
8. a kind of device of search color similar pictures, which is characterized in that 3 dimensional feature vectors and M of the described device based on picture
Dimensional feature vector searches for picture similar with given input picture color in picture library, wherein M is positive integer, described in correspondence
Picture library is predefined to have the 3 dimensional feature libraries and M dimensional features library, described device to include:Picture receiving module, characteristic vector pickup mould
Block, 3 dimensional feature enquiry modules and M dimensional feature enquiry modules,
The picture receiving module is for receiving input picture;
Described eigenvector extraction module is used to extract 3 dimensional feature vectors and M dimensional feature vectors of the input picture;
The 3 dimensional feature enquiry module in 3 dimensional feature library for inquiring with 3 dimensional feature vectors of the input picture most
Similar 3 dimensional feature vector, and obtain the corresponding first picture set of the 3 most like dimensional feature vectors;
The M dimensional features enquiry module is used to obtain the M dimensions of the picture in the first picture set in M dimensional features library
The first M dimensional feature vector set that feature vector is constituted, and therefrom inquiry and the M dimensional feature vectors of the input picture are most like
M dimensional feature vectors, obtain the corresponding second picture set of the most like M dimensional feature vectors.
9. device according to claim 8, which is characterized in that the 3 dimensional feature enquiry module includes:
3 WeiKDShu build submodule, for building 3 WeiKDShu based on 3 dimensional feature library;
3 dimension KD tree query submodules are used for using 3 dimensional feature vectors of the input picture as query point, to 3 WeiKDShu
K-NN search is carried out, 3 dimensional feature vectors of the nearest neighbor point of 3 dimensional feature vectors of the input picture are obtained, to obtain
The 3 most like dimensional feature vectors.
10. device according to claim 8 or claim 9, which is characterized in that the M dimensional features enquiry module includes:
M WeiKDShu build submodule, for based on the first M dimensional feature vector set structure M WeiKDShu;
M ties up KD tree query submodules, is used for using the M dimensional feature vectors of the input picture as query point, to the M WeiKDShu
K-NN search is carried out, the M dimensional feature vectors of the nearest neighbor point of the M dimensional feature vectors of the input picture are obtained, to obtain
The most like M dimensional feature vectors.
11. a kind of electronic equipment of search color similar pictures, which is characterized in that including:
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors so that one or more of processors are real
The now method as described in any in claim 1-7.
12. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is held by processor
The method as described in any in claim 1-7 is realized when row.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710311228.6A CN108804475B (en) | 2017-05-05 | 2017-05-05 | Method and device for searching color similar picture |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710311228.6A CN108804475B (en) | 2017-05-05 | 2017-05-05 | Method and device for searching color similar picture |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108804475A true CN108804475A (en) | 2018-11-13 |
CN108804475B CN108804475B (en) | 2021-07-16 |
Family
ID=64054747
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710311228.6A Active CN108804475B (en) | 2017-05-05 | 2017-05-05 | Method and device for searching color similar picture |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108804475B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8326029B1 (en) * | 2008-03-21 | 2012-12-04 | Hewlett-Packard Development Company, L.P. | Background color driven content retrieval |
CN103699532A (en) * | 2012-09-27 | 2014-04-02 | 中国电信股份有限公司 | Image color retrieval method and system |
CN104484425A (en) * | 2014-12-20 | 2015-04-01 | 辽宁师范大学 | Color image searching method based on multiple features |
CN104572971A (en) * | 2014-12-31 | 2015-04-29 | 安科智慧城市技术(中国)有限公司 | Image retrieval method and device |
-
2017
- 2017-05-05 CN CN201710311228.6A patent/CN108804475B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8326029B1 (en) * | 2008-03-21 | 2012-12-04 | Hewlett-Packard Development Company, L.P. | Background color driven content retrieval |
CN103699532A (en) * | 2012-09-27 | 2014-04-02 | 中国电信股份有限公司 | Image color retrieval method and system |
CN104484425A (en) * | 2014-12-20 | 2015-04-01 | 辽宁师范大学 | Color image searching method based on multiple features |
CN104572971A (en) * | 2014-12-31 | 2015-04-29 | 安科智慧城市技术(中国)有限公司 | Image retrieval method and device |
Non-Patent Citations (2)
Title |
---|
史变霞 等: "基于颜色特征的图像检索方法", 《微电子学与计算机》 * |
曹姝清 等: "《中国现代小卫星技术发展研究论文集》", 31 January 2016 * |
Also Published As
Publication number | Publication date |
---|---|
CN108804475B (en) | 2021-07-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106910210B (en) | Method and apparatus for generating image information | |
CN105975939B (en) | Video detecting method and device | |
EP1173827B1 (en) | Method and apparatus for representing and searching for colour images | |
CN108052613A (en) | For generating the method and apparatus of the page | |
CN109934181A (en) | Text recognition method, device, equipment and computer-readable medium | |
CN105184289B (en) | Character identifying method and device | |
CN108629823A (en) | The generation method and device of multi-view image | |
CN108764319A (en) | A kind of sample classification method and apparatus | |
CN107766492A (en) | A kind of method and apparatus of picture search | |
CN110533055A (en) | A kind for the treatment of method and apparatus of point cloud data | |
CN105912739B (en) | A kind of similar pictures searching system and its method | |
CN108090885A (en) | For handling the method and apparatus of image | |
CN111539341B (en) | Target positioning method, device, electronic equipment and medium | |
CN110443264A (en) | A kind of method and apparatus of cluster | |
CN110473263A (en) | The checking method of picture, device and system | |
CN107968743A (en) | The method and apparatus of pushed information | |
CN109272526A (en) | Image processing method, system and electronic equipment | |
CN109993749A (en) | The method and apparatus for extracting target image | |
JP2011100293A (en) | Information processing device, method for controlling the same, and program | |
CN108804475A (en) | The method and apparatus for searching for color similar pictures | |
CN111797266B (en) | Image processing method and apparatus, storage medium, and electronic device | |
CN109446379A (en) | Method and apparatus for handling information | |
CN108197563A (en) | For obtaining the method and device of information | |
CN108198163A (en) | A kind of PAN and multi-spectral image interfusion method based on discrete cosine transform | |
CN112100430A (en) | Article tracing 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 |