CN105022752A - Image retrieval method and apparatus - Google Patents

Image retrieval method and apparatus Download PDF

Info

Publication number
CN105022752A
CN105022752A CN201410175999.3A CN201410175999A CN105022752A CN 105022752 A CN105022752 A CN 105022752A CN 201410175999 A CN201410175999 A CN 201410175999A CN 105022752 A CN105022752 A CN 105022752A
Authority
CN
China
Prior art keywords
image
retrieved
index table
color
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201410175999.3A
Other languages
Chinese (zh)
Other versions
CN105022752B (en
Inventor
甘玉珏
郝颖
杨杰
卢燕青
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Telecom Corp Ltd
Original Assignee
China Telecom Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Telecom Corp Ltd filed Critical China Telecom Corp Ltd
Priority to CN201410175999.3A priority Critical patent/CN105022752B/en
Publication of CN105022752A publication Critical patent/CN105022752A/en
Application granted granted Critical
Publication of CN105022752B publication Critical patent/CN105022752B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Image Analysis (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention relates to an image retrieval method and apparatus. The method comprises the steps of: obtaining a to-be-retrieved image from a user terminal; converting the to-be-retrieved image to HSV space from RGB space; quantizing the converted to-be-retrieved image into N-dimensional color features; sorting the feature values of the N-dimensional color features in a descending order, and selecting the first M-dimensional color features as main color of the to-be-retrieved image; determining a cluster index table name of the to-be-retrieved image according to an index value corresponding to the main color; querying whether a cluster index table with the same name as the cluster index table of the to-be-retrieved image exists in the established cluster index table according to a name of the cluster index table; if existence, obtaining an image index of the corresponding image; querying main color percentage of the corresponding image according to the obtained image index; calculating the image similarity according to the main color percentage; and returning an image matched with the to-be-retrieved image to the user terminal according to the similarity. The image retrieval method and apparatus disclosed by the invention remarkably improve the image retrieval efficiency and accuracy.

Description

Image retrieval method and device
Technical Field
The present disclosure relates to the field of computer image retrieval, and in particular, to an image retrieval method and apparatus.
Background
With the popularization of internet application, the rapid development of multimedia technology and computer technology application, and the popularization and application of mass storage devices and digital devices, the presentation mode of information gradually evolves from the traditional text mode to the form mainly based on multimedia information such as graphics, images, videos, audios and the like. Among them, images have been deeply introduced into various aspects of people's life as the most important carriers for information transmission. Therefore, how to quickly and accurately find a required digital image from a large-capacity image database has become one of the hot spots of multimedia technology research in recent years, and has a wide economic value and market prospect.
The color feature is used as one of the methods for describing the global features of the image, has definite definition, easy extraction, rotation and translation invariance, is insensitive to various deformations, and shows quite strong robustness. Therefore, image retrieval based on color features is the most widely used, content-based image retrieval method. The MPEG-7 dominant color descriptor is a descriptive factor of MPEG-7, which replaces the features of the entire image with a small number of representative colors.
At present, a method of calculating the percentage of each extracted color may be adopted, and if the percentage is more than 5%, the corresponding color is regarded as the main color or the quantized color with the accumulated percentage less than 60% is regarded as the main color. However, the number of dominant color descriptors extracted by this method is not fixed, which increases the complexity of the search process and reduces the search efficiency.
A method of fixing the number of main colors can also be adopted, but a method of quickly indexing images is not proposed so far, and all images in a database are queried and subjected to similarity calculation at each query time, so that the retrieval efficiency and speed are greatly reduced.
Disclosure of Invention
The present disclosure proposes a new technical solution in view of at least one of the above problems.
The present disclosure provides, in one aspect thereof, an image retrieval method that significantly improves the efficiency and accuracy of retrieval of images.
The present disclosure provides, in another aspect thereof, an image retrieval apparatus that significantly improves the efficiency and accuracy of retrieving an image.
According to the present disclosure, there is provided an image retrieval method including:
acquiring an image to be retrieved from a user terminal, wherein the image to be retrieved is represented by an RGB space;
converting an image to be retrieved from an RGB space to an HSV space;
quantizing the image to be retrieved converted into the HSV space into N-dimensional color features;
sorting the characteristic values of the N-dimensional color characteristics of the image to be retrieved in a descending order according to the sizes, and selecting the sorted front M-dimensional color characteristics as the main color of the image to be retrieved, wherein M is less than N;
determining the name of a clustering index table of the image to be retrieved according to the index value corresponding to the main color of the image to be retrieved;
inquiring whether a cluster index table with the same name as that of the cluster index table of the image to be retrieved exists in the cluster index table established based on each image in the image database according to the determined name of the cluster index table of the image to be retrieved;
if the image index exists, acquiring the image index from the clustering index table with the same name as the clustering index table of the image to be retrieved;
inquiring the corresponding dominant color percentage of the image according to the acquired image index;
calculating the similarity between the image to be retrieved and the image inquired from the image database based on the dominant color percentage of the image;
and returning the image matched with the image to be retrieved to the user terminal according to the similarity between the images.
In some embodiments of the disclosure, the method further comprises:
and establishing a clustering index table based on each image in the image database.
In some embodiments of the present disclosure, the step of building a cluster index table based on images in the image database includes:
sequentially reading each image in an image database, wherein each image in the image database is represented by an RGB space;
converting each image in the image database from an RGB space to an HSV space;
quantizing each image converted into the HSV space into N-dimensional color features;
sorting the characteristic values of the N-dimensional color characteristics of each image in descending order according to the size, and selecting the sorted front M-dimensional color characteristics as the main color of each image;
determining the name of a cluster index table of each image in an image database according to the index value corresponding to the main color of each image;
and storing the image index value and the corresponding dominant color percentage of each image into a corresponding cluster index table.
In some embodiments of the present disclosure, the hue H in the HSV space is uniformly divided into 9 parts, the saturation S is divided into 3 parts, and the brightness V is divided into 3 parts.
According to the present disclosure, there is also provided an image retrieval apparatus including:
the image acquisition unit is used for acquiring an image to be retrieved from a user terminal, and the image to be retrieved is represented by an RGB space;
the space conversion unit is used for converting the image to be retrieved from the RGB space to the HSV space;
the image quantization unit is used for quantizing the image to be retrieved converted into the HSV space into N-dimensional color features;
the main color determining unit is used for sorting the characteristic values of the N-dimensional color characteristics of the image to be retrieved in a descending order according to the sizes, and selecting the front M-dimensional color characteristics after sorting as the main color of the image to be retrieved, wherein M is less than N;
the index table name determining unit is used for determining the name of the clustering index table of the image to be retrieved according to the index value corresponding to the main color of the image to be retrieved;
the judging unit is used for inquiring whether a cluster index table with the same name as that of the cluster index table of the image to be retrieved exists in the cluster index table established based on each image in the image database according to the determined name of the cluster index table of the image to be retrieved;
the dominant color percentage obtaining unit is used for obtaining an image index from a clustering index table with the same name as that of the clustering index table of the image to be retrieved if the dominant color percentage obtaining unit exists, and inquiring the corresponding dominant color percentage of the image according to the obtained image index;
the similarity calculation unit is used for calculating the similarity between the image to be retrieved and the image inquired from the image database based on the dominant color percentage of the image;
and the result returning unit is used for returning the image matched with the image to be retrieved to the user terminal according to the similarity between the images.
In some embodiments of the present disclosure, the apparatus further comprises:
and the index table establishing unit is used for establishing a clustering index table based on each image in the image database.
In some embodiments of the present disclosure, the index table establishing unit includes an image obtaining unit, a spatial conversion unit, an image quantization unit, a main color determination unit, an index table name determination unit, and a storage sub-unit, wherein,
the image acquisition unit is further used for sequentially reading each image in the image database, wherein each image in the image database is represented by an RGB space;
the space conversion unit is also used for converting each image in the image database into HSV space from RGB space;
an image quantization unit further configured to quantize each image converted into the HSV space into an N-dimensional color feature;
the main color determining unit is also used for sorting the characteristic values of the N-dimensional color characteristics of each image in a descending order according to the sizes, and selecting the sorted front M-dimensional color characteristics as the main color of each image;
the index table name determining unit is also used for determining the cluster index table name of each image in the image database according to the index value corresponding to the main color of each image;
and the storage subunit is used for storing the image index value and the corresponding dominant color percentage of each image into the corresponding cluster index table.
In some embodiments of the present disclosure, the image quantization unit uniformly divides the hue H in the HSV space into 9 parts, the saturation S into 3 parts, and the brightness V into 3 parts.
In the technical scheme of the disclosure, since the image in the HSV space is quantized into N dimensions, the main color of the image is determined according to the characteristic value, the name of the cluster index table of the image is determined by using the main color of the image, when the image to be retrieved is retrieved, the image with the same main color is firstly searched, and then the retrieval is performed in the image with the same main color, it can be seen that the retrieval range is remarkably reduced compared with the existing image retrieval method. Meanwhile, the retrieval range of the image is determined according to the main color of the image, so that the accuracy of image retrieval is further ensured.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure, are incorporated in and constitute a part of this application. In the drawings:
fig. 1 is a flowchart illustrating an image retrieval method according to an embodiment of the present disclosure.
Fig. 2 is a schematic structural diagram of a system for implementing image retrieval according to the present disclosure.
FIG. 3 is a schematic diagram of the RGB to HSV conversion of the present disclosure.
Fig. 4 is a schematic structural diagram of an image retrieval apparatus according to an embodiment of the present disclosure.
Detailed Description
The present disclosure will be described below with reference to the accompanying drawings. It is to be noted that the following description is merely illustrative and exemplary in nature and is in no way intended to limit the disclosure, its application, or uses. Unless specifically stated otherwise, the relative arrangement of components and steps and numerical expressions and values set forth in the embodiments do not limit the scope of the present disclosure. Additionally, techniques, methods, and apparatus known to those skilled in the art may not be discussed in detail but are intended to be part of the specification where appropriate.
The present disclosure is directed to overcoming the disadvantages and shortcomings of the prior art and providing an efficient clustered image retrieval algorithm that may be applied to image retrieval for MPEG-7. It quantizes the color information of the image using an HSV (Hue, Saturation, brightness) color model, and fixes the number of main colors. When the images are searched, only the images of the specific clustering index table need to be searched, and the specific clustering index table is formed by selecting images with higher similarity according to the main color characteristics of the images in the establishing process, so that the invalid search of a large number of images with dissimilar or low similarity is avoided, and the effectiveness and the efficiency of the search are obviously improved.
Fig. 1 is a flowchart illustrating an image retrieval method according to an embodiment of the present disclosure.
As shown in fig. 1, the flow in this embodiment may include:
s102, obtaining an image to be retrieved from a user terminal, wherein the image to be retrieved is represented by RGB (Red Green blue) space, such as MPEG-7 image.
S104, converting the image to be retrieved from the RGB space to the HSV space;
in the HSV space, H represents the hue, the value range of H is 0-360 degrees, the calculation is carried out in the anticlockwise direction from 0 degrees, red is represented by 0 degrees, green is represented by 120 degrees, and blue is represented by 240 degrees. S represents saturation, and the value range of S is 0-1. V represents brightness, and the value range of V is 0-1. Specifically, the conversion from the RGB space to the HSV space can be realized by using the existing conversion method.
S106, quantizing the image to be retrieved converted into the HSV space into N-dimensional color features;
specifically, the inventors found that two sides (e.g., 360 ° to 20 °) of red (0 °) are also close to red, two sides (e.g., 100 ° to 140 °) of green (120 °) are also close to green, and two sides (e.g., 220 ° to 260 °) of blue (240 °) are also close to blue. Therefore, the hue, the brightness and the saturation are respectively divided into a plurality of sections, and then the image in the HSV space can be quantized into a plurality of dimensions so as to further subdivide the color characteristics of the image, wherein N is an integer greater than 0.
S108, sorting the characteristic values of the N-dimensional color characteristics of the image to be retrieved in a descending order according to the sizes, and selecting the front M-dimensional color characteristics after sorting as the main color of the image to be retrieved, wherein M is less than N, namely, the front M color characteristics with higher characteristic values are used as the main color of the image.
S110, determining the name of a clustering index table of the image to be retrieved according to the index value corresponding to the main color of the image to be retrieved;
specifically, since the image is quantized to N dimensions, each of the combinations of hue, saturation, and luminance that are quantized can be represented by any one of index values 1 to N, which indirectly represent the hue, saturation, and luminance of the image.
When the cluster index table name of the image to be retrieved is determined, the cluster index table name is formed according to the index value sequence after the characteristic values are sorted in a descending order, namely, the name not only represents the main color contained in the image, but also represents the proportion of the main color in the image.
S112, inquiring whether a cluster index table with the same name as that of the cluster index table of the image to be retrieved exists in the cluster index table established based on each image in the image database according to the determined name of the cluster index table of the image to be retrieved;
it should be noted that the cluster index table of each image in the image database is already constructed before the images are retrieved. And (5) searching whether the cluster index table with the same cluster index table name exists in the cluster index table reflecting each image in the image database according to the cluster index table name of the image to be retrieved determined in the step (110), namely, searching whether the image database has the image with the same main color as the retrieved image by searching the cluster index table. Therefore, compared with the existing method for matching images one by one, the method obviously improves the retrieval efficiency.
And S114, if the image index exists, acquiring the image index from the clustering index table with the same name as the clustering index table of the image to be retrieved.
And S116, inquiring the corresponding dominant color percentage of the image according to the acquired image index.
And S118, calculating the similarity between the image to be retrieved and the image inquired from the image database based on the dominant color percentage of the image.
And S120, returning the image matched with the image to be retrieved to the user terminal according to the similarity between the images.
In this embodiment, since the images in the HSV space are quantized into N dimensions, the main color of the images is determined according to the feature value, the cluster index table name of the images is determined by using the main color of the images, and when the images to be retrieved are retrieved, the images with the same main color are first searched, and then the retrieval is performed in the images with the same main color, it can be seen that the retrieval range is significantly reduced compared with the existing image retrieval method. Meanwhile, the retrieval range of the image is determined according to the main color of the image, so that the accuracy of image retrieval is further ensured.
Further, before step S102, a cluster index table is established based on each image in the image database, so as to improve the retrieval efficiency of the image to be retrieved.
Specifically, the step of building a cluster index table based on the images in the image database may include:
sequentially reading each image in an image database, wherein each image in the image database is represented by an RGB space;
converting each image in the image database from an RGB space to an HSV space;
quantizing each image converted into the HSV space into N-dimensional color features;
sorting the characteristic values of the N-dimensional color characteristics of each image in descending order according to the size, and selecting the sorted front M-dimensional color characteristics as the main color of each image;
determining the name of a cluster index table of each image in an image database according to the index value corresponding to the main color of each image;
and storing the image index value and the corresponding dominant color percentage of each image into a corresponding cluster index table.
Here, the hue H in the HSV space may be uniformly divided into 9 parts, the saturation S may be divided into 3 parts, and the brightness V may be divided into 3 parts, so that the image quantization may be 81-dimensional, that is, N is 81.
In the following embodiments, an efficient clustering image retrieval algorithm based on MPEG-7 is provided, which applies MPEG-7 visual content description to quantize a color image into 81 dimensions, selects the first 8 dimensions (i.e., M ═ 8) with large feature values as main color features, establishes a cluster index table and a database according to main color combinations, calculates the similarity between images by using the main color features, and performs clustering and fast retrieval on images by using the cluster index table.
Fig. 2 is a schematic structural diagram of a system for implementing image retrieval according to the present disclosure.
As shown in fig. 2, an image feature analysis extraction module and an image retrieval module may be included.
The image characteristic analyzing and extracting module is responsible for processing images in the image database, realizing the main color extraction of the images and storing image characteristics into the image database in batches; synthesizing the name of the cluster index table according to the index value corresponding to the extracted main color, storing the index of the image into the cluster index table, and establishing a cluster index database. The function of the characteristic analysis and extraction module is realized by the following steps: image reading, image color space conversion, main color feature extraction and index saving. The detailed steps are as follows:
(1) image reading: the method comprises the steps of obtaining the names of all images in an image database, forming an image name list, calculating the total number A of the images contained in the image database, and marking the images in the image database by using 1-A respectively. The images in the image database are sequentially read into the feature analysis and extraction module according to the marks, wherein the read images are represented by an RGB color space in the system.
(2) Image color space conversion: HSV can digitize colors better than the RGB color space. The method is characterized in that the color of the image is quantitatively described by three components of hue H, saturation S and brightness V, wherein H is represented by an angle [0 degrees and 360 degrees ], the understanding mode of the human visual system on the color is more accurately reflected, and the image discrimination is better. Therefore, the RGB is firstly converted into the HSV image space, and then the color features of the image are extracted from the HSV space. After the color space conversion of the image is completed, each pixel point in the image is represented by using hue h, saturation s and brightness v, wherein the value range of h is 0 to 360, the value range of s is 0 to 1, and the value range of v is 0 to 1.
FIG. 3 is a schematic diagram of the RGB to HSV conversion of the present disclosure.
As shown in fig. 3, the conversion of the luminance v, the saturation s, and the hue h may be performed separately. For example, the following equally spaced HSV spatial quantization algorithm may be employed:
by the above algorithm, the hue h is divided into 9 parts, and the saturation s and the brightness v are equally divided into 3 parts. Therefore, the quantized color has 81 dimensions in total.
(3) Extracting main color features: after the image is converted into HSV space from RGB, the HSV image is quantized into 81-dimensional color features, the first 8-dimensional features with feature values arranged in descending order are selected, so that the main color of the image is extracted, and the image features are stored in an image database in batches.
The descriptor of the main color of the image may be expressed by the formula F { { C { (C)i,Pi},i=1,2,3,…,81,Pi∈[0,1]Definition of, wherein CiIs a three-dimensional dominant color vector (C9H + 3S + V) denoted by H, S, V, Pi is the dominant color percentage.
(4) And (4) index saving: combining 81 index values corresponding to the subscripts of the 81-dimensional color features in the step (3) into a cluster index table name according to the 8 index values corresponding to the extracted 8-dimensional dominant colors, storing the indexes of the images into the cluster index table, establishing a cluster index database, wherein the quantized color C is {1, 2, … 81}, and the corresponding index value is Ci={C1,C2,…,C81}。
The image retrieval module is responsible for firstly carrying out image feature analysis and extraction on an image to be retrieved, secondly combining a clustering index table name according to the main color index value of the image, inquiring an image index in the index table, inquiring the main color percentage according to an inquiry result, calculating the similarity between the image to be retrieved and an image inquired from an image database, and returning a matched image meeting conditions to a user. The function of the module can be realized by the following steps: retrieving images, converting image color space, analyzing and extracting features, inquiring indexes and calculating image similarity. The detailed steps are as follows:
(5) retrieving images: and acquiring the image to be retrieved from the terminal and reading the image into the image retrieval module. The image read in is represented in the system using the RGB color space.
(6) Image color space conversion: and converting the RGB space into the HSV space, and after the conversion of the image color space is finished, expressing each pixel point of the image by using hue h, saturation s and brightness v, wherein the value range of h is 0 to 360, the value range of s is 0 to 1, and the value range of v is 0 to 1.
(7) And (3) feature analysis and extraction: the image to be retrieved can be quantized into 81-dimensional color features after being converted into an HSV space, and the first 8-dimensional color features with characteristic values arranged in descending order are selected, so that the extraction of the main color of the image is realized.
(8) And (3) inquiring an index table: combining cluster index table names according to the main color index values of the images to be retrieved obtained in the step (7), and then inquiring image indexes in the index table of the names, wherein the quantized color C is {1, 2, …, 81}, and the corresponding index value is Ci={C1,C2,…,C81}。
(9) Calculating the similarity between the images: and (4) according to the image dominant color percentage of the index query image database queried in the step (8), calculating the similarity between the image to be retrieved and the image queried from the image database, and returning the matched image meeting the conditions to the user.
The image retrieval process based on the MPEG-7 dominant color descriptor is as follows:
(9a) by QjRepresents PiIn descending order of percentage, take the top M colors as dominant colors, non-dominant colors will not be considered.
<math> <mrow> <msub> <mi>P</mi> <mi>i</mi> </msub> <mo>=</mo> <mfenced open='{' close=''> <mtable> <mtr> <mtd> <msub> <mi>P</mi> <mi>i</mi> </msub> </mtd> <mtd> <msub> <mi>P</mi> <mi>i</mi> </msub> <mo>=</mo> <msub> <mi>Q</mi> <mi>j</mi> </msub> </mtd> </mtr> <mtr> <mtd> <mn>0</mn> </mtd> <mtd> <msub> <mi>P</mi> <mi>i</mi> </msub> <mo>&NotEqual;</mo> <msub> <mi>Q</mi> <mi>j</mi> </msub> </mtd> </mtr> </mtable> </mfenced> <mo>,</mo> <mi>i</mi> <mo>=</mo> <mn>1,2</mn> <mo>,</mo> <mo>.</mo> <mo>.</mo> <mo>.</mo> <mn>81</mn> <mo>;</mo> <mi>j</mi> <mo>=</mo> <mn>1,2</mn> <mo>,</mo> <mo>.</mo> <mo>.</mo> <mo>.</mo> <mi>M</mi> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>2</mn> <mo>)</mo> </mrow> </mrow> </math>
(9b) Normalized percentage response of M dominant colors
<math> <mrow> <msub> <msup> <mi>P</mi> <mo>&prime;</mo> </msup> <mi>i</mi> </msub> <mo>=</mo> <mfrac> <msub> <mi>P</mi> <mi>i</mi> </msub> <mrow> <munderover> <mi>&Sigma;</mi> <mn>1</mn> <mi>M</mi> </munderover> <mi></mi> <msub> <mi>Q</mi> <mi>j</mi> </msub> </mrow> </mfrac> <mo>,</mo> <msup> <mi>P</mi> <mo>&prime;</mo> </msup> <mo>=</mo> <mo>{</mo> <msup> <mi>P</mi> <mo>&prime;</mo> </msup> <mi>i</mi> <mo>,</mo> <mi>i</mi> <mo>=</mo> <mn>1,2</mn> <mo>,</mo> <mo>.</mo> <mo>.</mo> <mo>.</mo> <mn>81</mn> <mo>}</mo> <mo>,</mo> <mi>j</mi> <mo>=</mo> <mn>1,2</mn> <mo>,</mo> <mo>.</mo> <mo>.</mo> <mo>.</mo> <mo>,</mo> <mi>M</mi> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>3</mn> <mo>)</mo> </mrow> </mrow> </math>
(9c)FQ={CQi,P'QiAnd FT={CTi,P'TiAre dominant color descriptors for image Q and image T, respectively.
The similarity is as follows:
<math> <mrow> <mi>D</mi> <mrow> <mo>(</mo> <msub> <mi>F</mi> <mi>Q</mi> </msub> <mo>,</mo> <msub> <mi>F</mi> <mi>T</mi> </msub> <mo>)</mo> </mrow> <mo>=</mo> <munderover> <mi>&Sigma;</mi> <mn>1</mn> <mn>81</mn> </munderover> <mi>min</mi> <mrow> <mo>(</mo> <msubsup> <mi>P</mi> <mi>Qi</mi> <mo>&prime;</mo> </msubsup> <mo>,</mo> <msubsup> <mi>P</mi> <mi>Ti</mi> <mo>&prime;</mo> </msubsup> <mo>)</mo> </mrow> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>4</mn> <mo>)</mo> </mrow> </mrow> </math>
wherein, the closer the similarity D is to 1, the higher the similarity of the two images is, otherwise, the closer to 0, the lower the similarity is. The number of dominant colors can be changed in different image databases, and experiments prove that the dominant color M ═ 8 is enough to represent the image characteristics based on the MPEG-7 and achieve good retrieval effect.
It will be understood by those skilled in the art that all or part of the steps of implementing the above method embodiments may be implemented by hardware associated with program instructions, the program may be stored in a storage medium readable by a computing device, and the program may execute the steps of the above method embodiments when executed, and the storage medium may include various media capable of storing program codes, such as ROM, RAM, magnetic disk and optical disk.
Fig. 4 is a schematic structural diagram of an image retrieval apparatus according to an embodiment of the present disclosure.
As shown in fig. 4, the apparatus 40 in this embodiment may include an image acquisition unit 402, a spatial conversion unit 404, an image quantization unit 406, a dominant color determination unit 408, an index table name determination unit 410, a judgment unit 412, a dominant color percentage acquisition unit 414, a similarity calculation unit 416, and a result return unit 418. Wherein,
an image obtaining unit 402, configured to obtain an image to be retrieved from a user terminal, where the image to be retrieved is represented by an RGB space;
a space conversion unit 404, configured to convert an image to be retrieved from an RGB space to an HSV space;
an image quantization unit 406, configured to quantize the image to be retrieved converted into the HSV space into an N-dimensional color feature;
a main color determining unit 408, configured to sort the feature values of the N-dimensional color features of the image to be retrieved in a descending order of magnitude, and select the top M-dimensional color features after sorting as the main color of the image to be retrieved, where M is less than N;
an index table name determining unit 410, configured to determine a cluster index table name of the image to be retrieved according to an index value corresponding to the main color of the image to be retrieved;
a judging unit 412, configured to query, according to the determined name of the cluster index table of the image to be retrieved, whether a cluster index table with the same name as the cluster index table of the image to be retrieved exists in a cluster index table established based on each image in the image database;
a dominant color percentage obtaining unit 414, configured to, if the dominant color percentage exists, obtain an image index from a cluster index table with the same name as the cluster index table of the image to be retrieved, and query a corresponding dominant color percentage of the image according to the obtained image index;
a similarity calculation unit 416, configured to calculate a similarity between the image to be retrieved and the image queried from the image database based on the dominant color percentage of the image;
and a result returning unit 418, configured to return the image matched with the image to be retrieved to the user terminal according to the similarity between the images.
In this embodiment, since the images in the HSV space are quantized into N dimensions, the main color of the images is determined according to the feature value, the cluster index table name of the images is determined by using the main color of the images, and when the images to be retrieved are retrieved, the images with the same main color are first searched, and then the retrieval is performed in the images with the same main color, it can be seen that the retrieval range is significantly reduced compared with the existing image retrieval method. Meanwhile, the retrieval range of the image is determined according to the main color of the image, so that the accuracy of image retrieval is further ensured.
Further, the apparatus may further include:
and the index table establishing unit is used for establishing a clustering index table based on each image in the image database.
Wherein the index table establishing unit may include an image obtaining unit, a spatial conversion unit, an image quantization unit, a main color determination unit, an index table name determination unit, and a storage sub-unit, wherein,
the image acquisition unit is further used for sequentially reading each image in the image database, wherein each image in the image database is represented by an RGB space;
the space conversion unit is also used for converting each image in the image database into HSV space from RGB space;
an image quantization unit further configured to quantize each image converted into the HSV space into an N-dimensional color feature;
the main color determining unit is also used for sorting the characteristic values of the N-dimensional color characteristics of each image in a descending order according to the sizes, and selecting the sorted front M-dimensional color characteristics as the main color of each image;
the index table name determining unit is also used for determining the cluster index table name of each image in the image database according to the index value corresponding to the main color of each image;
and the storage subunit is used for storing the image index value and the corresponding dominant color percentage of each image into the corresponding cluster index table.
Further, the hue H in the HSV space may be uniformly divided into 9 parts, and the image quantizing unit may divide the saturation S into 3 parts and the brightness V into 3 parts.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments can be mutually referred to. For the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to the description of the method embodiment section for the relevant points.
Compared with the prior art, the embodiment of the present disclosure has the following advantages and effects:
(1) the dimension of the retrieval algorithm is 81 dimensions when the color features of the image are extracted, so that the extracted feature information is more accurate, and the precision ratio of the system is improved.
(2) In the HSV model, red corresponds to h-0 degrees, green corresponds to h-120 degrees, blue corresponds to h-240 degrees, the red (0) is close to red according to two sides [360 degrees, 20 degrees ] of the red, and two sides [100 degrees, 140 degrees ] of the green (120 degrees) are close to green.
(3) The retrieval algorithm quantifies the color features of the image into 81 dimensions, and the main color of the retrieved image only occupies 8 dimensions, so that only a part of the image belongs to a certain 8 dimensions; when the index is established, only the images meeting the conditions are indexed, meanwhile, the limited query conditions are set, only the index table meeting the conditions is indexed and queried, the correlation degree with the total number of the images in the image database is very low, and the retrieval time is obviously reduced.
(4) The system only needs to search the cluster image to which the searched image belongs when searching the image, neglects other cluster images, avoids invalid searching of a large number of dissimilar images, and therefore, the effectiveness and efficiency of searching are obviously improved.
While the present disclosure has been described with reference to exemplary embodiments, it should be understood that the present disclosure is not limited to the exemplary embodiments described above. It will be apparent to those skilled in the art that the above-described exemplary embodiments may be modified without departing from the scope and spirit of the disclosure. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.

Claims (8)

1. An image retrieval method, comprising:
acquiring an image to be retrieved from a user terminal, wherein the image to be retrieved is represented by an RGB space;
converting an image to be retrieved from an RGB space to an HSV space;
quantizing the image to be retrieved converted into the HSV space into N-dimensional color features;
sorting the characteristic values of the N-dimensional color characteristics of the image to be retrieved in a descending order according to the sizes, and selecting the sorted front M-dimensional color characteristics as the main color of the image to be retrieved, wherein M is less than N;
determining the name of a clustering index table of the image to be retrieved according to the index value corresponding to the main color of the image to be retrieved;
inquiring whether a cluster index table with the same name as that of the cluster index table of the image to be retrieved exists in the cluster index table established based on each image in the image database according to the determined name of the cluster index table of the image to be retrieved;
if the image index exists, acquiring the image index from the clustering index table with the same name as the clustering index table of the image to be retrieved;
inquiring the corresponding dominant color percentage of the image according to the acquired image index;
calculating the similarity between the image to be retrieved and the image inquired from the image database based on the dominant color percentage of the image;
and returning the image matched with the image to be retrieved to the user terminal according to the similarity between the images.
2. The image retrieval method of claim 1, wherein the method further comprises:
and establishing a clustering index table based on each image in the image database.
3. The image retrieval method according to claim 2, wherein the step of creating a cluster index table based on images in the image database comprises:
sequentially reading each image in an image database, wherein each image in the image database is represented by an RGB space;
converting each image in the image database from an RGB space to an HSV space;
quantizing each image converted into the HSV space into N-dimensional color features;
sorting the characteristic values of the N-dimensional color characteristics of each image in descending order according to the size, and selecting the sorted front M-dimensional color characteristics as the main color of each image;
determining the name of a cluster index table of each image in an image database according to the index value corresponding to the main color of each image;
and storing the image index value and the corresponding dominant color percentage of each image into a corresponding cluster index table.
4. The image retrieval method according to claim 3, wherein the hue H in the HSV space is uniformly divided into 9 parts, the saturation S is divided into 3 parts, and the brightness V is divided into 3 parts.
5. An image retrieval apparatus, comprising:
the image retrieval system comprises an image acquisition unit, a retrieval unit and a retrieval unit, wherein the image acquisition unit is used for acquiring an image to be retrieved from a user terminal, and the image to be retrieved is represented by an RGB space;
the space conversion unit is used for converting the image to be retrieved from the RGB space to the HSV space;
the image quantization unit is used for quantizing the image to be retrieved converted into the HSV space into N-dimensional color features;
the main color determining unit is used for sorting the characteristic values of the N-dimensional color characteristics of the image to be retrieved in a descending order according to the sizes, and selecting the front M-dimensional color characteristics after sorting as the main color of the image to be retrieved, wherein M is less than N;
the index table name determining unit is used for determining the name of the clustering index table of the image to be retrieved according to the index value corresponding to the main color of the image to be retrieved;
the judging unit is used for inquiring whether a cluster index table with the same name as that of the cluster index table of the image to be retrieved exists in the cluster index table established based on each image in the image database according to the determined name of the cluster index table of the image to be retrieved;
the dominant color percentage obtaining unit is used for obtaining an image index from a clustering index table with the same name as that of the clustering index table of the image to be retrieved if the dominant color percentage obtaining unit exists, and inquiring the corresponding dominant color percentage of the image according to the obtained image index;
the similarity calculation unit is used for calculating the similarity between the image to be retrieved and the image inquired from the image database based on the dominant color percentage of the image;
and the result returning unit is used for returning the image matched with the image to be retrieved to the user terminal according to the similarity between the images.
6. The image retrieval device according to claim 5, characterized in that the device further comprises:
and the index table establishing unit is used for establishing a clustering index table based on each image in the image database.
7. The image retrieval apparatus according to claim 6, wherein the index table creation unit includes the image acquisition unit, the spatial conversion unit, the image quantization unit, the dominant color determination unit, the index table name determination unit, and a storage sub-unit, wherein,
the image acquisition unit is further used for sequentially reading each image in the image database, wherein each image in the image database is represented by an RGB space;
the space conversion unit is also used for converting each image in the image database from an RGB space to an HSV space;
the image quantization unit is further used for quantizing each image converted into the HSV space into N-dimensional color features;
the main color determining unit is further configured to sort the feature values of the N-dimensional color features of each image in descending order of magnitude, and select the sorted front M-dimensional color features as the main color of each image;
the index table name determining unit is further used for determining the cluster index table name of each image in the image database according to the index value corresponding to the main color of each image;
and the storage subunit is used for storing the image index value and the corresponding dominant color percentage of each image into the corresponding cluster index table.
8. The image retrieval device according to claim 7, wherein the image quantization unit uniformly divides the hue H in the HSV space into 9 parts, the saturation S into 3 parts, and the brightness V into 3 parts.
CN201410175999.3A 2014-04-29 2014-04-29 Image search method and device Active CN105022752B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410175999.3A CN105022752B (en) 2014-04-29 2014-04-29 Image search method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410175999.3A CN105022752B (en) 2014-04-29 2014-04-29 Image search method and device

Publications (2)

Publication Number Publication Date
CN105022752A true CN105022752A (en) 2015-11-04
CN105022752B CN105022752B (en) 2019-04-05

Family

ID=54412734

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410175999.3A Active CN105022752B (en) 2014-04-29 2014-04-29 Image search method and device

Country Status (1)

Country Link
CN (1) CN105022752B (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105787965A (en) * 2016-01-26 2016-07-20 安徽创世科技股份有限公司 Image searching method based on color features
CN105912611A (en) * 2016-04-05 2016-08-31 中国科学技术大学 CNN based quick image search method
CN106780634A (en) * 2016-12-27 2017-05-31 努比亚技术有限公司 Picture dominant tone extracting method and device
CN107832359A (en) * 2017-10-24 2018-03-23 杭州群核信息技术有限公司 A kind of picture retrieval method and system
CN107908630A (en) * 2017-06-28 2018-04-13 重庆完美空间科技有限公司 Material picture color classification retrieving method
CN108764352A (en) * 2018-05-25 2018-11-06 百度在线网络技术(北京)有限公司 Duplicate pages content detection algorithm and device
CN109308325A (en) * 2018-08-21 2019-02-05 董志忠 Image search method and system
CN109558506A (en) * 2018-11-29 2019-04-02 青海民族大学 A kind of image search method based on color convergence vector
CN110119460A (en) * 2019-05-16 2019-08-13 广东三维家信息科技有限公司 Image search method, device and electronic equipment
CN110502651A (en) * 2019-08-15 2019-11-26 深圳市商汤科技有限公司 Image processing method and device, electronic equipment and storage medium
CN110647910A (en) * 2019-08-12 2020-01-03 浙江浩腾电子科技股份有限公司 Image similarity calculation method based on color quantization
CN110879849A (en) * 2019-11-09 2020-03-13 广东智媒云图科技股份有限公司 Similarity comparison method and device based on image-to-character conversion
CN112131424A (en) * 2020-09-22 2020-12-25 深圳市天维大数据技术有限公司 Distributed image analysis method and system
WO2021012521A1 (en) * 2019-07-19 2021-01-28 平安科技(深圳)有限公司 Search-based webpage forensics method and device, readable storage medium and server

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101714257A (en) * 2009-12-23 2010-05-26 公安部第三研究所 Method for main color feature extraction and structuring description of images
CN102542014A (en) * 2011-12-16 2012-07-04 华中科技大学 Image searching feedback method based on contents
CN102722880A (en) * 2011-03-29 2012-10-10 阿里巴巴集团控股有限公司 Image main color identification method and apparatus thereof, image matching method and server
CN103366178A (en) * 2012-03-30 2013-10-23 北京百度网讯科技有限公司 Method and device for carrying out color classification on target image

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101714257A (en) * 2009-12-23 2010-05-26 公安部第三研究所 Method for main color feature extraction and structuring description of images
CN102722880A (en) * 2011-03-29 2012-10-10 阿里巴巴集团控股有限公司 Image main color identification method and apparatus thereof, image matching method and server
CN102542014A (en) * 2011-12-16 2012-07-04 华中科技大学 Image searching feedback method based on contents
CN103366178A (en) * 2012-03-30 2013-10-23 北京百度网讯科技有限公司 Method and device for carrying out color classification on target image

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105787965B (en) * 2016-01-26 2018-08-07 安徽创世科技股份有限公司 A kind of image search method based on color characteristic
CN105787965A (en) * 2016-01-26 2016-07-20 安徽创世科技股份有限公司 Image searching method based on color features
CN105912611A (en) * 2016-04-05 2016-08-31 中国科学技术大学 CNN based quick image search method
CN105912611B (en) * 2016-04-05 2019-04-26 中国科学技术大学 A kind of fast image retrieval method based on CNN
CN106780634B (en) * 2016-12-27 2019-06-18 努比亚技术有限公司 Picture dominant tone extracting method and device
CN106780634A (en) * 2016-12-27 2017-05-31 努比亚技术有限公司 Picture dominant tone extracting method and device
CN107908630A (en) * 2017-06-28 2018-04-13 重庆完美空间科技有限公司 Material picture color classification retrieving method
CN107832359B (en) * 2017-10-24 2021-06-08 杭州群核信息技术有限公司 Picture retrieval method and system
CN107832359A (en) * 2017-10-24 2018-03-23 杭州群核信息技术有限公司 A kind of picture retrieval method and system
CN108764352A (en) * 2018-05-25 2018-11-06 百度在线网络技术(北京)有限公司 Duplicate pages content detection algorithm and device
CN108764352B (en) * 2018-05-25 2022-09-27 百度在线网络技术(北京)有限公司 Method and device for detecting repeated page content
CN109308325A (en) * 2018-08-21 2019-02-05 董志忠 Image search method and system
CN109308325B (en) * 2018-08-21 2022-07-01 董志忠 Image searching method and system
CN109558506A (en) * 2018-11-29 2019-04-02 青海民族大学 A kind of image search method based on color convergence vector
CN110119460A (en) * 2019-05-16 2019-08-13 广东三维家信息科技有限公司 Image search method, device and electronic equipment
WO2021012521A1 (en) * 2019-07-19 2021-01-28 平安科技(深圳)有限公司 Search-based webpage forensics method and device, readable storage medium and server
CN110647910A (en) * 2019-08-12 2020-01-03 浙江浩腾电子科技股份有限公司 Image similarity calculation method based on color quantization
CN110502651B (en) * 2019-08-15 2022-08-02 深圳市商汤科技有限公司 Image processing method and device, electronic equipment and storage medium
CN110502651A (en) * 2019-08-15 2019-11-26 深圳市商汤科技有限公司 Image processing method and device, electronic equipment and storage medium
CN110879849A (en) * 2019-11-09 2020-03-13 广东智媒云图科技股份有限公司 Similarity comparison method and device based on image-to-character conversion
CN112131424A (en) * 2020-09-22 2020-12-25 深圳市天维大数据技术有限公司 Distributed image analysis method and system

Also Published As

Publication number Publication date
CN105022752B (en) 2019-04-05

Similar Documents

Publication Publication Date Title
CN105022752B (en) Image search method and device
Wang et al. A novel method for image retrieval based on structure elements’ descriptor
Arandjelovic et al. Multiple queries for large scale specific object retrieval.
CN102819582B (en) Quick searching method for mass images
CN104376105B (en) The Fusion Features system and method for image low-level visual feature and text description information in a kind of Social Media
Sajjad et al. Integrating salient colors with rotational invariant texture features for image representation in retrieval systems
CN107590154B (en) Object similarity determination method and device based on image recognition
CN103366178A (en) Method and device for carrying out color classification on target image
CN102890700A (en) Method for retrieving similar video clips based on sports competition videos
CN110188217A (en) Image duplicate checking method, apparatus, equipment and computer-readable storage media
US20120117090A1 (en) System and method for managing digital contents
Singh et al. Image retrieval based on the combination of color histogram and color moment
Atlam et al. Comparative study on CBIR based on color feature
Saad et al. Image retrieval based on integration between YC b C r color histogram and shape feature
Al-Jubouri Content-based image retrieval: Survey
Pattanaik et al. Efficient content based image retrieval system using mpeg-7 features
Feng et al. An efficient indexing method for content-based image retrieval
US8885981B2 (en) Image retrieval using texture data
KR101242659B1 (en) Method for searching images
CN106021250A (en) Image semantic information retrieval method based on keyword
CN107870923B (en) Image retrieval method and device
Dong et al. Color space quantization-based clustering for image retrieval
CN104715071B (en) A kind of specific pedestrian retrieval method described based on imperfect text
Asif et al. Composite description based on color vector quantization and visual primary features for CBIR tasks
Zhao et al. Image descriptor based on local color directional quaternionic pattern

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