[go: up one dir, main page]

CN102200999B - A method for retrieving similarity shapes - Google Patents

A method for retrieving similarity shapes Download PDF

Info

Publication number
CN102200999B
CN102200999B CN201110106315A CN201110106315A CN102200999B CN 102200999 B CN102200999 B CN 102200999B CN 201110106315 A CN201110106315 A CN 201110106315A CN 201110106315 A CN201110106315 A CN 201110106315A CN 102200999 B CN102200999 B CN 102200999B
Authority
CN
China
Prior art keywords
shape
shapes
distance
retrieved
matrix
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.)
Expired - Fee Related
Application number
CN201110106315A
Other languages
Chinese (zh)
Other versions
CN102200999A (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.)
Huazhong University of Science and Technology
Original Assignee
Huazhong University of Science and Technology
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 Huazhong University of Science and Technology filed Critical Huazhong University of Science and Technology
Priority to CN201110106315A priority Critical patent/CN102200999B/en
Publication of CN102200999A publication Critical patent/CN102200999A/en
Application granted granted Critical
Publication of CN102200999B publication Critical patent/CN102200999B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种相似性形状检索方法,步骤为:①提取输入查询图像和数据库中待检索图像的形状轮廓;②用内距离形状上下文描述子对所有形状(包括输入查询形状和数据库中的待检索形状)进行表示。③用动态规划方法对所有形状(包括输入查询形状和数据库中的待检索形状)进行两两之间的匹配。④用内容敏感的相似性度量方法计算获得新的相似度度量排序。⑤获得形状检索的结果。本发明不再使用两两形状之间的不相似性(距离)作为形状检索的直接依据,而是通过对形状的内在差异进行整合,利用形状相似性空间中的结构信息对原始两两形状之间的不相似度(距离)进行改进,从而有效的提升了形状检索的准确率。

Figure 201110106315

The invention discloses a similarity shape retrieval method, the steps are: ① extracting the shape contour of the input query image and the image to be retrieved in the database; ② using the inner distance shape context descriptor to compare all shapes (including the input query shape and to be retrieved shape) to represent. ③ Use the dynamic programming method to match all shapes (including the input query shape and the shape to be retrieved in the database) between pairs. ④Using the content-sensitive similarity measurement method to calculate and obtain a new similarity measurement ranking. ⑤ Obtain the result of the shape search. The present invention no longer uses the dissimilarity (distance) between pairs of shapes as the direct basis for shape retrieval, but integrates the inherent differences of shapes and utilizes the structural information in the shape similarity space to compare the original pairwise shapes. The dissimilarity (distance) between them is improved, which effectively improves the accuracy of shape retrieval.

Figure 201110106315

Description

一种检索相似性形状的方法A method for retrieving similarity shapes

技术领域 technical field

本发明涉及对形状进行检索,具体涉及一种检索相似性形状的方法。The invention relates to retrieving shapes, in particular to a method for retrieving similar shapes.

背景技术 Background technique

形状匹配/检索是计算机视觉中的一个非常重要的问题。现有许多种不同的形状匹配方法,并且在提高匹配精度上取得了一定的进展。然而,几乎所有这些方法都重点专注于两两形状之间的相似性度量,试图通过提出更合理的形状描述子和匹配算法,从而更好的度量两个形状之间的相似性或距离。这些方法都基于一个典型的观点,两个形状越相似,它们之间的差异就越小,这个差异通常由距离函数来度量。然而,这一观点忽视了一个事实:对于形状而言,有些同类形状之间的差异可能很大,而有些不同类形状之间的差异可能反而相对较小。这种现象由形状的复杂性引起,由于同类形状间的遮挡、扭曲或非刚性的形变等,同类的形状可能有很大的区别。换言之,对于区别很大的同类形状而言,无论如何改进形状描述子或匹配算法,都不可能对本来差异就很大的两个形状进行很好的度量和比较,使得它们很相似。虽然这种差异可能不是形状之间的本质区别,但却难以消除。要解决这个问题,需要对目前单纯从两个形状本身的特性出发进行相似性度量的思路进行改进。Shape matching/retrieval is a very important problem in computer vision. There are many different shape matching methods, and some progress has been made in improving the matching accuracy. However, almost all of these methods focus on the similarity measurement between two shapes, trying to better measure the similarity or distance between two shapes by proposing more reasonable shape descriptors and matching algorithms. These methods are all based on a typical idea that the more similar two shapes are, the smaller the difference between them, which is usually measured by a distance function. However, this view ignores the fact that, as far as shapes are concerned, some shapes of the same type may have large differences, while some shapes of different types may have relatively small differences. This phenomenon is caused by the complexity of shapes, which may be very different due to occlusion, distortion, or non-rigid deformation between similar shapes. In other words, for similar shapes that are very different, no matter how the shape descriptor or matching algorithm is improved, it is impossible to measure and compare two shapes that are already very different, making them very similar. While this difference may not be an essential difference between the shapes, it is difficult to remove. To solve this problem, it is necessary to improve the current idea of similarity measurement based solely on the characteristics of the two shapes themselves.

“内距离形状上下文”是近年来提出的一种很有效的形状描述子。它对于同类形状的非刚性变化具有较强的稳定性。在本发明的系统中,形状描述子使用内距离形状上下文。内距离形状上下文的具体内容,在HaibinLing和David W.Jacobs所著、2007年发表在期刊“IEEE Transactions onPattern Analysis and Machine Intelligence”第26卷第11期上的文章“ShapeClassification Using the Inner-Distance”中有详细介绍。"Inner distance shape context" is a very effective shape descriptor proposed in recent years. It has strong stability for non-rigid changes of the same shape. In the system of the present invention, the shape descriptor uses an inner distance shape context. The specific content of the shape context of the inner distance is in the article "ShapeClassification Using the Inner-Distance" written by HaibinLing and David W. Jacobs and published in the journal "IEEE Transactions on Pattern Analysis and Machine Intelligence" Volume 26 Issue 11 in 2007 There are details.

动态规划方法是运筹学的一个分支,是解决多阶段决策过程的一种数学方法。近年来,动态规划方法在形状匹配、形状检索中取得了广泛的应用。在本发明中,对形状进行匹配使用动态规划方法。关于动态规划方法在形状匹配中应用的内容,在Evangelos Milios和Euripides G.M.Petrakis所著、2000年发表在期刊“IEEE Transactions on Image Processing”第9卷第1期上的文章“Shape Retrieval Based on Dynamic Programming”中有详细的介绍。Dynamic programming method is a branch of operations research, which is a mathematical method to solve multi-stage decision-making process. In recent years, dynamic programming methods have been widely used in shape matching and shape retrieval. In the present invention, a dynamic programming method is used for shape matching. Regarding the application of dynamic programming methods in shape matching, the article "Shape Retrieval Based on Dynamic Programming" written by Evangelos Milios and Euripides G.M.Petrakis and published in the journal "IEEE Transactions on Image Processing" Volume 9 Issue 1 in 2000 " has a detailed introduction.

发明内容 Contents of the invention

本发明的目的在于提供一种检索相似性形状的方法,该方法可以提高形状检索的准确率。The purpose of the present invention is to provide a method for retrieving similar shapes, which can improve the accuracy of shape retrieval.

本发明提供的一种检索相似性形状的方法,包括下述步骤:A method for retrieving similarity shapes provided by the invention comprises the following steps:

(1)提取输入查询图像和数据库中待检索图像的形状轮廓,查询图像称之为查询形状,待检索图像称之为待检索形状;(1) Extract the shape outline of the input query image and the image to be retrieved in the database, the query image is called the query shape, and the image to be retrieved is called the shape to be retrieved;

(2)在步骤(1)所提取的查询形状和待检索形状的基础上,计算每个形状轮廓的特征,也就是描述子;(2) On the basis of the query shape extracted in step (1) and the shape to be retrieved, calculate the feature of each shape outline, that is, the descriptor;

(3)在步骤(2)计算得到的形状特征的基础上,对于输入的查询形状和数据库中的待检索形状所组成的形状集合,对集合中的任意两个形状之间进行匹配,求出其两两之间的不相似性度量值,根据这些不相似性度量值组成一个不相似性度量矩阵;(3) On the basis of the shape features calculated in step (2), for the shape set composed of the input query shape and the shape to be retrieved in the database, match any two shapes in the set to obtain According to the dissimilarity measure value between two pairs, a dissimilarity measure matrix is formed according to these dissimilarity measure values;

(4)根据步骤(3)求得的不相似性度量矩阵,计算查询形状跟数据库中任意一个待检索形状之间的相似度;(4) Calculate the similarity between the query shape and any shape to be retrieved in the database according to the dissimilarity measurement matrix obtained in step (3);

(5)基于步骤(4)中求得的输入查询形状跟数据库中所有待检索形状之间的相似度,确定检索输出结果。(5) Determine the retrieval output result based on the similarity between the input query shape obtained in step (4) and all the shapes to be retrieved in the database.

本发明具备如下性质:(1)取代了以前只计算每一对形状的相似度的方式,更多地利用了由已知所有形状组成的流形;(2)没有显性地学习流形或测地线,因为这一计算耗费比较大。一个更好的相似度通过查询形状向数据库中待检索的形状传递相似度来得到。在具体实施方式部分将对本发明的效果作进一步的说明。The present invention has the following properties: (1) instead of the previous method of only calculating the similarity of each pair of shapes, more use is made of manifolds composed of all known shapes; (2) there is no explicit learning of manifolds or Geodesics, because this calculation is relatively expensive. A better similarity is obtained by transferring the similarity of the query shape to the shape to be retrieved in the database. The effect of the present invention will be further described in the specific embodiment part.

附图说明 Description of drawings

图1是本发明输入的测试图像示例;Fig. 1 is the test image example of input of the present invention;

图2是形状轮廓抽样点及内距离示意图,(A)轮廓采样点示意图,(B)形状的内距离示意图,(C)局部形状的内距离示意图;Fig. 2 is a schematic diagram of shape contour sampling points and inner distance, (A) contour sampling point schematic diagram, (B) inner distance schematic diagram of shape, (C) inner distance schematic diagram of local shape;

图3是内角度示意图;Fig. 3 is a schematic diagram of an inner angle;

图4是带角度划分的同心圆及其在轮廓表示上的应用示意图;Fig. 4 is a schematic diagram of concentric circles with angle division and its application in contour representation;

图5是带角度划分的同心圆及内距离示意图;Fig. 5 is a schematic diagram of concentric circles and inner distances divided by angles;

图6是计算统计直方图示意图;Fig. 6 is a schematic diagram of calculating a statistical histogram;

图7是轮廓采样点及其统计直方图示意图;Fig. 7 is a schematic diagram of contour sampling points and their statistical histograms;

图8是实施本发明方法的系统流程图;Fig. 8 is a system flow diagram implementing the method of the present invention;

图9是在MPEG-7数据库上检索率的比较;Fig. 9 is the comparison of retrieval rate on MPEG-7 database;

图10是在MPEG-7数据库上检索的结果的比较;Figure 10 is a comparison of the results retrieved on the MPEG-7 database;

图11是带局部丢失的形状检索的结果比较。Figure 11 is a comparison of the results of shape retrieval with local loss.

具体实施方式 Detailed ways

本发明涉及到一种相似形状的检索方法和系统。系统中有一个形状数据库,该数据库中包含若干个形状,这些形状是等待被检索输出的形状(以下简称为“待检索形状”)。另外,作为系统的输入,有一个查询形状,数据库中的待检索形状会分别与该输入查询形状进行相似性比较,从而确定哪些待检索形状与输入查询形状足够相似并作为检索结果输出。The invention relates to a similar shape retrieval method and system. There is a shape database in the system, which contains several shapes, which are shapes waiting to be retrieved and outputted (hereinafter referred to as "shapes to be retrieved"). In addition, as the input of the system, there is a query shape, and the shapes to be retrieved in the database will be compared with the input query shape to determine which shapes to be retrieved are sufficiently similar to the input query shape and output as retrieval results.

检索工作从系统接收输入查询形状开始,以系统返回通过检索得出的若干结果形状结束。The retrieval work begins with the system receiving the input query shape and ends with the system returning several result shapes obtained through retrieval.

给定一个形状数据库、一个查询形状和一个形状距离函数,它不必是一个度量,本发明学习一个距离函数,这个距离函数通过查询形状和数据库中的待检索形状两两之间的相似度形成的流形上的最短路径来得到。本发明不需要显性地学习这个流形。实验证明,新学习的距离函数能够整合内在形状差异的知识。这个学习过程是非监督的。Given a shape database, a query shape, and a shape distance function, which does not have to be a metric, the present invention learns a distance function that is formed by pairwise similarity between the query shape and the shape to be retrieved in the database The shortest path on the manifold is obtained. The present invention does not need to learn this manifold explicitly. Experiments demonstrate that the newly learned distance function is able to incorporate knowledge of intrinsic shape differences. This learning process is unsupervised.

在本发明提出的方法中,在根据已有形状描述子和形状匹配算法计算获得的形状相似度基础上,进一步计算得到新的相似度。直观的说,对于一个给定的形状S1,即使形状S3与形状S1不相似,但若与形状S3相似的形状S2相似于S1,那么形状S1和形状S3的相似度也会很高。然而,即使形状S1和形状S3很相似,但如果与形状S3相似的形状S2跟形状S1并不相似,那么形状S1和形状S3的相似度将会很低。因此,得到的新相似度是对内容敏感的,这里给定形状的内容就是与其相似的形状。In the method proposed by the present invention, on the basis of the shape similarity calculated by the existing shape descriptor and the shape matching algorithm, a new similarity is further calculated. Intuitively speaking, for a given shape S 1 , even if shape S 3 is not similar to shape S 1, if shape S 2 similar to shape S 3 is similar to S 1 , then shape S 1 and shape S 3 are similar will also be high. However, even though shape S1 and shape S3 are very similar, if shape S2, which is similar to shape S3 , is not similar to shape S1 , the similarity between shape S1 and shape S3 will be low. Therefore, the resulting new similarity is content-sensitive, where the content of a given shape is the shape it is similar to.

即使形状S1和形状S3的差异较大,但有一个形状S2与它们的差异都很小,仍然认为形状S1和形状S3相似。这种情况对于多数形状距离是可能的,因为它们不满足三角形不等式的关系,即d(S1,S3)≤d(S1,S2)+d(S2,S3)并不是一直成立。若对某些形状S1,S2,S3,,满足d(S1,S3)>d(S1,S2)+d(S2,S3)这一情况,那么本章提出的方法能够学到一个新距离d′(S1,S3)满足d′(S1,S3)≤d(S1,S2)+d(S2,S3)。同样,若在距离空间中存在一条路径使得d(S1,S3)>d(S1,S2,1)+...+d(S2,u,S3),其中u是该路径上形状的数量,那么本方法得到一个新的距离d′(S1,S3)≤d(S1,S2,1)+...+d(S2,u,S3)。由于这条路径表示一个从形状S1到形状S3的一个最小扭曲变形的过程,能够忽视不是很关键的形状差异,并且集中在较关键的形状差异上,这样就得到了一个新的距离d′。本发明通过这个新的距离度量提升了形状检索的正确率。Even though the difference between shape S1 and shape S3 is large, but there is a shape S2 that differs little from both of them, shape S1 and shape S3 are still considered similar. This case is possible for most shape distances because they do not satisfy the triangle inequality relation, that is, d(S 1 , S 3 )≤d(S 1 , S 2 )+d(S 2 , S 3 ) is not always established. If for some shapes S 1 , S 2 , S 3 , satisfies the condition of d(S 1 , S 3 )>d(S 1 , S 2 )+d(S 2 , S 3 ), then the proposed The method can learn a new distance d′(S 1 , S 3 ) satisfying d′(S 1 , S 3 )≤d(S 1 , S 2 )+d(S 2 , S 3 ). Similarly, if there exists a path in distance space such that d(S 1 , S 3 )>d(S 1 , S 2,1 )+...+d(S 2, u , S 3 ), where u is the The number of shapes on the path, then this method obtains a new distance d′(S 1 , S 3 )≤d(S 1 , S 2,1 )+...+d(S 2 , u, S 3 ). Since this path represents a process of minimum distortion from shape S1 to shape S3 , it is possible to ignore the less critical shape differences and concentrate on the more critical shape differences, thus obtaining a new distance d '. The present invention improves the correct rate of shape retrieval through this new distance measure.

下面结合附图和实例对本发明方法作进一步详细的说明。Below in conjunction with accompanying drawing and example the method of the present invention is described in further detail.

如图8所示,本发明方法包括下述步骤:As shown in Figure 8, the inventive method comprises the following steps:

(1)提取输入查询图像和数据库中待检索图像的轮廓。输入的查询图像和数据库中的待检索图像,都是二值图像。如果输入的查询图像不是二值图像,先将其转换成二值图像。转换的方法包括人工手工标注或图像分割方法(例如,图归一化切分等算法)等。如图1所示,图中所示的形状是本发明的输入图像。从输入的查询图像和数据库的待检索图像中,通过轮廓提取算法得到形状轮廓。(1) Extract the contours of the input query image and the image to be retrieved in the database. The input query image and the image to be retrieved in the database are both binary images. If the input query image is not a binary image, convert it to a binary image first. Conversion methods include manual labeling or image segmentation methods (for example, algorithms such as graph normalization and segmentation), etc. As shown in Figure 1, the shape shown in the figure is the input image of the present invention. From the input query image and the image to be retrieved in the database, the shape contour is obtained through the contour extraction algorithm.

