CN105069144A - Similar image search method - Google Patents
Similar image search method Download PDFInfo
- Publication number
- CN105069144A CN105069144A CN201510514545.9A CN201510514545A CN105069144A CN 105069144 A CN105069144 A CN 105069144A CN 201510514545 A CN201510514545 A CN 201510514545A CN 105069144 A CN105069144 A CN 105069144A
- Authority
- CN
- China
- Prior art keywords
- feature
- rootsift
- image
- distance
- database
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 23
- 239000000284 extract Substances 0.000 claims abstract description 14
- 239000013598 vector Substances 0.000 claims description 9
- 235000021110 pickles Nutrition 0.000 claims description 3
- 230000000694 effects Effects 0.000 description 2
- 238000011524 similarity measure Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/58—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
- G06F16/583—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
Landscapes
- Engineering & Computer Science (AREA)
- Library & Information Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Image Analysis (AREA)
Abstract
本发明公开了一种搜索相似图片的方法,包括如下步骤,S1构建图像的RootSIFT模型,并对图像数据库中的图像进行RootSIFT特征的提取,所述RootSIFT特征包括关键点和特征描述子,将提取的特征描述子存储到特征数据库;S2提取目标图像的RootSIFT特征,使用Flann特征匹配方法,与特征数据库中的特征描述子进行匹配,计算匹配成功的关键点个数,即两幅图像之间的距离;S3输出相似图像。
The invention discloses a method for searching similar pictures, comprising the following steps: S1 constructs a RootSIFT model of an image, and extracts RootSIFT features from images in an image database, the RootSIFT features include key points and feature descriptors, and extract The feature descriptors in the feature database are stored in the feature database; S2 extracts the RootSIFT features of the target image, uses the Flann feature matching method to match with the feature descriptors in the feature database, and calculates the number of key points that are successfully matched, that is, the distance between the two images distance; S3 outputs similar images.
Description
技术领域technical field
本发明涉及图像处理领域,具体涉及一种搜索相似图片的方法。The invention relates to the field of image processing, in particular to a method for searching similar pictures.
背景技术Background technique
随着数字信息技术的发展,数字图像已经进入了千家万户,然而随着数字图像数量的增加,如何在庞大的图像数据库里快速而准确地寻找跟某一张图片相似的其它图片成为了一个难题。例如一个人去了埃及旅行,那里风景秀丽文化深厚,因此拍摄了成千上万的照片。有一天他偶尔发现特别喜欢一张黄昏下金字塔的照片,然后他想知道他的相机里面还有没有类似场景的照片,如果一张又一张地翻阅他的照片集工作量是非常庞大的,那能不能建立一个个人的图片搜索引擎?只要在引擎中输入某一张图片,图像搜索引擎就会提取该图像的特征,然后跟图像数据库中的图像特征进行匹配,最后输出跟输入图像相似度最高的图像。With the development of digital information technology, digital images have entered thousands of households. However, with the increase in the number of digital images, how to quickly and accurately find other pictures similar to a certain picture in a huge image database has become a problem. problem. For example, a person traveled to Egypt, where the scenery is beautiful and the culture is profound, so he took thousands of photos. One day he occasionally found a photo of the pyramids at dusk that he particularly liked, and then he wondered if there were any photos of similar scenes in his camera. It would be a huge workload to browse through his photo collection one by one, Can you build a personal image search engine? As long as a certain picture is input into the engine, the image search engine will extract the features of the image, then match it with the image features in the image database, and finally output the image with the highest similarity with the input image.
SIFT即尺度不变特征变换(Scale-invariantfeaturetransform,SIFT),是用于图像处理领域的一种描述子。这种描述具有尺度不变性,可在图像中检测出关键点,是一种局部特征描述子。SIFT由DavidLowe在1999年提出,在2004年加以完善。SIFT特征是基于物体上的一些局部外观的兴趣点而与影像的大小和旋转无关。对于光线、噪声、微视角改变的容忍度也相当高。RootSIFT是SIFT的一种改进算法,它采用Hellinger核函数代替SIFT中欧氏距离度量值作为两个向量间的相似性度量,实验结果表明,RootSIFT的效果比SIFT更好。SIFT is a scale-invariant feature transform (Scale-invariant feature transform, SIFT), which is a descriptor used in the field of image processing. This description has scale invariance, can detect key points in the image, and is a local feature descriptor. SIFT was proposed by David Lowe in 1999 and improved in 2004. The SIFT feature is based on some local appearance interest points on the object independent of the size and rotation of the image. The tolerance to light, noise, and micro viewing angle changes is also quite high. RootSIFT is an improved algorithm of SIFT. It uses the Hellinger kernel function instead of the Euclidean distance measure in SIFT as the similarity measure between two vectors. Experimental results show that the effect of RootSIFT is better than SIFT.
发明内容Contents of the invention
为了克服现有技术存在的缺点与不足,本发明提供一种搜索相似图片的方法。In order to overcome the shortcomings and deficiencies of the prior art, the present invention provides a method for searching similar pictures.
本发明采用如下技术方案:The present invention adopts following technical scheme:
一种搜索相似图片的方法,包括如下步骤A method for searching for similar pictures, comprising the following steps
S1构建图像的RootSIFT模型,并对图像数据库中的图像进行RootSIFT特征的提取,所述RootSIFT特征包括关键点和特征描述子,将提取的特征描述子存储到特征数据库;S1 builds the RootSIFT model of the image, and extracts the RootSIFT feature to the image in the image database, the RootSIFT feature includes key points and feature descriptors, and stores the extracted feature descriptors into the feature database;
S2提取目标图像的RootSIFT特征,使用Flann特征匹配方法,与特征数据库中每一幅图像的特征描述子进行匹配,计算匹配成功的关键点个数,即两幅图像之间的距离;S2 extracts the RootSIFT feature of the target image, uses the Flann feature matching method, matches the feature descriptor of each image in the feature database, and calculates the number of key points that match successfully, that is, the distance between the two images;
S3输出与目标图像匹配成功的关键点数最多的前n幅图像。S3 outputs the top n images with the largest number of key points that successfully match the target image.
所述S1具体为:The S1 is specifically:
S1.1在SIFT基础上,建立图像的RootSIFT模型;S1.1 On the basis of SIFT, establish the RootSIFT model of the image;
S1.2遍历图像数据库中的每一张图片,通过RootSIFT模型提取每一张图片的RootSIFT特征;S1.2 traverse each picture in the image database, and extract the RootSIFT feature of each picture through the RootSIFT model;
S1.3将提取的RootSIFT特征的特征描述子通过python的pickle模块存储到一个pkl文件中。S1.3 Store the feature descriptor of the extracted RootSIFT feature into a pkl file through the pickle module of python.
所述Flann特征匹配方法具体为:计算两幅图像的特征描述子向量的距离,具体是对每个需要匹配的关键点同对应图片的各个关键点进行距离的计算并找出距离目标关键点最近距离的关键点。The Flann feature matching method is specifically: calculating the distance between the feature descriptor vectors of two images, specifically calculating the distance between each key point that needs to be matched and each key point of the corresponding picture and finding the distance from the target key point. Key points for distance.
当最近的距离除以次近的距离的值少于0.75时认为这两个关键点匹配成功。When the value of the closest distance divided by the next closest distance is less than 0.75, the two key points are considered to be matched successfully.
本发明的有益效果Beneficial effects of the present invention
(1)本发明依据SIFT的改进算法RootSIFT特征提取方法提取图像的特征,该特征具有对旋转、尺度、缩放、亮度变化保持不变性,从不同的角度描述图像的特征,更能准确地搜索与目标图像相似的图像;(1) The present invention extracts the feature of image according to the improved algorithm RootSIFT feature extraction method of SIFT, and this feature has the invariance to rotation, scale, scaling, brightness change, describes the feature of image from different angles, can search and compare more accurately images similar to the target image;
(2)本发明在特征匹配时使用了Flann特征匹配方法,使系统拥有了快速的匹配速率以及更好的搜索的准确率。(2) The present invention uses the Flann feature matching method during feature matching, so that the system has a fast matching rate and better search accuracy.
附图说明Description of drawings
图1是本发明的工作流程图。Fig. 1 is a work flowchart of the present invention.
具体实施方式Detailed ways
下面结合实施例及附图,对本发明作进一步地详细说明,但本发明的实施方式不限于此。The present invention will be described in further detail below in conjunction with the embodiments and the accompanying drawings, but the embodiments of the present invention are not limited thereto.
实施例Example
如图1所示,一种搜索相似图片的方法,包括如下步骤:As shown in Figure 1, a method for searching similar pictures includes the following steps:
S1构建图像的RootSIFT模型,并对图像数据库中的图像进行RootSIFT特征的提取,将提取的特征描述子存储到特征数据库。所述RootSIFT特征包括关键点和特征描述子,每个关键点有三个信息:位置,所处尺度、方向,为每个关键点建立一个特征描述子,用一组向量将这个关键点描述出来,使其不随各种变化而改变,比如光照变化、视角变化等等。一般表征特征描述子在关键点尺度空间内4*4的窗口中计算的8个方向的梯度信息,共4*4*8=128维向量。S1 builds the RootSIFT model of the image, extracts the RootSIFT feature from the image in the image database, and stores the extracted feature descriptor in the feature database. The RootSIFT feature includes key points and feature descriptors, each key point has three information: position, scale, direction, a feature descriptor is established for each key point, and this key point is described by a set of vectors, Make it not change with various changes, such as lighting changes, viewing angle changes, and so on. The general feature descriptor calculates gradient information in 8 directions in a 4*4 window in the key point scale space, and a total of 4*4*8=128-dimensional vectors.
所述的RootSIFT模型是在SIFT特征模型拓展而来的。在纹理分类和图像分类中使用欧氏距离的性能比使用Hellinger核函数的性能低。因此,考虑SIFT算法中相似性度量也可以用Hellinger核函数来度量,发现核函数的效果更好。The RootSIFT model is extended from the SIFT feature model. The performance of using Euclidean distance in texture classification and image classification is lower than that of using Hellinger kernel function. Therefore, considering that the similarity measure in the SIFT algorithm can also be measured by the Hellinger kernel function, it is found that the effect of the kernel function is better.
步骤S1具体包括:Step S1 specifically includes:
S1.1在SIFT基础上,建立图像的RootSIFT模型。S1.1 On the basis of SIFT, establish the RootSIFT model of the image.
具体方式是使用Hellinger核函数代替欧氏距离来衡量两个特征向量之间的相似性,具体的操作可以分为两个步骤完成:①对特征向量进行L1规范化,②对每个元素求平方根。得到具有L1规范化的特征向量RootSIFT。The specific method is to use the Hellinger kernel function instead of the Euclidean distance to measure the similarity between two feature vectors. The specific operation can be divided into two steps: ① normalize the feature vector by L1, and ② calculate the square root of each element. Get the eigenvector RootSIFT with L1 normalization.
S1.2遍历图像数据库中的每一张图片,提取每一张图片的RootSIFT特征。S1.2 traverse each picture in the image database, and extract the RootSIFT feature of each picture.
S1.3将提取的RootSIFT特征的特征描述子通过python的pickle模块存储到一个pkl文件中。S1.3 Store the feature descriptor of the extracted RootSIFT feature into a pkl file through the pickle module of python.
S2提取目标图像的RootSIFT特征,使用Flann特征匹配方法,与特征数据库中的每一幅图像的特征描述子进行匹配,计算图像数据库中每一幅图像与目标图像匹配成功的关键点个数,即图像与图像的距离。S2 extracts the RootSIFT feature of the target image, uses the Flann feature matching method to match the feature descriptor of each image in the feature database, and calculates the number of key points that each image in the image database successfully matches the target image, that is Image-to-image distance.
具体方式是使用Flann特征匹配方法,其中k设置为2,即选择距离最近的关键点数为2。取一幅图像中的某个关键点,并找出其与另一幅图像中距离欧氏最近的前两个关键点,具体计算方法是在计算两个关键点的特征描述子向量的欧氏距离,即两个向量每个对应元素差的平方和。这两个关键点中,如果最近的距离除以次近的距离少于某个比例阈值,则接受这一对匹配点,这样操作的原因是为了排除因为图像遮挡和背景混乱而产生的无匹配关系的关键点。本方法中设置的阈值是0.75。在本方法中认为两幅图像之间匹配成功的关键点个数是两幅图像的距离,匹配成功的个数越多说明这两幅的图像距离越近,两幅图像之间的相似度越高。The specific way is to use the Flann feature matching method, where k is set to 2, that is, the number of key points with the closest distance is selected as 2. Take a key point in an image and find the first two key points closest to Euclidean in another image. The specific calculation method is to calculate the Euclidean of the feature descriptor vectors of the two key points The distance is the sum of the squares of the difference between each corresponding element of the two vectors. Among these two key points, if the closest distance divided by the next closest distance is less than a certain ratio threshold, the pair of matching points is accepted. The reason for this operation is to exclude no matching due to image occlusion and background confusion. key points of the relationship. The threshold set in this method is 0.75. In this method, the number of key points that are successfully matched between two images is considered to be the distance between the two images. The more the number of successful matches, the closer the distance between the two images and the greater the similarity between the two images. high.
S3输出与目标图像匹配成功的关键点数最多的前n幅图像。S3 outputs the top n images with the largest number of key points that successfully match the target image.
上述实施例为本发明较佳的实施方式,但本发明的实施方式并不受所述实施例的限制,其他的任何未背离本发明的精神实质与原理下所作的改变、修饰、替代、组合、简化,均应为等效的置换方式,都包含在本发明的保护范围之内。The above-mentioned embodiment is a preferred embodiment of the present invention, but the embodiment of the present invention is not limited by the embodiment, and any other changes, modifications, substitutions and combinations made without departing from the spirit and principle of the present invention , simplification, all should be equivalent replacement methods, and are all included in the protection scope of the present invention.
Claims (4)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510514545.9A CN105069144A (en) | 2015-08-20 | 2015-08-20 | Similar image search method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510514545.9A CN105069144A (en) | 2015-08-20 | 2015-08-20 | Similar image search method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105069144A true CN105069144A (en) | 2015-11-18 |
Family
ID=54498513
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510514545.9A Pending CN105069144A (en) | 2015-08-20 | 2015-08-20 | Similar image search method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105069144A (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106528665A (en) * | 2016-10-21 | 2017-03-22 | 广州视源电子科技股份有限公司 | AOI equipment test file searching method and system |
CN107295327A (en) * | 2016-04-05 | 2017-10-24 | 富泰华工业(深圳)有限公司 | Light-field camera and its control method |
CN109271995A (en) * | 2017-07-18 | 2019-01-25 | 深圳市凯立德科技股份有限公司 | A kind of high-precision image matching method and system |
CN109346188A (en) * | 2018-10-19 | 2019-02-15 | 刘瑞红 | A kind of medical statistics data processing method |
CN110598019A (en) * | 2019-09-11 | 2019-12-20 | 腾讯科技(深圳)有限公司 | Repeated image identification method and device |
CN111460190A (en) * | 2020-04-07 | 2020-07-28 | 中国民航信息网络股份有限公司 | Method and device for matching luggage |
CN112184702A (en) * | 2020-10-27 | 2021-01-05 | 携程计算机技术(上海)有限公司 | Image cheating detection method, device, electronic device, storage medium |
CN112926447A (en) * | 2021-02-24 | 2021-06-08 | 贵州电网有限责任公司 | Electric power material automatic discrimination method based on image feature recognition |
CN113077410A (en) * | 2020-01-03 | 2021-07-06 | 上海依图网络科技有限公司 | Image detection method, device and method, chip and computer readable storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120011142A1 (en) * | 2010-07-08 | 2012-01-12 | Qualcomm Incorporated | Feedback to improve object recognition |
CN103442014A (en) * | 2013-09-03 | 2013-12-11 | 中国科学院信息工程研究所 | Method and system for automatic detection of suspected counterfeit websites |
CN103955694A (en) * | 2014-04-09 | 2014-07-30 | 广州邦讯信息系统有限公司 | Image recognition meter reading system and method |
CN104751475A (en) * | 2015-04-16 | 2015-07-01 | 中国科学院软件研究所 | Feature point optimization matching method for static image object recognition |
-
2015
- 2015-08-20 CN CN201510514545.9A patent/CN105069144A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120011142A1 (en) * | 2010-07-08 | 2012-01-12 | Qualcomm Incorporated | Feedback to improve object recognition |
CN103442014A (en) * | 2013-09-03 | 2013-12-11 | 中国科学院信息工程研究所 | Method and system for automatic detection of suspected counterfeit websites |
CN103955694A (en) * | 2014-04-09 | 2014-07-30 | 广州邦讯信息系统有限公司 | Image recognition meter reading system and method |
CN104751475A (en) * | 2015-04-16 | 2015-07-01 | 中国科学院软件研究所 | Feature point optimization matching method for static image object recognition |
Non-Patent Citations (1)
Title |
---|
RELJA 等: "Three things everyone should know to improve object retrieval", 《IEEE CONFERENCE ON COMPUTER VISION & PATTERN RECOGNITION》 * |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107295327A (en) * | 2016-04-05 | 2017-10-24 | 富泰华工业(深圳)有限公司 | Light-field camera and its control method |
CN107295327B (en) * | 2016-04-05 | 2019-05-10 | 富泰华工业(深圳)有限公司 | Light field camera and control method thereof |
CN106528665A (en) * | 2016-10-21 | 2017-03-22 | 广州视源电子科技股份有限公司 | AOI equipment test file searching method and system |
CN106528665B (en) * | 2016-10-21 | 2019-09-03 | 广州视源电子科技股份有限公司 | AOI equipment test file searching method and system |
CN109271995A (en) * | 2017-07-18 | 2019-01-25 | 深圳市凯立德科技股份有限公司 | A kind of high-precision image matching method and system |
CN109346188A (en) * | 2018-10-19 | 2019-02-15 | 刘瑞红 | A kind of medical statistics data processing method |
CN110598019A (en) * | 2019-09-11 | 2019-12-20 | 腾讯科技(深圳)有限公司 | Repeated image identification method and device |
CN113077410A (en) * | 2020-01-03 | 2021-07-06 | 上海依图网络科技有限公司 | Image detection method, device and method, chip and computer readable storage medium |
CN111460190A (en) * | 2020-04-07 | 2020-07-28 | 中国民航信息网络股份有限公司 | Method and device for matching luggage |
CN111460190B (en) * | 2020-04-07 | 2023-06-16 | 中国民航信息网络股份有限公司 | Luggage matching method and device |
CN112184702A (en) * | 2020-10-27 | 2021-01-05 | 携程计算机技术(上海)有限公司 | Image cheating detection method, device, electronic device, storage medium |
CN112184702B (en) * | 2020-10-27 | 2025-01-07 | 携程计算机技术(上海)有限公司 | Image cheating detection method, device, electronic device, and storage medium |
CN112926447A (en) * | 2021-02-24 | 2021-06-08 | 贵州电网有限责任公司 | Electric power material automatic discrimination method based on image feature recognition |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105069144A (en) | Similar image search method | |
Van Gemert et al. | APT: Action localization proposals from dense trajectories. | |
Zhang et al. | Histogram of 3D facets: A depth descriptor for human action and hand gesture recognition | |
Simonyan et al. | Learning local feature descriptors using convex optimisation | |
Jangyodsuk et al. | Sign language recognition using dynamic time warping and hand shape distance based on histogram of oriented gradient features | |
Joon Oh et al. | Person recognition in personal photo collections | |
CN103207898B (en) | A kind of similar face method for quickly retrieving based on local sensitivity Hash | |
CN104991954B (en) | Shopping search system based on picture search and its implementation | |
CN103258037A (en) | Trademark identification searching method for multiple combined contents | |
US9626552B2 (en) | Calculating facial image similarity | |
CN105574505A (en) | Human body target re-identification method and system among multiple cameras | |
CN103577840B (en) | Item identification method | |
Nanni et al. | Effective and precise face detection based on color and depth data | |
CN105608463B (en) | A kind of stereo-picture feature matching method | |
CN110019912A (en) | Graphic searching based on shape | |
CN103984942A (en) | Object recognition method and mobile terminal | |
Trinh et al. | On illumination-invariant variational optical flow for weakly textured scenes | |
CN110309810A (en) | A Pedestrian Re-Identification Method Based on Batch Center Similarity | |
Paul et al. | Mining images for image annotation using SURF detection technique | |
CN102393960A (en) | Method for describing local characteristic of image | |
Zhou et al. | Discarding wide baseline mismatches with global and local transformation consistency | |
CN105074729B (en) | Method, system and medium for luminosity edge-description | |
Weinmann et al. | Material recognition for efficient acquisition of geometry and reflectance | |
Peng et al. | Learning to multimodal hash for robust video copy detection | |
Ji et al. | An effective pipeline for a real-world clothes retrieval system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20151118 |