CN106570475A - Purple clay teapot seal retrieval method - Google Patents
Purple clay teapot seal retrieval method Download PDFInfo
- Publication number
- CN106570475A CN106570475A CN201610955127.8A CN201610955127A CN106570475A CN 106570475 A CN106570475 A CN 106570475A CN 201610955127 A CN201610955127 A CN 201610955127A CN 106570475 A CN106570475 A CN 106570475A
- Authority
- CN
- China
- Prior art keywords
- image
- seal
- matching
- dark
- feature
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 44
- 239000004927 clay Substances 0.000 title description 5
- 230000004927 fusion Effects 0.000 claims abstract description 6
- 230000001788 irregular Effects 0.000 claims abstract description 5
- 238000004422 calculation algorithm Methods 0.000 claims description 16
- 230000006870 function Effects 0.000 claims description 14
- 238000005070 sampling Methods 0.000 claims description 8
- 238000001514 detection method Methods 0.000 claims description 6
- 238000012886 linear function Methods 0.000 claims description 3
- 238000010606 normalization Methods 0.000 claims description 2
- 206010008190 Cerebrovascular accident Diseases 0.000 claims 1
- 208000006011 Stroke Diseases 0.000 claims 1
- 125000002015 acyclic group Chemical group 0.000 claims 1
- 230000009466 transformation Effects 0.000 abstract description 9
- 230000008859 change Effects 0.000 abstract description 7
- 239000004576 sand Substances 0.000 abstract description 7
- PXFBZOLANLWPMH-UHFFFAOYSA-N 16-Epiaffinine Natural products C1C(C2=CC=CC=C2N2)=C2C(=O)CC2C(=CC)CN(C)C1C2CO PXFBZOLANLWPMH-UHFFFAOYSA-N 0.000 abstract description 5
- 238000005286 illumination Methods 0.000 abstract description 4
- 238000000844 transformation Methods 0.000 abstract description 3
- 238000010586 diagram Methods 0.000 description 6
- 238000000605 extraction Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 4
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000003909 pattern recognition Methods 0.000 description 2
- 238000007781 pre-processing Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000011218 segmentation Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000003708 edge detection Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 230000001629 suppression Effects 0.000 description 1
- 230000009897 systematic effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/10—Terrestrial scenes
-
- 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
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
- G06F18/2411—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on the proximity to a decision surface, e.g. support vector machines
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/46—Descriptors for shape, contour or point-related descriptors, e.g. scale invariant feature transform [SIFT] or bags of words [BoW]; Salient regional features
- G06V10/462—Salient features, e.g. scale invariant feature transforms [SIFT]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- Life Sciences & Earth Sciences (AREA)
- Multimedia (AREA)
- Probability & Statistics with Applications (AREA)
- Image Analysis (AREA)
Abstract
本发明公开了一种紫砂壶印章检索方法。首先对手机拍照得到的紫砂壶印章图像,进行裁剪、缩放,再通过调整图像的均值和均方差改变图像的亮度和对比度,得到规范的图像。在规范的图像中提取紫砂壶印章的边缘特征和形状区域特征,进行特征融合后,利用已训练好的SVM分类器,将印章粗划分为圆形、三角形、矩形、不规则形状四大类。抽取紫砂壶印章图像的SIFT特征,引入几何约束条件,采用改进的基于置信传播的匹配方法与模板库中图像匹配;同时利用聚类方法优化检索所需时间,完成印章检索。该发明对光照不均以及旋转、缩放、侧视等仿射变换,有良好的鲁棒性。
The invention discloses a search method for a purple sand teapot seal. Firstly, crop and zoom the Zisha teapot seal image obtained by taking pictures with the mobile phone, and then change the brightness and contrast of the image by adjusting the mean value and mean square error of the image to obtain a standardized image. Extract the edge features and shape region features of the purple sand pot seal from the standardized image, and after feature fusion, use the trained SVM classifier to roughly divide the seal into four categories: circle, triangle, rectangle, and irregular shape. Extract the SIFT feature of the Zisha teapot seal image, introduce geometric constraints, and use an improved matching method based on belief propagation to match the image in the template library; at the same time, use the clustering method to optimize the time required for retrieval to complete the seal retrieval. The invention has good robustness to uneven illumination and affine transformations such as rotation, scaling, and side view.
Description
技术领域technical field
本发明属于数字图像处理和模式识别技术领域,具体涉及一种紫砂壶印章检索方法。The invention belongs to the technical field of digital image processing and pattern recognition, and in particular relates to a search method for a purple sand teapot seal.
背景技术Background technique
印章的检索由于其字体的多样性,印文载体的不稳定性,目前紫砂壶印章的识别依然主要靠肉眼观察,通过比对印章的细节特征,重叠对照,拼接比较等人工方法,鉴定紫砂壶的制作者。近些年来,随着数字图像处理和模式识别技术的蓬勃发展,为计算机代替人工进行紫砂壶印章的检索提供了可靠的理论基础。Seal retrieval Due to the diversity of fonts and the instability of the printed carrier, the identification of Zisha teapot seals is still mainly based on visual observation. Through manual methods such as comparing the details of the seals, overlapping comparisons, and splicing comparisons, Zisha teapots can be identified. the producer. In recent years, with the vigorous development of digital image processing and pattern recognition technology, a reliable theoretical basis has been provided for computers to replace manual retrieval of purple sand pot seals.
2008年,倪琦等人提出了一种基于梯度分割和特征匹配的印章识别算法(倪琦,王新赛,李坚,等.基于梯度分割和特征匹配的印章识别算法研究[J].计算机工程与设计,2008,29(20):5400-5402.),首先通过图像直方图均衡化拉伸印章灰度与背景灰度差值,再利用灰度梯度边缘骤变原理粗捡出印章边缘,最后通过模板匹配精检出印章边缘,完成识别。该方法简单快捷,但受限于模板匹配的缺点,不具有旋转不变性和尺度不变性。In 2008, Ni Qi and others proposed a seal recognition algorithm based on gradient segmentation and feature matching (Ni Qi, Wang Xinsai, Li Jian, et al. Research on seal recognition algorithm based on gradient segmentation and feature matching[J].Computer Engineering and Design, 2008,29(20):5400-5402.), firstly stretch the difference between the gray level of the stamp and the gray level of the background through the equalization of the image histogram, and then use the principle of sudden change of the edge of the gray gradient to roughly pick out the edge of the stamp , and finally the edge of the stamp is detected through template matching to complete the recognition. This method is simple and fast, but it is limited by the shortcomings of template matching, and it does not have rotation invariance and scale invariance.
2010年,郎海涛等人提出了一种基于匹配特征点随机生成特征线的伪造印章识别方法(郎海涛,雷兰一菲.基于匹配特征点随机生成特征线的伪造印章识别方法:CN,CN101894260A[P].2010.),具体实施方法是提取待检测图像的特征点,构建数据库,包含了每个特征点位置以及其他描述符号的信息。基于匹配特征点随机生成可识别的待验印章与参考印章图像特征线;根据同一印章在不同环境下得到的印文,有图像信息一致和图像特征点分布相似的原则,判断待检测图像是否为伪造印章图像。该方法具有简单高效的特点,但受限于光照变换和缩放时,部分特征点的缺失可能导致正样本误判为伪造印章图像。In 2010, Lang Haitao and others proposed a method for identifying counterfeit seals based on randomly generated feature lines from matching feature points (Lang Haitao, Lei Lan Yifei. A method for identifying counterfeit seals based on randomly generated feature lines from matching feature points: CN, CN101894260A[P ].2010.), the specific implementation method is to extract the feature points of the image to be detected, and build a database, including the position of each feature point and other descriptor information. Based on the matching feature points, the recognizable image feature lines of the seal to be tested and the reference seal are randomly generated; according to the seals obtained from the same seal in different environments, there are principles of consistent image information and similar distribution of image feature points to determine whether the image to be detected is Forged stamp image. This method is simple and efficient, but limited by illumination transformation and scaling, the lack of some feature points may cause positive samples to be misjudged as fake seal images.
2007年,章毅等人提出了一种印章鉴别控制方法(章毅,吕建成,张权昉,等.印章鉴别系统及其控制方法:CN,CN 101008985A[P].2007.),首先用二值化、骨架提取、边框提取和印文提取四个操作步骤提取待识别印文。接下来在印文配准步骤中,先粗略配准,先将待识别印文与模版印文调整到大致相同的位置和方向,精细配准进一步将两幅印文调整到几乎相同的位置和方向;在印文鉴别步骤中,采用了多级识别策略及多特征分类融合决策方法对待识别印文和模版印文进行鉴别。该方法对完整印章图像能很好地实现鉴别控制。但当图像有缺失时,图像配准上的效果将急剧下降。In 2007, Zhang Yi and others proposed a seal identification control method (Zhang Yi, Lv Jiancheng, Zhang Quanfang, etc. Seal identification system and its control method: CN, CN 101008985A[P].2007.), first use binary The printed text to be recognized is extracted through four operation steps of transformation, skeleton extraction, frame extraction and printed text extraction. Next, in the stamp registration step, the rough registration is performed first, and the print to be recognized and the template print are adjusted to approximately the same position and direction, and the fine registration further adjusts the two prints to almost the same position and orientation. Direction; In the seal identification step, a multi-level identification strategy and a multi-feature classification fusion decision-making method are used to identify the seal to be identified and the template print. This method can well realize the identification control of the complete seal image. But when the image is missing, the effect on image registration will drop sharply.
通过对现有印章识别技术分析发现目前的很多方法:全局匹配方法,受限于图像匹配的瓶颈,不具有抗仿射变换的能力;由于紫砂壶印章字体的艺术性,汉字识别方法也不能良好地应用到印章检索上;目前,没有一种系统的框架用于紫砂壶印章的检索。Through the analysis of the existing seal recognition technology, it is found that there are many current methods: the global matching method is limited by the bottleneck of image matching, and does not have the ability to resist affine transformation; Applied to seal retrieval; at present, there is no systematic framework for the retrieval of Zisha teapot seals.
发明内容Contents of the invention
发明目的:为了克服现有技术中存在的不足,本发明提供一种紫砂壶印章检索方法,该方法能可靠迅速地完成紫砂壶印章的检索。Purpose of the invention: In order to overcome the deficiencies in the prior art, the present invention provides a search method for the seal of the purple clay pot, which can reliably and quickly complete the search for the seal of the purple clay pot.
技术方案:为实现上述目的,本发明采用的技术方案为:Technical scheme: in order to achieve the above object, the technical scheme adopted in the present invention is:
步骤1,对紫砂壶印章的拍摄图像进行预处理,得到检测区域的规范化图像;Step 1, preprocessing the photographed image of the purple clay teapot seal to obtain a normalized image of the detection area;
步骤2,对所述规范化图像进行亮度和对比度的调整,通过调整图像的均值和均方差,使图像的亮度和对比度分别固定在一个特定值;Step 2, adjusting the brightness and contrast of the standardized image, and fixing the brightness and contrast of the image at a specific value by adjusting the mean value and mean square error of the image;
步骤3,将图像中印章的形状初步划分;Step 3, initially dividing the shape of the seal in the image;
步骤4,对待检索图像抽取SIFT特征,形成128维SIFT描述子;并对模板图像和待检索图像使用改进的BP-SIFT算法进行特征匹配,通过计算匹配点的匹配率,判定姓名所属模板库中的类别,完成印章姓名鉴定。Step 4: Extract SIFT features from the image to be retrieved to form a 128-dimensional SIFT descriptor; and use the improved BP-SIFT algorithm to perform feature matching on the template image and the image to be retrieved, and determine the name in the template library by calculating the matching rate of the matching points category, complete the seal name identification.
进一步地,步骤1按照如下方法实现:将所述拍摄图像进行边缘检测和显著区域提取,得到印章部分;并进行缩放,使边缘保留至少5个像素空白后得到100*100大小的检测区域的规范化图像。Further, step 1 is implemented as follows: edge detection and salient area extraction are performed on the captured image to obtain the seal part; and scaling is performed to obtain a 100*100 size detection area normalization after leaving at least 5 pixels blank on the edge image.
进一步地,步骤2调整图像的具体方法为:Further, the specific method of adjusting the image in step 2 is:
步骤2-1,将图像的均值调整为0,g1=g-u1,在调整过程中,均方差不变;其中,g1为第一步得到的图像的像素值,g为原像素值,u1为原图像均值;Step 2-1, adjust the mean value of the image to 0, g 1 =gu 1 , during the adjustment process, the mean square error remains unchanged; where, g 1 is the pixel value of the image obtained in the first step, g is the original pixel value, u 1 is the mean value of the original image;
步骤2-2,将图像的均方差调整为d0,g2=g1*d0/d1,在调整过程中,均值不变,仍为0;其中,d0为新目标图像均方差,g2为第二步得到的图像的像素值,g1为第一步所得图像的像素值,d1为原图均方差;Step 2-2, adjust the mean square error of the image to d 0 , g 2 =g 1 *d 0 /d 1 , during the adjustment process, the mean value remains unchanged and is still 0; where, d 0 is the mean square error of the new target image , g 2 is the pixel value of the image obtained in the second step, g 1 is the pixel value of the image obtained in the first step, and d 1 is the mean square error of the original image;
步骤2-3,将图像的均值调整为u0,g3=g2+u0,其中,g3为目标图像像素值,g2为第二步所得图像的像素值,u0为目标图像均值。Step 2-3, adjust the mean value of the image to u 0 , g 3 =g 2 +u 0 , where g 3 is the pixel value of the target image, g 2 is the pixel value of the image obtained in the second step, and u 0 is the target image mean.
进一步地,步骤3中,待检索印章图像分为四大类:圆形印章图像、矩形印章图像、三角形印章图像、不规则印章图像。Further, in step 3, the stamp images to be retrieved are divided into four categories: circular stamp images, rectangular stamp images, triangular stamp images, and irregular stamp images.
进一步地,步骤3中对图像中印章的形状进行初步划分的具体方法为:Further, the specific method for preliminary division of the shape of the seal in the image in step 3 is:
步骤3-1,通过canny算子检测得到图像的边缘信息,在得到的边缘轮廓上间隔地进行采样,计算图像形心到边缘点的距离,作为边界描述子;Step 3-1, the edge information of the image is obtained by detecting the canny operator, sampling is performed at intervals on the obtained edge contour, and the distance from the centroid of the image to the edge point is calculated as the boundary descriptor;
步骤3-2,通过图像形心,求得最大外接圆;在此基础上采样得到目标的区域形状特征;Step 3-2, obtain the largest circumscribed circle through the centroid of the image; on this basis, obtain the regional shape characteristics of the target by sampling;
步骤3-3,归一化边缘特征和区域形状特征,线性融合特征后作为分类器输入;Step 3-3, normalize edge features and region shape features, linearly fuse features as classifier input;
步骤3-4,利用多分类中DAG法则,使用N·(N-1)/2个SVM分类器,分类器形成一个有向无环图,当到来一个样本时,自上而下地将样本精细划分,直到达到叶子节点,将图像的形状进行初步划分,其中,N为划分的类别数。Step 3-4, use the DAG rule in multi-classification, use N (N-1)/2 SVM classifiers, the classifier forms a directed acyclic graph, when a sample comes, refine the sample from top to bottom Divide until the leaf node is reached, and initially divide the shape of the image, where N is the number of divided categories.
进一步地,步骤3中的采样间隔为其中,L为轮廓长度。Further, the sampling interval in step 3 is Among them, L is the profile length.
进一步地,步骤3中的SVM分类器使用RBF核函数,定义为空间中点x到y点的欧氏距离的单调函数,y为核函数的中心:Further, the SVM classifier in step 3 uses the RBF kernel function, which is defined as a monotone function of the Euclidean distance from point x to point y in the space, and y is the center of the kernel function:
其中,空间中RBF核SVM性能的影响因素为惩罚参数C和核参数σ2;使用网格搜索法选择所述参数:对分别取N和M个值,其中C的范围设置为 范围设置为步距为0.1;组合所有的N×M个值计算SVM推广能力,将其中使得SVM推广性能最优的组合作为选择参数。Wherein, the influencing factors of RBF kernel SVM performance in space are the penalty parameter C and the kernel parameter σ 2 ; use the grid search method to select the parameters: for Take N and M values respectively, where the range of C is set to scope set to The step distance is 0.1; all N×M values are combined to calculate the SVM generalization ability, and the combination that makes the SVM generalization performance optimal is used as the selection parameter.
进一步地,步骤4中改进的BP-SIFT算法包括引入两点空间距离比值约束,临近点搜索前的聚类以减少时间复杂度。Furthermore, the improved BP-SIFT algorithm in step 4 includes the introduction of two-point spatial distance ratio constraints, and the clustering of adjacent points before searching to reduce time complexity.
进一步地,步骤4中改进的BP-SIFT算法的具体方法为:Further, the specific method of the improved BP-SIFT algorithm in step 4 is:
步骤4-1,利用经典SIFT算法对待检索图像抽取SIFT特征,形成128维SIFT特征描述子;Step 4-1, using the classic SIFT algorithm to extract SIFT features from the image to be retrieved to form a 128-dimensional SIFT feature descriptor;
步骤4-2,使用KMEANS聚类将模板图像中所有特征点根据坐标位置聚为C类;对于模板图像中的所有特征点,计算其属于哪类,并在该类中找出最近K个临近点;Step 4-2, use KMEANS clustering to cluster all feature points in the template image into C categories according to their coordinate positions; for all feature points in the template image, calculate which category they belong to, and find the nearest K neighbors in this category point;
步骤4-3,初始化所有的置信度为一个常数,设n=1;对模板图像中当前特征点和待检索图像中的当前特征点的组合对,迭代地更新其匹配置信度;Step 4-3, initialize all confidence levels as a constant, set n=1; for the combination of the current feature point in the template image and the current feature point in the image to be retrieved, update its matching confidence level iteratively;
步骤4-4,通过特征点与其K个临近点的几何距离约束和两幅图像特征点之间的欧氏距离的线性函数组合估计计算匹配概率;Step 4-4, estimate and calculate the matching probability by combining the geometric distance constraints of the feature point and its K adjacent points and the linear function combination of the Euclidean distance between the feature points of the two images;
步骤4-5,n←n+1,然后转至第(4-4)步,直到匹配概率不再改变或迭代次数n达到最大;Step 4-5, n←n+1, then go to step (4-4), until the matching probability does not change or the number of iterations n reaches the maximum;
步骤4-6,如果匹配度小于预设阈值,则该两点匹配成功;否则不是匹配对。In steps 4-6, if the matching degree is less than the preset threshold, the two points are successfully matched; otherwise, they are not a matching pair.
步骤4-7,对所有模板图像重复进行以上步骤,计算待检索图像与各个模板图像的匹配率,归为匹配度最高的一类。Steps 4-7, repeat the above steps for all template images, calculate the matching rate between the image to be retrieved and each template image, and classify them into the category with the highest matching degree.
有益效果:本发明提供的紫砂壶印章检索方法,与目前存在技术相比,具有以下有益效果:检索精度更高,结合了机器学习和图像配准技术,在特征匹配前初步划分大类,能够缩减后续与模板匹配的时间,筛选出一些误检索;空间信息和局部信息结合,具有良好的抗旋转、缩放等仿射变换的能力;搜索临近点前使用聚类,避免了全局的大规模搜索,大大缩减了检索所需时间。Beneficial effects: Compared with the current existing technology, the Zisha teapot seal retrieval method provided by the present invention has the following beneficial effects: the retrieval accuracy is higher, and machine learning and image registration technology are combined to preliminarily divide into categories before feature matching, which can Reduce the time for subsequent template matching and screen out some misretrievals; the combination of spatial information and local information has a good ability to resist affine transformations such as rotation and scaling; use clustering before searching for adjacent points to avoid large-scale global searches , greatly reducing the retrieval time.
附图说明Description of drawings
图1是本发明的紫砂壶印章检索流程图。Fig. 1 is the search flowchart of purple sand teapot seal of the present invention.
图2(a)、图2(b)、图2(c)是调整灰度图像均值和均方差的结果示意图。Figure 2(a), Figure 2(b), and Figure 2(c) are schematic diagrams of the results of adjusting the mean and mean square error of grayscale images.
图3(a)、图3(b)、图3(c)是提取边缘特征示意图。Figure 3(a), Figure 3(b), and Figure 3(c) are schematic diagrams of extracting edge features.
图4(a)、图4(b)是检索成功的示意图。黑色线段连接待匹配图像与模板图像的两个匹配点。其中4(a)包含了旋转变换。Figure 4(a) and Figure 4(b) are schematic diagrams of successful retrieval. The black line segment connects the two matching points of the image to be matched and the template image. Among them, 4(a) contains the rotation transformation.
图5(a)、图5(b)是在模板图像中未检索到该类印章的示意图。Fig. 5(a) and Fig. 5(b) are schematic diagrams that such stamps are not retrieved in the template image.
具体实施方式detailed description
下面结合附图对本发明作更进一步的说明。The present invention will be further described below in conjunction with the accompanying drawings.
本发明是一种紫砂壶印章检索方法。首先对手机拍照得到的紫砂壶印章图像,进行裁剪、缩放,再通过调整图像的均值和均方差改变图像的亮度和对比度,得到规范的图像。在规范的图像中提取紫砂壶印章的边缘特征和形状区域特征,进行特征融合后,利用已训练好的SVM分类器,将印章粗划分为圆形、三角形、矩形、不规则形状四大类。抽取紫砂壶印章图像的SIFT特征,引入几何约束条件,采用改进的基于置信传播的匹配方法与模板库中图像匹配;同时利用聚类方法优化检索所需时间,完成印章检索。该发明对光照不均以及旋转、缩放、侧视等仿射变换,有良好的鲁棒性。The invention relates to a search method for a purple sand teapot seal. Firstly, crop and zoom the Zisha teapot seal image obtained by taking pictures with the mobile phone, and then change the brightness and contrast of the image by adjusting the mean value and mean square error of the image to obtain a standardized image. Extract the edge features and shape region features of the purple sand pot seal from the standardized image, and after feature fusion, use the trained SVM classifier to roughly divide the seal into four categories: circle, triangle, rectangle, and irregular shape. Extract the SIFT feature of the Zisha teapot seal image, introduce geometric constraints, and use an improved matching method based on belief propagation to match the image in the template library; at the same time, use the clustering method to optimize the time required for retrieval to complete the seal retrieval. The invention has good robustness to uneven illumination and affine transformations such as rotation, scaling, and side view.
本发明将从拍摄或网络得到的紫砂壶印章图像规范化处理后,先进行调整均值均方差预处理。提取边缘特征,提取区域形状特征,融合后作为SVM分类器输入,将印章图像根据几何形状初划分为四大类。再提取SIFT特征,利用改进的BP-SIFT算法与模板图像配准,完成印章检索。流程如图1所示。In the present invention, after standardizing the image of the purple clay teapot seal obtained from photography or the Internet, the mean value and mean square error are adjusted for preprocessing. Extract the edge feature, extract the regional shape feature, and use it as the input of the SVM classifier after fusion, and divide the seal image into four categories according to the geometric shape. Then extract the SIFT feature, and use the improved BP-SIFT algorithm to register with the template image to complete the seal retrieval. The process is shown in Figure 1.
步骤1,对拍摄或网络来源获得的图像进行规范化处理,包括有效区域提取,边缘裁剪和图像大小调整。Step 1, normalize the images obtained from shooting or network sources, including effective area extraction, edge cropping and image resizing.
步骤2,对规范化的图像进行亮度和对比度的调整,通过调整图像的均值和均方差,能使图像的亮度和对比度分别固定在一个特定值,增强印章图像对光照影响的鲁棒性。如图2(a)、图2(b)、图2(c)所示。Step 2, adjust the brightness and contrast of the normalized image. By adjusting the mean value and mean square error of the image, the brightness and contrast of the image can be fixed at a specific value, and the robustness of the stamp image to the influence of light can be enhanced. As shown in Figure 2(a), Figure 2(b), and Figure 2(c).
(1)将图像的均值调整为0。g1=g-u1。在调整过程中,均方差不变。其中,g1为第一步得到的图像的像素值,g为原像素值,u1为原图像均值。(1) Adjust the mean value of the image to 0. g 1 =gu 1 . During the adjustment process, the mean square error does not change. Among them, g 1 is the pixel value of the image obtained in the first step, g is the original pixel value, and u 1 is the mean value of the original image.
(2)将图像的均方差调整为d0,g2=g1*d0/d1。在调整过程中,均值不变,仍为0。其中,d0为新目标图像均方差,g2为第二步得到的图像的像素值,g1为第一步所得图像的像素值,d1为原图均方差。(2) Adjust the mean square error of the image to d 0 , g 2 =g 1 *d 0 /d 1 . During the adjustment process, the mean does not change and remains at 0. Among them, d 0 is the mean square error of the new target image, g 2 is the pixel value of the image obtained in the second step, g 1 is the pixel value of the image obtained in the first step, and d 1 is the mean square error of the original image.
(3)将图像的均值调整为u0。g3=g2+u0。本发明取d0=50,u0=127。其中,g3为目标图像像素值,g2为第二步所得图像的像素值,u0为目标图像均值。(3) Adjust the mean value of the image to u 0 . g 3 =g 2 +u 0 . In the present invention, d 0 =50, u 0 =127. Among them, g 3 is the pixel value of the target image, g 2 is the pixel value of the image obtained in the second step, and u 0 is the mean value of the target image.
步骤3,对预处理后的图像提取边缘特征和区域形状特征,输入SVM分类器,根据对印章的先验知识完成印章形状初分类。如图3(a)、图3(b)、图3(c)所示。Step 3: Extract edge features and region shape features from the preprocessed image, input them into the SVM classifier, and complete the initial classification of the seal shape based on the prior knowledge of the seal. As shown in Figure 3(a), Figure 3(b), and Figure 3(c).
(3-1)通过canny算子检测得到图像的边缘信息,接着,在得到的边缘轮廓上间隔地进行采样,共采样20次,计算图像形心到边缘点的距离,作为边界描述子f1=[b1 b2 ...b20]。包括四个步骤:首先,求高斯滤波器和图像的卷积,然后,用一阶偏导的有限差分计算梯度的方向和幅值;接着,对梯度幅值进行非极大值抑制(只保留幅值局部变化最大的点);最后,使用双阈值算法减少假边缘段数量。(3-1) The edge information of the image is obtained by detecting the canny operator, and then, the obtained edge contour is sampled at intervals, a total of 20 samples are taken, and the distance from the image centroid to the edge point is calculated as the boundary descriptor f 1 =[b 1 b 2 . . . b 20 ]. It includes four steps: first, find the convolution of the Gaussian filter and the image, then use the finite difference of the first-order partial derivative to calculate the direction and magnitude of the gradient; then, perform non-maximum suppression on the gradient magnitude (only keep point with the largest local variation in magnitude); finally, a double-thresholding algorithm is used to reduce the number of false edge segments.
(3-2)通寻找二值化图像的形心,求得最大外接圆。在此基础上采样得到目标的区域形状特征。首先利用公式(3-2) Find the maximum circumscribed circle by finding the centroid of the binarized image. On this basis, the regional shape features of the target are obtained by sampling. First use the formula
求得图像形心。其中,(xc,yc)为图像形心坐标,m为采集点个数。Find the centroid of the image. Among them, (x c , y c ) is the coordinates of the centroid of the image, and m is the number of collection points.
以形心为圆心,以距离形心最大的像素点距离为半径,形成目标的最大外接圆。将半径等距离划分为5份,形成5个同心圆。从0到360度开始旋转,间隔为地进行采样,记录旋转轴与同心圆的交点处像素灰度值,形成大小为5×20的形状描述子其中L为圆周长。With the centroid as the center and the pixel distance from the centroid as the radius, the maximum circumscribed circle of the target is formed. Divide the radius into 5 equal distances to form 5 concentric circles. Rotate from 0 to 360 degrees with an interval of sampling, record the gray value of the pixel at the intersection of the rotation axis and the concentric circle, and form a shape descriptor with a size of 5×20 where L is the circumference of the circle.
(3-3)归一化边缘特征和区域形状特征,线性融合特征后作为分类器输入。(3-3) Normalize the edge features and region shape features, and linearly fuse the features as the input of the classifier.
对边缘特征和形状矩阵特征归一化融合:finew=(fi-fmin)/(fmax-fmin)。Normalized fusion of edge features and shape matrix features: f inew =(f i -f min )/(f max -f min ).
其中,finew为第i个归一化后的特征,fmin和fmax分别为最大和最小特征量。形成最终6×20维的特征描述子 Among them, f inew is the i-th normalized feature, and f min and f max are the maximum and minimum feature quantities, respectively. Form the final 6×20-dimensional feature descriptor
(3-4)利用多分类中DAG法则,用N·(N-1)/2个,本发明N=4,即6个SVM分类器,分类器形成一个有向无环图,当到来一个样本时,自上而下地将样本逐渐精细划分,直到达到叶子节点,将图像最终分为矩形,圆形,三角形,不规则形状四大类。(3-4) Utilize the DAG rule in multi-classification, with N (N-1)/2, the present invention N=4, namely 6 SVM classifiers, classifier forms a directed acyclic graph, when coming a When sampling, the sample is gradually finely divided from top to bottom until it reaches the leaf node, and the image is finally divided into four categories: rectangle, circle, triangle, and irregular shape.
选取基于SVM分类器,使用RBF核函数,定义为空间中点x到y点的欧氏距离的单调函数,y为核函数的中心。Select a classifier based on SVM and use the RBF kernel function, which is defined as a monotone function of the Euclidean distance from point x to point y in the space, and y is the center of the kernel function.
它能将样本映射到一个高维空间,而线性核函数是RBF核函数的一个特例,因而不用再考虑线性核函数。而且RBF核函数参数比多项式核函数少,计算复杂度低。It can map samples to a high-dimensional space, and the linear kernel function is a special case of the RBF kernel function, so there is no need to consider the linear kernel function. Moreover, the RBF kernel function has fewer parameters than the polynomial kernel function, and the calculation complexity is low.
其中,空间中RBF核SVM性能的影响因素为惩罚参数C和核参数σ2;使用网格搜索法选择所述参数:对分别取N和M个值,其中C的范围设置为 范围设置为[2-10,23],步距为0.1。组合所有的N×M个值计算SVM推广能力,将其中使得SVM推广性能最优的组合作为选择参数。Wherein, the influencing factors of RBF kernel SVM performance in space are the penalty parameter C and the kernel parameter σ 2 ; use the grid search method to select the parameters: for Take N and M values respectively, where the range of C is set to The range is set to [2 -10 ,2 3 ] with a step size of 0.1. Combining all N×M values to calculate the SVM generalization ability, the combination that makes the SVM generalization performance optimal is used as the selection parameter.
步骤4,对待检索图像抽取SIFT特征,形成128维SIFT描述子。对模板图像和待检索图像使用改进的BP-SIFT算法进行特征匹配。通过计算匹配点的匹配率,判定姓名所属模板库中的类别,完成印章姓名鉴定。BP-SIFT算法的思想如下:由于传统SIFT匹配缺少空间信息约束,BP-SIFT通过特征点与其临近点的空间几何距离分别在两幅图像中的差值来判断几何距离的相似度。提高了传统SIFT匹配的利用BP-SIFT算法计算特征点之间的匹配度。但不足之处有两点:一,在图像有缩放、错切等仿射变换下,两幅图像中的对应两点距离差值并不相等;二,寻找临近点的时间复杂度太大。本发明采用了更一般的准则,利用距离比值作为新的几何约束条件;在全局查找临近点之前使用聚类,大大缩减了需要搜索的时间。Step 4: Extract SIFT features from the image to be retrieved to form a 128-dimensional SIFT descriptor. Use the improved BP-SIFT algorithm to match the template image and the image to be retrieved. By calculating the matching rate of the matching points, the category in the template library to which the name belongs is determined, and the identification of the seal name is completed. The idea of the BP-SIFT algorithm is as follows: due to the lack of spatial information constraints in traditional SIFT matching, BP-SIFT judges the similarity of geometric distances by the difference between the spatial geometric distances of feature points and their adjacent points in the two images. Improve the traditional SIFT matching using BP-SIFT algorithm to calculate the matching degree between feature points. But there are two shortcomings: first, under the affine transformation such as zooming and miscutting of the image, the distance difference between the corresponding two points in the two images is not equal; second, the time complexity of finding the adjacent point is too large. The present invention adopts a more general criterion, uses the distance ratio as a new geometric constraint condition; uses clustering before searching for adjacent points globally, and greatly reduces the time required for searching.
(1)利用经典SIFT算法对待检索图像抽取SIFT特征,形成128维SIFT特征描述子;(1) Use the classic SIFT algorithm to extract SIFT features from the image to be retrieved to form a 128-dimensional SIFT feature descriptor;
(2)使用KMEANS聚类将模板图像中所有特征点根据坐标位置聚为C类;对于模板图像中的所有特征点,计算其属于哪类,并在该类中找出最近K个临近点;(2) Use KMEANS clustering to cluster all feature points in the template image into C classes according to their coordinate positions; for all feature points in the template image, calculate which class they belong to, and find the nearest K adjacent points in this class;
(3)初始化所有的置信度为一个常数,设n=1。对模板图像中当前特征点和待检索图像中的当前特征点的组合对,迭代地更新其匹配置信度;(3) Initialize all confidence levels as a constant, and set n=1. For the combined pair of the current feature point in the template image and the current feature point in the image to be retrieved, iteratively update its matching confidence;
(4)通过特征点与其K个临近点的几何距离约束和两幅图像特征点之间的欧氏距离的线性函数组合估计计算匹配概率;(4) estimate and calculate the matching probability through the linear function combination estimation of the geometric distance constraint of the feature point and its K adjacent points and the Euclidean distance between the feature points of the two images;
(5)n←n+1,然后转至第(4)步,直到匹配概率不再改变或迭代次数n达到最大;(5) n←n+1, then go to step (4), until the matching probability does not change or the number of iterations n reaches the maximum;
(6)如果匹配度小于预设阈值,则该两点匹配成功;否则不是匹配对。如图4(a)、图4(b)所示,检索成功的示意图,黑色线段连接待匹配图像与模板图像的两个匹配点,其中4(a)包含了旋转变换。图5(a)、图5(b)是检索不成功的结果示意图。(6) If the matching degree is less than the preset threshold, the two points match successfully; otherwise, they are not a matching pair. As shown in Figure 4(a) and Figure 4(b), the schematic diagram of successful retrieval, the black line segment connects the two matching points between the image to be matched and the template image, and 4(a) contains the rotation transformation. Figure 5(a) and Figure 5(b) are schematic diagrams of unsuccessful retrieval results.
(7)对所有模板图像重复进行以上步骤,计算待检索图像与各个模板图像的匹配率。归为匹配度最高的一类。(7) Repeat the above steps for all template images, and calculate the matching rate between the image to be retrieved and each template image. classified into the category with the highest matching degree.
综上所述,本发明结合SVM形状粗分类与特征点匹配实现紫砂壶印章检索的方案:To sum up, the present invention combines SVM shape rough classification and feature point matching to realize the scheme of Zisha teapot seal retrieval:
(1)对图像做调整均值和均方差处理,能将图像亮度和对比度固定在一个特定值,使图像有良好的抗光照干扰能力。(1) Adjusting the mean value and mean square deviation of the image can fix the brightness and contrast of the image at a specific value, so that the image has a good ability to resist light interference.
(2)采用SVM对印章形状特征粗分类,能初步划分待检索图像的大类,缩减后续需要匹配的模板图像的数据量,提高检索时间。(2) Using SVM to roughly classify the shape features of seals can preliminarily divide the categories of images to be retrieved, reduce the amount of template image data that needs to be matched later, and improve the retrieval time.
(3)在匹配时利用图像特征点与其周围临近点的几何信息,既保留了局部特征,也结合了全局特征,提高了检索的精确度。(3) The geometric information of image feature points and their surrounding adjacent points is used in matching, which not only preserves local features, but also combines global features, which improves the accuracy of retrieval.
(4)对特征点周围临近点进行聚类,避免了全局搜索,在精度影响很小的情况下,提高了检索的时间。(4) Clustering the adjacent points around the feature points avoids the global search, and improves the retrieval time with little impact on the accuracy.
通过500张样本实验,本发明对印章形状的分类准确率达到95.6%以上。对工艺师的匹配度达到91.2%以上。与传统的用字符识别或图像配准检索印章的方法相比,对光照、旋转、缩放等变化的鲁棒性更高。Through the experiment of 500 samples, the classification accuracy rate of the present invention to the shape of the seal reaches more than 95.6%. The matching degree for craftsmen is over 91.2%. It is more robust to changes in illumination, rotation, scaling, etc. than traditional methods of retrieving stamps with character recognition or image registration.
以上所述仅是本发明的优选实施方式,应当指出:对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above is only a preferred embodiment of the present invention, it should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present invention, some improvements and modifications can also be made, and these improvements and modifications are also possible. It should be regarded as the protection scope of the present invention.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610955127.8A CN106570475B (en) | 2016-11-03 | 2016-11-03 | A kind of dark-red enameled pottery seal search method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610955127.8A CN106570475B (en) | 2016-11-03 | 2016-11-03 | A kind of dark-red enameled pottery seal search method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106570475A true CN106570475A (en) | 2017-04-19 |
CN106570475B CN106570475B (en) | 2019-08-02 |
Family
ID=58535449
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610955127.8A Active CN106570475B (en) | 2016-11-03 | 2016-11-03 | A kind of dark-red enameled pottery seal search method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106570475B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108536827A (en) * | 2018-04-11 | 2018-09-14 | 南京理工大学 | A kind of similar frequency spectrum image searching method |
CN109101979A (en) * | 2018-07-11 | 2018-12-28 | 中国艺术科技研究所 | A kind of dark-red enameled pottery bottom inscriptions distinguishing method between true and false |
CN109767436A (en) * | 2019-01-07 | 2019-05-17 | 深圳市创业印章实业有限公司 | A kind of method and device that the seal true and false identifies |
CN112016563A (en) * | 2020-10-17 | 2020-12-01 | 深圳神目信息技术有限公司 | Method for identifying authenticity of circular seal |
CN113255686A (en) * | 2021-07-15 | 2021-08-13 | 恒生电子股份有限公司 | Method and device for identifying seal in image, processing equipment and storage medium |
CN113361547A (en) * | 2021-06-30 | 2021-09-07 | 深圳证券信息有限公司 | Signature identification method, device, equipment and readable storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101576958A (en) * | 2009-06-15 | 2009-11-11 | 西安交通大学 | Extraction method of rectangle seal graphics with border based on form feature |
KR101382163B1 (en) * | 2013-03-14 | 2014-04-07 | 국방과학연구소 | Ground target classification method, and ground target classification apparatus using the same |
US20160012317A1 (en) * | 2014-07-09 | 2016-01-14 | Ditto Labs, Inc. | Systems, methods, and devices for image matching and object recognition in images using template image classifiers |
-
2016
- 2016-11-03 CN CN201610955127.8A patent/CN106570475B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101576958A (en) * | 2009-06-15 | 2009-11-11 | 西安交通大学 | Extraction method of rectangle seal graphics with border based on form feature |
KR101382163B1 (en) * | 2013-03-14 | 2014-04-07 | 국방과학연구소 | Ground target classification method, and ground target classification apparatus using the same |
US20160012317A1 (en) * | 2014-07-09 | 2016-01-14 | Ditto Labs, Inc. | Systems, methods, and devices for image matching and object recognition in images using template image classifiers |
Non-Patent Citations (3)
Title |
---|
徐华: "印鉴识别算法的研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
李灵杰 等: "一种面向交通场景的快速图像增强算法", 《计算机与现代化》 * |
熊琰铖 等: "基于几何信息的特征匹配改进算法", 《小型微型计算机系统》 * |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108536827A (en) * | 2018-04-11 | 2018-09-14 | 南京理工大学 | A kind of similar frequency spectrum image searching method |
CN108536827B (en) * | 2018-04-11 | 2021-09-03 | 南京理工大学 | Similar spectrum picture searching method |
CN109101979A (en) * | 2018-07-11 | 2018-12-28 | 中国艺术科技研究所 | A kind of dark-red enameled pottery bottom inscriptions distinguishing method between true and false |
CN109767436A (en) * | 2019-01-07 | 2019-05-17 | 深圳市创业印章实业有限公司 | A kind of method and device that the seal true and false identifies |
CN112016563A (en) * | 2020-10-17 | 2020-12-01 | 深圳神目信息技术有限公司 | Method for identifying authenticity of circular seal |
CN112016563B (en) * | 2020-10-17 | 2021-07-13 | 深圳神目信息技术有限公司 | Method for identifying authenticity of circular seal |
CN113361547A (en) * | 2021-06-30 | 2021-09-07 | 深圳证券信息有限公司 | Signature identification method, device, equipment and readable storage medium |
CN113255686A (en) * | 2021-07-15 | 2021-08-13 | 恒生电子股份有限公司 | Method and device for identifying seal in image, processing equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN106570475B (en) | 2019-08-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112686812B (en) | Bank card inclination correction detection method and device, readable storage medium and terminal | |
CN106570475B (en) | A kind of dark-red enameled pottery seal search method | |
Jiao et al. | A configurable method for multi-style license plate recognition | |
CN107103317A (en) | Fuzzy license plate image recognition algorithm based on image co-registration and blind deconvolution | |
CN112016547A (en) | Image character recognition method, system and medium based on deep learning | |
CN110298376B (en) | An Image Classification Method of Bank Notes Based on Improved B-CNN | |
CN101957919B (en) | Character recognition method based on image local feature retrieval | |
CN107633226B (en) | Human body motion tracking feature processing method | |
CN104778470B (en) | Text detection based on component tree and Hough forest and recognition methods | |
CN102147858B (en) | License plate character identification method | |
CN109271991A (en) | A kind of detection method of license plate based on deep learning | |
Zhang et al. | Road recognition from remote sensing imagery using incremental learning | |
CN106529532A (en) | License plate identification system based on integral feature channels and gray projection | |
CN108629286B (en) | Remote sensing airport target detection method based on subjective perception significance model | |
CN108960055B (en) | Lane line detection method based on local line segment mode characteristics | |
CN101398894A (en) | Automobile license plate automatic recognition method and implementing device thereof | |
CN106709530A (en) | License plate recognition method based on video | |
CN102799879A (en) | Method for identifying multi-language multi-font characters from natural scene image | |
Li et al. | A complex junction recognition method based on GoogLeNet model | |
Peng et al. | Recognition of low-resolution logos in vehicle images based on statistical random sparse distribution | |
CN108681735A (en) | Optical character recognition method based on convolutional neural networks deep learning model | |
CN108509950B (en) | Railway contact net support number plate detection and identification method based on probability feature weighted fusion | |
CN106529461A (en) | Vehicle model identifying algorithm based on integral characteristic channel and SVM training device | |
CN111738055A (en) | Multi-category text detection system and bill form detection method based on the system | |
CN116503622A (en) | Data acquisition and reading method based on computer vision image |
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 |