从输入的查询图像所提取的形状轮廓称为查询形状,从数据库中的待检索图像所提取的形状轮廓称为待检索形状。由于形状轮廓包含了二值图像的关键信息,同时轮廓提取非常容易实现,所以输入的查询图像也可称为输入查询形状,二值图像数据库也可称为形状数据库,数据库中的待检索图像也可称为待检索形状。文中后面分别采用“查询形状”、“形状数据库”和“待检索形状”的说法。The shape outline extracted from the input query image is called the query shape, and the shape outline extracted from the image to be retrieved in the database is called the shape to be retrieved. Since the shape contour contains the key information of the binary image, and the contour extraction is very easy to implement, the input query image can also be called the input query shape, the binary image database can also be called the shape database, and the images to be retrieved in the database can also be called Can be referred to as the shape to be retrieved. Later in the paper, the terms "query shape", "shape database" and "shape to be retrieved" are used respectively.

对于数据库中的待检索图像,从二值图像得到相应的形状轮廓的处理工作,不用在检索阶段进行,可以事先完成。对于输入的查询图像,其提取形状轮廓的工作只能在检索阶段完成。For the image to be retrieved in the database, the processing work of obtaining the corresponding shape outline from the binary image does not need to be carried out in the retrieval stage, but can be completed in advance. For the input query image, its work of extracting the shape contour can only be done in the retrieval stage.

(2)在步骤(1)所提取的查询形状和待检索形状的基础上,计算每个形状轮廓的特征,也就是描述子。本发明使用内距离形状上下文作为形状的描述子。具体做法如下:(2) On the basis of the query shape extracted in step (1) and the shape to be retrieved, calculate the feature of each shape outline, that is, the descriptor. The present invention uses the inner distance shape context as a shape descriptor. The specific method is as follows:

(2.1)对每个形状轮廓进行均匀采样。每个轮廓上采样N个点,N的取值在不同的应用环境中根据需要设定,如N=100。见图2(A)所示,在该图中剪刀的外轮廓上的圆形实心点即为轮廓上的采样点。(2.1) Uniformly sample each shape profile. N points are sampled on each contour, and the value of N is set according to needs in different application environments, such as N=100. As shown in Figure 2(A), the circular solid points on the outer contour of the scissors in this figure are the sampling points on the contour.

(2.2)对于每个形状轮廓上的每个采样点pi,i表示采样点的序号,i=1,...,N,使用内距离形状上下文描述子进行描述。对于某个形状来说,其形状轮廓上的所有N个采样点的内距离形状描述子,共同组成了这个形状的特征。(2.2) For each sampling point p i on each shape outline, i represents the serial number of the sampling point, i=1,...,N, described using the inner distance shape context descriptor. For a certain shape, the inner distance shape descriptors of all N sampling points on the shape contour together form the feature of this shape.

计算每个采样点的内距离形状上下文描述子,具体做法如下:Calculate the inner distance shape context descriptor of each sampling point, the specific method is as follows:

(2.2.1)计算内距离。定义采样点之间的内距离为在形状内部连接两个采样点的最短路径的长度。使用最短路径算法计算某个采样点pi到形状边界上其它采样点之间的内距离,计算方法如下:①首先构造一个图结构,在该图结构中,每个采样点pi作为图的顶点,设其中任意两个采样点为p1和p2,判断连接这两个顶点的边是否落在形状的内部,如果落在形状的内部,那么就在这两个顶点之间保留一条边的连接,边权重等于它们之间的欧式距离||p1-p2||。如果该边没有完全落在形状的内部,则这两个顶点之间没有一条边直接相连。②在整个权重图上使用最短路径算法(如迪科斯彻(Dijkstra)算法),获得任意两个点之间的最短连接,该最短距离即为内距离。在图2(C)中是形状局部细节上的最短路径线段。(2.2.1) Calculate the inner distance. Defines the inner distance between sample points as the length of the shortest path connecting two sample points inside the shape. Use the shortest path algorithm to calculate the inner distance between a sampling point p i and other sampling points on the shape boundary, the calculation method is as follows: ① first construct a graph structure, in this graph structure, each sampling point p i is used as the graph Vertex, set any two sampling points as p 1 and p 2 , judge whether the edge connecting these two vertices falls inside the shape, if it falls inside the shape, then keep an edge between these two vertices connection, the edge weight is equal to the Euclidean distance between them ||p 1 -p 2 ||. If the edge does not fall completely inside the shape, then no edge is directly connected between the two vertices. ② Use the shortest path algorithm (such as Dijkstra's algorithm) on the entire weight graph to obtain the shortest connection between any two points, and the shortest distance is the inner distance. In Fig. 2(C) it is the shortest path segment on the local detail of the shape.

(2.2.2)计算内角度。定义一个采样点p1相对于另一个采样点p2的内角度为轮廓采样点p1的切线方向和从点p1出发的p1、p2之间的最短路径方向之间的夹角。如图3中,p1和p2是轮廓上的两个采样点,图中所示的角度θ即为p1和p2之间的内角度。(2.2.2) Calculate the inner angle. Define the inner angle of one sampling point p 1 relative to another sampling point p 2 as the angle between the tangent direction of the contour sampling point p 1 and the direction of the shortest path between p 1 and p 2 starting from point p 1 . As shown in Figure 3, p 1 and p 2 are two sampling points on the contour, and the angle θ shown in the figure is the internal angle between p 1 and p 2 .

(2.2.3)计算内距离形状上下文描述子。本发明中使用带方向划分的同心圆作为计算描述子的工具,所谓带方向划分是指以采样点pi的切线方向为零度角方向,将360度空间均匀划分成G个区间,如图4所示,同心圆的圆心处于某个轮廓采样点pi,同心圆每个圆的半径以及同心圆的方向角度划分根据应用的具体场合而定,假设零角度方向为采样点pi的切线方向,假设角度划分为G个区间,本例中使用的是将360度划分为G=12个区间,每个区域为30度。又假设有R个同心圆,本例中R=5,则R个同心圆和G个角度区间结合起来构成了(R+1)×G个区间。然后结合(2.2.1)和(2.2.2)获得的内距离和内角度,确定轮廓上其他的点在以点pi为圆心的带方向距离划分同心圆的(R+1)×G个区间中的分布,获得一个统计直方图,该直方图见图7右侧所示。该统计直方图即为内距离形状上下文描述子。其数学定义为:(2.2.3) Calculate the inner distance shape context descriptor. In the present invention, concentric circles with directional division are used as a tool for calculating descriptors. The so-called directional division refers to taking the tangent direction of sampling point p i as the zero-degree angle direction, and evenly dividing the 360-degree space into G intervals, as shown in Figure 4 As shown, the center of the concentric circles is at a certain contour sampling point p i , the radius of each concentric circle and the direction and angle division of the concentric circles depend on the specific application occasions, assuming that the zero angle direction is the tangent direction of the sampling point p i , assuming that the angle is divided into G intervals, in this example, 360 degrees are divided into G=12 intervals, each area is 30 degrees. Assuming that there are R concentric circles, in this example R=5, then the R concentric circles and G angle intervals are combined to form (R+1)×G intervals. Then combine the inner distance and inner angle obtained by (2.2.1) and (2.2.2) to determine the (R+1)×G concentric circles of other points on the contour divided by the directional distance with the point p i as the center distribution in the interval to obtain a statistical histogram, which is shown on the right side of Figure 7. The statistical histogram is the inner distance shape context descriptor. Its mathematical definition is:

hi(k)=#{pj:1≤j≤N,j≠i,pj-pi∈bin(k)}h i (k)=#{p j : 1≤j≤N, j≠i, p j -p i ∈ bin(k)}

在上式中,hi表示轮廓上第i个采样点的内距离形状上下文统计直方图,hi(k)表示落在该统计直方图的第k个区间里点的个数,k的取值范围是从1到(R+1)×G的整数。pi表示第i个采样点,也就是该统计直方图描述的对象,pj则表示形状轮廓上的N个采样点中,除了pi以外其他N-1个点中的任意一个。pi是上述同心圆的圆心,pj-pi表示一个向量,该向量指向pj。bin表示上述的用带方向距离划分的同心圆获得的区间划分,bin(k)表示第k个区间。表达式的含义是如果向量pj-pi落在区间bin(k)中,则认为点pj落在统计直方图的区间k中,把相应的统计直方图的区间k中的点的数量hi(k)加1。符号#表示累加的含义。In the above formula, h i represents the inner distance shape context statistical histogram of the i-th sampling point on the contour, h i (k) represents the number of points falling in the k-th interval of the statistical histogram, and the value of k is The value range is an integer from 1 to (R+1)×G. p i represents the i-th sampling point, which is the object described by the statistical histogram, and p j represents any of the N sampling points on the shape outline, except for p i , any of the other N-1 points. p i is the center of the above-mentioned concentric circles, and p j -p i represents a vector pointing to p j . bin represents the interval division obtained by the above-mentioned concentric circles with directional distance division, and bin(k) represents the kth interval. The meaning of the expression is that if the vector p j -p i falls in the interval bin(k), then the point p j is considered to fall in the interval k of the statistical histogram, and the number of points in the interval k of the corresponding statistical histogram h i (k) is incremented by 1. The symbol # indicates the meaning of accumulation.

结合图4、图5进一步解释,在图4中,设圆心所在的位置为pi,箭头指向的位置为pj,经过一个中间点pw,图5中从圆心出发的折线段的长度即为内距离,在计算内距离形状上下文描述子时,首先将图5中的折线段做部分旋转得到图6中所示的直线段,然后看该直线段末端端点落在哪个距离区间中,判断该直线段与点pi的切线方向的夹角(即图6中接近圆心位置所标示的角度θ)的度数落在哪个角度区间中,结合上述两部分信息,最终确定点pj落在哪个区间中,然后将该区间的累加值在之前的基础上加1。Combined with Fig. 4 and Fig. 5 to further explain, in Fig. 4, suppose the position of the center of the circle is p i , the position pointed by the arrow is p j , passing through an intermediate point p w , the length of the broken line segment starting from the center of the circle in Fig. 5 is is the inner distance, when calculating the inner distance shape context descriptor, first partially rotate the broken line segment in Figure 5 to obtain the straight line segment shown in Figure 6, and then check which distance interval the end point of the straight line segment falls in, and judge In which angle interval does the angle between the straight line segment and the tangent direction of point p i fall (that is, the angle θ marked near the center of the circle in Figure 6) fall in which angle interval, combining the above two parts of information, finally determine which point p j falls in interval, and then add 1 to the accumulated value of the interval on the previous basis.

最终获得的统计直方图如图7所示,颜色越深的地方表示点数越少,颜色越浅的地方表示点数越多。The final statistical histogram is shown in Figure 7. The darker the color, the fewer points, and the lighter the color, the more points.

在图7的统计直方图中,横轴方向表示角度区间划分,纵轴方向表示距离区间划分。In the statistical histogram in FIG. 7 , the direction of the horizontal axis represents the division of angle intervals, and the direction of the vertical axis represents the division of distance intervals.

(2.3)计算每个形状轮廓的特征(2.3) Calculate the features of each shape profile

重复(2.2)的过程,计算获得某个形状轮廓上每一个采样点的内距离形状上下文描述子,从而获得对该形状的描述。这种对整个形状的描述,是通过一组如(2.2.3)描述的统计直方图所组成,每个统计直方图都是该形状轮廓上某一个点的描述。这样一组描述子,就是前面所述的形状特征。Repeat the process of (2.2) to calculate the inner distance shape context descriptor of each sampling point on the contour of a certain shape, so as to obtain the description of the shape. This description of the entire shape is composed of a set of statistical histograms as described in (2.2.3), and each statistical histogram is a description of a certain point on the contour of the shape. Such a set of descriptors is the shape feature mentioned above.

重复这个过程,计算获得输入查询形状和数据库中所有待检索形状的特征。Repeat this process to calculate the features of the input query shape and all shapes to be retrieved in the database.

对于数据库中的待检索形状,其形状轮廓特征的计算不用在检索阶段进行,可以事先完成。对于输入的查询形状,其形状轮廓特征的计算只能在检索阶段完成。For the shape to be retrieved in the database, the calculation of its shape contour feature does not need to be carried out in the retrieval stage, but can be completed in advance. For the input query shape, the computation of its shape contour features can only be done in the retrieval stage.

(3)形状匹配(3) Shape matching

在步骤(2)计算得到的形状特征的基础上,对于输入的查询形状和数据库中的待检索形状所组成的形状集合,对集合中的任意两个形状之间进行匹配,求出其两两之间的不相似性度量值(距离)。On the basis of the shape features calculated in step (2), for the shape set composed of the input query shape and the shape to be retrieved in the database, match any two shapes in the set to find the pairwise The dissimilarity measure (distance) between them.

(3.1)两个形状之间的匹配(3.1) Matching between two shapes

本发明使用动态规划方法,求解任意两个形状轮廓上采样点的最佳对应关系和这两个形状之间的不相似性度量值(距离),完成形状匹配。具体做法如下:The present invention uses a dynamic programming method to solve the optimal corresponding relationship of sampling points on any two shape contours and the dissimilarity measurement value (distance) between the two shapes to complete shape matching. The specific method is as follows:

假设待匹配的其中一个形状为A,另外一个形状为B,由A和B的轮廓采样点组成两个序列集合,分别记为{pi,i=1,...,N},{qj,j=1,...,N}。Assuming that one of the shapes to be matched is A and the other is B, the contour sampling points of A and B form two sequence sets, which are respectively recorded as {p i , i=1,...,N}, {q j , j=1, . . . , N}.

(3.1.1)分别计算序列{pi,i=1,...,N}中的任意一个点pi与序列{qj,j=1,...,N}中的任意一个点qj之间的特征距离c(i,j),该距离定义为由(2.2)计算得到的点pi的统计直方图与点qj的统计直方图之间的距离,其数学定义如下:(3.1.1) Calculate any point p i in the sequence {p i , i=1,..., N} and any point in the sequence {q j , j=1,..., N} respectively The characteristic distance c(i, j) between q j , which is defined as the distance between the statistical histogram of point p i calculated by (2.2) and the statistical histogram of point q j , its mathematical definition is as follows:

cc (( ii ,, jj )) == 11 22 ΣΣ kk == 11 (( RR ++ 11 )) ×× GG [[ hh AA ,, ii (( kk )) -- hh BB ,, jj (( kk )) ]] 22 hh AA ,, ii (( kk )) ++ hh BB ,, jj (( kk ))

其中hA,i,hB,j为(2.2.3)中定义的统计直方图,下标A和B表示hA,i(k)、hB,j(k)分别是形状A和形状B的统计直方图,c(i,j)表示点pi和点qi的特征距离。where h A, i , h B, j are statistical histograms defined in (2.2.3), subscripts A and B represent h A, i (k), h B, j (k) are shape A and shape The statistical histogram of B, c(i, j) represents the characteristic distance between point p i and point q i .

通过计算形状A上所有点与形状B上所有点的特征距离,获得N×N的特征距离矩阵{c(i,j),i=1,...,N,j=1,...,N}:By calculating the feature distances between all points on shape A and all points on shape B, an N×N feature distance matrix {c(i, j), i=1,..., N, j=1,... ,N}:

CC == cc (( 1,11,1 )) cc (( 1,21,2 )) .. .. .. cc (( 11 ,, NN -- 11 )) cc (( 11 ,, NN )) cc (( 2,12,1 )) cc (( 2,22,2 )) .. .. .. cc (( 22 ,, NN -- 11 )) cc (( 22 ,, NN )) .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. cc (( NN -- 1,11,1 )) cc (( NN -- 1,21,2 )) .. .. .. cc (( NN -- 11 ,, NN -- 11 )) cc (( NN -- 11 ,, NN )) cc (( NN ,, 11 )) cc (( NN ,, 22 )) .. .. .. cc (( NN ,, NN -- 11 )) cc (( NN ,, NN ))

(3.1.2)假设两个序列{pi,i=1,...,N}和{qj,j=1,...,N}在点p1和q1处对齐。运用动态规划方法,求得两个序列的不相似度(距离)D1,其求解过程如下:(3.1.2) Suppose two sequences {p i , i=1, . . . , N} and {q j , j=1, . . . , N} are aligned at points p 1 and q 1 . Using the dynamic programming method, the dissimilarity (distance) D1 of the two sequences is obtained, and the solution process is as follows:

①生成一个N×N的空矩阵M,称为动态规划矩阵。① Generate an N×N empty matrix M, which is called a dynamic programming matrix.

②初始化边际条件:② Initialize the marginal conditions:

M(0,0)=0;M(0,0)=0;

M(i,0)=γ×i,i=1,...,N;M(i,0)=γ×i, i=1,...,N;

M(0,j)=γ×j,j=1,...,N;M(0, j)=γ×j, j=1,...,N;

这些数值不包含在动态规划矩阵M中,因为M中的元素的行索引和列索引的范围均为从1到N的整数。γ为设定的一个标量惩罚因子。These values are not included in the dynamic programming matrix M, because the row index and column index of the elements in M are integers ranging from 1 to N. γ is a scalar penalty factor set.

③按照从左到右、从上到下的顺序,依次计算动态规划矩阵M中每个元素的值S(i,j),i=1,...,N,j=1,...,N。计算公式如下:③ According to the order from left to right and from top to bottom, calculate the value S(i, j) of each element in the dynamic programming matrix M sequentially, i=1,..., N, j=1,... , N. Calculated as follows:

Mm (( ii ,, jj )) == minmin Mm (( ii -- 11 ,, jj -- 11 )) ++ cc (( ii ,, jj )) Mm (( ii -- 11 ,, jj )) ++ γγ Mm (( ii ,, jj -- 11 )) ++ γγ

其中c(i,j)为点pi与点qj之间的特征距离。where c(i, j) is the characteristic distance between point p i and point q j .

④当动态规划矩阵中每个元素的值均计算完毕,则动态规划方法结束。两个序列的不相似度D1=M(N,N)。④ When the value of each element in the dynamic programming matrix is calculated, the dynamic programming method ends. The degree of dissimilarity D 1 of two sequences = M(N, N).

(3.1.4)重复(3.1.3)的过程,分别假设两个序列{pi}和{qi}在p2与q1处对齐,p3与q1处对齐,......,pN与q1处对齐,分别运用动态规划算法求得不相似度(距离)D2,D3,...,DN(3.1.4) Repeat the process of (3.1.3), assuming that the two sequences {p i } and {q i } are aligned at p 2 and q 1 , p 3 and q 1 are aligned, ..... ., p N is aligned with q 1 , and the dissimilarity (distance) D 2 , D 3 , . . .

(3.1.5)选取步骤(3.1.3)到(3.1.4)中求得的N个距离中最小的那个,作为形状A,B之间的不相似性度量值(距离):(3.1.5) Select the smallest of the N distances obtained in steps (3.1.3) to (3.1.4) as the dissimilarity measure (distance) between shapes A and B:

D(A,B)=min(Di),i=1,...,ND(A,B)=min(D i ), i=1,...,N

(3.2)形状集合中两两形状之间的匹配(3.2) Matching between pairs of shapes in the shape set

对于由输入的查询形状和数据库中的待检索形状所组成的形状集合,利用步骤(3.1)所描述的方法,对集合中的任意两个形状,利用动态规划算法进行匹配,求出其不相似性度量值(距离)。For the shape set composed of the input query shape and the shape to be retrieved in the database, using the method described in step (3.1), use the dynamic programming algorithm to match any two shapes in the set to find their dissimilarity Sexual measure (distance).

假设数据库中含有n个待检索形状,n为正整数,输入的查询形状与数据库中的n个形状一起,一共组成了n+1个形状{xi,i=1,...,n+1}。根据步骤(3.1),可以分别求出这n+1个形状两两之间的不相似性度量值(距离),组成一个不相似性度量矩阵(距离矩阵){Di,j,i,j=1,...,n,n+1}:Assuming that the database contains n shapes to be retrieved, n is a positive integer, and the input query shape together with n shapes in the database form a total of n+1 shapes { xi , i=1,...,n+ 1}. According to step (3.1), the dissimilarity measure value (distance) between these n+1 shapes can be obtained respectively, and a dissimilarity measure matrix (distance matrix) {D i, j , i, j =1,...,n,n+1}:

其中,Di,j表示第i个形状与第j个形状之间的不相似性度量值(距离)。另外,将输入的查询形状放在这n+1个形状中的第一个,即x1where D i,j represents the dissimilarity measure (distance) between the i-th shape and the j-th shape. Additionally, put the input query shape in the first of these n+1 shapes, ie x 1 .

对于数据库中的n个待检索形状,其两两之间的匹配和不相似性度量计算,不用在检索阶段进行,可以事先完成。但如果被匹配的两个形状中包含输入的查询形状,则其匹配和不相似性度量工作,只能在检索阶段完成。也就是说,对于矩阵D,其第一行和第一列的元素值必须在检索阶段计算,其他元素值均可事先计算求得。For the n shapes to be retrieved in the database, the calculation of matching and dissimilarity measures between them does not need to be performed in the retrieval phase, but can be completed in advance. But if the input query shape is included in the two matched shapes, the matching and dissimilarity measurement work can only be done in the retrieval stage. That is to say, for the matrix D, the element values of the first row and the first column must be calculated in the retrieval stage, and other element values can be calculated in advance.

(4)根据步骤(3)求得的不相似性度量(距离)矩阵,计算查询形状跟数据库中任意一个待检索形状之间的相似度。(4) Calculate the similarity between the query shape and any shape to be retrieved in the database according to the dissimilarity measure (distance) matrix obtained in step (3).

本步骤也就是通过使用内容敏感的形状相似度度量方法获得检索结果,其具体做法如下:This step is to obtain the retrieval result by using the content-sensitive shape similarity measurement method, and the specific method is as follows:

(4.1)定义关系矩阵wi,j,其计算公式如下:(4.1) Define the relationship matrix w i, j , whose calculation formula is as follows:

ww ii ,, jj == expexp (( -- DD. ii ,, jj 22 λλ ii ,, jj 22 ))

其中,Di,j是步骤(3.2)中获得的不相似度量矩阵(距离矩阵),λi,j为归一化参数,该归一化参数的计算方法如下:Among them, D i, j is the dissimilarity measure matrix (distance matrix) obtained in step (3.2), λ i, j is a normalization parameter, and the calculation method of this normalization parameter is as follows:

λi,j=α·mean({knnd(xi),knnd(xj)})λ i, j = α·mean({knnd(x i ), knnd(x j )})

在上式中,mean({knnd(xi),knnd(xj)})表示形状xi,xj的前b个最近邻距离的平均距离。所谓最近邻距离,是指与该形状的不相似性度量值(距离)中最小的b个距离。参数b和α在实际应用环境中根据经验决定,在本例中b=10,α=0.27。In the above formula, mean({knnd(x i ), knnd(x j )}) represents the average distance of the first b nearest neighbors of shape x i and x j . The so-called nearest neighbor distance refers to the smallest b distances among the dissimilarity measure values (distances) to the shape. The parameters b and α are determined empirically in the actual application environment, in this example b=10, α=0.27.

(4.2)定义概率转移矩阵P,该概率转移矩阵通过对wi,j沿行方向归一化得到,计算公式如下:(4.2) Define the probability transition matrix P, which is obtained by normalizing w i, j along the row direction, and the calculation formula is as follows:

PP ii ,, jj == ww ii ,, jj ΣΣ hh == 11 nno ++ 11 ww ii ,, hh

其中wi,j为上述的关系矩阵。Wherein w i, j is the above-mentioned relationship matrix.

(4.3)定义关键函数f,并通过下列递归的过程来求解关键函数:(4.3) Define the key function f, and solve the key function through the following recursive process:

f t + 1 ( x i ) = Σ j = 1 n + 1 P i , j f t ( x j ) , i=2,...,(n+1) f t + 1 ( x i ) = Σ j = 1 no + 1 P i , j f t ( x j ) , i=2,...,(n+1)

且有and have

ft+1(x1)=1f t+1 (x 1 )=1

其中Pi,j为上述的概率转移矩阵;该递归过程需要经过T次迭代,参数T在实际应用环境中预先决定,本例中T=5000。Wherein P i, j is the above-mentioned probability transition matrix; the recursive process needs T iterations, and the parameter T is predetermined in the actual application environment, and T=5000 in this example.

(4.4)使用步骤(4.3)的递归迭代过程得到的关键函数f,结果记作fT(xi),i=1,...,n,n+1,求解结果是一个n+1行1列的矩阵。去掉fT(x1),所剩余的n行1列的矩阵中,第i行的值表示数据库中的第i个形状与输入查询形状的相似度。(4.4) Use the key function f obtained by the recursive iteration process of step (4.3), the result is denoted as f T ( xi ), i=1,..., n, n+1, and the solution result is an n+1 line A matrix with 1 column. Remove f T (x 1 ), and in the remaining n-row and one-column matrix, the value in the i-th row represents the similarity between the i-th shape in the database and the input query shape.

(5)基于(4)中求得的输入查询形状跟数据库中n个待检索形状之间的相似度fT(xi),i=2,...,n,n+1,确定检索输出结果。(5) Based on the similarity f T ( xi ) between the input query shape obtained in (4) and n shapes to be retrieved in the database, i=2,...,n,n+1, determine the retrieval Output the result.

对fT(xi),i=2,...,n+1中的n行值从大到小进行排序,根据排序以后的顺序,确定数据库中待检索形状的检索输出顺序。例如,第i个值最大,则输出的检索结果,第i-1个形状排在检索结果的第一位,以此类推得到第二位检索结果、第三位检索结果,等等。Sort the n rows of values in f T ( xi ), i=2,...,n+1 from large to small, and determine the retrieval output sequence of the shapes to be retrieved in the database according to the sorted sequence. For example, if the i-th value is the largest, in the output search result, the shape i-1 will be ranked first in the search result, and so on to get the second search result, the third search result, and so on.

检索输出的不是形状轮廓,而是数据库中的原始二值图像。如图10、图11所示。Instead of shape contours, the retrieval output is the original binary image in the database. As shown in Figure 10 and Figure 11.

设定一个参数l,表示检索返回的图像结果的数量。也就是说,检索返回的是数据库中与输入查询图像相似度最大的前l个图像。参数l的值由用户根据实际应用的需求灵活设定,本例中l=40。Set a parameter l, indicating the number of image results returned by the search. That is to say, the retrieval returns the top l images in the database that have the greatest similarity with the input query image. The value of the parameter l is flexibly set by the user according to actual application requirements, in this example l=40.

实验结果证明本发明能够提高已有形状匹配方法的检索性能。Experimental results prove that the invention can improve the retrieval performance of existing shape matching methods.

表1中给出了在MPEG-7CE-Shape-1数据库上本发明与近10年来发表在国际重要期刊和会议上的主要方法的比较,本发明取得了91.61%的检索精度,是目前在该数据库上取得的结果中最高的。Provided in table 1 on the MPEG-7CE-Shape-1 database, the present invention and the comparison of the main method published in international important periodicals and conferences in the past 10 years, the present invention has achieved 91.61% retrieval accuracy, is currently in this The highest result achieved on the database.

表2中给出了在Kimia99数据集上本发明与近年来的重要方法的结果并进行了比较,结果显示,本发明的方法在各个阶上的结果均高于其他方法。The results of the present invention and important methods in recent years on the Kimia99 data set are given in Table 2 and compared. The results show that the results of the method of the present invention are higher than other methods in each order.

在具体实施方式(4.1)中,存在着两个参数b和α,表3给出了在不同的参数下系统能够达到的检索精度,可以看到,在微调参数的情况下,本发明的最高检索精度可以达到92.57%。In the specific implementation (4.1), there are two parameters b and α. Table 3 shows the retrieval accuracy that the system can achieve under different parameters. It can be seen that in the case of fine-tuning parameters, the present invention achieves the highest The retrieval accuracy can reach 92.57%.

图9中给出的是在MPEG-7数据库上直接使用内距离形状上下文方法的检索率(圆圈标记的曲线)和使用本发明方法的检索率(“*”号标记的曲线)的比较。可以看到本发明给出的方法效果明显优于直接使用内距离形状上下文方法。Provided in Fig. 9 is the comparison of the retrieval rate (circle-marked curve) of directly using the inner distance shape context method on the MPEG-7 database and the retrieval rate of the method of the present invention ("*" mark curve). It can be seen that the effect of the method provided by the present invention is significantly better than that of directly using the inner distance shape context method.

图10给出的是在MPEG-7数据库上检索的结果,第一列是待检索的形状,右边10列是直接使用内距离形状上下文方法(奇数行)的检索结果和本发明方法(偶数行)的检索结果,图中给出了前10个最相近的结果。可以看到本发明给出的方法效果明显优于直接使用内距离形状上下文方法。What Fig. 10 provided is the result of retrieval on the MPEG-7 database, and the first column is the shape to be retrieved, and the right 10 columns are the retrieval results and the method of the present invention (even rows) directly using the inner distance shape context method (odd rows). ), the figure shows the top 10 most similar results. It can be seen that the effect of the method provided by the present invention is significantly better than that of directly using the inner distance shape context method.

图11给出的是带局部丢失的形状检索实验。第一列为丢失了一个部分的待检索图像,右边10列是直接使用内距离形状上下文方法(奇数行)进行检索和使用本发明方法(偶数行)进行检索得到的检索结果,图中给出了前10个最相似的检索结果。Figure 11 shows the shape retrieval experiment with local loss. The first column is the image to be retrieved that lost a part, and the 10 columns on the right are the retrieval results obtained by directly using the inner distance shape context method (odd-numbered rows) and using the method of the present invention (even-numbered rows), as shown in the figure The top 10 most similar search results.

表1不同方法在MPEG-7数据集上的检索率(bull’s eyes)Table 1 Retrieval rate of different methods on MPEG-7 dataset (bull’s eyes)

Figure BDA0000057703650000131
Figure BDA0000057703650000131

表2Kimia 99数据集的检索结果Table 2 The retrieval results of the Kimia 99 dataset

Figure BDA0000057703650000132
Figure BDA0000057703650000132

表3在不同参数下的bull’s eye检索率Table 3 The retrieval rate of bull’s eye under different parameters

  b=3 b=3   b=5 b=5   b=7 b=7   b=9 b=9   α=0.1 α=0.1   83.9% 83.9%   88.11% 88.11%   89.26% 89.26%   89.84% 89.84%   α=0.15 α=0.15   84.33% 84.33%   88.67% 88.67%   89.66% 89.66%   90.31% 90.31%   α=0.2 α=0.2   85.77% 85.77%   90.29% 90.29%   91.34% 91.34%   91.84% 91.84%   α=0.25 α=0.25   88.71% 88.71%   92.17% 92.17%   92.57% 92.57%   92.56% 92.56%   α=0.3 α=0.3   89.69% 89.69%   91.16% 91.16%   91.41% 91.41%   91.16% 91.16%   α=0.35 α=0.35   89.03% 89.03%   90.39% 90.39%   90.30% 90.30%   90.20% 90.20%   α=0.4 α=0.4   88.74% 88.74%   89.99% 89.99%   89.97% 89.97%   89.84% 89.84%

