CN109308325B - Image searching method and system - Google Patents
Image searching method and system Download PDFInfo
- Publication number
- CN109308325B CN109308325B CN201810951203.7A CN201810951203A CN109308325B CN 109308325 B CN109308325 B CN 109308325B CN 201810951203 A CN201810951203 A CN 201810951203A CN 109308325 B CN109308325 B CN 109308325B
- Authority
- CN
- China
- Prior art keywords
- image
- meta
- image set
- feature
- module
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
- G06F18/232—Non-hierarchical techniques
- G06F18/2321—Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
- G06F18/23213—Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
Abstract
The invention discloses an image searching method and system, comprising the following steps: s1, respectively carrying out curve segmentation on the target image set and the meta-image; s2, extracting a feature compact child from each segmented region; s3, storing the image information in the image set; s4, calculating the Hamming distance between the feature compact child of each area in the meta-image and the feature compact child of each area in the target image set; s5 searches the result image set according to the Hamming distance. The invention has the beneficial effects that: aiming at the feature coding technology with low bit, low complexity and high accuracy of different feature types, the data volume of the feature descriptor of a single image area is reduced from hundreds of K bytes to K bytes, so that the storage cost is greatly reduced, and the search precision is improved.
Description
Technical Field
The invention relates to the field of image searching, in particular to an image searching method and system.
Background
Currently, in the field of image search, an image recognition method is mainly adopted to extract available search features, and then the available search features are compared with a sample library one by one, and then matched results are output.
Some existing image search algorithms extract feature description information according to images, and then search through a similarity algorithm, which causes the following disadvantages: the descriptor information of the image is large, the searching precision is not enough, and the memory occupied by the single feature descriptor information is large.
An effective solution to the problems in the related art has not been proposed yet.
Disclosure of Invention
Aiming at the technical problems in the related art, the invention provides an image searching method and an image searching system, which can solve the problems of high accuracy of image descriptor characteristics, large information amount of a single descriptor and the like.
In order to achieve the technical purpose, the technical scheme of the invention is realized as follows:
an image searching method, comprising the steps of:
s1, respectively carrying out curve segmentation on the target image set and the meta-image;
s2, extracting feature compactors from each segmented region;
s3, storing the image information in the image set;
s4, calculating the Hamming distance between the feature compact child of each area in the meta-image and the feature compact child of each area in the target image set;
s5 searches the result image set according to the Hamming distance.
Further, the step S1 of performing curve segmentation on the target image set and the meta-image respectively specifically includes:
s11, respectively acquiring the dimension information of the target image set and the meta-image, and calculating the coordinates of the center points of the target image set and the meta-image;
s12, calculating the widths and heights of the target image set and the meta-image respectively, and calculating the major radius and the minor radius of the ellipse; drawing an ellipse by taking the central point as an origin and the long radius and the short radius; drawing an X axis and a Y axis by taking the central point as an origin;
s13 divides the target image set and the meta image into 5 regions with X-axis, Y-axis, and elliptic curves, respectively.
Further, the extracting the feature compactness in step S2 specifically includes:
s21 constructing a GMM model;
s22, training a codebook by using a K-means algorithm according to the GMM model;
s23 obtains the feature compactors by fisher vector & VLAD method.
Further, acquisition target image set information including reading each picture in the image set and search meta-image information processing including reading a meta-image, converting the image set and the meta-image into HSV color spaces, respectively, are required before step S1.
Further, the image information in step S3 includes, but is not limited to, an image ID, an image tag, and a feature compactness of each region.
In another aspect of the present invention, there is provided an image search system including:
the first segmentation module is used for respectively carrying out curve segmentation on the target image set and the meta-image;
the extraction module is used for extracting a characteristic compacter from each divided region;
the storage module is used for storing the image information in the image set;
the first calculation module is used for calculating the Hamming distance between the feature compact child of each region in the meta-image and the feature compact child of each region in the target image set;
and the searching module is used for searching out the result image set according to the Hamming distance.
Further, the first segmentation module comprises:
the first acquisition module is used for respectively acquiring the dimension information of the target image set and the meta-image and calculating the coordinates of the center points of the target image set and the meta-image;
the second calculation module is used for calculating the widths and the heights of the target image set and the meta-image respectively and calculating the long radius and the short radius of the ellipse; drawing an ellipse by taking the central point as an origin and the long radius and the short radius; drawing an X axis and a Y axis by taking the central point as an origin;
and the second segmentation module is used for segmenting the target image set and the element image into 5 regions by an X axis, a Y axis and an elliptic curve respectively.
Further, the extracting the feature compacter in the extracting module specifically includes:
the building module is used for building a GMM model;
the training module is used for training the codebook by using a K-means algorithm according to the GMM model;
and the second acquisition module is used for acquiring the characteristic compactors by a fisher vector & VLAD method.
Further, the image information in the storage module includes, but is not limited to, an image ID, an image tag, and a feature compact for each region.
The invention has the beneficial effects that: aiming at the feature coding technology with low bit, low complexity and high accuracy of different feature types, the data volume of the feature descriptor of a single image area is reduced from hundreds of K bytes to K bytes, so that the storage cost is greatly reduced, and the search precision is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a flowchart of an image searching method according to an embodiment of the present invention;
FIG. 2 is a flow chart of extracting feature compactors according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an image search system according to an embodiment of the invention;
FIG. 4 is a schematic diagram of a first segmentation module according to an embodiment of the invention;
FIG. 5 is a schematic diagram of an extraction module according to an embodiment of the invention;
FIG. 6 is a picture of a collection of images according to an embodiment of the present invention;
fig. 7 is a picture of a resultant image set according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present invention.
As shown in fig. 1, 2, 6 and 7, the image searching method according to an embodiment of the present invention includes the steps of:
s1, respectively carrying out curve segmentation on the target image set and the meta-image;
s2, extracting feature compactness sub from each divided region, and storing the feature compactness sub information into a list;
s3, storing the image information in the image set;
specifically, a unique image ID is applied according to an image cloud service interface, and information such as an image label and a compact sub-information list of each region feature is set;
opening Nosql or database connection, saving image related information, closing connection and the like;
s4, calculating the Hamming distance between the feature compact child of each area in the meta-image and the feature compact child of each area in the target image set;
s5 searches for a set of resulting images having the same features or scenes based on the hamming distance.
Specifically, the images are sorted in descending order according to the hamming distance, and the image set meeting the requirements is searched.
In an embodiment of the present invention, the curve segmenting the target image set and the meta-image in step S1 includes:
s11, respectively acquiring the dimension information of the target image set and the meta-image, and calculating the coordinates of the center points of the target image set and the meta-image;
s12, respectively calculating the width W and the height H of the target image set and the meta-image, and calculating the long radius and the short radius of the ellipse; drawing an ellipse by taking the central point as an origin and the long radius and the short radius; drawing an X axis and a Y axis by taking the central point as an origin;
s13 divides the target image set and the meta image into 5 regions by the X-axis, the Y-axis, and the elliptic curve, respectively.
Specifically, shape information of an image is read according to an image example; reading the values of 0 and 1 positions of shape information data as height H and width W; calculating coordinates (X, Y), (cX, cY) = [ int (W0.5), int (H0.5) ] of the center point of the image from the height H and the width W; taking the central point as an origin, dividing the area into four quadrants by an X axis and a Y axis, and representing the information as follows: (0, cX, 0, cY), (cX, W, cY, H), (0, cX, cY, H); calculating a rectangle of the region where the object is located, then calculating the ellipse radius calculation ratio, and calculating the ellipse radius ratio of the long radius W to the ellipse radius ratio and the ellipse radius ratio of the short radius H to the ellipse radius ratio; drawing an ellipse by taking the central point as an origin and the long radius and the short radius; the image is divided into 5 regions by the first, second, third and fourth quadrant regions and the sum elliptic curve.
In an embodiment of the present invention, the extracting the feature compactness step in step S2 specifically includes:
s21 constructing a GMM model;
establishing a mixed Gaussian model for each pixel of each image through a gmm algorithm in opencv, wherein the mixed Gaussian model represents a background with large weight and a foreground with small weight; if the new pixel can be matched with the Gaussian mixture model corresponding to the upper background, the new pixel is taken as the background; if the matching is a mixed Gaussian model with smaller weight or no matching mixed Gaussian model, the pixel is regarded as a foreground;
s22, training a codebook by using a K-means algorithm according to the GMM model;
A. appropriately selecting initial centers of the C classes;
B. in the K iteration, the distance from any sample to each center of C is calculated, and the sample is classified into the class where the center with the shortest distance is located;
C. updating the central value of the class by means of methods such as mean value and the like;
D. for all C clustering centers, if the values are kept unchanged after the updating by the iterative algorithm of (B) and (C), or a certain number of iterations is reached, or the change of the classification is less than a threshold value, the iteration is ended, otherwise, the iteration is continued;
s23 obtains the feature compactors by calling the fisher vector & VLAD method in opencv.
In an embodiment of the present invention, before step S1, acquisition target image set information and search meta-image information processing are required, where the acquisition target image set information includes reading each picture in an image set, and the search meta-image information processing includes reading a meta-image, and converting the image set and the meta-image into HSV color spaces, respectively.
Acquiring target image set information, namely reading each image in an image set, specifically, judging whether the image set is a folder or not according to os.path.isdir, if not, reading an image file through imread, and executing curve segmentation; if the folder is selected, continuing to read the image set in the folder;
the searching for the meta image information processing comprises reading a meta image, specifically, reading the meta image information through an imread according to a meta image path;
respectively converting the image set and the meta image into HSV color spaces:
A. hue H uses an angular measure with a value range of 0-360 deg., calculated from red in the counterclockwise direction, red being 0 deg., green being 120 deg., blue being 240 deg., and their complementary colors are: yellow 60 °, cyan 180 °, magenta 300 °;
B. saturation S represents the degree to which the color approaches the spectral color; one color, which can be seen as the result of a mixture of certain spectral colors and white; wherein, the larger the proportion of the spectral color is, the higher the degree of the color approaching the spectral color is, and the higher the saturation of the color is; the saturation is high, and the color is dark and bright; the white light component of the spectrum color is 0, and the saturation reaches the highest; the value range is usually 0% -100%, and the larger the value is, the more saturated the color is;
C. brightness represents the brightness of the color, and the brightness value of the light source is related to the brightness of the luminous body; for object colors, this value is related to the transmittance or reflectance of the object, usually ranging from 0% (black) to 100% (white);
D. for a 3D color histogram, 8 bins for the hue channel, 12 bins for the saturation channel, and 3 bins for the luma channel, the total eigenvectors are 8 × 12 × 3= 288.
In a specific embodiment of the present invention, the image information in step S3 includes, but is not limited to, an image ID, an image tag, and a feature compactness of each region.
As shown in fig. 3 to 7, in another aspect of the present invention, there is provided an image search system including:
the first segmentation module is used for respectively carrying out curve segmentation on the target image set and the meta-image;
the extraction module is used for extracting a characteristic compacter from each divided region;
the storage module is used for storing the image information in the image set;
the first calculation module is used for calculating the Hamming distance between the feature compact child of each region in the meta-image and the feature compact child of each region in the target image set;
and the searching module is used for searching out the result image set according to the Hamming distance.
In one embodiment of the present invention, the first segmentation module comprises:
the first acquisition module is used for respectively acquiring the dimension information of the target image set and the meta-image and calculating the coordinates of the center points of the target image set and the meta-image;
the second calculation module is used for calculating the widths and the heights of the target image set and the meta-image respectively and calculating the long radius and the short radius of the ellipse; drawing an ellipse by taking the central point as an origin and the long radius and the short radius; drawing an X axis and a Y axis by taking the central point as an origin;
and the second segmentation module is used for segmenting the target image set and the element image into 5 areas by an X axis, a Y axis and an elliptic curve respectively.
In an embodiment of the present invention, the extracting the feature compactness sub in the extracting module specifically includes:
the building module is used for building a GMM model;
the training module is used for training the codebook by using a K-means algorithm according to the GMM model;
and the second acquisition module is used for acquiring the characteristic compactors by a fisher vector & VLAD method.
In one embodiment of the present invention, the image information in the storage module includes, but is not limited to, an image ID, an image tag, and a feature compact for each region.
In summary, with the above technical solution of the present invention, for the feature encoding techniques with low bit, low complexity and high accuracy of different feature types, the data size of the feature descriptor of a single image region is reduced from several hundred kbytes to several kbytes, thereby greatly reducing the storage cost and improving the search accuracy.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (8)
1. An image search method, comprising the steps of:
s1, respectively carrying out curve segmentation on the target image set and the meta-image;
the step S1 of performing curve segmentation on the target image set and the meta image respectively specifically includes:
s11, respectively acquiring the dimension information of the target image set and the meta-image, and calculating the coordinates of the center points of the target image set and the meta-image;
s12, calculating the widths and heights of the target image set and the meta-image respectively, and calculating the long radius and the short radius of the ellipse; drawing an ellipse by taking the central point as an origin and the long radius and the short radius; drawing an X axis and a Y axis by taking the central point as an origin;
s13, dividing the target image set and the meta-image into 5 areas by X-axis, Y-axis and elliptic curve respectively;
s2, extracting feature compactors from each segmented region;
s3, storing the image information in the image set;
s4, calculating the Hamming distance between the feature compact child of each area in the meta-image and the feature compact child of each area in the target image set;
s5 searches the result image set according to the Hamming distance.
2. The image searching method according to claim 1, wherein the extracting the feature compactness sub-step in step S2 specifically includes:
s21 constructing a GMM model;
s22, training a codebook by using a K-means algorithm according to the GMM model;
s23 obtains the feature compactors through the fisher vector & VLAD method.
3. The image searching method according to claim 1, wherein before step S1, acquiring target image set information including reading each picture in an image set and searching meta-image information processing including reading a meta-image for converting the image set and the meta-image into HSV color space are required.
4. The image searching method according to any one of claims 1 to 3, wherein the image information in step S3 includes but is not limited to an image ID, an image tag and a feature compact for each region.
5. An image search system, comprising:
the first segmentation module is used for respectively carrying out curve segmentation on the target image set and the meta-image;
the extraction module is used for extracting a characteristic compact child from each segmented region;
the storage module is used for storing the image information in the image set;
the first calculation module is used for calculating the Hamming distance between the feature compact child of each region in the meta-image and the feature compact child of each region in the target image set;
and the searching module is used for searching out the result image set according to the Hamming distance.
6. The image search system of claim 5, wherein the first segmentation module comprises:
the first acquisition module is used for respectively acquiring the dimension information of the target image set and the meta-image and calculating the coordinates of the center points of the target image set and the meta-image;
the second calculation module is used for calculating the widths and the heights of the target image set and the meta-image respectively and calculating the long radius and the short radius of the ellipse; drawing an ellipse by taking the central point as an origin and the long radius and the short radius; drawing an X axis and a Y axis by taking the central point as an origin;
and the second segmentation module is used for segmenting the target image set and the element image into 5 regions by an X axis, a Y axis and an elliptic curve respectively.
7. The image search system of claim 5, wherein the extracting the feature compactness sub-block in the extracting module specifically comprises:
the building module is used for building a GMM model;
the training module is used for training the codebook by using a K-means algorithm according to the GMM model;
and the second acquisition module is used for acquiring the characteristic compactors by a fisher vector & VLAD method.
8. The image search system of any of claims 5-7, wherein the image information in the storage module includes, but is not limited to, an image ID, an image tag, and a compact subset of features for each region.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810951203.7A CN109308325B (en) | 2018-08-21 | 2018-08-21 | Image searching method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810951203.7A CN109308325B (en) | 2018-08-21 | 2018-08-21 | Image searching method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109308325A CN109308325A (en) | 2019-02-05 |
CN109308325B true CN109308325B (en) | 2022-07-01 |
Family
ID=65224003
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810951203.7A Active CN109308325B (en) | 2018-08-21 | 2018-08-21 | Image searching method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109308325B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103207879A (en) * | 2012-01-17 | 2013-07-17 | 阿里巴巴集团控股有限公司 | Method and equipment for generating image index |
CN105022752A (en) * | 2014-04-29 | 2015-11-04 | 中国电信股份有限公司 | Image retrieval method and apparatus |
CN108364006A (en) * | 2018-01-17 | 2018-08-03 | 超凡影像科技股份有限公司 | Medical Images Classification device and its construction method based on multi-mode deep learning |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8503777B2 (en) * | 2010-12-16 | 2013-08-06 | Sony Corporation | Geometric feature based image description and fast image retrieval |
JP6393230B2 (en) * | 2015-04-20 | 2018-09-19 | 株式会社日立製作所 | Object detection method and image search system |
-
2018
- 2018-08-21 CN CN201810951203.7A patent/CN109308325B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103207879A (en) * | 2012-01-17 | 2013-07-17 | 阿里巴巴集团控股有限公司 | Method and equipment for generating image index |
CN105022752A (en) * | 2014-04-29 | 2015-11-04 | 中国电信股份有限公司 | Image retrieval method and apparatus |
CN108364006A (en) * | 2018-01-17 | 2018-08-03 | 超凡影像科技股份有限公司 | Medical Images Classification device and its construction method based on multi-mode deep learning |
Also Published As
Publication number | Publication date |
---|---|
CN109308325A (en) | 2019-02-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109344701B (en) | Kinect-based dynamic gesture recognition method | |
CN106529380B (en) | Image recognition method and device | |
Khan et al. | Discriminative color descriptors | |
US10332266B2 (en) | Method and device for traffic sign recognition | |
JP5269123B2 (en) | Color discrimination method for color-based image code | |
Luo et al. | Color object detection using spatial-color joint probability functions | |
Bhunia et al. | Text recognition in scene image and video frame using color channel selection | |
CN103824091B (en) | A kind of licence plate recognition method for intelligent transportation system | |
CN103699532B (en) | Image color retrieval method and system | |
EP1870858A2 (en) | Method of classifying colors of color based image code | |
Nandi et al. | Traffic sign detection based on color segmentation of obscure image candidates: a comprehensive study | |
Acatay et al. | Comprehensive evaluation of deep learning based detection methods for vehicle detection in aerial imagery | |
CN107358189B (en) | Object detection method in indoor environment based on multi-view target extraction | |
CN105260428A (en) | Picture processing method and apparatus | |
Damavandi et al. | Speed limit traffic sign detection and recognition | |
KR101742115B1 (en) | An inlier selection and redundant removal method for building recognition of multi-view images | |
CN104361348A (en) | Flower and plant recognition method on intelligent terminal | |
Huang et al. | Text detection and recognition in natural scene images | |
Reta et al. | Color uniformity descriptor: An efficient contextual color representation for image indexing and retrieval | |
CN109284759A (en) | One kind being based on the magic square color identification method of support vector machines (svm) | |
Zhou et al. | Region-based high-level semantics extraction with cedd | |
Ciobanu et al. | Image categorization based on computationally economic LAB colour features | |
CN112784932A (en) | Font identification method and device and storage medium | |
KR20090065099A (en) | System for managing digital image features and its method | |
CN109308325B (en) | Image searching method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |