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
image
connected domain
distance
color
swimming
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 Analysis (AREA)
  • Image Processing (AREA)

Abstract

The invention is a character extracting method in complex background color image based on runlength adjacency graph, which belongs to character extracting field in preprocess of color image character identification. All color connection sections are acquired with CRAG (color run-length adjacency graph) region growing algorithm after the digital color image is acquired, then the color average is carried on with color classification, acquires several color centers, forms different color layers with the color centers, then the color connection regions accordant to connection region differentiation rule are distributed onto several color layers. Finally the character is selected out through character analysis and size consistency differentiation, and acquires the character image. The method has a high speed and accuracy.

Description

Based on character extracting method in the complex background coloured image of run-length adjacency graph
Technical field
Both belong to the image segmentation field based on character extracting method in the complex background coloured image of run-length adjacency graph, belonged to the preprocessing technical field of literal identification again.
Background technology
From have complicated color image, extract alphabetic character, become not only difficulty but also critical step in the colored printing body document recognition system.Often exist a large amount of literal in the colored printing text image He in the photograph image, these Chinese character have comprised a lot of Useful Informations.In order to extract these useful informations, at first to need from the coloured image of complexity, to extract these useful character pictures automatically and accurately, just can be discerned processing.Popular OCR system still can not solve this extraction problem in the complicated color image Chinese words at present.
The extracting method of color document Chinese words character roughly can be divided into two classes: the first kind is not consider distinctive chromatic information in the colored printing document, and directly its scanning is transferred to gray level image, after carry out binaryzation and cut apart.These class methods have been lost the chromatic information of file and picture, have not been suitable for to extract the alphabetic character foreground image from the coloured image of complexity.Second class methods are to utilize colouring information to obtain the connected domain of image earlier, and post analysis obtains the character aspect.Because these class methods have been considered the colouring information of colored printing file and picture more than the first kind, so when processing has the color text image of complex background, have obvious superiority, thereby these class methods have become the focus of present research gradually.
At present, in second class methods, roughly be divided into roughly and can be divided three classes again:
1) edge analysis: the color change place in image extracts the edge, and extracts different color aspects by analyzing the edge.
For complicated phenomenons such as background striped interference, will produce a large amount of edge fractures and the situation of intersecting when adopting edge analysis, bring very big difficulty for cutting apart of color aspect.
2) region growing: carry out region growing, merging according to the colour consistency criterion, cut apart different color aspects
3) cluster analysis: the color characteristic vector of each picture element in the abstract image, and on selected color space, these features are carried out cluster analysis, cut apart the color aspect according to clustering result.Find that by analyzing direct cluster can produce too much cluster centre for the big image of change of background, if employing fuzzy C-means clustering, the less center of shared number of picture elements is lost, can cause losing of small character like this, and because loss edge transition colouring information can cause the too much fracture of stroke.
The method of edge analysis and cluster analysis is not utilized the relevant information of distinctive color of coloured image and position fully, thereby all can not well extract alphabetic character from coloured image.
The growth criterion that traditional region growing algorithm adopts has caused excessive calculation consumption, but the region growing algorithm is considered the color in the coloured image and the relevant information of position exactly, effectively avoid the color cluster method to ignore the defective of positional information, can reduce calculated amount by improving the growth criterion simultaneously.
The present invention is exactly by adopting new region growing algorithm CRAG (Color Run-length Adjacency Graph), search obtains colored connected domain from image, then the average color of these connected domains is carried out color cluster, generate different color aspects according to the color center that obtains.At last obtain needed possible literal aspect according to specific criterion.This method has following advantage:
1) algorithm is simple, and computing velocity is fast;
2) be that the color cluster of unit makes that literal is easier to be branched away with the connected domain;
3) can handle anti-text of an annotated book word automatically;
4) can extract in the image because character itself, perhaps cause the character of color gradient owing to illumination;
5) reserved character colouring information.
The present invention is exactly by colour that utilizes adjacent image point and positional information, combines as main breach with color clustering, has realized the high performance character extraction algorithm of high-speed high accuracy, also is a kind of image segmentation algorithm simultaneously.This is the method that does not all have use in the present every other document.
Summary of the invention
The objective of the invention is to realize the method that the complicated color image Chinese words character based on CRAG structural region growth algorithm extracts, this method also can be applied to the color images field.On the basis of BAG structure, propose the CRAG structure in the new color space, and based on this, proposed a kind of new region growing algorithm.At last, be the extracting method (the CRAG method of indication is the method in following) that core has been set up a kind of color document images Chinese words character with this growth algorithm.
Need to prove that method of the present invention is applicable to other any color spaces, only need be with r (red) hereinafter, g (green), three fundametal components that three kinds of color components of b (indigo plant) correspond respectively to other color spaces get final product, and the threshold value that relates in the method is different and different according to the color space of choosing.The clustering method that the present invention adopts needn't only be confined to the initial clustering method, also can adopt other clustering methods.
The present invention is made up of following 4 parts: color images, and connected domain center color cluster, image layer is looked unfamiliar with character layer and is chosen.
1 color images
The colored connected domain searching algorithm that is based on the CRAG structure that adopts belongs to the region growing algorithm.Here abbreviate the CRAG algorithm as.
BAG (the block adjacency graph) algorithm that the connected domain profile extracts on the thinking of this algorithm and the bianry image is close.The CRAG algorithm is appreciated that into two steps, at first obtains the colored distance of swimming of horizontal direction, then the close colored distance of swimming of adjacent color is constantly merged, and obtains colored connected domain.Be that example describes below with the rgb space:
The colored distance of swimming is expressed as follows: R p{ (r p, g p, b p), (x p, y p), f p, (r wherein p, g p, b p) be 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.
Production method is as follows: 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,
o pq = ( r q - r p ) 2 + ( g q - g p ) 2 + ( b q - b p ) 2 .
If(o pq<TD)
{ r p = ( r p × f p + r q ) f p + 1 ; g p = ( g p × f p + g q ) f p + 1 ; b p = ( b p × f p + b q ) f p + 1 ; f p = f p + 1 ; }
Else{p=p+1;r p=r q;g p=g q;b p=b q;} (1-1)
According to (1-1) as can be known: if o PqLess than threshold value TD, these two pixels are merged into a distance of swimming so, and recomputate the average r of this distance of swimming, g, b value: r p, g p, b pOtherwise,, second pixel just becomes the starting point of the new distance of swimming.Continue to calculate itself and the Euclidean distance of next adjacent image point, if still less than TD, just this pixel is added this distance of swimming, and recomputate its r, g, the b value, otherwise, serve as next one distance of swimming starting point newly 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.
In addition from second row of image, after obtaining a colored distance of swimming, 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 on the position at rgb space Pp ':
o p p ′ = ( r p ′ - r p ) 2 + ( g p ′ - g p ) 2 + ( b p ′ - 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.TD and TV value between 12~16.
As shown in Figure 6: each grid is represented a pixel among the figure, and for pixel " 5 ", the position at " 2,4,6,8 " four neighboring pixels places links to each other with its 4 neighborhood.For the different distances of swimming of two adjacent lines,, claim that so 4 neighborhoods link to each other between these two distances of swimming if the situation that meets the continuous position of 4 neighborhoods shown in Figure 6 is arranged in they each self-contained pixels relative position each other.
According to above-mentioned rule, travel through complete width of cloth image after, 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}.
The organization definition of connected domain is as follows:
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 = Σ u = 1 m n ( r p u × f p u ) / Σ u = 1 m n f p u - - - ( 1 - 2 )
g n = Σ u = 1 m n ( g p u × f p u ) / Σ u = 1 m n f p u - - - ( 1 - 3 )
b n = Σ u = 1 m n ( b p u × f p u ) / Σ u = 1 m n f p u - - - ( 1 - 4 )
X n = { R p u | u = 1,2 . . . m n } Represent 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 nThereby piece image can be described with all connected domains that obtain.
2 connected domain color clustering steps are analyzed
The color of choosing a connected domain is arbitrarily calculated other connected domain and its Euclidean distance o in the RGB color space as initial center Cn:
o cn = ( r n - r c ) 2 + ( g n - g c ) 2 + ( b n - b c ) 2
If less than threshold value TC, with its cluster, recomputate r, g, the average of b is as the center color value of cluster, if greater than TC, then generate second new center, calculate all samples, because the color center position constantly changes according to this method, need to merge the color center of centre distance simultaneously, finally can obtain the color cluster center of proper number less than TC.
Some special connected domain can not be the literal piece, has done a screening in advance, participate in cluster connected domain sample to choose criterion as follows:
1)Hmin<h n<Hmax,Vmin<v n<Vmax;
2 ) - - H _ V min < h n / v n < H _ V max , Perhaps V _ H min < v n / h n < V _ H max ;
3 ) - - Q 2 > ( &Sigma; u = 1 m n f p u / h n &times; v n ) > Q 1 , Here ( &Sigma; u = 1 m n f p u / h n &times; v n ) The PEL (picture element) density of expression connected domain.
H in the following formula 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.
1) in, because character stroke height and width in the test pattern mostly are respectively less than figure image height H and wide V, what is called is high, promptly refers to vertical number of pixels of image, the lateral pixel number of wide finger image.Here set maximum high wide being respectively of connected domain to be selected: Hmax=min (H, 400), Vmax=min (V, 400), this is that and under the situation of 300dpi scanning resolution in the coloured image of typing, the maximum Gao Kuanjun of this character stroke is long less than 400 pixels because at present the font size of the alphabetic character in the colored printing document is mostly less than 120 pounds, simultaneously, consider the high wide of text filed image reality.Hmin and Vmin are respectively the minimum high wide of the connected domain sample that participates in color cluster, if this value has got the rate of recalling that conference reduces small font as can be known by experiment, thereby for make the present invention have widely versatility here value be 3, so both can remove the interference of much noise point, well keep the image of punctuation mark again.
2) H_Vmin in 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.Here according to the characteristics of stroke, minimum value is 1, and maximal value is 50 to get final product.
3) if in Q 1=0.3, Q 2=0.8, part will be excluded by the frame of image and the influence at other long and narrow fine rule edges, need to prove Q 1And Q 2Still can setting value ± about 0.2 change i.e. Q 1Can be in 0.1~0.5 scope value, Q 2Span can be 0.6~1.
In addition, the threshold value TC that has just mentioned can be between 20-50 value, but when TC is less, can cause aspect too much, thereby, TC=45 adopted, reduced the generation of image aspect, reduce calculation consumption, this is a well selection for extract alphabetic character from coloured image, can effectively remove the interference noise point.
More than the difference of setting range of these parameters, can cause the used connected domain number of variations of cluster, also can change the difference of the color center number of generation simultaneously.If what limit is narrow, though can reduce calculated amount, raising speed, to some indivedual background and prospect too the approaching meeting of color cause adhesion; If too wide, can cause the color center of generation too much, increase calculated amount.Thereby, found through experiments: if choosing value in the parameter area above-mentioned can obtain good alphabetic character and extract the result.And, by the restriction of these conditions, further reduced the operand of initial clustering, simultaneously also to a certain degree the place to go partial noise color center.
The generation of 3 image aspects
With 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, the alphabetic character image just may exist on one or more layers like this.If exist height and width to equal the connected domain of text filed image height and width respectively in addition, then the aspect at this connected domain place be decided to be the background aspect.(, the aspect that generates is all transferred to the image of white gravoply, with black engraved characters here for the ease of follow-up cutting identification work.) then, by the non-legible character figure of following criterion elder generation's exclusive segment layer:
1) number of picture elements of each character layer will surpass 200, otherwise is decided to be noise floor;
2) if the height and width of connected domain C and test pattern size are about the same, with the center color of C look as a setting, its place aspect is the background aspect so;
If by 1), 2) screening after, if remaining aspect number greater than L the time, is supposed the no more than L of foreground here, just get comprise the black picture element sum in the aspect and come before the individual aspect of L+2.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.
Here, L can choose according to actual conditions, the L=4 that generally gets of the present invention, and value can effectively further reduce noise or the background aspect in the alternative characters layer in this scope, avoids losing of character layer.By the erased noise layer, background layer etc. are above-mentioned to be chosen after the criterion, will be considered to comprise the image layer of alphabetic character in the remaining layer.
The selection of 4 character aspects
Suppose that the height on the vertical direction of image is H, the width on the horizontal direction is V.Obtain K aspect after the colo(u)r breakup, (1≤i≤K), do the projection of level and vertical direction respectively can obtain the u of horizontal direction projection width for aspect i 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.According to the above result who obtains, can calculate the mean value that aspect i goes up projection width:
The mean breadth of horizontal direction projection Avg H i = 1 N i &Sigma; l = 0 N i - 1 u il ; The mean breadth of vertical direction projection
Avg W i = 1 M i &Sigma; j = 0 M i - 1 w ij .
Aspect i goes up the mean value of projection interval width:
The mean breadth of horizontal direction projection interval Avg E i = 1 Z i &Sigma; s = 0 Z i - 1 e is ; The mean breadth of vertical direction projection
Avg D i = 1 Y i &Sigma; i = 0 Y i - 1 d it .
The variance that calculates this horizontal projection width of aspect is Var H i = &Sigma; l = 0 N i - 1 ( u il - Avg H i ) 2 / N i , The variance of vertical projection width is Var W i = &Sigma; j = 0 M i - 1 ( w ij - Avg W i ) 2 / M i ;
The variance of the horizontal projection interval width of this aspect Var E i = &Sigma; s = 0 Z i - 1 ( e is - Avg E i ) 2 / Z i , The variance of vertical projection interval width Var D i = &Sigma; t = 0 Y i - 1 ( d it - Avg D i ) 2 / Y i ;
Can find by the feature of analyzing the alphabetic character connected domain, the big or small basically identical in alphabetic character image connectivity territory, it is more even to distribute, and according to these physical characteristicss, can define the size identical property criterion P of figure layer iFollowing (1≤i≤K):
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 E i , Var D i ) ) &times; ( 1 + max ( Var H i , Var W i ) )
Max () and min () represent the minimum and maximum value of two numerical value in the bracket respectively.
Calculate the size identical property criterion P of each figure layer i, and by numerical values recited ordering, maximum be most probable alphabetic character aspect.Experimental result also shows, by the size identical property criterion, can be at satisfying of certain limit the requirement of system to automatic differentiation literal aspect, can be convenient to follow-up work of treatment for system provides putting in order of alternative aspect simultaneously.
The invention is characterized in: 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;
In the image each row pixel with delegation and its next-door neighbour's the colored distance of swimming Euclidean distance o in the rgb space again 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 - g 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 p p &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 p u | u = 1,2 . . . m n } Represent 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 Avg H i = 1 N i &Sigma; i = 0 N i - 1 u il ,
The mean breadth of vertical direction projection Avg W i = 1 M i &Sigma; j = 0 M i - 1 w ij ,
The mean breadth of horizontal direction projection interval Avg E 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 Var H i = &Sigma; i = 0 N i - 1 ( u il - AvgH i ) 2 / N i ,
The variance of vertical projection width is VarW i = &Sigma; j = 0 M i - 1 ( w ij - AvgW i ) 2 / M i ,
The variance of horizontal projection interval width Var E i = &Sigma; s = 0 Z i - 1 ( e is - AvgE i ) 2 / Z i ,
The variance of vertical projection interval width VarD i = &Sigma; t = 0 Y i - 1 ( d it - AvgD 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 ( AvgH i / AvgW i , AvgW i / AvgH i ) &times; H &times; V ( 1 + | max ( N i , M i ) - max ( H / V , V / H ) | / 2 ) &times; ( 1 + max ( VarE i , VarD i ) ) &times; ( 1 + max ( Var H i , VarW 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.
(7) the present invention can act on other any color spaces, only need be with r hereinafter, g, three fundametal components that three kinds of color components of b correspond respectively to other color spaces get final product, and the threshold value that relates in the method is different and different according to the color space of choosing.
Experiment effect of the present invention shows, adopt the present invention to handle the coloured image that comprises literal and can obtain the correct extraction ratio of very high alphabetic character: the correct extraction ratio for colored magazine heading alphabetic character is 94.4%, correct extraction ratio 90.7% for alphabetic character on the offset news, the correct extraction ratio 95% of alphabetic character on the photochrome all is higher than the correct extraction ratio of the alphabetic character that adopts existing additive method.
Description of drawings
The hardware of a typical character extraction system of Fig. 1 constitutes.
Fig. 2 is based on the process flow diagram of the alphabetic character extracting method of CRAG.
Fig. 3 CRAG structural representation: 3a,, 3b, 3c, 3d, 3e, 3f, 3g.
Fig. 4 stage construction generates for example: 4a is an original color image, 4b, 4c, 4d, 4e, 4f, 4g, the image aspect of 4h for generating.
Fig. 5 figure layer perspective view: 5a is the vertical direction projection histogram, and 5b is a vertical direction projection width synoptic diagram, and 5c is the horizontal direction projection histogram, and 5d is a horizontal direction projection width synoptic diagram.
Figure 64 neighborhood synoptic diagram that links to each other.
Embodiment
As shown in Figure 1, the character extraction system has two parts to constitute on hardware in coloured image: image capture device and processor.Image capture device generally is a scanner, and digital camera or digital camera are used for obtaining the digital picture that comprises character.Processor generally is that computing machine or some have the terminal of calculation process ability, is used for digital picture is handled, and the style of writing of going forward side by side word character extracts.
Process flow diagram as shown in Figure 2 based on CRAG alphabetic character extracting method.At first by scanner colored printing document etc. is swept, perhaps the coloured image that Digital photographic or video camera are obtained is input to processor (computing machine or other-end treatment facility), obtains containing the coloured image of alphabetic character like this.Then adopt the region growing algorithm to obtain adopting the colored connected domain of CRAG structrual description to these images that comprise character, add the connected domain filter criteria again, the average color of screening back connected domain is carried out simple color cluster, the different color center that obtains, can generate different color image aspects according to these color center, obtain alphabetic character image aspect to be selected by the size identical property criterion at last, promptly change required alphabetic character bianry image into, send into follow-up character cutting and identification module and handle.
Split image obtains connected domain
After the coloured image that will comprise alphabetic character changed digital picture input computing machine into, adopting CRAG algorithm exploded view to look like was a plurality of connected domains.This algorithm is appreciated that into two steps, at first obtains the colored distance of swimming of horizontal direction, then the close colored distance of swimming of adjacent color is constantly merged, and obtains colored connected domain.
The colored distance of swimming is expressed as follows: R p{ (r p, g p, b p), (x p, y p), f p, (r wherein p, g p, b p) be 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.
Production method is as follows: 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,
o pq = ( r q - r p ) 2 + ( g q - g p ) 2 + ( b q - b p ) 2 .
If(o pq<TD)
{ 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 ; f p = f p + 1 ; }
Else{p=p+1;r p=r q;g p=g q;b p=b q;} (1-1)
According to (1-1) as can be known: if o PqLess than threshold value TD, these two pixels are merged into a distance of swimming so, and recomputate the average r of this distance of swimming, g, b value: r p, g p, b pOtherwise,, second pixel just becomes the starting point of the new distance of swimming.Continue to calculate itself and the next adjacent Euclidean distance that resembles rope, if still less than TD, 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.
In addition from second row of image, after obtaining a colored distance of swimming, 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 on the position at rgb space 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.
As shown in Figure 6: each grid is represented a pixel among the figure, and for pixel " 5 ", the position at " 2,4,6,8 " four neighboring pixels places links to each other with its 4 neighborhood.For the different distances of swimming of two adjacent lines,, claim that so 4 neighborhoods link to each other between these two distances of swimming if the situation that meets the continuous position of 4 neighborhoods shown in Figure 6 is arranged in they each self-contained pixels relative position each other.
According to above-mentioned rule, travel through complete width of cloth image after, 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}.
The organization definition of connected domain is as follows:
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 p u | u = 1,2 . . . m n } Represent 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 nThereby piece image can be described with all connected domains that obtain.
Thresholding TD and TV are the important parameters that influences the algorithm success or not, if select too smallly, it is more broken that character is got, lost the meaning of region growing, essence is the positional information of having lost pixel, the conforming extracting rule of the prospect of having destroyed has increased the operand of next step connected domain color cluster simultaneously; If obtain excessively, can make character connected domain and other target adhesion.The present invention adopts empirical parameter here, when this scope of TD=TV=12~16 time, can obtain good result through experimental verification, if surpass this scope, tend to cause a lot of characters and background adhesion, promptly can't from similar background, extract character.
Shown in Figure 3 as Fig. 3: background is yellowish green dichromatism, and the prospect character is that image B 1 and the background image B2 that the coloured image A of gradual change look literal can regard as by prospect alphabetic character R forms, and the connected domain C of letter r is formed in figure C1 statement 1The CRAG structure form, some rectangular blocks are used for representing the colored distance of swimming that this connected domain comprises among the figure, each distance of swimming width is a pixel, the broken line between the colored distance of swimming is represented the annexation that exists between the close colored distance of swimming of these colors in the connected domain.Same background image B2 can use connected domain C2, and C3 and C4 unite statement.Suppose the edge effect of ignoring this figure, adopt the CRAG algorithm just can obtain forming the set { C of the connected domain of image A n| n=1,2 ..., K}, K=3, h 1And v 1Be respectively the height and width of C1, h 2And v 2Then be respectively the height and width of C2.For the characteristics of this algorithm are described better, what the character prospect adopted here is the gradual change color.H and V represent the height and width of original image respectively.
Color cluster
Color is to distinguish the important criterion of character prospect and background.For human eye can be seen clearly, the general and background of the color of character itself has sizable difference.The different zone of color is separated on the different image layer, is convenient to obtaining of alphabetic character zone, and can realizes such target the step of color cluster.
Obtain after the connected domain, adopt specific connected domain filter criteria, the average color of satisfactory connected domain is carried out cluster, obtain some cluster centres, represent and constitute a kind of aspect of color with each cluster centre according to the prospect characteristics.Color according to each connected domain is nearer from which cluster centre, and it is assigned on the layer of respective color.
General clustering algorithm need be known the number of cluster centre in advance, and the number of cluster centre can't realize determining in an application of the invention.In addition, color distinction is assigned on the different layers greater than the connected domain of predetermined value.So that making the background of literal and prospect separates.Thereby, adopting the method for selecting initial cluster center here, clustering method is as described below:
The color of choosing a connected domain is arbitrarily calculated other connected domain and its Euclidean distance in the RGB color space as initial center, if less than threshold value TC, with its cluster, recomputate r, g, the average of b is as the center color value of cluster, if greater than TC, then generate second new center, calculate all samples, because the color center position constantly changes according to this method, need to merge the color center of centre distance simultaneously, finally can obtain the color cluster center of proper number less than TC.
Some special connected domain can not be the literal piece, has done a screening in advance, participate in cluster connected domain sample to choose criterion as follows:
1)Hmin<h n<Hmax,Vmin<v n<Vmax;
2 ) - - H _ V min < h n / v n < H _ V max , Perhaps V _ H min < v n / h n < V _ H max ;
3 ) Q 2 > ( &Sigma; u = 1 m n f p u / h n &times; v n ) > Q 1 , Here ( &Sigma; u = 1 m n f p u / h n &times; v n ) The PEL (picture element) density of expression connected domain.
H in the following formula nAnd v nWhat refer to respectively is the height and width of the colored connected domain of gained.
1) in, because character stroke height and width in the test pattern mostly are respectively less than figure image height H and wide V, what is called is high, promptly refers to vertical number of pixels of image, the lateral pixel number of wide finger image.Here set maximum high wide being respectively of connected domain to be selected: Hmax=min (H, 400), Vmax=min (V, 400), this is that and under the situation of 300dpi scanning resolution in the coloured image of typing, the maximum Gao Kuanjun of this character stroke is long less than 400 pixels because at present the font size of the alphabetic character in the colored printing document is mostly less than 120 pounds, simultaneously, consider the high wide of text filed image reality.Hmin and Vmin are respectively the minimum high wide of the connected domain sample that participates in color cluster, if this value has got the rate of recalling that conference reduces small font as can be known by experiment, thereby for make the present invention have widely versatility here value be 3, so both can remove the interference of much noise point, well keep the image of punctuation mark again.
2) H_Vmin in 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.Here according to the characteristics of stroke, minimum value is 1, and maximal value is 50 to get final product.
3) if in Q 1=0.3, Q 2=0.8, part will be excluded by the frame of image and the influence at other long and narrow fine rule edges, need to prove Q 1And Q 2Still can setting value ± about 0.2 change i.e. Q 1Can be in 0.1~0.5 scope value, Q 2Span can be 0.6~1.
In addition, the threshold value TC that has just mentioned can be between 20-50 value, but when TC is less, can cause aspect too much, thereby, TC=45 adopted, reduced the generation of image aspect, reduce calculation consumption, this is a well selection for extract alphabetic character from coloured image, can effectively remove the interference noise point.
More than the difference of setting range of these parameters, can cause the used connected domain number of variations of cluster, also can change the difference of the color center number of generation simultaneously.If what limit is narrow, though can reduce calculated amount, raising speed, to some indivedual background and prospect too the approaching meeting of color cause adhesion; If too wide, can cause the color center of generation too much, increase calculated amount.Thereby, found through experiments: if choosing value in the parameter area above-mentioned can obtain good alphabetic character and extract the result.And, by the restriction of these conditions, further reduced the operand of initial clustering, simultaneously also to a certain degree the place to go partial noise color center.Compare with directly adopting C mean cluster method, thereby the cluster sample number has reduced the cluster operand, the smoothing process that has overcome the fuzzy C average simultaneously causes the problem that the less alphabetic character of shared pixel is lost.
Image layered
After the connected domain color cluster, calculate the Euclidean distance of connected domain and cluster centre.If distance is less than TC, the connected domain that promptly has similar colour is assigned on the layer, just can generate different image layer.
In the process that generates the alphabetic character layer images, need some connected domain filter criteria equally, but, the printing word font size is mostly between 10pt-12pt, the existence of cromogram picture point diffusional effect simultaneously, the stroke connected domain that obtains alphabetic character is all smaller, and punctuation mark also need be taken into account.Thereby, to lose and cause stroke fracture for fear of little connected domain, the filter criteria that the connected domain filter criteria when generating the character aspect adopts during with color cluster is also inequality.
In this step, with 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, the alphabetic character image just may exist on one or more layers like this.If exist height and width to equal the connected domain of text filed image height and width respectively in addition, then the aspect at this connected domain place be decided to be the background aspect.(, the aspect that generates is all transferred to the image of white gravoply, with black engraved characters here for the ease of follow-up cutting identification work.) then, by the non-legible character figure of following criterion elder generation's exclusive segment layer:
4) number of picture elements of each character layer will surpass 200, otherwise is decided to be noise floor;
5) if the height and width of connected domain C and test pattern size are about the same, with the center color of C look as a setting, its place aspect is the background aspect so;
6) if by 1), 2) screening after, if remaining aspect number greater than L the time, is supposed the no more than L of foreground here, just get comprise the black pixel sum in the aspect and come before the individual aspect of L+2.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.
Here, L can choose according to actual conditions, the L=4 that generally gets of the present invention, and value can effectively further reduce noise or the background aspect in the alternative characters layer in this scope, avoids losing of character layer.By the erased noise layer, background layer etc. are above-mentioned to be chosen after the criterion, will be considered to comprise the image layer of alphabetic character in the remaining layer.
As shown in Figure 4, a is the urtext area image, b, and c, d, e, f, g, 7 image aspects that h generates for 7 color center that obtain according to connected domain average color cluster, for the ease of handling, each figure layer has all transferred black white image to here.Choose contained number of pixels according to above-mentioned criterion and be positioned at the b of the first six, c, d, e, f, six aspects of g.Notice that alternative aspect is still too much, below will be for the further character aspect of providing of common situation judgment criterion.
Character layer is selected
Because the present invention does not relate to the cutting and the identification of character, and general requirement of system do not introduce segmental information in the alphabetic character image extraction stage as far as possible, thereby a kind of simple method of needs be carried out the judgement of automatic alphabetic character aspect.By analyzing two the tangible characteristics that have of document printing Chinese words character:
● the alphabetic character size basically identical in the text filed image;
● alphabetic character is arranged comparatively neat.
The present invention will utilize These characteristics to define a kind of size identical property criterion, carry out the character aspect.
Because size identical property criterion provided by the invention mainly is to utilize the size of pixel two direction projections in the image aspect, be at the projection of single line text or do not have staggered multirow literal situation setting in vertical direction, do not consider more complicated situation.For complicated situation more, need more complicated cutting step to go to obtain the size of alphabetic character piece, and the present invention is just sending into the alphabetic character aspect the preliminary judgement of carrying out before the follow-up cutting identification here, so this just requires also to meet under the following situation at former text filed image:
● the text color in the former text filed image is single;
● the sum of contained literal row or column is no more than three, and is expert at and column direction all is neat, promptly approximate being positioned on the straight line.
The size identical property principle that assurance defines according to the present invention is carried out the automatic judgement of alphabetic character aspect, obtains the differentiation accuracy rate of higher alphabetic character aspect.
For convenience of explanation, be example with the figure layer c among Fig. 4, with reference to shown in Figure 5, suppose that the height on the vertical direction of image is H, the width on the horizontal direction is V.Obtain K aspect after the colo(u)r breakup, (1≤i≤K), do the projection of level and vertical direction respectively can obtain the u of horizontal direction projection width for aspect i 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.According to the above result who obtains, can calculate the mean value that aspect i goes up projection width:
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 .
Aspect i goes up the mean value of projection interval width:
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 that calculates this horizontal projection width of aspect is VarH i = &Sigma; l = 0 N i - 1 ( u il - AvgH i ) 2 / N i , The variance of vertical projection width is VarW i = &Sigma; j = 0 M i - 1 ( w ij - AvgW i ) 2 / M i ;
The variance of the horizontal projection interval width of this aspect VarE i = &Sigma; s = 0 Z i - 1 ( e is - Avg E i ) 2 / Z i , The variance of vertical projection interval width VarD i = &Sigma; t = 0 Y i - 1 ( d it - AvgD i ) 2 / Y i ;
Can find by the feature of analyzing the alphabetic character connected domain, the big or small basically identical in alphabetic character image connectivity territory, it is more even to distribute, and according to these physical characteristicss, can define the size identical property criterion P of figure layer iFollowing (1≤i≤K):
P i = min ( AvgH i / AvgW i , AvgW i / AvgH i ) &times; H &times; V ( 1 + | max ( N i , M i ) - max ( H / V , V / H ) | / 2 ) &times; ( 1 + max ( VarE i , VarD i ) ) &times; ( 1 + max ( VarH i , VarW i ) )
Max () and min () represent the minimum and maximum value of two numerical value in the bracket respectively.
Calculate the size identical property criterion P of each figure layer i, and by numerical values recited ordering, maximum be most probable alphabetic character aspect.Experimental result also shows, by the size identical property criterion, can be at satisfying of certain limit the requirement of system to automatic differentiation literal aspect, can be convenient to follow-up work of treatment for system provides putting in order of alternative aspect simultaneously.
Table 1 has provided, and selects aspect b for six characters generation of the urtext area image a among Fig. 4, c, and d, e, f, the consistance criterion of g is according to P iDraw the alphabetic character aspect that c figure layer is generation.Compare c and e among Fig. 4 simultaneously, can find easily, mostly contain the contour edge that has plenty of alphabetic character among the e, thereby its consistance criterion comes second.This shows, can be by big young pathbreaker's optional layer face ordering of P (i).
The consistance criterion of each figure layer of table 1 image a
b c d e f g
P i 11.394 82.948 21.704 47.1 10.289 4.819
Because cutting and identification do not belong to coverage of the present invention, thereby will not remake elaboration in the present invention.
The sample storehouse
In order to verify the superiority of this method, set up some sample storehouses according to common colored printing file and picture, as shown in table 2.
The tabulation of table 2 sample database data statistics
Name text area image piece number (opening) number of characters (individual)
Title storehouse 47 1224
Colored magazine sample storehouse
Positive library 30 5420
Offset news sample storehouse 39 551
Photochrome image library 52 664
Experimental result
Table 3 has provided the comparative result of several different methods
Table 3 is correct to extract number of characters relatively
The connective local of the direct face of CRAG is from suitable
Number of characters (individual)
Method look clustering methodology is answered dynamic thresholding method
Colored magazine title storehouse
1156 732 905 847
(1224)
Offset news sample storehouse
500 457 318 143
(551)
Photochrome sample storehouse
631 578 357 277
(664)
In sum, can find that the CRAG method has in following several advantages:
● algorithm is simple, can effectively overcome the influence that ground unrest changes;
● be that the color cluster of unit makes that literal is easier to be branched away with the connected domain, and reduced operand;
● can handle anti-text of an annotated book word and polychrome word automatically;
● can extract the bigger character picture of foreground range, utilize, perhaps cause the character of color gradient owing to illumination owing to character itself;
● be subjected to the edge transition effects little, avoided losing of small characters;
● kept character color information;
● but the process object scope is wide: as colored magazine, and newspaper and photograph image etc.
The present invention has obtained excellent recognition result in experiment, have very 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 (21)