本发明不仅局限于上述具体实施方式,本领域一般技术人员根据本发明公开的内容,可以采用其它多种具体实施方式实施本发明,因此,凡是采用本发明的设计结构和思路,做一些简单的变化或更改的设计,都落入本发明保护的范围。The present invention is not limited to the above-mentioned specific embodiments, and those skilled in the art can adopt various other specific embodiments to implement the present invention according to the disclosed content of the present invention. Changes or modified designs all fall within the protection scope of the present invention.

Claims (3)

1.一种检索相似性形状的方法,包括下述步骤:1. A method for retrieving similarity shapes, comprising the steps of: (1)提取输入查询图像和数据库中待检索图像的形状轮廓,查询图像称之为查询形状,待检索图像称之为待检索形状;(1) Extract the shape contour of the input query image and the image to be retrieved in the database, the query image is called the query shape, and the image to be retrieved is called the shape to be retrieved; (2)在步骤(1)所提取的查询形状和待检索形状的基础上,计算每个形状轮廓的特征,也就是描述子;(2) Based on the query shape extracted in step (1) and the shape to be retrieved, calculate the feature of each shape outline, that is, the descriptor; (3)在步骤(2)计算得到的形状特征的基础上,对于输入的查询形状和数据库中的待检索形状所组成的形状集合,对集合中的任意两个形状之间进行匹配,求出其两两之间的不相似性度量值,根据求出的不相似性度量值组成不相似性度量矩阵;(3) On the basis of the shape features calculated in step (2), for the shape set composed of the input query shape and the shape to be retrieved in the database, match any two shapes in the set to find According to the dissimilarity measure value between two pairs, a dissimilarity measure matrix is formed according to the calculated dissimilarity measure value; (4)根据步骤(3)求得的不相似性度量矩阵,计算查询形状跟数据库中任意一个待检索形状之间的相似度;(4) According to the dissimilarity measurement matrix obtained in step (3), calculate the similarity between the query shape and any shape to be retrieved in the database; (5)基于(4)中求得的输入查询形状跟数据库中n个待检索形状之间的相似度,确定检索输出结果;(5) Based on the similarity between the input query shape obtained in (4) and the n shapes to be retrieved in the database, determine the retrieval output result; 步骤(2)包括下述过程:Step (2) includes the following process: (2.1)对每个形状轮廓进行均匀采样;(2.1) Uniform sampling of each shape profile; (2.2)对于每个形状轮廓上的每个采样点pi,i表示采样点的序号,i=1,...,N,使用内距离形状上下文描述子进行描述,N表示形状轮廓上的采样点的数量;(2.2) For each sampling point p i on each shape contour, i represents the serial number of the sampling point, i=1,...,N, using the inner distance shape context descriptor to describe, and N represents the the number of sampling points; (2.3)重复(2.2)的过程,计算获得某个形状轮廓上每一个采样点的内距离形状上下文描述子,从而获得对该形状的描述;(2.3) Repeat the process of (2.2) to calculate the inner distance shape context descriptor of each sampling point on the outline of a certain shape, so as to obtain the description of the shape; 步骤(3)具体包括下述过程:Step (3) specifically includes the following process: (3.1)两个形状之间的匹配:(3.1) Matching between two shapes: 使用动态规划方法,求解任意两个形状轮廓上采样点的最佳对应关系和这两个形状之间的不相似性度量值,完成形状匹配;Use the dynamic programming method to solve the best correspondence between sampling points on any two shape contours and the dissimilarity measure between the two shapes to complete the shape matching; (3.2)形状集合中两两形状之间的匹配,得到不相似度量矩阵{Di,j,i,j=1,...,n,n+1}:(3.2) Matching between two shapes in the shape set, the dissimilarity metric matrix {D i,j ,i,j=1,...,n,n+1} is obtained: 对于由输入的查询形状和数据库中的待检索形状所组成的形状集合,利用步骤(3.1)所描述的方法,对集合中的任意两个形状,利用动态规划算法进行匹配,求出其不相似性度量值;For the shape set composed of the input query shape and the shape to be retrieved in the database, using the method described in step (3.1), use the dynamic programming algorithm to match any two shapes in the set to find their dissimilarity measure of sex; 假设数据库中含有n个待检索形状,n为正整数,输入的查询形状与数据库中的n个形状一起,一共组成了n+1个形状{xi,i=1,...,n+1};根据步骤(3.1),分别求出这n+1个形状两两之间的不相似性度量值,组成一个不相似度量矩阵{Di,j,i,j=1,...,n,n+1}:Assume that the database contains n shapes to be retrieved, and n is a positive integer. The input query shape and n shapes in the database form a total of n+1 shapes { xi ,i=1,...,n+ 1}; according to step (3.1), calculate the dissimilarity measurement values between the n+1 shapes and form a dissimilarity measurement matrix {D i,j ,i,j=1,... ,n,n+1}: DD. ii ,, jj == DD. (( 1,11,1 )) DD. (( 1,21,2 )) .. .. .. DD. (( 11 ,, nno )) DD. (( 11 ,, nno ++ 11 )) DD. (( 2,12,1 )) DD. (( 2,22,2 )) .. .. .. DD. (( 22 ,, nno )) DD. (( 22 ,, nno ++ 11 )) .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. DD. (( nno ,, 11 )) DD. (( nno ,, 22 )) .. .. .. DD. (( nno ,, nno )) DD. (( nno ,, nno ++ 11 )) DD. (( nno ++ 1,11,1 )) DD. (( nno ++ 1,21,2 )) .. .. .. DD. (( nno ++ 11 ,, nno )) DD. (( nno ++ 11 ,, nno ++ 11 )) 其中,Di,j表示第i个形状与第j个形状之间的不相似性度量值;where D i,j represents the dissimilarity measure between the i-th shape and the j-th shape; 步骤(4)具体包括下述过程:Step (4) specifically includes the following process: (4.1)定义关系矩阵wi,j,其计算公式如下:(4.1) Define the relationship matrix w i,j , whose calculation formula is as follows: ww ii ,, jj == expexp (( -- DD. ii ,, jj 22 λλ ii ,, jj 22 )) 其中,Di,j是步骤(3.2)中获得的不相似度量矩阵,λi,j为归一化参数,该归一化参数的计算方法如下:Among them, D i, j is the dissimilarity measure matrix obtained in step (3.2), and λ i, j is the normalization parameter, and the calculation method of the normalization parameter is as follows: λi,j=α·mean({knnd(xi),knnd(xj)})λ i,j =α·mean({knnd(x i ),knnd(x j )}) 在上式中,mean({knnd(xi),knnd(xj)})表示形状xi,xj的前b个最近邻距离的平均距离,所谓最近邻距离,是指与该形状的不相似性度量值中最小的b个距离;In the above formula, mean({knnd(x i ),knnd(x j )}) represents the average distance of the first b nearest neighbor distances of shape x i and x j , the so-called nearest neighbor distance refers to the the smallest b distances in the dissimilarity measure; (4.2)定义概率转移矩阵P,该概率转移矩阵通过对wi,j沿行方向归一化得到,计算公式如下:(4.2) Define the probability transition matrix P, which is obtained by normalizing w i, j along the row direction, and the calculation formula is as follows: PP ii ,, jj == ww ii ,, jj ΣΣ hh == 11 nno ++ 11 ww ii ,, hh (4.3)定义关键函数f,并通过下列递归的过程来求解关键函数:(4.3) Define the key function f, and solve the key function through the following recursive process: ff tt ++ 11 (( xx ii )) == ΣΣ jj == 11 nno ++ 11 PP ii ,, jj ff tt (( xx jj )) ,, ii == 22 ,, .. .. .. ,, (( nno ++ 11 )) 且有and have ft+1(x1)=1f t+1 (x 1 )=1 其中Pi,j为上述的转移概率矩阵;该递归过程需要经过T次迭代,参数T为预先设定的迭代次数;Where P i,j is the transition probability matrix mentioned above; the recursive process requires T iterations, and the parameter T is the preset number of iterations; (4.4)使用步骤(4.3)的递归迭代过程得到关键函数f,结果记作fT(xi),i=1,...,n,n+1,求解结果是一个n+1行1列的矩阵;去掉fT(x1),所剩余的n行1列的矩阵中,第i行的值表示数据库中的第i个形状与输入查询形状的相似度。(4.4) Use the recursive iteration process of step (4.3) to obtain the key function f, and record the result as f T (x i ), i=1,...,n,n+1, and the solution result is an n+1 row 1 column matrix; remove f T (x 1 ), and in the remaining n-row and 1-column matrix, the value of the i-th row represents the similarity between the i-th shape in the database and the input query shape. 2.根据权利要求1所述的检索相似性形状的方法,其特征在于,步骤(2.2)包括下述过程:2. The method for retrieving similarity shapes according to claim 1, wherein step (2.2) includes the following process: (2.2.1)计算内距离:定义采样点之间的内距离为在形状内部连接两个采样点的最短路径的长度,使用最短路径算法计算某个采样点pi到形状边界上其它采样点之间的内距离;(2.2.1) Calculate the inner distance: define the inner distance between sampling points as the length of the shortest path connecting two sampling points inside the shape, and use the shortest path algorithm to calculate a certain sampling point p i to other sampling points on the shape boundary the inner distance between (2.2.2)计算内角度:定义一个采样点p1相对于另一个采样点p2的内角度为轮廓采样点p1的切线方向和从点p1出发的p1、p2之间的最短路径方向之间的夹角;(2.2.2) Calculate the inner angle: define the inner angle of one sampling point p 1 relative to another sampling point p 2 as the tangent direction of the contour sampling point p 1 and the distance between p 1 and p 2 starting from point p 1 The angle between the shortest path directions; (2.2.3)计算内距离形状上下文描述子:使用带方向距离划分的同心圆作为计算描述子的工具,同心圆的圆心处于某个轮廓采样点pi,假设角度划分为G个区间,又假设有R个同心圆,则R个同心圆和G个角度区间结合起来构成了(R+1)×G个区间;然后结合(2.2.1)和(2.2.2)获得的内距离和内角度,确定轮廓上其他的点在以点pi为圆心的带方向距离划分同心圆的(R+1)×G个区间中的分布,获得一个统计直方图,该统计直方图即为内距离形状上下文描述子;所谓带方向距离划分是指以采样点pi的切线方向为零度角方向,将360度空间均匀划分成G个区间。(2.2.3) Calculate inner distance shape context descriptor: Use concentric circles with direction and distance division as a tool for calculating descriptors. The center of the concentric circles is at a certain contour sampling point p i , assuming that the angle is divided into G intervals, and Assuming that there are R concentric circles, the R concentric circles and G angle intervals are combined to form (R+1)×G intervals; then combine the inner distance and inner distance obtained by (2.2.1) and (2.2.2) Angle, determine the distribution of other points on the contour in the (R+1)×G intervals of the concentric circles divided by the directional distance with the point p i as the center, and obtain a statistical histogram, which is the inner distance Shape context descriptor; the so-called directional distance division means that the 360-degree space is evenly divided into G intervals with the tangent direction of the sampling point p i as the zero-degree angle direction. 3.根据权利要求1或2所述的检索相似性形状的方法,其特征在于,步骤(3.1)具体包括下述过程:3. The method for retrieving similarity shapes according to claim 1 or 2, wherein the step (3.1) specifically includes the following process: (3.1.1)分别计算序列{pi,i=1,...N,中的任意一个点pi与序列{qj,j=1,...N中的任意一个点qj之间的特征距离c(i,j),该距离定义为由(2.2)计算得到的点pi的统计直方图与点qj的统计直方图之间的距离,其数学定义如下:(3.1.1) Calculate the difference between any point p i in the sequence {p i , i=1,...N, and any point q j in the sequence {q j ,j=1,...N, respectively. The characteristic distance c(i,j) between is defined as the distance between the statistical histogram of point p i calculated by (2.2) and the statistical histogram of point q j , and its mathematical definition is as follows: cc (( ii ,, jj )) == 11 22 ΣΣ kk == 11 (( RR ++ 11 )) ×× GG [[ hh AA ,, ii (( kk )) -- hh BB ,, jj (( kk )) ]] 22 hh AA ,, ii (( kk )) ++ hh BB ,, jj (( kk )) 其中hA,i,hB,j为步骤(2.2.3)中定义的统计直方图,下标A和B表示hA,i(k)、hB,j(k)分别是形状A和形状B的统计直方图,c(i,j)表示点pi和点qi的特征距离;where h A, i , h B, j are the statistical histograms defined in step (2.2.3), subscripts A and B indicate that h A, i (k), h B, j (k) are shapes A and Statistical histogram of shape B, c(i,j) represents the feature distance between point p i and point q i ; 通过计算形状A上所有点与形状B上所有点的特征距离,获得N×N的特征距离矩阵{c(i,j),i=1,...,N,j=1,...,N}:By calculating the feature distances between all points on shape A and all points on shape B, an N×N feature distance matrix {c(i,j),i=1,...,N,j=1,... ,N}: CC == cc (( 1,11,1 )) cc (( 1,21,2 )) .. .. .. cc (( 11 ,, NN -- 11 )) cc (( 11 ,, NN )) cc (( 2,12,1 )) cc (( 2,22,2 )) .. .. .. cc (( 22 ,, NN -- 11 )) cc (( 22 ,, NN )) .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. cc (( NN -- 1,11,1 )) cc (( NN -- 1,21,2 )) .. .. .. cc (( NN -- 11 ,, NN -- 11 )) cc (( NN -- 11 ,, NN )) cc (( NN ,, 11 )) cc (( NN ,, 22 )) .. .. .. cc (( NN ,, NN -- 11 )) cc (( NN ,, NN )) (3.1.2)假设两个序列{pi,i=1,...,N}和{qj,j,j=1,...,N}在点p1和q1处对齐,运用动态规划方法,求得两个序列的不相似度,作为D1,其求解过程如下:(3.1.2) Suppose two sequences {p i ,i=1,...,N} and {q j ,j,j=1,...,N} are aligned at points p 1 and q 1 , Using the dynamic programming method, the degree of dissimilarity between the two sequences is obtained as D 1 , and the solution process is as follows: ①生成一个N×N的空矩阵M,称为动态规划矩阵;① Generate an N×N empty matrix M, which is called a dynamic programming matrix; ②初始化边际条件:② Initialize the marginal conditions: M(0,0)=0;M(0,0)=0; M(i,0)=γ×i,i=1,...,N;M(i,0)=γ×i, i=1,...,N; M(0,j)=γ×j,j=1,...,N;M(0,j)=γ×j,j=1,...,N; γ为设定的一个标量惩罚因子;γ is a set scalar penalty factor; ③按照从左到右、从上到下的顺序,依次计算动态规划矩阵M中每个元素的值S(i,j),i=1,...,N,j=1,...,N,计算公式如下:③ Calculate the value S(i,j) of each element in the dynamic programming matrix M in sequence from left to right and from top to bottom, i=1,...,N,j=1,... ,N, the calculation formula is as follows: Mm (( ii ,, jj )) == minmin Mm (( ii -- 11 ,, jj -- 11 )) ++ cc (( ii ,, jj )) Mm (( ii -- 11 ,, jj )) ++ γγ Mm (( ii ,, jj -- 11 )) ++ γγ 其中c(i,j)为点pi与点qj之间的特征距离;Where c(i,j) is the characteristic distance between point p i and point q j ; ④当动态规划矩阵中每个元素的值均计算完毕,则动态规划方法结束,两个序列的不相似度D1=M(N,N);④ When the value of each element in the dynamic programming matrix is calculated, the dynamic programming method ends, and the dissimilarity degree D 1 of the two sequences is D 1 =M(N,N); (3.1.3)重复(3.1.2)的过程,分别假设两个序列{pi}和{qi}在p2与q1处对齐,p3与q1处对齐,……,pN与q1处对齐,分别运用动态规划算法求得不相似度D2,D3,…,DN(3.1.3) Repeat the process of (3.1.2), assuming that two sequences {p i } and {q i } are aligned at p 2 and q 1 , p 3 and q 1 , ..., p N Align with q 1 , use the dynamic programming algorithm to obtain the degree of dissimilarity D 2 , D 3 ,..., D N ; (3.1.4)选取步骤(3.1.2)到(3.1.3)中求得的N个距离中最小的那个,作为形状A,B之间的不相似性度量值:(3.1.4) Select the smallest of the N distances obtained in steps (3.1.2) to (3.1.3) as the dissimilarity measure between shapes A and B: D(A,B)=min(Di),i=1,...,N。D(A,B)=min(D i ), i=1,...,N.
CN201110106315A 2011-04-27 2011-04-27 A method for retrieving similarity shapes Expired - Fee Related CN102200999B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110106315A CN102200999B (en) 2011-04-27 2011-04-27 A method for retrieving similarity shapes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110106315A CN102200999B (en) 2011-04-27 2011-04-27 A method for retrieving similarity shapes

Publications (2)

Publication Number Publication Date
CN102200999A CN102200999A (en) 2011-09-28
CN102200999B true CN102200999B (en) 2012-10-10

Family

ID=44661674

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110106315A Expired - Fee Related CN102200999B (en) 2011-04-27 2011-04-27 A method for retrieving similarity shapes

Country Status (1)

Country Link
CN (1) CN102200999B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11328171B2 (en) 2018-04-19 2022-05-10 Shenzhen Sensetime Technology Co., Ltd. Image retrieval method and apparatus

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102306202B (en) * 2011-09-30 2013-09-04 中国传媒大学 High-dimension vector rapid searching algorithm based on block distance
CN102521287A (en) * 2011-11-28 2012-06-27 上海交通大学 Expectation model-based image re-ranking method
US9239395B2 (en) 2012-03-31 2016-01-19 University Of Science And Technology Of China Method and system of determining earthquake parameters, earthquake search engine
CN103365916B (en) * 2012-03-31 2016-12-14 中国科学技术大学 Earthquake parameter estimates acquisition methods and system, seismic events search engine
WO2014070147A1 (en) * 2012-10-30 2014-05-08 Hewlett-Packard Development Company, L.P. Analyzing data with computer vision
CN103093461B (en) * 2013-01-14 2015-11-18 大连理工大学 A kind of shape matching method based on metric
US9305233B2 (en) 2013-09-12 2016-04-05 The Boeing Company Isotropic feature matching
CN104299226B (en) * 2014-09-22 2017-07-28 大冶市华兴玻璃有限公司 A kind of method of circular Bottle & Can profile similarity retrieval
CN104680132B (en) * 2015-01-30 2017-11-21 哈尔滨工程大学 A kind of sonar target recognition methods based on Shape context method
CN106682693A (en) * 2016-12-23 2017-05-17 浙江大学 A recognition method for overlapping images of plastic bottles
CN109426791B (en) * 2017-09-01 2022-09-16 深圳市金溢科技股份有限公司 Multi-site and multi-vehicle matching method, server and system
CN109685837B (en) * 2018-11-07 2024-03-22 中国矿业大学 Heterologous remote sensing image registration method based on feature structure similarity
CN113379777A (en) * 2021-05-26 2021-09-10 西安电子科技大学 Shape description and retrieval method based on minimum circumscribed rectangle vertical internal distance proportion

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1379364A (en) * 2001-03-29 2002-11-13 日本电气株式会社 Graph comparing device and graph comparing method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4709961B2 (en) * 1999-08-05 2011-06-29 シヴォリューティオン ベー. フェー. Auxiliary data detection in information signals

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1379364A (en) * 2001-03-29 2002-11-13 日本电气株式会社 Graph comparing device and graph comparing method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11328171B2 (en) 2018-04-19 2022-05-10 Shenzhen Sensetime Technology Co., Ltd. Image retrieval method and apparatus

Also Published As

Publication number Publication date
CN102200999A (en) 2011-09-28

Similar Documents

Publication Publication Date Title
CN102200999B (en) A method for retrieving similarity shapes
CN105844669B (en) A kind of video object method for real time tracking based on local Hash feature
Deng et al. Visual reranking through weakly supervised multi-graph learning
CN110188225B (en) Image retrieval method based on sequencing learning and multivariate loss
CN104915434B (en) A kind of multidimensional time-series sorting technique based on mahalanobis distance DTW
CN110852168A (en) Pedestrian re-recognition model construction method and device based on neural framework search
CN102004786B (en) Acceleration method in image retrieval system
CN107577990A (en) A Large-Scale Face Recognition Method Based on GPU Accelerated Retrieval
CN110851645A (en) A Similarity Preserving Image Retrieval Method Based on Deep Metric Learning
CN112150523B (en) Three-dimensional point cloud registration method with low overlapping rate
CN107346328A (en) A kind of cross-module state association learning method based on more granularity hierarchical networks
CN104217015B (en) Based on the hierarchy clustering method for sharing arest neighbors each other
US20070230791A1 (en) Robust indexing and retrieval of electronic ink
Cao et al. Similarity based leaf image retrieval using multiscale R-angle description
CN110781295B (en) Multi-label data feature selection method and device
CN105320764B (en) A 3D model retrieval method and retrieval device based on incremental slow feature
CN104615676A (en) A Method of Image Retrieval Based on Maximum Similarity Matching
CN110866134B (en) A Distribution Consistency Preserving Metric Learning Method for Image Retrieval
CN102254020A (en) Global K-Means Clustering Method Based on Feature Weight
CN107832335A (en) A kind of image search method based on context deep semantic information
CN107291895A (en) A kind of quick stratification document searching method
CN111143567A (en) Comment emotion analysis method based on improved neural network
CN104820840A (en) Nearest neighborhood hyper-spectral image classification method based on dictionary and band restructuring
CN109101567A (en) A kind of distributed text approximate KNN semantic search calculation method
CN107103206A (en) The DNA sequence dna cluster of local sensitivity Hash based on standard entropy

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20121010