[go: up one dir, main page]

CN1588431A - Character extracting method from complecate background color image based on run-length adjacent map - Google Patents

Character extracting method from complecate background color image based on run-length adjacent map Download PDF

Info

Publication number
CN1588431A
CN1588431A CN 200410062261 CN200410062261A CN1588431A CN 1588431 A CN1588431 A CN 1588431A CN 200410062261 CN200410062261 CN 200410062261 CN 200410062261 A CN200410062261 A CN 200410062261A CN 1588431 A CN1588431 A CN 1588431A
Authority
CN
China
Prior art keywords
color
image
connected domain
width
distance
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN 200410062261
Other languages
Chinese (zh)
Other versions
CN1312625C (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.)
Tsinghua University
Original Assignee
Tsinghua University
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 Tsinghua University filed Critical Tsinghua University
Priority to CNB2004100622612A priority Critical patent/CN1312625C/en
Publication of CN1588431A publication Critical patent/CN1588431A/en
Application granted granted Critical
Publication of CN1312625C publication Critical patent/CN1312625C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

基于游程邻接图的复杂背景彩色图像中字符提取方法,属于彩色图像文字识别预处理中的文字字符提取领域。在得到数字彩色图像之后,首先使用CRAG(color run-length adjacency graph)区域生长算法得到图像的所有彩色连通域,再通过对这些连通域的颜色平均值进行颜色聚类,得到若干个颜色中心,以此颜色中心形成不同的颜色层面,然后将符合连通域判别规则的彩色连通域分到若干个颜色层面上。最后通过特征分析和大小一致性判据从颜色层面中挑选出文字字符图像层面,获得在文字图像层面的字符图像。该算法解决了彩色文字字符笔画图像渐变的字符图像提取问题,并具有较高的提取速度,具有较高的提取准确率,同时保留了文字和背景图像的原始色彩,便于将来的图像恢复。

The invention discloses a method for extracting characters from complex background color images based on run-length adjacency graphs, belonging to the field of character extraction in color image character recognition preprocessing. After obtaining the digital color image, first use the CRAG (color run-length adjacency graph) region growing algorithm to obtain all the color connected domains of the image, and then perform color clustering on the color averages of these connected domains to obtain several color centers, Different color levels are formed based on the color center, and then the color connected domains that meet the connected domain discrimination rules are divided into several color levels. Finally, the text character image level is selected from the color level through feature analysis and size consistency criterion, and the character image at the text image level is obtained. This algorithm solves the character image extraction problem of color text character stroke image gradient, and has a high extraction speed and high extraction accuracy, while retaining the original color of the text and background image, which is convenient for future image restoration.

Description

基于游程邻接图的复杂背景彩色图像中字符提取方法Character Extraction Method in Color Image with Complex Background Based on Run-length Adjacency Graph

技术领域technical field

基于游程邻接图的复杂背景彩色图像中字符提取方法既属于图像分割领域,又属于文字识别的预处理领域。The method of extracting characters from complex background color images based on run-length adjacency graph belongs to the field of image segmentation and the preprocessing field of character recognition.

背景技术Background technique

从具有复杂彩色图像中提取文字字符,已经成为彩色印刷体文档识别系统中的既困难又关键的步骤。在彩色印刷文本图像中和照片图像中往往存在着大量的文字,这些文字符包含了很多有用的信息。为了提取这些有用信息,首先需要从复杂的彩色图像中自动而精确的提取这些有用的字符图像,才能予以识别处理。目前流行的OCR系统尚不能解决这种在复杂彩色图像中文字的提取问题。Extracting text characters from complex color images has become a difficult and critical step in color printed document recognition systems. There are often a large number of texts in color printed text images and photo images, and these text characters contain a lot of useful information. In order to extract these useful information, it is necessary to automatically and accurately extract these useful character images from complex color images before they can be recognized and processed. The current popular OCR system cannot solve the problem of extracting characters in complex color images.

彩色文档中文字字符的提取方法大致可以分为两类:第一类是不考虑彩色印刷文档中特有的彩色信息,而直接将其扫描转为灰度图像,后进行二值化分割。这一类方法丢失了文档图像的彩色信息,已经不适用于从复杂的彩色图像中提取文字字符前景图像。第二类方法是先利用颜色信息得到图像的连通域,而后分析得到字符层面。由于这一类方法较之第一类更多地考虑了彩色印刷文档图像的颜色信息,所以在处理具有复杂背景的彩色文本图像时具有明显的优越性,因而这一类方法已经逐渐成为现在研究的热点。The extraction methods of text characters in color documents can be roughly divided into two categories: the first category does not consider the unique color information in color printed documents, but directly scans them into grayscale images, and then performs binary segmentation. This type of method loses the color information of the document image, and is no longer suitable for extracting the foreground image of text characters from complex color images. The second type of method is to use the color information to obtain the connected domain of the image, and then analyze to obtain the character level. Since this type of method considers the color information of color printed document images more than the first type, it has obvious advantages when dealing with color text images with complex backgrounds, so this type of method has gradually become the current research hotspots.

目前,在第二类方法中大致分为大致又可以分为三类:At present, in the second category of methods, they can be roughly divided into three categories:

1)边缘分析:在图像中的颜色突变处抽取边缘,并通过分析边缘来抽取不同的颜色层面。1) Edge analysis: extract the edge at the sudden change of color in the image, and extract different color levels by analyzing the edge.

对于背景条纹干扰等复杂现象,采用边缘分析时将产生大量的边缘断裂和交叉的情况,给颜色层面的分割带来很大的困难。For complex phenomena such as background stripe interference, a large number of edge breaks and intersections will occur when using edge analysis, which will bring great difficulties to the segmentation of color layers.

2)区域生长:根据颜色一致性准则进行区域生长、合并,分割不同的颜色层面2) Region growth: region growth and merging are performed according to the color consistency criterion, and different color layers are segmented

3)聚类分析:抽取图像中每一个象素点的颜色特征矢量,并在选定的颜色空间上对这些特征进行聚类分析,根据聚类的结果来分割颜色层面。通过分析发现直接聚类对于背景变化大的图像会产生过多的聚类中心,如果采用模糊C均值聚类,在平滑过程中会使所占象素数较少的中心丢失,这样会引起小字的丢失,并且由于损失边缘过渡颜色信息,会造成笔画过多的断裂。3) Cluster analysis: extract the color feature vector of each pixel in the image, and perform cluster analysis on these features in the selected color space, and divide the color level according to the clustering results. Through analysis, it is found that direct clustering will produce too many cluster centers for images with large background changes. If fuzzy C-means clustering is used, centers that occupy less pixels will be lost during the smoothing process, which will cause small fonts , and due to the loss of edge transition color information, it will cause too many breaks in strokes.

边缘分析和聚类分析的方法没有充分的利用彩色图像特有的颜色和位置的相关信息,因而都不能很好的从彩色图像中提取文字字符。The methods of edge analysis and cluster analysis do not make full use of the color and position information of color images, so they cannot extract text characters from color images well.

传统的区域生长算法采用的生长准则造成了过量的计算消耗,但是区域生长算法恰恰是考虑到彩色图像中的颜色和位置的相关信息,有效的避免了颜色聚类法忽视位置信息的缺陷,同时可以通过改进生长准则来减少计算量。The growth criterion adopted by the traditional region growing algorithm causes excessive calculation consumption, but the region growing algorithm just takes into account the color and position related information in the color image, effectively avoiding the defect that the color clustering method ignores the position information, and at the same time The computation can be reduced by improving the growth criterion.

本发明就是通过采用新的区域生长算法CRAG(Color Run-length Adjacency Graph),从图像中搜索得到彩色连通域,而后将这些连通域的平均颜色进行颜色聚类,根据得到的颜色中心生成不同的色彩层面。最后根据特定的判别准则得到所需要的可能的文字层面。这种方法有以下优点:The present invention uses the new region growing algorithm CRAG (Color Run-length Adjacency Graph) to search for color connected domains from the image, and then performs color clustering on the average colors of these connected domains, and generates different colors according to the obtained color centers. color level. Finally, the required possible text level is obtained according to a specific criterion. This approach has the following advantages:

1)算法简单,计算速度快;1) The algorithm is simple and the calculation speed is fast;

2)以连通域为单位的颜色聚类使文字更容易被分出来;2) Color clustering based on connected domains makes it easier to separate text;

3)能自动处理反白文字;3) Can automatically process highlighted text;

4)可以提取图像中由于字符本身,或者由于光照而造成颜色渐变的字符;4) It is possible to extract characters in the image that have color gradients due to the characters themselves or due to illumination;

5)保留字符颜色信息。5) Keep character color information.

本发明就是通过利用相邻象素的彩色和位置信息,同彩色聚类相结合作为主要的突破口,实现了高速度高准确性高性能的字符提取算法,同时也是一种图像分割算法。这是目前所有其他文献里都没有使用的方法。The present invention realizes a high-speed, high-accuracy and high-performance character extraction algorithm by utilizing the color and position information of adjacent pixels and combining it with color clustering as the main breakthrough, and is also an image segmentation algorithm. This is a method not used in any other literature so far.

发明内容Contents of the invention

本发明的目的在于实现基于CRAG结构区域生长算法的复杂彩色图像中文字字符提取的方法,该方法也可以应用于彩色图像分割领域。在BAG结构的基础上提出了新的彩色空间内的CRAG结构,并以此为基础,提出了一种新的区域生长算法。最后,以该生长算法为核心建立了一种彩色文档图像中文字字符的提取方法(下面中所指的CRAG方法即为此方法)。The purpose of the present invention is to realize the method for character extraction in complex color image based on CRAG structural region growing algorithm, and this method can also be applied to the field of color image segmentation. On the basis of BAG structure, a new CRAG structure in color space is proposed, and based on this, a new region growing algorithm is proposed. Finally, based on the growth algorithm, a method for extracting text characters in color document images is established (the CRAG method referred to below is this method).

需要说明的是本发明的方法适用于其他任何彩色空间,只需要将下文中的r(红),g(绿),b(蓝)三种颜色分量分别对应于其他彩色空间的三个基本分量即可,方法中涉及到的阈值根据选取的色彩空间不同而有所不同。本发明采用的聚类方法不必仅局限于初始聚类方法,也可以采用其他聚类方法。It should be noted that the method of the present invention is applicable to any other color space, and it is only necessary to correspond to the three basic components of r (red), g (green), and b (blue) hereinafter respectively to the three basic components of other color spaces That is, the threshold involved in the method varies according to the selected color space. The clustering method used in the present invention is not limited to the initial clustering method, and other clustering methods can also be used.

本发明有以下4部分组成:彩色图像分割,连通域中心颜色聚类,图像层面生成与字符层选取。The present invention consists of the following four parts: color image segmentation, color clustering at the center of connected domains, image layer generation and character layer selection.

1彩色图像分割1 color image segmentation

采用的是基于CRAG结构的彩色连通域搜索算法,属于区域生长算法。这里简称为CRAG算法。The color connected domain search algorithm based on the CRAG structure is used, which belongs to the region growing algorithm. Here it is referred to as the CRAG algorithm for short.

该算法的思路与二值图像上连通域轮廓提取的BAG(block adjacency graph)算法相近。CRAG算法可以理解成两个步骤,首先获取水平方向彩色游程,然后把相邻的颜色相近的彩色游程不断合并,得到彩色连通域。下面以RGB空间为例进行说明:The idea of this algorithm is similar to the BAG (block adjacency graph) algorithm for extracting connected domain contours on binary images. The CRAG algorithm can be understood as two steps. First, obtain the color runs in the horizontal direction, and then continuously merge adjacent color runs with similar colors to obtain the color connected domain. The following uses the RGB space as an example to illustrate:

彩色游程表示如下:Rp{(rp,gp,bp),(xp,yp),fp},其中(rp,gp,bp)是游程上各点在RGB彩色空间的r,g,b颜色分量平均值,(xp,yp)为该游程的起始坐标,fp为游程的长度。The color run is expressed as follows: R p {(r p , g p , b p ), (x p , y p ), f p }, where (r p , g p , b p ) is the RGB color The average value of r, g, b color components in the space, (x p , y p ) is the starting coordinate of the run, and f p is the length of the run.

产生方法如下:从每一行的第一个象素开始,认为该象素为一个新的游程的起始点,计算该起始点和同一行中与它紧邻的象素在RGB空间内的欧氏距离opqThe generation method is as follows: starting from the first pixel of each row, consider this pixel as the starting point of a new run, and calculate the Euclidean distance between the starting point and its adjacent pixels in the same row in the RGB space o pq ,

oo pqpq == (( rr qq -- rr pp )) 22 ++ (( gg qq -- gg pp )) 22 ++ (( bb qq -- bb pp )) 22 ..

If(opq<TD)If(o pq <TD)

{{ rr pp == (( rr pp &times;&times; ff pp ++ rr qq )) ff pp ++ 11 ;; gg pp == (( gg pp &times;&times; ff pp ++ gg qq )) ff pp ++ 11 ;; bb pp == (( bb pp &times;&times; ff pp ++ bb qq )) ff pp ++ 11 ;; ff pp == ff pp ++ 11 ;; }}

Else{p=p+1;rp=rq;gp=gq;bp=bq;}                            (1-1)Else {p=p+1; r p = r q ; g p = g q ; b p = b q ;} (1-1)

根据(1-1)可知:如果opq小于阈值TD,那么这两个象素合并为一个游程,并重新计算该游程的平均r,g,b值:rp,gp,bp,反之,第二个象素便成为新游程的起始点。继续计算其与下一个相邻象素的欧氏距离,如果仍小于TD,就将该象素加入该游程,并重新计算它的r,g,b值,否则,以该象素点为下一个新游程起始点。根据上述规则,可以这样遍历图像每一行中的所有象素得到若干个彩色游程。According to (1-1), it can be seen that if o pq is less than the threshold TD, then the two pixels are merged into one run, and the average r, g, b values of the run are recalculated: r p , g p , b p , and vice versa , the second pixel becomes the starting point of the new run. Continue to calculate the Euclidean distance between it and the next adjacent pixel, if it is still smaller than TD, add this pixel to the run, and recalculate its r, g, b values, otherwise, take this pixel as the next A new run starting point. According to the above rules, several color runs can be obtained by traversing all the pixels in each row of the image.

另外从图像的第二行开始,在得到一个彩色游程以后,计算该游程与上一相邻行在位置上是4邻域相连的彩色游程在RGB空间的欧氏距离opp’In addition, starting from the second line of the image, after obtaining a color run, calculate the Euclidean distance o pp' of the color run in RGB space between this run and the previous adjacent line that is connected by 4 neighbors in position:

oo pp pp &prime;&prime; == (( rr pp &prime;&prime; -- rr pp )) 22 ++ (( gg pp &prime;&prime; -- gg pp )) 22 ++ (( bb pp &prime;&prime; -- bb pp )) 22

判断该距离是否小于TV,若小于则合并为同一个连通域,即连接这两个游程;反之,作为新连通域的起始游程。TD和TV在12~16之间取值。Judging whether the distance is less than TV, if it is less than, merge into the same connected domain, that is, connect the two runs; otherwise, use it as the initial run of the new connected domain. TD and TV take values between 12 and 16.

如图6所示:图中每一个方格代表一个象素,对于象素“5”来讲,“2,4,6,8”四个相邻的象素所在的位置与它4邻域相连。对于两个相邻行的不同游程而言,如果它们各自包含的象素彼此之间的相对位置中有符合图6所示的4邻域相连位置的情况,那么称这两个游程之间4邻域相连。As shown in Figure 6: each square in the figure represents a pixel. For pixel "5", the positions of the four adjacent pixels of "2, 4, 6, 8" and its 4 neighbors connected. For the different runs of two adjacent lines, if the relative positions of the pixels contained in each of them conform to the 4-neighborhood connection position shown in Figure 6, then the distance between the two runs is called 4 Neighbors are connected.

按照上述规则,遍历完整幅图像后,根据游程之间的连接关系便可以得到组成图像的所有连通域的集合{Cn|n=1,2,...,K}。According to the above rules, after traversing the entire image, the set {C n |n=1, 2, ..., K} of all connected domains composing the image can be obtained according to the connection relationship between runs.

连通域的结构定义如下:The structure of a connected domain is defined as follows:

Cn{(rn,gn,bn),Xn,(vn,hn)}。(rn,gn,bn)表示的是连通域Cn的平均颜色r,g,b值,C n {(r n , g n , b n ), X n , (v n , h n )}. (r n , g n , b n ) represents the average color r, g, b value of the connected domain C n ,

rr nno == &Sigma;&Sigma; uu == 11 mm nno (( rr pp uu &times;&times; ff pp uu )) // &Sigma;&Sigma; uu == 11 mm nno ff pp uu -- -- -- (( 11 -- 22 ))

gg nno == &Sigma;&Sigma; uu == 11 mm nno (( gg pp uu &times;&times; ff pp uu )) // &Sigma;&Sigma; uu == 11 mm nno ff pp uu -- -- -- (( 11 -- 33 ))

bb nno == &Sigma;&Sigma; uu == 11 mm nno (( bb pp uu &times;&times; ff pp uu )) // &Sigma;&Sigma; uu == 11 mm nno ff pp uu -- -- -- (( 11 -- 44 ))

X n = { R p u | u = 1,2 . . . m n } 表示该连通域内包含的所有彩色游程的集合。通过简单计算很容易得到连通域的高vn和宽hn。从而,一幅图像可以用所有得到的连通域描述。 x no = { R p u | u = 1,2 . . . m no } Represents the set of all colored runs contained in the connected domain. It is easy to get the height v n and width h n of the connected domain by simple calculation. Thus, an image can be described by all the resulting connected domains.

2连通域彩色聚类步骤分析2 Connected Domain Color Clustering Step Analysis

任意选取一个连通域的颜色作为初始中心,计算其它连通域与其在RGB彩色空间的欧氏距离ocnRandomly select the color of a connected domain as the initial center, and calculate the Euclidean distance o cn between other connected domains and their RGB color space:

oo cncn == (( rr nno -- rr cc )) 22 ++ (( gg nno -- gg cc )) 22 ++ (( bb nno -- bb cc )) 22

若小于阈值TC,将其聚类,重新计算r,g,b的均值作为聚类的中心颜色值,若大于TC,则生成第二个新的中心,按照该方法计算所有样本,由于颜色中心位置不断变化,同时需要合并中心距离小于TC的颜色中心,最终可以得到适当数目的颜色聚类中心。If it is less than the threshold TC, cluster it, recalculate the mean value of r, g, b as the center color value of the cluster, if it is greater than TC, generate a second new center, and calculate all samples according to this method, because the color center The position is constantly changing, and at the same time, it is necessary to merge the color centers whose center distance is less than TC, and finally an appropriate number of color cluster centers can be obtained.

有些特殊的连通域不可能是文字块,预先作了一个筛选,参与聚类连通域样本的选取准则如下:Some special connected domains cannot be text blocks, and a screening is made in advance. The selection criteria for clustering connected domain samples are as follows:

1)Hmin<hn<Hmax,Vmin<vn<Vmax;1) Hmin<h n <Hmax, Vmin<v n <Vmax;

2 ) - - H _ V min < h n / v n < H _ V max , 或者 V _ H min < v n / h n < V _ H max ; 2 ) - - h _ V min < h no / v no < h _ V max , or V _ h min < v no / h no < V _ h max ;

3 ) - - Q 2 > ( &Sigma; u = 1 m n f p u / h n &times; v n ) > Q 1 , 这里 ( &Sigma; u = 1 m n f p u / h n &times; v n ) 表示连通域的象素密度。 3 ) - - Q 2 > ( &Sigma; u = 1 m no f p u / h no &times; v no ) > Q 1 , here ( &Sigma; u = 1 m no f p u / h no &times; v no ) Represents the pixel density of the connected domain.

上式中hn和vn分别指代的是所得彩色连通域的高和宽,mn表示第n个连通域内的彩色游程数,fpu表示第pu个游程的游程长度。In the above formula, h n and v n respectively refer to the height and width of the obtained color connected domain, m n represents the number of color runs in the nth connected domain, and f pu represents the run length of the p uth run.

1)中,由于测试图像中的字符笔画高度和宽度分别大都是小于图像高H和宽V,所谓高,即指图像的纵向象素数目,宽指图像的横向象素数目。这里设定待选连通域最大高宽分别为:Hmax=min(H,400),Vmax=min(V,400),这是由于目前彩色印刷文档中的文字字符的字号大都小于120磅,而在300dpi扫描分辨率的情况下录入的彩色图像中,该字符笔画的最大高宽均小于400个象素长,同时,考虑到文本区域图像实际的高宽。Hmin和Vmin分别为参与颜色聚类的连通域样本的最小高宽,通过实验可知如果该值取得过大会降低小字体的招回率,因而为了使本发明具有广泛的通用性这里取值为3,这样既可以除去大量噪声点的干扰,又很好的保留了标点符号的图像。In 1), since the character stroke height and width in the test image are mostly less than the image height H and width V respectively, so-called height refers to the number of vertical pixels of the image, and width refers to the number of horizontal pixels of the image. The maximum height and width of the connected domain to be selected here are set to be respectively: Hmax=min(H, 400), Vmax=min(V, 400), this is because the font size of the text characters in the current color printing document is mostly less than 120 points, and In the color image entered under the scanning resolution of 300dpi, the maximum height and width of the character strokes are both less than 400 pixels long, and at the same time, the actual height and width of the image in the text area are considered. Hmin and Vmin are the minimum height and width of connected domain samples participating in color clustering respectively. It can be seen from experiments that if the value is too large, the recall rate of small fonts will be reduced. Therefore, in order to make the present invention have wide versatility, the value is 3 here. , which can not only remove the interference of a large number of noise points, but also preserve the image of punctuation marks well.

2)中的H_Vmin和H_Vmax分别指的是连通域的高度与宽度比值的最小和最大值,同样,V_Hmin和V_Hmax指的是宽高比的最小和最大值。在这里根据笔画的特点,最小值为1,最大值为50即可。H_Vmin and H_Vmax in 2) refer to the minimum and maximum value of the height-to-width ratio of the connected domain, respectively. Similarly, V_Hmin and V_Hmax refer to the minimum and maximum value of the aspect ratio. Here, according to the characteristics of strokes, the minimum value is 1, and the maximum value is 50.

3)中如果Q1=0.3,Q2=0.8,部分由图像的边框和其他狭长的细线边缘的影响将被排除,需要说明的是Q1和Q2仍可以在设定值的±0.2左右变化,即Q1可以在0.1~0.5范围内取值,Q2的取值范围可以是0.6~1。3) If Q 1 =0.3, Q 2 =0.8, partly affected by the border of the image and other long and narrow thin line edges will be excluded, it should be noted that Q 1 and Q 2 can still be within ±0.2 of the set value Change left and right, that is, Q 1 can take a value in the range of 0.1-0.5, and Q 2 can take a value in the range of 0.6-1.

另外,刚提到的阈值TC可以在20-50之间取值,但TC较小的时候,会造成层面过多,因而,采用TC=45,减少了图像层面的生成,降低计算消耗,这对于从彩色图像中提取文字字符是一个很好的选择,可以有效的去干扰噪声点。In addition, the threshold TC just mentioned can take a value between 20-50, but when TC is small, it will cause too many layers. Therefore, using TC=45 reduces the generation of image layers and reduces calculation consumption. It is a good choice for extracting text characters from color images, which can effectively remove noise points.

以上这些参量的设定范围的不同,会造成聚类所用的连通域数目变化,同时也会改变生成的颜色中心数目的不同。如果限定的过窄,虽然能降低计算量,提高速度,但是对某些个别背景和前景过于颜色接近的会造成粘连;如果太宽,会造成生成的颜色中心过多,增加计算量。因而,通过实验发现:如果在上面所提到的参数范围内选值,可以取得很好的文字字符提取结果。并且,通过这些条件的限制,进一步降低了初始聚类的运算量,同时也一定程度的去处了部分噪声颜色中心。The different setting ranges of the above parameters will cause the number of connected domains used for clustering to change, and also change the number of generated color centers. If the limit is too narrow, although it can reduce the amount of calculation and increase the speed, it will cause adhesion for some individual backgrounds and foregrounds whose colors are too close; if it is too wide, it will cause too many color centers to be generated and increase the amount of calculation. Therefore, it is found through experiments that if the value is selected within the above-mentioned parameter range, a good text character extraction result can be obtained. Moreover, through the limitations of these conditions, the computational load of the initial clustering is further reduced, and at the same time, part of the noise color centers are removed to a certain extent.

3图像层面的生成3 Generation of image level

将所有高或宽分别小于文本区域图像的高或宽的连通域都与颜色中心比较,如果连通域的平均颜色值和颜色中心的欧氏距离小于TC,便将满足这个条件的连通域放在一个图像层面上,从而可以得到多个层面,这样文字字符图像便可能会存在一个或多个层上。另外如果存在高和宽分别等于文本区域图像高和宽的连通域,则把该连通域所在的层面定为背景层面。(为了便于后续切分识别工作,这里已将生成的层面全部转为白底黑字的图像。)然后,通过如下准则先排除部分非文字字符图层:Compare all the connected domains whose height or width are smaller than the height or width of the text area image respectively with the color center, if the Euclidean distance between the average color value of the connected domain and the color center is less than TC, then put the connected domain satisfying this condition in On an image layer, multiple layers can be obtained, so that the text character image may exist on one or more layers. In addition, if there is a connected domain whose height and width are respectively equal to the height and width of the image in the text region, then the layer where the connected domain is located is defined as the background layer. (In order to facilitate the subsequent segmentation and recognition work, all the generated layers have been converted to images of black characters on a white background.) Then, some non-text character layers are first excluded by the following criteria:

1)每一个文字层的象素数要超过200个,否则定为噪声层;1) The number of pixels in each text layer must exceed 200, otherwise it will be defined as a noise layer;

2)如果连通域C的高和宽和测试图像大小大体相当,那么将C的中心颜色作为背景色,它所在层面为背景层面;2) If the height and width of the connected domain C are roughly equal to the size of the test image, then the center color of C is used as the background color, and the layer where it is located is the background layer;

如果通过1),2)的筛选后,如果剩下的层面数大于L个的时候,这里假定前景色不多于L个,便取层面中所包含黑色象素总数排在前L+2个的层面。前景指的是整幅图像中所包含的文字字符图像,前景色指的是这些文字字符图像的大致颜色,图像中除了文字字符图像以外的部分都称为背景。If after passing the screening of 1) and 2), if the number of remaining layers is greater than L, it is assumed that there are no more than L foreground colors, and the total number of black pixels contained in the layers is ranked in the top L+2 level. The foreground refers to the character images included in the entire image, the foreground color refers to the approximate color of these character images, and the part of the image other than the character images is called the background.

这里,L可以根据实际情况选取,本发明的一般取L=4,在这个范围内取值可以有效的进一步减少备选字符层中的噪声或背景层面,避免字符层的丢失。通过删除噪声层,背景层等上述选取准则以后,剩下的层中将被认为有可能包含文字字符的图像层。Here, L can be selected according to the actual situation. In the present invention, L=4 is generally taken. Taking a value within this range can effectively further reduce the noise or the background layer in the candidate character layer, and avoid the loss of the character layer. After the above selection criteria such as noise layer and background layer are deleted, the remaining layers will be considered as image layers that may contain text characters.

4字符层面的选择4 character level selection

假定图像的垂直方向上的高度为H,水平方向上的宽度为V。颜色分层后得到K个层面,对于层面i(1≤i≤K),分别作水平和垂直方向的投影,可以得到水平方向投影宽度的uil(0≤l<Ni)和垂直方向的投影宽度wij(0≤j<Mi),i为图像层面的序号,l代表水平方向投影宽度的序号,j代表垂直方向投影宽度的序号,为了消除小噪声的干扰,每一个坐标位置上的对应的投影黑色象素数目必须超过5个。同时,仅统计两个方向上投影宽度超过10个象素宽的投影个数Ni和Mi,即Ni和Mi分别为在两个方向上得到的符合要求的投影宽度的总数。水平方向上相邻两个投影宽度之间的距离为水平投影间隔宽度eis(0≤s<Zi),垂直方向上相邻两个投影宽度之间的距离为垂直投影间隔宽度dit(0≤t<Yi),Zi和Yi分别为在两个方向上得到的投影间隔宽度的总数。根据得到的以上结果,可以计算得出层面i上投影宽度的平均值:Assume that the height of the image in the vertical direction is H, and the width in the horizontal direction is V. After color layering, K levels are obtained. For level i (1≤i≤K), the horizontal and vertical projections are made respectively, and u il (0≤l<N i ) of the projection width in the horizontal direction and u il in the vertical direction can be obtained. Projection width w ij (0≤j<M i ), i is the sequence number of the image level, l represents the sequence number of the projection width in the horizontal direction, and j represents the sequence number of the projection width in the vertical direction. In order to eliminate the interference of small noises, each coordinate position The number of corresponding projected black pixels must exceed 5. At the same time, only count the number of projections N i and M i whose projection width exceeds 10 pixels in the two directions, that is, N i and M i are the total number of projection widths obtained in the two directions that meet the requirements. The distance between two adjacent projection widths in the horizontal direction is the horizontal projection interval width e is (0≤s<Z i ), and the distance between two adjacent projection widths in the vertical direction is the vertical projection interval width d it ( 0≤t<Y i ), Z i and Y i are respectively the total number of projection interval widths obtained in two directions. According to the above results obtained, the average value of the projection width on layer i can be calculated:

水平方向投影的平均宽度 Avg H i = 1 N i &Sigma; l = 0 N i - 1 u il ; 垂直方向投影的平均宽度The average width of the projection in the horizontal direction Avg h i = 1 N i &Sigma; l = 0 N i - 1 u il ; The average width of the vertical projection

AvgAvg WW ii == 11 Mm ii &Sigma;&Sigma; jj == 00 Mm ii -- 11 ww ijij ..

层面i上投影间隔宽度的平均值:Average of projected interval widths on slice i:

水平方向投影间隔的平均宽度 Avg E i = 1 Z i &Sigma; s = 0 Z i - 1 e is ; 垂直方向投影的平均宽度The average width of the projection interval in the horizontal direction Avg E. i = 1 Z i &Sigma; the s = 0 Z i - 1 e is ; The average width of the vertical projection

AvgAvg DD. ii == 11 YY ii &Sigma;&Sigma; ii == 00 YY ii -- 11 dd itit ..

计算得到该层面水平投影宽度的方差为 Var H i = &Sigma; l = 0 N i - 1 ( u il - Avg H i ) 2 / N i , 垂直投影宽度的方差为 Var W i = &Sigma; j = 0 M i - 1 ( w ij - Avg W i ) 2 / M i ; The calculated variance of the horizontal projection width of this layer is Var h i = &Sigma; l = 0 N i - 1 ( u il - Avg h i ) 2 / N i , The variance of the vertical projection width is Var W i = &Sigma; j = 0 m i - 1 ( w ij - Avg W i ) 2 / m i ;

该层面的水平投影间隔宽度的方差 Var E i = &Sigma; s = 0 Z i - 1 ( e is - Avg E i ) 2 / Z i , 垂直投影间隔宽度的方差 Var D i = &Sigma; t = 0 Y i - 1 ( d it - Avg D i ) 2 / Y i ; The variance of the horizontal projection interval width for this slice Var E. i = &Sigma; the s = 0 Z i - 1 ( e is - Avg E. i ) 2 / Z i , Variance of Vertical Projection Interval Width Var D. i = &Sigma; t = 0 Y i - 1 ( d it - Avg D. i ) 2 / Y i ;

通过分析文字字符连通域的特征可以发现,文字字符图像连通域的大小基本一致,分布比较均匀,根据这些物理特性,可以定义图层的大小一致性判据Pi如下(1≤i≤K):By analyzing the characteristics of the connected domain of text characters, it can be found that the size of the connected domain of text characters and images is basically the same, and the distribution is relatively uniform. According to these physical characteristics, the size consistency criterion P i of the layer can be defined as follows (1≤i≤K) :

PP ii == minmin (( AvgAvg Hh ii // AvgAvg WW ii ,, AvgAvg WW ii // AvgAvg Hh ii )) &times;&times; Hh &times;&times; VV (( 11 ++ || maxmax (( NN ii ,, Mm ii )) -- maxmax (( Hh // VV ,, VV // Hh )) || // 22 )) &times;&times; (( 11 ++ maxmax (( VarVar EE. ii ,, VarVar DD. ii )) )) &times;&times; (( 11 ++ maxmax (( VarVar Hh ii ,, VarVar WW ii )) ))

max()和min()分别代表括号中两个数值的最大和最小值。max() and min() represent the maximum and minimum of the two values in parentheses, respectively.

计算各个图层的大小一致性判据Pi,并按数值大小排序,最大的即为最可能的文字字符层面。实验结果也表明,通过大小一致性判别准则,可以在一定范围的满足了系统对自动判别文字层面的要求,同时可以为系统提供备选层面的排列顺序,便于后续的处理工作。The size consistency criterion P i of each layer is calculated, and sorted by numerical value, the largest is the most likely character level. The experimental results also show that the size consistency criterion can meet the requirements of the system for automatic discrimination of the text level within a certain range, and at the same time provide the system with the arrangement order of the alternative levels, which is convenient for subsequent processing.

本发明的特征在于:它依次包含以下步骤:The present invention is characterized in that: it comprises the following steps successively:

(1)通过图像采集设备把彩色印刷文档或照片图像扫描入图像处理器中;(1) Scan the color printed document or photo image into the image processor through the image acquisition device;

(2)在上述图像处理器中设定:(2) Set in the above image processor:

图像的高和宽分别用符号H和V表示;The height and width of the image are represented by symbols H and V, respectively;

图像中每一行象素与同一行和它紧邻的彩色游程再RGB空间内的欧氏距离opq的阈值为TD;The threshold of the Euclidean distance o pq between each row of pixels in the image and the same row and its adjacent color run in RGB space is TD;

从图像的第二行开始算起,该彩色游程与上一相邻行在位置上是4邻域相连的彩色游程在RGB空间的欧氏距离opp’的阈值是TV,选取TD=TV=12~16。Counting from the second row of the image, the color run and the last adjacent row are in position 4 neighbors. The threshold of the Euclidean distance o pp' of the color run in RGB space is TV, select TD=TV= 12-16.

连通域的初始中心与组成图像所有连通域的集合中的其他连通域在RGB彩色空间的欧氏距离ocn的阈值TC,选取TC=20~50;The threshold TC of the Euclidean distance o cn between the initial center of the connected domain and other connected domains in the set of all connected domains forming the image in RGB color space, select TC=20~50;

待选连通域最大高度Hmax=min(H,400),象素数;The maximum height of the connected domain to be selected Hmax=min(H, 400), the number of pixels;

待选连通域最大宽度Vmax=min(V,400),象素数;The maximum width of the connected domain to be selected Vmax=min(V, 400), the number of pixels;

待选连通域最小高度Hmin=3,象素数;The minimum height of the connected domain to be selected Hmin=3, the number of pixels;

待选连通域最小宽度Vmin=3,象素数;The minimum width of the connected domain to be selected Vmin=3, the number of pixels;

待选连通域的高宽比或宽高比的最小值为1,最大值为50;The minimum value of the aspect ratio or aspect ratio of the connected domain to be selected is 1, and the maximum value is 50;

各连通域的象素密度用 ( &Sigma; u = 1 m n f p u / h n &times; v n ) 表示,hn和vn分别指代的是所得彩色连通域的高和宽,mn表示第n个连通域内的彩色游程数,fpu表示第pu个游程的游程长度,设定: Q 2 > ( &Sigma; u = 1 m n f p u / h n &times; v n ) > Q 1 , Q1=0.1~0.5,Q2=0.6~1;The pixel density of each connected domain is used ( &Sigma; u = 1 m no f p u / h no &times; v no ) Indicates that h n and v n respectively refer to the height and width of the obtained color connected domain, m n indicates the number of color runs in the nth connected domain, f pu indicates the run length of the p uth run, set: Q 2 > ( &Sigma; u = 1 m no f p u / h no &times; v no ) > Q 1 , Q 1 =0.1~0.5, Q 2 =0.6~1;

在连通域彩色聚类过程中的阈值TC=20~50;Threshold TC=20~50 in the process of connected domain color clustering;

在选取得到的备选彩色层面数K≤L+2,L=4。The number of candidate color layers K≤L+2 obtained after selection, L=4.

(3)分割彩色图像,获取彩色连通域,即一幅图像用连通域集合来描述。(3) Segment the color image to obtain color connected domains, that is, an image is described by a set of connected domains.

(3.1)从每一行的第一个象素开始,认为该象素为一个新的游程的起始点,计算该起始点和同一行中与它紧邻的象素在RGB空间内的欧氏距离opq,其中所述的彩色游程表示如下:Rp{(rp,gp,bp),(xp,yp),fp},rp,gp,bp是游程上各点在RGB彩色空间的r,g,b颜色分量平均值,(xp,yp)为该游程的起始坐标,fp为游程的长度:(3.1) Starting from the first pixel of each row, consider this pixel as the starting point of a new run, and calculate the Euclidean distance between the starting point and its adjacent pixels in the same row in RGB space o pq , wherein the color run is expressed as follows: R p {(r p , g p , b p ), (x p , y p ), f p }, r p , g p , b p are the points on the run The average value of r, g, and b color components in the RGB color space, (x p , y p ) is the starting coordinate of the run, and f p is the length of the run:

oo pqpq == (( rr qq -- rr pp )) 22 ++ (( gg qq -- gg pp )) 22 ++ (( bb qq -- bb pp )) 22 ..

若opq<TD,则把两个象素合并成为一个游程,并计算该游程的平均r,g,b值,即rp,gp,bpIf o pq <TD, combine two pixels into one run, and calculate the average r, g, b value of the run, namely r p , g p , b p :

rr pp == (( rr pp &times;&times; ff pp ++ rr qq )) ff pp ++ 11 ;; gg pp == (( gg pp &times;&times; ff pp ++ gg qq )) ff pp ++ 11 ;; bb pp == (( bb pp &times;&times; ff pp ++ bb qq )) ff pp ++ 11 ;;

游程的长度增1:fp=fp+1;The length of the run increases by 1: f p =f p +1;

反之,第二个象素便成为新游程的起始点,继续计算其与下一个相邻象素的欧氏距离,如果仍小于TD,就将该象素加入该游程,并重新计算它的r,g,b值,否则,以该象素点为下一个新游程起始点。根据上述规则,可以这样遍历图像每一行中的所有象素得到若干个彩色游程。On the contrary, the second pixel will become the starting point of a new run, continue to calculate the Euclidean distance between it and the next adjacent pixel, if it is still less than TD, add this pixel to the run, and recalculate its r , g, b values, otherwise, take this pixel as the starting point of the next new run. According to the above rules, several color runs can be obtained by traversing all the pixels in each row of the image.

(3.2)从图像的第二行开始得到彩色游程后,计算该游程与上一相邻行在位置上是4邻域相连的彩色游程在RGB空间的欧氏距离opp’(3.2) After obtaining the color run length from the second line of the image, calculate the Euclidean distance o pp' of the color run length in RGB space between the color run length and the previous adjacent line in the position of 4 neighbors:

oo pp pp &prime;&prime; == (( rr pp &prime;&prime; -- rr pp )) 22 ++ (( gg pp &prime;&prime; -- gg pp )) 22 ++ (( bb pp &prime;&prime; -- bb pp )) 22

判断该距离是否小于TV,若小于则合并为同一个连通域,即连接这两个游程;反之,作为新连通域的起始游程。以这种方式遍历完整幅图像后,根据游程之间的连接关系便可以得到组成图像的所有连通域的集合{Cn|n=1,2,...,K}。Judging whether the distance is less than TV, if it is less than, merge into the same connected domain, that is, connect the two runs; otherwise, use it as the initial run of the new connected domain. After traversing the entire image in this way, the set {C n |n=1, 2, ..., K} of all connected domains composing the image can be obtained according to the connection relationship between runs.

所述连通域用下列结构式表示:The connected domain is represented by the following structural formula:

Cn{(rn,gn,bn),Xn,(vn,hn)}。(rn,gn,bn)表示的是连通域Cn的平均颜色r,g,b值,C n {(r n , g n , b n ), X n , (v n , h n )}. (r n , g n , b n ) represents the average color r, g, b value of the connected domain C n ,

rr nno == &Sigma;&Sigma; uu == 11 mm nno (( rr pp uu &times;&times; ff pp uu )) // &Sigma;&Sigma; uu == 11 mm nno ff pp uu -- -- -- (( 11 -- 22 ))

gg nno == &Sigma;&Sigma; uu == 11 mm nno (( gg pp uu &times;&times; ff pp uu )) // &Sigma;&Sigma; uu == 11 mm nno ff pp uu -- -- -- (( 11 -- 33 ))

bb nno == &Sigma;&Sigma; uu == 11 mm nno (( bb pp uu &times;&times; ff pp uu )) // &Sigma;&Sigma; uu == 11 mm nno ff pp uu -- -- -- (( 11 -- 44 ))

X n = { R p u | u = 1,2 . . . m n } 表示该连通域内包含的所有彩色游程的集合。通过简单计算很容易得到连通域的高vn和宽hn x no = { R p u | u = 1,2 . . . m no } Represents the set of all colored runs contained in the connected domain. It is easy to get the height v n and width h n of the connected domain by simple calculation.

(4)对连通域进行彩色聚类,以得到适当数目的颜色聚类中心。(4) Carry out color clustering on connected domains to obtain an appropriate number of color cluster centers.

同时按以下三个准则选取参与彩色聚类的连通域样本:At the same time, the connected domain samples participating in the color clustering are selected according to the following three criteria:

1)Hmin<hn<Hmax,Vmin<vn<Vmax,即参与彩色聚类的连通域的高度和宽度都要在上述设定范围内;1) Hmin<h n <Hmax, Vmin<v n <Vmax, that is, the height and width of connected domains participating in color clustering must be within the above-mentioned setting range;

2 ) - - H _ V min < h n / v n < H _ V max , 或者 V _ H min < v n / h n < V _ H max , 其中的H_Vmin和H_Vmax分别指的是连通域的高度与宽度比值的最小和最大值,同样,V_Hmin和V_Hmax指的是宽高比的最小和最大值。 2 ) - - h _ V min < h no / v no < h _ V max , or V _ h min < v no / h no < V _ h max , Among them, H_Vmin and H_Vmax refer to the minimum and maximum value of the height-to-width ratio of the connected domain, respectively. Similarly, V_Hmin and V_Hmax refer to the minimum and maximum value of the aspect ratio.

3 ) - - Q 2 > ( &Sigma; u = 1 m n f p u / h n &times; v n ) > Q 1 , 即连通域的象素密度在Q1和Q2之间。 3 ) - - Q 2 > ( &Sigma; u = 1 m no f p u / h no &times; v no ) > Q 1 , That is, the pixel density of the connected domain is between Q1 and Q2 .

(5)形成图像层面,并从中删除噪声层和明显的背景层,并得到有可能包含文字的图像层。(5) Form the image layer, and delete the noise layer and obvious background layer therefrom, and obtain the image layer that may contain text.

(5.1)形成图像层面(5.1) Form the image level

把所有高或宽分别小于文本区域图像的高或宽的连通域都与颜色中心比较,如果连通域的平均颜色值和颜色中心的欧氏距离小于TC,便将满足这个条件的连通域放在一个图像层面上,从而可以得到多个层面,同时把它们全部转为白底黑字的图像;Compare all the connected domains whose height or width are smaller than the height or width of the text region image respectively with the color center, if the Euclidean distance between the average color value of the connected domain and the color center is less than TC, then put the connected domain satisfying this condition in the One image layer, so that multiple layers can be obtained, and all of them can be converted into black-and-white images at the same time;

(5.2)按照以下准则依次排除非文字字符层(5.2) Exclude the non-literal character layer in sequence according to the following guidelines

1)当每一个文字层的象素数少于200个,定为噪声层,予以排除;1) When the number of pixels in each text layer is less than 200, it is defined as a noise layer and excluded;

2)如果连通域的高和宽和测试图像大小相当,就把该连通域的中心颜色作为背景色,它所在层面为背景层面;2) If the height and width of the connected domain are equivalent to the size of the test image, the central color of the connected domain is used as the background color, and the layer where it is located is the background layer;

(5.3)在前景色不多于L个的条件下,若剩下图像层面数大于L个时,便选取层面中所包含黑色象素总数排在前L+2个的层面,作为可能存在文字字符图像的层面,按以下步骤处理。前景指的是整幅图像中所包含的文字字符图像,前景色指的是这些文字字符图像的大致颜色,图像中除了文字字符图像以外的部分都称为背景。(5.3) Under the condition that the number of foreground colors is not more than L, if the number of remaining image layers is greater than L, then select the layer whose total number of black pixels in the layer ranks in the top L+2, as the possible text The level of the character image is processed according to the following steps. The foreground refers to the character images included in the entire image, the foreground color refers to the approximate color of these character images, and the part of the image other than the character images is called the background.

(6)根据一致性判据公式计算得到的步骤(5.3)所得的可能的文字字符图像层的一致性判决值Pi,(1≤i≤K),K为上述层面数,进行排序,其Pi值最大的层面即为最可能的文字字符层面。(6) The consistency judgment value P i of the possible text character image layer obtained in the step (5.3) obtained according to the consistency criterion formula, (1≤i≤K), K is the number of the above-mentioned layers, sorted, and The level with the largest P i value is the most likely character level.

(6.1)对于所述K个层面分别作为水平和垂直方向的投影,可以得到水平方向投影宽度的uil(0≤l<Ni)和垂直方向的投影宽度wij(0≤j<Mi),i为图像层面的序号,l代表水平方向投影宽度的序号,j代表垂直方向投影宽度的序号,为了消除小噪声的干扰,每一个坐标位置上的对应的投影黑色象素数目必须超过5个。同时,仅统计两个方向上投影宽度超过10个象素宽的投影个数Ni和Mi,即Ni和Mi分别为在两个方向上得到的符合要求的投影宽度的总数。水平方向上相邻两个投影宽度之间的距离为水平投影间隔宽度eis(0≤s<Zi),垂直方向上相邻两个投影宽度之间的距离为垂直投影间隔宽度dit(0≤t<Yi),Zi和Yi分别为在两个方向上得到的投影间隔宽度的总数。(6.1) For the K levels as the projections in the horizontal and vertical directions respectively, u il (0≤l<N i ) of the projection width in the horizontal direction and w ij (0≤j<M i ) of the projection width in the vertical direction can be obtained ), i is the sequence number of the image level, l represents the sequence number of the projection width in the horizontal direction, and j represents the sequence number of the projection width in the vertical direction. In order to eliminate the interference of small noises, the number of corresponding projected black pixels on each coordinate position must exceed 5 indivual. At the same time, only count the number of projections N i and M i whose projection width exceeds 10 pixels in the two directions, that is, N i and M i are the total number of projection widths obtained in the two directions that meet the requirements. The distance between two adjacent projection widths in the horizontal direction is the horizontal projection interval width e is (0≤s<Z i ), and the distance between two adjacent projection widths in the vertical direction is the vertical projection interval width d it ( 0≤t<Y i ), Z i and Y i are respectively the total number of projection interval widths obtained in two directions.

(6.2)计算以下各值:(6.2) Calculate the following values:

水平方向投影的平均宽度 Avg H i = 1 N i &Sigma; i = 0 N i - 1 u il , The average width of the projection in the horizontal direction Avg h i = 1 N i &Sigma; i = 0 N i - 1 u il ,

垂直方向投影的平均宽度 Avg W i = 1 M i &Sigma; j = 0 M i - 1 w ij , The average width of the vertical projection Avg W i = 1 m i &Sigma; j = 0 m i - 1 w ij ,

水平方向投影间隔的平均宽度 Avg E i = 1 Z i &Sigma; s = 0 Z i - 1 e is , The average width of the projection interval in the horizontal direction Avg E. i = 1 Z i &Sigma; the s = 0 Z i - 1 e is ,

垂直方向投影的平均宽度 AvgD i = 1 Y i &Sigma; t = 0 Y i - 1 d it , The average width of the vertical projection AvgD i = 1 Y i &Sigma; t = 0 Y i - 1 d it ,

水平投影宽度的方差为 Var H i = &Sigma; i = 0 N i - 1 ( u il - AvgH i ) 2 / N i , The variance of the horizontal projection width is Var h i = &Sigma; i = 0 N i - 1 ( u il - ikB i ) 2 / N i ,

垂直投影宽度的方差为 VarW i = &Sigma; j = 0 M i - 1 ( w ij - AvgW i ) 2 / M i , The variance of the vertical projection width is wxya i = &Sigma; j = 0 m i - 1 ( w ij - wxya i ) 2 / m i ,

水平投影间隔宽度的方差 Var E i = &Sigma; s = 0 Z i - 1 ( e is - AvgE i ) 2 / Z i , variance of horizontal projection interval width Var E. i = &Sigma; the s = 0 Z i - 1 ( e is - AvgE i ) 2 / Z i ,

垂直投影间隔宽度的方差 VarD i = &Sigma; t = 0 Y i - 1 ( d it - AvgD i ) 2 / Y i ; Variance of Vertical Projection Interval Width VarD i = &Sigma; t = 0 Y i - 1 ( d it - AvgD i ) 2 / Y i ;

(6.3)在原文字区域图像内文字颜色单一,所含文字行或列的总数小于三个,且行或列方向上的文字近似在一条直线上,按下式计算一致性判据值Pi(6.3) In the original text area image, the text color is single, the total number of text rows or columns contained is less than three, and the text in the row or column direction is approximately on a straight line, and the consistency criterion value P i is calculated according to the following formula:

PP ii == minmin (( AvgHikB ii // AvgWwxya ii ,, AvgWwxya ii // AvgHikB ii )) &times;&times; Hh &times;&times; VV (( 11 ++ || maxmax (( NN ii ,, Mm ii )) -- maxmax (( Hh // VV ,, VV // Hh )) || // 22 )) &times;&times; (( 11 ++ maxmax (( VarEVarE ii ,, VarDVarD ii )) )) &times;&times; (( 11 ++ maxmax (( VarVar Hh ii ,, VarWwxya ii )) ))

i为层面数,i=1,...,K;i is the number of layers, i=1,...,K;

对得到的Pi按大小排序,取其值最大的文字层面供文字字符切分与识别使用。The obtained P i are sorted by size, and the text level with the largest value is used for text character segmentation and recognition.

(7)本发明可以作用于其他任何彩色空间,只需要将下文中的r,g,b三种颜色分量分别对应于其他彩色空间的三个基本分量即可,方法中涉及到的阈值根据选取的色彩空间不同而有所不同。(7) The present invention can be applied to any other color space, and only need to correspond to the three basic components of other color spaces by the following r, g, and b three color components, and the thresholds involved in the method are selected according to The color space varies.

本发明的实验效果表明,采用本发明处理包含文字的彩色图像可以得到很高的文字字符正确提取率:对于彩色杂志上标题文字字符的正确提取率为94.4%,对于彩色报纸上文字字符的正确提取率90.7%,彩色照片上文字字符的正确提取率95%,均高于采用现有的其他方法的文字字符的正确提取率。The experimental effect of the present invention shows that adopting the present invention to process color images containing text can obtain a very high correct extraction rate of text characters: the correct extraction rate for title text characters on color magazines is 94.4%, and the correct extraction rate for text characters on color newspapers is 94.4%. The extraction rate is 90.7%, and the correct extraction rate of text characters on the color photo is 95%, both of which are higher than the correct extraction rates of text characters using other existing methods.

附图说明Description of drawings

图1一个典型的字符提取系统的硬件构成。Figure 1 shows the hardware configuration of a typical character extraction system.

图2基于CRAG的文字字符提取方法的流程图。Fig. 2 is a flow chart of the text character extraction method based on CRAG.

图3CRAG结构示意图:3a,,3b,3c,3d,3e,3f,3g。Figure 3 Schematic diagram of CRAG structure: 3a, 3b, 3c, 3d, 3e, 3f, 3g.

图4多层面生成举例:4a为原始彩色图像,4b、4c、4d、4e、4f、4g、4h为生成的图像层面。Figure 4 Multi-level generation example: 4a is the original color image, 4b, 4c, 4d, 4e, 4f, 4g, 4h are the generated image levels.

图5图层投影示意图:5a为垂直方向投影直方图,5b为垂直方向投影宽度示意图,5c为水平方向投影直方图,5d为水平方向投影宽度示意图。Figure 5 is a schematic diagram of layer projection: 5a is a projection histogram in the vertical direction, 5b is a schematic diagram of the projection width in the vertical direction, 5c is a projection histogram in the horizontal direction, and 5d is a schematic diagram of the projection width in the horizontal direction.

图64邻域相连示意图。Fig. 64 Schematic diagram of neighborhood connection.

具体实施方式Detailed ways

如图1所示,一个彩色图像中字符提取系统在硬件上有两个部分构成:图像采集设备和处理器。图像采集设备一般是扫描仪,数字摄像机或数字照相机,用来获取包含字符的数字图像。处理器一般是计算机或者某些具有运算处理能力的终端,用于对数字图像进行处理,并进行文字字符提取。As shown in Figure 1, the character extraction system in a color image consists of two parts in hardware: image acquisition device and processor. The image acquisition device is generally a scanner, a digital video camera or a digital camera, and is used to acquire digital images containing characters. The processor is generally a computer or some terminal with computing and processing capabilities, which is used to process digital images and extract text and characters.

如图2所示的基于CRAG文字字符提取方法的流程图。首先通过扫描仪将彩色印刷文档等扫入,或者将数字照相或摄像机获得的彩色图像输入到处理器(计算机或其他终端处理设备),这样得到含有文字字符的彩色图像。而后对这些包含字符的图像采用区域生长算法得到采用CRAG结构描述的彩色连通域,再加入连通域筛选准则,将筛选后连通域的平均颜色进行简单的颜色聚类,得到的不同的颜色中心,根据这些颜色中心可以生成不同的色彩图像层面,最后通过大小一致性判据得到待选的文字字符图像层面,即转变为所需的文字字符二值图像,送入后续的字符切分与识别模块处理。The flow chart of the method for extracting text characters based on CRAG as shown in FIG. 2 . Firstly, a color printed document is scanned in through a scanner, or a color image obtained by a digital camera or video camera is input to a processor (computer or other terminal processing equipment), so that a color image containing text characters is obtained. Then use the region growing algorithm on these images containing characters to obtain the color connected domain described by the CRAG structure, and then add the connected domain screening criterion, and perform simple color clustering on the average color of the filtered connected domain, and obtain different color centers, According to these color centers, different color image levels can be generated, and finally the character image level to be selected is obtained through the size consistency criterion, that is, converted into the required binary image of the text character, and sent to the subsequent character segmentation and recognition module deal with.

分割图像获取连通域Segment an image to obtain connected domains

将包含文字字符的彩色图像转变为数字图像输入计算机后,采用CRAG算法分解图像为多个连通域。该算法可以理解成两个步骤,首先获取水平方向彩色游程,然后把相邻的颜色相近的彩色游程不断合并,得到彩色连通域。After converting the color image containing text characters into a digital image and inputting it into the computer, the CRAG algorithm is used to decompose the image into multiple connected domains. The algorithm can be understood as two steps, first obtain the color runs in the horizontal direction, and then continuously merge the adjacent color runs with similar colors to obtain the color connected domain.

彩色游程表示如下:Rp{(rp,gp,bp),(xp,yp),fp},其中(rp,gp,bp)是游程上各点在RGB彩色空间的r,g,b颜色分量平均值,(xp,yp)为该游程的起始坐标,fp为游程的长度。The color run is expressed as follows: R p {(r p , g p , b p ), (x p , y p ), f p }, where (r p , g p , b p ) is the RGB color The average value of r, g, b color components in the space, (x p , y p ) is the starting coordinate of the run, and f p is the length of the run.

产生方法如下:从每一行的第一个象素开始,认为该象素为一个新的游程的起始点,计算该起始点和同一行中与它紧邻的象素在RGB空间内的欧氏距离opqThe generation method is as follows: starting from the first pixel of each row, consider this pixel as the starting point of a new run, and calculate the Euclidean distance between the starting point and its adjacent pixels in the same row in the RGB space o pq ,

oo pqpq == (( rr qq -- rr pp )) 22 ++ (( gg qq -- gg pp )) 22 ++ (( bb qq -- bb pp )) 22 ..

If(opq<TD)If(o pq <TD)

{{ rr pp == (( rr pp &times;&times; ff pp ++ rr qq )) ff pp ++ 11 ;; gg pp == (( gg pp &times;&times; ff pp ++ gg qq )) ff pp ++ 11 ;; bb pp == (( bb pp &times;&times; ff pp ++ bb qq )) ff pp ++ 11 ;; ff pp == ff pp ++ 11 ;; }}

Else{p=p+1;rp=rq;gp=gq;bp=bq;}                            (1-1)Else {p=p+1; r p = r q ; g p = g q ; b p = b q ;} (1-1)

根据(1-1)可知:如果opq小于阈值TD,那么这两个象素合并为一个游程,并重新计算该游程的平均r,g,b值:rp,gp,bp,反之,第二个象素便成为新游程的起始点。继续计算其与下一个相邻象索的欧氏距离,如果仍小于TD,就将该象素加入该游程,并重新计算它的r,g,b值,否则,以该象素点为下一个新游程起始点。根据上述规则,可以这样遍历图像每一行中的所有象素得到若干个彩色游程。According to (1-1), it can be seen that if o pq is less than the threshold TD, then the two pixels are merged into one run, and the average r, g, b values of the run are recalculated: r p , g p , b p , and vice versa , the second pixel becomes the starting point of the new run. Continue to calculate the Euclidean distance between it and the next adjacent pixel, if it is still smaller than TD, add this pixel to the run, and recalculate its r, g, b values, otherwise, take this pixel as the next A new run starting point. According to the above rules, several color runs can be obtained by traversing all the pixels in each row of the image.

另外从图像的第二行开始,在得到一个彩色游程以后,计算该游程与上一相邻行在位置上是4邻域相连的彩色游程在RGB空间的欧氏距离opp’In addition, starting from the second line of the image, after obtaining a color run, calculate the Euclidean distance o pp' of the color run in RGB space between this run and the previous adjacent line that is connected by 4 neighbors in position:

oo pppp &prime;&prime; == (( rr pp &prime;&prime; -- rr pp )) 22 ++ (( gg pp &prime;&prime; -- gg pp )) 22 ++ (( bb pp &prime;&prime; -- bb pp )) 22

判断该距离是否小于TV,若小于则合并为同一个连通域,即连接这两个游程;反之,作为新连通域的起始游程。Judging whether the distance is less than TV, if it is less than, merge into the same connected domain, that is, connect the two runs; otherwise, use it as the initial run of the new connected domain.

如图6所示:图中每一个方格代表一个象素,对于象素“5”来讲,“2,4,6,8”四个相邻的象素所在的位置与它4邻域相连。对于两个相邻行的不同游程而言,如果它们各自包含的象素彼此之间的相对位置中有符合图6所示的4邻域相连位置的情况,那么称这两个游程之间4邻域相连。As shown in Figure 6: each square in the figure represents a pixel, and for pixel "5", the positions of the four adjacent pixels of "2, 4, 6, 8" and its 4 neighbors connected. For the different runs of two adjacent rows, if the relative positions of the pixels contained in each of them conform to the 4-neighborhood connection position shown in Figure 6, then the distance between the two runs is called 4 Neighbors are connected.

按照上述规则,遍历完整幅图像后,根据游程之间的连接关系便可以得到组成图像的所有连通域的集合{Cn|n=1,2,...,K}。According to the above rules, after traversing the entire image, the set {C n |n=1, 2, ..., K} of all connected domains composing the image can be obtained according to the connection relationship between runs.

连通域的结构定义如下:The structure of a connected domain is defined as follows:

Cn{(rn,gn,bn),Xn,(vn,hn)}。(rn,gn,bn)表示的是连通域Cn的平均颜色r,g,b值,C n {(r n , g n , b n ), X n , (v n , h n )}. (r n , g n , b n ) represents the average color r, g, b value of the connected domain C n ,

rr nno == &Sigma;&Sigma; uu == 11 mm nno (( rr pp uu &times;&times; ff pp uu )) // &Sigma;&Sigma; uu == 11 mm nno ff pp uu -- -- -- (( 11 -- 22 ))

gg nno == &Sigma;&Sigma; uu == 11 mm nno (( gg pp uu &times;&times; ff pp uu )) // &Sigma;&Sigma; uu == 11 mm nno ff pp uu -- -- -- (( 11 -- 33 ))

bb nno == &Sigma;&Sigma; uu == 11 mm nno (( bb pp uu &times;&times; ff pp uu )) // &Sigma;&Sigma; uu == 11 mm nno ff pp uu -- -- -- (( 11 -- 44 ))

X n = { R p u | u = 1,2 . . . m n } 表示该连通域内包含的所有彩色游程的集合。通过简单计算很容易得到连通域的高vn和宽hn。从而,一幅图像可以用所有得到的连通域描述。 x no = { R p u | u = 1,2 . . . m no } Represents the set of all colored runs contained in the connected domain. It is easy to get the height v n and width h n of the connected domain by simple calculation. Thus, an image can be described by all the resulting connected domains.

门限TD和TV是影响算法成功与否的重要参数,如果选得过小,会使字符分得比较碎,丧失了区域生长的意义,实质是损失了象素的位置信息,破坏了前景一致性的提取规则,同时增加了下一步连通域颜色聚类的运算量;如果取得过大,会使字符连通域与其它目标粘连。本发明这里采用经验参数,经实验验证当TD=TV=12~16这个范围的时候,可以得到很好的结果,如果超过这个范围,往往会造成很多的字符与背景粘连,即无法从相似的背景中提取字符。Threshold TD and TV are important parameters that affect the success of the algorithm. If they are selected too small, the characters will be divided into fragments, and the meaning of region growth will be lost. In essence, the position information of pixels will be lost, and the foreground consistency will be destroyed. At the same time, it increases the calculation amount of connected domain color clustering in the next step; if it is too large, it will make the character connected domain stick to other objects. The present invention adopts empirical parameters here. It has been verified by experiments that when TD=TV=12~16, good results can be obtained. Extract characters from the background.

如图3图3所示:背景为黄绿两色,前景字符为渐变色文字的彩色图像A可以看成是由前景文字字符R的图像B1和背景图像B2组成,图C1表述组成字母R的连通域C1的CRAG结构组成,图中若干矩形块用来表示该连通域所包含的彩色游程,各游程宽度为一个象素,彩色游程之间的折线表示连通域内这些颜色相近彩色游程之间存在的连接关系。同样背景图像B2可以用连通域C2,C3和C4联合表述。假定忽略该图的边缘效应,采用CRAG算法便可以得到组成图像A的连通域的集合{Cn|n=1,2,...,K},K=3,h1和v1分别为C1的高和宽,h2和v2则分别为C2的高和宽。为了更好地说明本算法的特点,这里字符前景采用的是渐变颜色。H和V分别表示原始图像的高和宽。As shown in Figure 3 and Figure 3: the background is yellow and green, and the color image A of the foreground character is a gradient color text, which can be regarded as composed of the image B1 of the foreground text character R and the background image B2. Figure C1 expresses the composition of the letter R The CRAG structure of the connected domain C 1 is composed of several rectangular blocks in the figure to represent the color runs contained in the connected domain, and the width of each run is one pixel. Existing connections. Similarly, the background image B2 can be jointly expressed by connected domains C2, C3 and C4. Assuming that the edge effect of the graph is ignored, the CRAG algorithm can be used to obtain the set of connected domains {C n |n=1, 2, ..., K}, K=3, h 1 and v 1 are respectively The height and width of C1, h 2 and v 2 are the height and width of C2 respectively. In order to better illustrate the characteristics of this algorithm, the foreground of the characters here is a gradient color. H and V represent the height and width of the original image, respectively.

颜色聚类color clustering

颜色是区分字符前景和背景的重要判据。为了人眼能够看清楚,字符本身的颜色一般与背景有相当大的差别。把颜色不同的区域分开到不同的图像层上,便于文字字符区域的获取,而对颜色聚类的步骤能够实现这样的目标。Color is an important criterion for distinguishing character foreground and background. In order for the human eye to see clearly, the color of the character itself is generally quite different from the background. Separating areas with different colors into different image layers facilitates the acquisition of text character areas, and the step of clustering colors can achieve this goal.

得到连通域以后,根据前景特点采用特定的连通域筛选准则,将符合要求的连通域的平均颜色进行聚类,得到一些聚类中心,以每个聚类中心代表并构成一种颜色的层面。根据每个连通域的颜色离哪个聚类中心更近,把它分到相应颜色的层上。After the connected domain is obtained, according to the characteristics of the foreground, the average color of the connected domain that meets the requirements is clustered using specific connected domain screening criteria, and some cluster centers are obtained, and each cluster center represents and constitutes a level of color. According to which cluster center the color of each connected domain is closer to, it is assigned to the layer of the corresponding color.

一般聚类算法需要预先知道聚类中心的个数,而聚类中心的个数在本发明的应用中无法实现确定。另外,颜色差别大于预定值的连通域分到不同的层上。以便使文字的背景和前景分开。因而,在这里采用选择初始聚类中心的方法,聚类方法如下所述:General clustering algorithms need to know the number of cluster centers in advance, but the number of cluster centers cannot be determined in the application of the present invention. In addition, connected domains whose color difference is greater than a predetermined value are assigned to different layers. In order to separate the background and foreground of the text. Therefore, the method of selecting the initial cluster center is adopted here, and the clustering method is as follows:

任意选取一个连通域的颜色作为初始中心,计算其它连通域与其在RGB彩色空间的欧氏距离,若小于阈值TC,将其聚类,重新计算r,g,b的均值作为聚类的中心颜色值,若大于TC,则生成第二个新的中心,按照该方法计算所有样本,由于颜色中心位置不断变化,同时需要合并中心距离小于TC的颜色中心,最终可以得到适当数目的颜色聚类中心。Randomly select the color of a connected domain as the initial center, calculate the Euclidean distance between other connected domains and its RGB color space, if it is less than the threshold TC, cluster it, and recalculate the mean value of r, g, b as the center color of the cluster If the value is greater than TC, a second new center is generated, and all samples are calculated according to this method. Since the position of the color center is constantly changing, and it is necessary to merge the color centers whose center distance is smaller than TC, an appropriate number of color cluster centers can be finally obtained. .

有些特殊的连通域不可能是文字块,预先作了一个筛选,参与聚类连通域样本的选取准则如下:Some special connected domains cannot be text blocks, and a screening is made in advance. The selection criteria for clustering connected domain samples are as follows:

1)Hmin<hn<Hmax,Vmin<vn<Vmax;1) Hmin<h n <Hmax, Vmin<v n <Vmax;

2 ) - - H _ V min < h n / v n < H _ V max , 或者 V _ H min < v n / h n < V _ H max ; 2 ) - - h _ V min < h no / v no < h _ V max , or V _ h min < v no / h no < V _ h max ;

3 ) Q 2 > ( &Sigma; u = 1 m n f p u / h n &times; v n ) > Q 1 , 这里 ( &Sigma; u = 1 m n f p u / h n &times; v n ) 表示连通域的象素密度。 3 ) Q 2 > ( &Sigma; u = 1 m no f p u / h no &times; v no ) > Q 1 , here ( &Sigma; u = 1 m no f p u / h no &times; v no ) Represents the pixel density of the connected domain.

上式中hn和vn分别指代的是所得彩色连通域的高和宽。In the above formula, h n and v n respectively refer to the height and width of the obtained color connected domain.