* 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 华东师范大学 Method for rapid marking image connection element
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 惠普发展公司,有限责任合伙企业 The System and method for of the prospect background segmentation of digitized image
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

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 extracting device, character extracting method and recording medium

Cited By (27)

* 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 华东师范大学 Method for rapid marking image connection element
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
CN101599124B (en) * 2008-06-03 2011-06-22 汉王科技股份有限公司 Method and device for segmenting characters from video image
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
CN101794434B (en) * 2008-11-07 2016-03-16 奥林巴斯株式会社 Image processing apparatus 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 惠普发展公司,有限责任合伙企业 The System and method for of the prospect background segmentation of digitized image
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
CN103281474B (en) * 2013-05-02 2015-04-15 武汉大学 Image and text separation method for scanned image of multifunctional integrated printer
CN103281474A (en) * 2013-05-02 2013-09-04 武汉大学 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

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
CN1136516C (en) Apparatus of treating colour pictures and pattern extracting device
CN1201266C (en) Image processing apparatus, image processing method and program, and its recording medium
CN100345165C (en) Method and apparatus for image-based photorealistic 3D face modeling
CN1313963C (en) Character recognition method
CN1290311C (en) Image processing device and method for aligning position between pages of book image data
CN1525733A (en) Boundary detection method between areas having different features in image data
CN1311394C (en) Appts. and method for binary image
CN1396775A (en) Method and device for splitting pixel image
CN1729485A (en) Method and device for tracing moving object in image
CN1684492A (en) Image dictionary creating apparatus, coding apparatus, image dictionary creating method
CN1452388A (en) Picture compression method and device, and picture coding device and method
CN1945599A (en) Image processing device, image processing method, and computer program product
CN1592915A (en) User definable image reference points
CN1913573A (en) Image processing apparatus for image retrieval and control method therefor
CN1359587A (en) Recording of information
CN1741035A (en) Blocks letter Arabic character set text dividing method
CN1400806A (en) Adaptive two-valued image processing method and equipment
CN1969314A (en) Image processing device and method, recording medium, and program
CN1664846A (en) On-line hand-written Chinese characters recognition method based on statistic structural features
CN1859541A (en) Image processing apparatus and its control method
CN1773501A (en) Image searching device, image forming device, image searching method, image searching program, and computer-readable storage medium
CN100346339C (en) Image search program

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