1)中,由于测试图像中的字符笔画高度和宽度分别大都是小于图像高H和宽V,所谓高,即指图像的纵向象素数目,宽指图像的横向象素数目。这里设定待选连通域最大高宽分别为:Hmax=min(H,400),Vmax=min(V,400),这是由于目前彩色印刷文档中的文字字符的字号大都小于120磅,而在300dpi扫描分辨率的情况下录入的彩色图像中,该字符笔画的最大高宽均小于400个象素长,同时,考虑到文本区域图像实际的高宽。Hmin和Vmin分别为参与颜色聚类的连通域样本的最小高宽,通过实验可知如果该值取得过大会降低小字体的招回率,因而为了使本发明具有广泛的通用性这里取值为3,这样既可以除去大量噪声点的干扰,又很好的保留了标点符号的图像。In 1), since the character stroke height and width in the test image are mostly less than the image height H and width V respectively, the so-called height refers to the vertical pixel number of the image, and the width refers to the horizontal pixel number of the image. The maximum height and width of the connected domain to be selected here are set to be respectively: Hmax=min(H, 400), Vmax=min(V, 400), this is because the font size of the text characters in the current color printing document is mostly less than 120 pounds, and In the color image entered under the scanning resolution of 300dpi, the maximum height and width of the character strokes are both less than 400 pixels long, and at the same time, the actual height and width of the image in the text area are considered. Hmin and Vmin are the minimum height and width of connected domain samples participating in color clustering respectively. It can be seen from experiments that if the value is too large, the recall rate of small fonts will be reduced. Therefore, in order to make the present invention have wide versatility, the value is 3 here. , which can not only remove the interference of a large number of noise points, but also preserve the image of punctuation marks well.

2)中的H_Vmin和H_Vmax分别指的是连通域的高度与宽度比值的最小和最大值,同样,V_Hmin和V_Hmax指的是宽高比的最小和最大值。在这里根据笔画的特点,最小值为1,最大值为50即可。H_Vmin and H_Vmax in 2) refer to the minimum and maximum value of the height-to-width ratio of the connected domain, respectively. Similarly, V_Hmin and V_Hmax refer to the minimum and maximum value of the aspect ratio. Here, according to the characteristics of strokes, the minimum value is 1, and the maximum value is 50.

3)中如果Q1=0.3,Q2=0.8,部分由图像的边框和其他狭长的细线边缘的影响将被排除,需要说明的是Q1和Q2仍可以在设定值的±0.2左右变化,即Q1可以在0.1~0.5范围内取值,Q2的取值范围可以是0.6~1。3) If Q 1 =0.3, Q 2 =0.8, partly affected by the border of the image and other long and narrow thin line edges will be excluded, it should be noted that Q 1 and Q 2 can still be within ±0.2 of the set value Change left and right, that is, Q 1 can take a value in the range of 0.1-0.5, and Q 2 can take a value in the range of 0.6-1.

另外,刚提到的阈值TC可以在20-50之间取值,但TC较小的时候,会造成层面过多,因而,采用TC=45,减少了图像层面的生成,降低计算消耗,这对于从彩色图像中提取文字字符是一个很好的选择,可以有效的去干扰噪声点。In addition, the threshold TC just mentioned can take a value between 20-50, but when TC is small, it will cause too many layers. Therefore, using TC=45 reduces the generation of image layers and reduces calculation consumption. It is a good choice for extracting text characters from color images, which can effectively remove noise points.

以上这些参量的设定范围的不同,会造成聚类所用的连通域数目变化,同时也会改变生成的颜色中心数目的不同。如果限定的过窄,虽然能降低计算量,提高速度,但是对某些个别背景和前景过于颜色接近的会造成粘连;如果太宽,会造成生成的颜色中心过多,增加计算量。因而,通过实验发现:如果在上面所提到的参数范围内选值,可以取得很好的文字字符提取结果。并且,通过这些条件的限制,进一步降低了初始聚类的运算量,同时也一定程度的去处了部分噪声颜色中心。与直接采用C均值聚类方法比较,聚类样本数减少从而减少了聚类运算量,同时克服了模糊C均值的平滑过程引起所占象素较少的文字字符丢失的问题。The different setting ranges of the above parameters will cause the number of connected domains used for clustering to change, and also change the number of generated color centers. If the limit is too narrow, although it can reduce the amount of calculation and increase the speed, it will cause adhesion for some individual backgrounds and foregrounds whose colors are too close; if it is too wide, it will cause too many color centers to be generated and increase the amount of calculation. Therefore, it is found through experiments that if the value is selected within the above-mentioned parameter range, a good text character extraction result can be obtained. Moreover, through the limitations of these conditions, the computational load of the initial clustering is further reduced, and at the same time, part of the noise color centers are removed to a certain extent. Compared with the direct use of C-means clustering method, the number of clustering samples is reduced, thereby reducing the amount of clustering calculations, and at the same time, it overcomes the problem of the loss of text characters that occupy less pixels caused by the smoothing process of fuzzy C-means.

图像分层image layering

在连通域颜色聚类之后,计算连通域与聚类中心的欧氏距离。若距离小于TC,即具有相似彩色的连通域分到一个层上,便可以生成不同的图像层。After connected domain color clustering, calculate the Euclidean distance between the connected domain and the cluster center. If the distance is less than TC, that is, the connected domains with similar colors are divided into one layer, and then different image layers can be generated.

在生成文字字符层面图像的过程中,同样需要一些连通域筛选准则,但是,印刷文字字体大小大都在10pt-12pt之间,同时彩色图像点扩散效应的存在,得到文字字符的笔画连通域都比较小,标点符号也是需要兼顾的。因而,为了避免小的连通域丢失而造成笔画断裂,生成字符层面时的连通域筛选准则与颜色聚类时采用的筛选准则并不相同。In the process of generating images at the level of text characters, some connected domain screening criteria are also required. However, the font size of printed text is mostly between 10pt-12pt. Small, punctuation marks also need to be taken into account. Therefore, in order to avoid stroke breaks caused by the loss of small connected domains, the screening criteria for connected domains when generating character levels are different from those used for color clustering.

在这一步骤中,将所有高或宽分别小于文本区域图像的高或宽的连通域都与颜色中心比较,如果连通域的平均颜色值和颜色中心的欧氏距离小于TC,便将满足这个条件的连通域放在一个图像层面上,从而可以得到多个层面,这样文字字符图像便可能会存在一个或多个层上。另外如果存在高和宽分别等于文本区域图像高和宽的连通域,则把该连通域所在的层面定为背景层面。(为了便于后续切分识别工作,这里已将生成的层面全部转为白底黑字的图像。)然后,通过如下准则先排除部分非文字字符图层:In this step, all the connected domains whose height or width are smaller than the height or width of the text area image are compared with the color center, if the Euclidean distance between the average color value of the connected domain and the color center is less than TC, this will be satisfied The conditional connected domain is placed on an image level, so that multiple levels can be obtained, so that the text character image may exist on one or more layers. In addition, if there is a connected domain whose height and width are respectively equal to the height and width of the image in the text region, then the layer where the connected domain is located is defined as the background layer. (In order to facilitate the subsequent segmentation and recognition work, all the generated layers have been converted to images of black characters on a white background.) Then, some non-text character layers are first excluded through the following criteria:

4)每一个文字层的象素数要超过200个,否则定为噪声层;4) The number of pixels in each text layer must exceed 200, otherwise it will be defined as a noise layer;

5)如果连通域C的高和宽和测试图像大小大体相当,那么将C的中心颜色作为背景色,它所在层面为背景层面;5) If the height and width of the connected domain C are roughly equivalent to the size of the test image, then the center color of C is used as the background color, and the layer where it is located is the background layer;

6)如果通过1),2)的筛选后,如果剩下的层面数大于L个的时候,这里假定前景色不多于L个,便取层面中所包含黑象素总数排在前L+2个的层面。前景指的是整幅图像中所包含的文字字符图像,前景色指的是这些文字字符图像的大致颜色,图像中除了文字字符图像以外的部分都称为背景。6) After passing the screening of 1) and 2), if the number of remaining layers is greater than L, it is assumed that there are no more than L foreground colors, and the total number of black pixels contained in the layer is ranked first L+ 2 levels. The foreground refers to the character images included in the entire image, the foreground color refers to the approximate color of these character images, and the part of the image other than the character images is called the background.

这里,L可以根据实际情况选取,本发明的一般取L=4,在这个范围内取值可以有效的进一步减少备选字符层中的噪声或背景层面,避免字符层的丢失。通过删除噪声层,背景层等上述选取准则以后,剩下的层中将被认为有可能包含文字字符的图像层。Here, L can be selected according to the actual situation. In the present invention, L=4 is generally taken. Taking a value within this range can effectively further reduce the noise or the background layer in the candidate character layer, and avoid the loss of the character layer. After the above selection criteria such as noise layer and background layer are deleted, the remaining layers will be considered as image layers that may contain text characters.

如图4中所示,a为原始文本区域图像,b,c,d,e,f,g,h为根据连通域平均颜色聚类得到的7颜色中心而生成的7个图像层面,这里为了便于处理,各图层都已经转为黑白图像。根据上述准则选取所含象素数目位于前六名的b,c,d,e,f,g六个层面。注意到备选层面仍然过多,下面将对于常见情况的给出进一步字符层面判断准则。As shown in Figure 4, a is the original text area image, b, c, d, e, f, g, h are the 7 image levels generated by the 7 color centers obtained by clustering the average color of the connected domain, here for For ease of processing, each layer has been converted to a black and white image. Select b, c, d, e, f, g six layers which contain the number of pixels in the top six according to the above criteria. Noticing that there are still too many alternative levels, the following will give further character level judgment criteria for common situations.

字符层选择character layer selection

由于本发明不涉及到字符的切分和识别,并且系统一般要求在文字字符图像提取阶段尽量不引入切分信息,因而需要一种简单易行的方法来进行自动的文字字符层面的判决。通过分析印刷文档中文字字符的有两个明显的特点:Since the present invention does not involve character segmentation and recognition, and the system generally requires that no segmentation information be introduced in the character image extraction stage, a simple and easy method is needed for automatic character-level judgment. By analyzing the text characters in printed documents, there are two obvious characteristics:

●  文本区域图像内的文字字符大小基本一致;● The text characters in the image in the text area are basically the same size;

●  文字字符排列较为整齐。● Text characters are neatly arranged.

本发明将利用上述特点定义一种大小一致性准则,进行字符层面。The present invention will utilize the above-mentioned characteristics to define a size consistency criterion at the character level.

由于本发明提供的大小一致性准则主要是利用图像层面中的象素两方向投影的大小,是针对单行文字的投影或者在垂直方向上无交错多行文字情况设定的,并不考虑更为复杂的情况。对于更为复杂的情况,需要更为复杂的切分步骤去得到文字字符块的大小,而本发明这里只是在将文字字符层面送入后续切分识别之前进行的初步判断,因此这就要求在原文本区域图像还符合下述情况下:Because the size consistency criterion provided by the present invention mainly utilizes the size of the two-direction projection of the pixel in the image level, it is set for the projection of a single-line text or the situation of multi-line text without interlacing in the vertical direction, and does not consider more complicated situation. For more complex situations, more complex segmentation steps are needed to obtain the size of the text character block, and the present invention is only a preliminary judgment before sending the text character level into the subsequent segmentation recognition, so this requires The original text area image also meets the following conditions:

●  原文本区域图像内的文字颜色单一;● The text color in the image of the original text area is single;

●  所含文字行或列的总数不超过三个,且在行和列方向都是整齐的,即近似位于一条直线上。● The total number of rows or columns of text contained is not more than three, and the row and column directions are all neat, that is, they are approximately on a straight line.

保证根据本发明定义的大小一致性原则进行文字字符层面的自动判断,得到较高的文字字符层面的判别准确率。It is guaranteed to perform automatic judgment at the character level according to the size consistency principle defined in the present invention, so as to obtain a higher discrimination accuracy rate at the character level.

为了便于说明,以图4中的图层c为例,参照图5所示,假定图像的垂直方向上的高度为H,水平方向上的宽度为V。颜色分层后得到K个层面,对于层面i(1≤i≤K),分别作水平和垂直方向的投影,可以得到水平方向投影宽度的uil(0≤l<Ni)和垂直方向的投影宽度wij(0≤j<Mi),i为图像层面的序号,l代表水平方向投影宽度的序号,j代表垂直方向投影宽度的序号,为了消除小噪声的干扰,每一个坐标位置上的对应的投影黑色象素数目必须超过5个。同时,仅统计两个方向上投影宽度超过10个象素宽的投影个数Ni和Mi,即Ni和Mi分别为在两个方向上得到的符合要求的投影宽度的总数。水平方向上相邻两个投影宽度之间的距离为水平投影间隔宽度eis(0≤s<Zi),垂直方向上相邻两个投影宽度之间的距离为垂直投影间隔宽度dit(0≤t<Yi),Zi和Yi分别为在两个方向上得到的投影间隔宽度的总数。根据得到的以上结果,可以计算得出层面i上投影宽度的平均值:For the convenience of description, take the layer c in FIG. 4 as an example, as shown in FIG. 5 , assume that the height of the image in the vertical direction is H, and the width in the horizontal direction is V. After color layering, K levels are obtained. For level i (1≤i≤K), the horizontal and vertical projections are made respectively, and u il (0≤l<N i ) of the projection width in the horizontal direction and u il in the vertical direction can be obtained. Projection width w ij (0≤j<M i ), i is the sequence number of the image level, l represents the sequence number of the projection width in the horizontal direction, and j represents the sequence number of the projection width in the vertical direction. In order to eliminate the interference of small noises, each coordinate position The number of corresponding projected black pixels must exceed 5. At the same time, only count the number of projections N i and M i whose projection width exceeds 10 pixels in the two directions, that is, N i and M i are the total number of projection widths obtained in the two directions that meet the requirements. The distance between two adjacent projection widths in the horizontal direction is the horizontal projection interval width e is (0≤s<Z i ), and the distance between two adjacent projection widths in the vertical direction is the vertical projection interval width d it ( 0≤t<Y i ), Z i and Y i are respectively the total number of projection interval widths obtained in two directions. According to the above results obtained, the average value of the projection width on layer i can be calculated:

水平方向投影的平均宽度 AvgH i = 1 N i &Sigma; l = 0 N i - 1 u il ; 垂直方向投影的平均宽度The average width of the projection in the horizontal direction ikB i = 1 N i &Sigma; l = 0 N i - 1 u il ; The average width of the vertical projection

AvgWwxya ii == 11 Mm ii &Sigma;&Sigma; jj == 00 Mm ii -- 11 ww ijij ..

层面i上投影间隔宽度的平均值:Average of projected interval widths on slice i:

水平方向投影间隔的平均宽度 AvgE i = 1 Z i &Sigma; s = 0 Z i - 1 e is ; 垂直方向投影的平均宽度The average width of the projection interval in the horizontal direction AvgE i = 1 Z i &Sigma; the s = 0 Z i - 1 e is ; The average width of the vertical projection

AvgDAvgD ii == 11 YY ii &Sigma;&Sigma; tt == 00 YY ii -- 11 dd itit ..

计算得到该层面水平投影宽度的方差为 VarH i = &Sigma; l = 0 N i - 1 ( u il - AvgH i ) 2 / N i , 垂直投影宽度的方差为 VarW i = &Sigma; j = 0 M i - 1 ( w ij - AvgW i ) 2 / M i ; The calculated variance of the horizontal projection width of this layer is Var H i = &Sigma; l = 0 N i - 1 ( u il - ikB i ) 2 / N i , The variance of the vertical projection width is wxya i = &Sigma; j = 0 m i - 1 ( w ij - wxya i ) 2 / m i ;

该层面的水平投影间隔宽度的方差 VarE i = &Sigma; s = 0 Z i - 1 ( e is - Avg E i ) 2 / Z i , 垂直投影间隔宽度的方差 VarD i = &Sigma; t = 0 Y i - 1 ( d it - AvgD i ) 2 / Y i ; The variance of the horizontal projection interval width for this slice Var E i = &Sigma; the s = 0 Z i - 1 ( e is - Avg E. i ) 2 / Z i , Variance of Vertical Projection Interval Width VarD i = &Sigma; t = 0 Y i - 1 ( d it - AvgD i ) 2 / Y i ;

通过分析文字字符连通域的特征可以发现,文字字符图像连通域的大小基本一致,分布比较均匀,根据这些物理特性,可以定义图层的大小一致性判据Pi如下(1≤i≤K):By analyzing the characteristics of the connected domain of text characters, it can be found that the size of the connected domain of text characters and images is basically the same, and the distribution is relatively uniform. According to these physical characteristics, the size consistency criterion P i of the layer can be defined as follows (1≤i≤K) :

PP ii == minmin (( AvgHikB ii // AvgWwxya ii ,, AvgWwxya ii // AvgHikB ii )) &times;&times; Hh &times;&times; VV (( 11 ++ || maxmax (( NN ii ,, Mm ii )) -- maxmax (( Hh // VV ,, VV // Hh )) || // 22 )) &times;&times; (( 11 ++ maxmax (( VarEVarE ii ,, VarDVarD ii )) )) &times;&times; (( 11 ++ maxmax (( VarHVar H ii ,, VarWwxya ii )) ))

max()和min()分别代表括号中两个数值的最大和最小值。max() and min() represent the maximum and minimum of the two values in parentheses, respectively.

计算各个图层的大小一致性判据Pi,并按数值大小排序,最大的即为最可能的文字字符层面。实验结果也表明,通过大小一致性判别准则,可以在一定范围的满足了系统对自动判别文字层面的要求,同时可以为系统提供备选层面的排列顺序,便于后续的处理工作。The size consistency criterion P i of each layer is calculated, and sorted by numerical value, the largest is the most likely character level. The experimental results also show that the size consistency criterion can meet the requirements of the system for automatic discrimination of the text level within a certain range, and at the same time provide the system with the arrangement order of the alternative levels, which is convenient for subsequent processing.

表1给出了,对于图4中的原始文本区域图像a的六个字符代选层面b,c,d,e,f,g的一致性判据,根据Pi得出c图层即为生成的文字字符层面。同时对照比较图4中的c和e,可以很容易的发现,e中大都含有的是文字字符的轮廓边缘,因而其一致性判据排在第二位。由此可以看出,可以按P(i)的大小将备选层面排序。Table 1 shows, for the six character selection levels b, c, d, e, f, g of the original text area image a in Figure 4, the consistency criterion, according to P i , the c layer is obtained as Generated text character level. At the same time, by comparing c and e in Figure 4, it can be easily found that most of e contains the outline edges of text characters, so its consistency criterion ranks second. It can be seen from this that the candidate levels can be sorted according to the size of P(i).

          表1  图像a的各图层的一致性判据Table 1 Consistency criteria of each layer of image a

      b         c         d         e       f         gb b c d d e e f f g

Pi   11.394    82.948    21.704    47.1    10.289    4.819 Pi 11.394 82.948 21.704 47.1 10.289 4.819

由于切分和识别不属于本发明的涉及范围,因而在本发明中将不再作阐述。Since the segmentation and identification do not belong to the scope of the present invention, they will not be elaborated in the present invention.

样本库sample library

为了验证该方法的优越性,根据常见的彩色印刷文档图像建立了一些样本库,如表2所示。In order to verify the superiority of the method, some sample libraries are established based on common color printed document images, as shown in Table 2.

                        表2 样本库数据统计列表Table 2 Statistical list of sample library data

名称                     文本区域图像块数(张)           字符数(个)Name Number of image blocks in the text area (sheets) Number of characters (pieces)

                 标题库       47                          1224Title Library 47 1224

彩色杂志样本库Color Magazine Sample Library

                 正文库       30                          5420Text Library 30 5420

彩色报纸样本库                39                          551Color Newspaper Sample Library 39 551

彩色照片图像库                52                          664Color Photo Image Library 52 664

实验结果Experimental results

表3给出了多种方法的比较结果Table 3 shows the comparison results of various methods

                表3 正确提取字符数比较Table 3 Comparison of the number of correctly extracted characters

                    CRAG     直接颜    连通性    局域自适                                                                                 

字符数(个)Number of characters (a)

                    方法     色聚类    分析法    应动态阈值法                                                            , 

彩色杂志标题库Library of Colored Magazine Titles

                    1156      732       905       847                                                                                 

(1224)(1224)

彩色报纸样本库Color Newspaper Sample Library

                    500       457       318       143                                                                                                    

(551)(551)

彩色照片样本库Color Photo Sample Library

                    631       578       357       277                                                                                                 

(664)(664)

综上所述,可以发现CRAG方法具有在以下几种优点:In summary, it can be found that the CRAG method has the following advantages:

●  算法简单,能有效的克服背景噪声变化的影响;● The algorithm is simple and can effectively overcome the influence of background noise changes;

●  以连通域为单位的颜色聚类使文字更容易被分出来,并减少了运算量;● Color clustering in units of connected domains makes it easier to separate text and reduces the amount of computation;

●  能自动处理反白文字和多色字;● Can automatically process highlighted text and multi-colored text;

●  可以提取前景色范围变化较大的字符图像,利用由于字符本身,或者由于光照而造成颜色渐变的字符;● It can extract character images whose foreground color range changes greatly, and use characters whose colors change gradually due to the characters themselves or due to illumination;

●  受边缘过渡效应影响小,避免了小字符的丢失;● Less affected by the edge transition effect, avoiding the loss of small characters;

●  保留了字符颜色信息;● Retain the character color information;

●  可处理对象范围广:如彩色杂志,报纸和照片图像等。● Can handle a wide range of objects: such as color magazines, newspapers and photo images.

本发明在实验中获得了优异的识别结果,具有非常广泛的应用前景。The invention has obtained excellent recognition results in experiments and has very wide application prospects.

Claims (1)

1. based on character extracting method in the complex background coloured image of run-length adjacency graph, it is characterized in that: it comprises following steps successively:
(1) by image capture device colored printing document or photograph image are scanned in the image processor;
(2) in above-mentioned image processor, set:
The height and width of image are represented with symbol H and V respectively;
Each row pixel and the Euclidean distance o of the colored distance of swimming in rgb space in the image with delegation and its next-door neighbour PqThreshold value be TD;
Begin to count from second row of image, this colour distance of swimming and last adjacent lines are the Euclidean distance o of the colored distance of swimming that links to each other of 4 neighborhoods at rgb space on the position Pp 'Threshold value be TV, choose TD=TV=12~16;
Other connected domains in the set of the initial center of connected domain and all connected domains of composition diagram picture are at the Euclidean distance o of RGB color space CnThreshold value TC, choose TC=20~50;
Connected domain maximum height Hmax=min to be selected (H, 400), number of picture elements;
Connected domain breadth extreme Vmax=min to be selected (V, 400), number of picture elements;
Connected domain minimum constructive height Hmin=3 to be selected, number of picture elements;
Connected domain minimum widith Vmin=3 to be selected, number of picture elements;
The depth-width ratio of connected domain to be selected or the minimum value of the ratio of width to height are 1, and maximal value is 50;
The PEL (picture element) density of each connected domain is used ( &Sigma; u = 1 m n f p u / h n &times; v n ) Expression, h nAnd v nWhat refer to respectively is the height and width of the colored connected domain of gained, m nRepresent the colored number of runs in n the connected domain, f PuRepresent p uThe run length of the individual distance of swimming, set: Q 2 > ( &Sigma; u = 1 m n f p u / h n &times; v n ) > Q 1 , Q 1=0.1~0.5,Q 2=0.6~1;
Threshold value TC=20~50 in connected domain color clustering process;
Count K≤L+2, L=4 choosing the alternative colored aspect that obtains;
(3) cut apart coloured image, obtain colored connected domain, promptly piece image is gathered with connected domain and is described;
(3.1) from each the row first pixel, think that this pixel is the starting point of a new distance of swimming, calculate this starting point and with in the delegation with it next-door neighbour the Euclidean distance o of pixel in rgb space Pq, the wherein said colored distance of swimming is expressed as follows: R p{ (r p, g p, b p), (x p, y p), f p, r p, g p, b pBe on the distance of swimming each point at the r of RGB color space, g, b color component mean value, (x p, y p) be the origin coordinates of this distance of swimming, f pLength for the distance of swimming:
o pq = ( r q - r p ) 2 + ( g q - q p ) 2 + ( b q - b p ) 2 .
If o Pq<TD, then two pixels being merged becomes a distance of swimming, and calculates the average r of this distance of swimming, g, b value, i.e. r p, g p, b p:
r p = ( r p &times; f p + r q ) f p + 1 ; g p = ( g p &times; f p + g q ) f p + 1 ; b p = ( b p &times; f p + b q ) f p + 1 ;
The length of the distance of swimming increases 1:f p=f p+ 1;
Otherwise,, continue to calculate the Euclidean distance of itself and next adjacent image point, if still less than TD just second pixel becomes the starting point of the new distance of swimming, just this pixel is added this distance of swimming, and recomputate its r, g, the b value, otherwise, serve as next new distance of swimming starting point with this picture element; According to above-mentioned rule, traversing graph obtains several colored distances of swimming as all pixels in each row like this;
(3.2) begin to obtain the colored distance of swimming from second row of image after, calculate this distance of swimming and last adjacent lines and be the colored distance of swimming that 4 neighborhoods link to each other Euclidean distance o at rgb space on the position Pp':
o pp &prime; = ( r p &prime; - r p ) 2 + ( g p &prime; - g p ) 2 + ( b p &prime; - b p ) 2 .
Whether judge this distance less than TV,, promptly connect this two distances of swimming if less than then merging into same connected domain; Otherwise, as the initial distance of swimming of new connected domain; After traveling through complete width of cloth image by this way, just can obtain the set { C of all connected domains of composition diagram picture according to the annexation between the distance of swimming n| n=1,2 ..., K};
Described connected domain is represented with following structural:
C n{ (r n, g n, b n), X n, (v n, h n), (r n, g n, b n) that represent is connected domain C nAverage color r, g, the b value,
r n = &Sigma; u = 1 m n ( r p u &times; f p u ) / &Sigma; u = 1 m n f p u - - - ( 1 - 2 )
g n = &Sigma; u = 1 m n ( g p u &times; f p u ) / &Sigma; u = 1 m n f p u - - - ( 1 - 3 )
b n = &Sigma; u = 1 m n ( b p u &times; f p u ) / &Sigma; u = 1 m n f p u - - - ( 1 - 4 )
X n={ R Pu| u=1,2...m nRepresent the set of institute's chromatic colour distance of swimming of comprising in this connected domain, be easy to obtain the high v of connected domain by simple computation nWith wide h n
(4) connected domain is carried out color clustering, to obtain the color cluster center of proper number;
Choose the connected domain sample that participates in color clustering by following three criterions simultaneously:
1) Hmin<h n<Hmax, Vmin<v n<Vmax, the height and the width that promptly participate in the connected domain of color clustering all will be in above-mentioned setting ranges;
2) H _ V min < h n / v n < H - V max , Perhaps V _ H min < v n / h n < V _ H max , H_Vmin wherein and H_Vmax refer to the minimum and the maximal value of the height and the width ratio of connected domain respectively, and same, V_Hmin and V_Hmax refer to the minimum and the maximal value of the ratio of width to height;
3) Q 2 > ( &Sigma; u = 1 m n f p u / h n &times; v n ) > Q 1 , The PEL (picture element) density that is connected domain is at Q 1And Q 2Between;
(5) form the image aspect, and therefrom erased noise layer and significantly background layer, and obtain to comprise the image layer of literal;
(5.1) form the image aspect
All high or wide respectively less than the high or wide connected domain of text filed image all with color center relatively, if the Euclidean distance of the average color of connected domain and color center is less than TC, the connected domain that just will satisfy this condition is placed on the image aspect, thereby can obtain a plurality of aspects, simultaneously they all be transferred to the image of white gravoply, with black engraved characters;
(5.2) get rid of non-legible character layer successively according to following criterion
1) number of picture elements when each character layer is less than 200, is decided to be noise floor, is got rid of;
2) if the height and width of connected domain and test pattern sizableness, just the center color of this connected domain look as a setting, its place aspect is the background aspect;
(5.3) under the condition of the no more than L of foreground, if remaining image aspect number during greater than L, just choose comprise the black picture element sum in the aspect and come before the individual aspect of L+2, as the aspect that may have the alphabetic character image, processing according to the following steps; The alphabetic character image that prospect refers in the entire image to be comprised, foreground refers to the roughly color of these alphabetic character images, and the part in the image except the alphabetic character image all is called background;
(6) the consistance decision value P of the possible alphabetic character image layer of step (5.3) gained that calculates according to consistance criterion formula i, (1≤i≤K), K is above-mentioned aspect number, sorts its P iThe maximum aspect of value is most probable alphabetic character aspect;
(6.1) for a described K aspect respectively as the projection of level and vertical direction, can obtain the u of horizontal direction projection width Il(0≤l<N i) and the w of projection width of vertical direction Ij(0≤j<M i), i is the sequence number of image aspect, and l represents the sequence number of horizontal direction projection width, and j represents the sequence number of vertical direction projection width, and in order to eliminate little interference of noise, the projection black picture element number of the correspondence on each coordinate position must be above 5; Simultaneously, only add up on the both direction projection width and surpass 10 projection number N that pixel is wide iAnd M i, i.e. N iAnd M iBe respectively the sum of the satisfactory projection width that on both direction, obtains; Distance on the horizontal direction between adjacent two projection widths is horizontal projection interval width e Is(0≤s<Z i), the distance on the vertical direction between adjacent two projection widths is vertical projection interval width d It(0≤t<Y i), Z iAnd Y iBe respectively the sum of the projection interval width that on both direction, obtains;
(6.2) calculate following each value:
The mean breadth of horizontal direction projection AvgH i = 1 N i &Sigma; l = 0 N i - 1 u il ,
The mean breadth of vertical direction projection AvgW i = 1 M i &Sigma; j = 0 M i - 1 w ij ,
The mean breadth of horizontal direction projection interval AvgE i = 1 Z i &Sigma; s = 0 Z i - 1 e is ,
The mean breadth of vertical direction projection AvgD i = 1 Y i &Sigma; t = 0 Y i - 1 d it ,
The variance of horizontal projection width is VarH i = &Sigma; l = 0 N i - 1 ( u il - Avg H i ) 2 / N i ,
The variance of vertical projection width is VarW i = &Sigma; j = 0 M i - 1 ( w il - Avg W i ) 2 / M i ,
The variance of horizontal projection interval width VarE i = &Sigma; s = 0 z i - 1 ( e il - Avg E i ) 2 / Z i ,
The variance of vertical projection interval width VarD i = &Sigma; t = 0 Y i - 1 ( d it - Avg D i ) 2 / Y i ;
(6.3) text color is single in former literal field area image, and the sum of contained literal row or column is less than three, and the literal on the row or column direction is approximate point-blank, is calculated as follows consistance criterion value P i:
P i = min ( Avg H i / Avg W i , Avg W i / Avg H i ) &times; H &times; V ( 1 + | max ( N i , M i ) - max ( H / V , V / H ) | / 2 ) &times; ( 1 + max ( Var D i ) ) &times; ( 1 + max ( Var H i , Var W i ) )
I is the aspect number, i=1 ..., K;
To the P that obtains iSort by size, get the maximum literal aspect of its value and use for alphabetic character cutting and identification.
CNB2004100622612A 2004-07-02 2004-07-02 Character extracting method from complecate background color image based on run-length adjacent map Expired - Fee Related CN1312625C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2004100622612A CN1312625C (en) 2004-07-02 2004-07-02 Character extracting method from complecate background color image based on run-length adjacent map

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2004100622612A CN1312625C (en) 2004-07-02 2004-07-02 Character extracting method from complecate background color image based on run-length adjacent map

Publications (2)

Publication Number Publication Date
CN1588431A true CN1588431A (en) 2005-03-02
CN1312625C CN1312625C (en) 2007-04-25

Family

ID=34603673

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2004100622612A Expired - Fee Related CN1312625C (en) 2004-07-02 2004-07-02 Character extracting method from complecate background color image based on run-length adjacent map

Country Status (1)

Country Link
CN (1) CN1312625C (en)

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100442287C (en) * 2005-04-20 2008-12-10 国际商业机器公司 Method and device for processing data flow
CN100487722C (en) * 2005-08-26 2009-05-13 欧姆龙株式会社 Method for determining connection sequence of cascade classifiers with different features and specific threshold
CN100501762C (en) * 2007-04-17 2009-06-17 华东师范大学 A Method for Fast Labeling of Connected Components in Images
CN100555323C (en) * 2005-04-13 2009-10-28 佳能株式会社 The method and apparatus that is used for smoothed binary image
CN101599124B (en) * 2008-06-03 2011-06-22 汉王科技股份有限公司 Method and device for segmenting characters from video image
CN102332097A (en) * 2011-10-21 2012-01-25 中国科学院自动化研究所 Method for segmenting complex background text images based on image segmentation
CN102446274A (en) * 2010-09-30 2012-05-09 汉王科技股份有限公司 Underlined text image preprocessing method and device
CN101753764B (en) * 2008-12-17 2012-09-26 夏普株式会社 Image processing apparatus and method, image reading apparatus, and image sending method
CN101436248B (en) * 2007-11-14 2012-10-24 佳能株式会社 Method and equipment for generating text character string according to image
CN101436254B (en) * 2007-11-14 2013-07-24 佳能株式会社 Image processing method and image processing equipment
CN103281474A (en) * 2013-05-02 2013-09-04 武汉大学 Image and text separation method for scanned image of multifunctional integrated printer
US8768017B2 (en) 2008-11-07 2014-07-01 Olympus Corporation Image processing apparatus, computer readable recording medium storing therein image processing program, and image processing method
CN104463138A (en) * 2014-12-19 2015-03-25 深圳大学 Text positioning method and system based on visual structure attribute
CN104899586A (en) * 2014-03-03 2015-09-09 阿里巴巴集团控股有限公司 Method for recognizing character contents included in image and device thereof
CN104951741A (en) * 2014-03-31 2015-09-30 阿里巴巴集团控股有限公司 Character recognition method and device thereof
CN102725773B (en) * 2009-12-02 2015-12-02 惠普发展公司,有限责任合伙企业 System and method for foreground and background segmentation of digitized images
CN107220949A (en) * 2017-05-27 2017-09-29 安徽大学 The self adaptive elimination method of moving vehicle shade in highway monitoring video
CN110619331A (en) * 2019-09-20 2019-12-27 江苏鸿信系统集成有限公司 Color distance-based color image field positioning method
CN112906469A (en) * 2021-01-15 2021-06-04 上海至冕伟业科技有限公司 Fire-fighting sensor and alarm equipment identification method based on building plan
CN114327341A (en) * 2021-12-31 2022-04-12 江苏龙冠影视文化科技有限公司 Remote interactive virtual display system
CN114913248A (en) * 2022-07-18 2022-08-16 南通金丝楠膜材料有限公司 Self-adaptive control method of corona machine in film production process
CN118506348A (en) * 2024-06-19 2024-08-16 北京蓝湾博阅科技有限公司 A method and system for identifying short play content based on computer vision recognition
CN118628752A (en) * 2024-08-12 2024-09-10 武汉同创万智数字科技有限公司 Garden maintenance information processing system based on image processing

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102136064A (en) * 2011-03-24 2011-07-27 成都四方信息技术有限公司 System for recognizing characters from image
CN102332088B (en) * 2011-06-22 2014-10-29 浙江工业大学 Vote symbolic machine visual identification method based on run length feature

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002185782A (en) * 2000-12-14 2002-06-28 Pfu Ltd Character extraction device, character extraction method, and recording medium

Cited By (29)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100555323C (en) * 2005-04-13 2009-10-28 佳能株式会社 The method and apparatus that is used for smoothed binary image
CN100442287C (en) * 2005-04-20 2008-12-10 国际商业机器公司 Method and device for processing data flow
CN100487722C (en) * 2005-08-26 2009-05-13 欧姆龙株式会社 Method for determining connection sequence of cascade classifiers with different features and specific threshold
CN100501762C (en) * 2007-04-17 2009-06-17 华东师范大学 A Method for Fast Labeling of Connected Components in Images
CN101436254B (en) * 2007-11-14 2013-07-24 佳能株式会社 Image processing method and image processing equipment
CN101436248B (en) * 2007-11-14 2012-10-24 佳能株式会社 Method and equipment for generating text character string according to image
CN101599124B (en) * 2008-06-03 2011-06-22 汉王科技股份有限公司 Method and device for segmenting characters from video image
CN101794434B (en) * 2008-11-07 2016-03-16 奥林巴斯株式会社 Image processing apparatus and image processing method
US8768017B2 (en) 2008-11-07 2014-07-01 Olympus Corporation Image processing apparatus, computer readable recording medium storing therein image processing program, and image processing method
CN101753764B (en) * 2008-12-17 2012-09-26 夏普株式会社 Image processing apparatus and method, image reading apparatus, and image sending method
CN102725773B (en) * 2009-12-02 2015-12-02 惠普发展公司,有限责任合伙企业 System and method for foreground and background segmentation of digitized images
CN102446274A (en) * 2010-09-30 2012-05-09 汉王科技股份有限公司 Underlined text image preprocessing method and device
CN102446274B (en) * 2010-09-30 2014-04-16 汉王科技股份有限公司 Underlined text image preprocessing method and device
CN102332097A (en) * 2011-10-21 2012-01-25 中国科学院自动化研究所 Method for segmenting complex background text images based on image segmentation
CN102332097B (en) * 2011-10-21 2013-06-26 中国科学院自动化研究所 Method for segmenting complex background text images based on image segmentation
CN103281474A (en) * 2013-05-02 2013-09-04 武汉大学 Image and text separation method for scanned image of multifunctional integrated printer
CN103281474B (en) * 2013-05-02 2015-04-15 武汉大学 Image and text separation method for scanned image of multifunctional integrated printer
CN104899586A (en) * 2014-03-03 2015-09-09 阿里巴巴集团控股有限公司 Method for recognizing character contents included in image and device thereof
CN104899586B (en) * 2014-03-03 2018-10-12 阿里巴巴集团控股有限公司 Method and device is identified to the word content for including in image
CN104951741A (en) * 2014-03-31 2015-09-30 阿里巴巴集团控股有限公司 Character recognition method and device thereof
CN104463138A (en) * 2014-12-19 2015-03-25 深圳大学 Text positioning method and system based on visual structure attribute
CN104463138B (en) * 2014-12-19 2018-08-28 深圳大学 The text positioning method and system of view-based access control model structure attribute
CN107220949A (en) * 2017-05-27 2017-09-29 安徽大学 The self adaptive elimination method of moving vehicle shade in highway monitoring video
CN110619331A (en) * 2019-09-20 2019-12-27 江苏鸿信系统集成有限公司 Color distance-based color image field positioning method
CN112906469A (en) * 2021-01-15 2021-06-04 上海至冕伟业科技有限公司 Fire-fighting sensor and alarm equipment identification method based on building plan
CN114327341A (en) * 2021-12-31 2022-04-12 江苏龙冠影视文化科技有限公司 Remote interactive virtual display system
CN114913248A (en) * 2022-07-18 2022-08-16 南通金丝楠膜材料有限公司 Self-adaptive control method of corona machine in film production process
CN118506348A (en) * 2024-06-19 2024-08-16 北京蓝湾博阅科技有限公司 A method and system for identifying short play content based on computer vision recognition
CN118628752A (en) * 2024-08-12 2024-09-10 武汉同创万智数字科技有限公司 Garden maintenance information processing system based on image processing

Also Published As

Publication number Publication date
CN1312625C (en) 2007-04-25

Similar Documents

Publication Publication Date Title
CN1588431A (en) Character extracting method from complecate background color image based on run-length adjacent map
CN1184796C (en) Image processing method and equipment, image processing system and storage medium
CN1119767C (en) Character string extraction apparatus and pattern extraction apparatus
CN1201266C (en) Image processing device and image processing method
CN1253010C (en) Picture compression method and device, and picture coding device and method
CN1290311C (en) Image processing device and method for aligning position between pages of book image data
CN1313963C (en) Character recognition method
CN1516073A (en) Color image processing device and pattern extraction device
CN1269068C (en) Header extracting device and method for extracting header from file image
CN1525733A (en) Boundary detection methods between regions with different characteristics in image data
CN1882035A (en) Image processing apparatus, image processing method, computer program, and storage medium
CN1620094A (en) Image processing apparatus and method for converting image data to predetermined format
CN1696959A (en) Specific subject detection device
CN1882036A (en) Image processing apparatus and method
CN101030257A (en) Document Image Segmentation Method Based on Chinese Character Features
CN1041773C (en) Character recognition method and apparatus based on 0-1 pattern representation of histogram of character image
CN1310182C (en) Method, device and storage medium for enhancing document, image and character recognition
CN1969314A (en) Image processing device and method, storage medium and program thereof
CN1882026A (en) Method of generating information embedded halftone screen code
CN1859541A (en) Image processing apparatus and its control method
CN1099541A (en) image processing device
CN1773501A (en) Image retrieval and formation device, method and program, and recording medium
CN1664859A (en) Image file generation
CN1790377A (en) Reverse character recognition method, quick and accurate block sorting method and text line generation method
CN1841407A (en) Image processing apparatus

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
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20070425

Termination date: 20130702