CN101030257A - File-image cutting method based on Chinese characteristics - Google Patents

File-image cutting method based on Chinese characteristics Download PDF

Info

Publication number
CN101030257A
CN101030257A CN 200710065408 CN200710065408A CN101030257A CN 101030257 A CN101030257 A CN 101030257A CN 200710065408 CN200710065408 CN 200710065408 CN 200710065408 A CN200710065408 A CN 200710065408A CN 101030257 A CN101030257 A CN 101030257A
Authority
CN
China
Prior art keywords
filtering
saltus step
pixel
image
row
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 200710065408
Other languages
Chinese (zh)
Other versions
CN100428268C (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.)
Communication University of China
Original Assignee
Communication University of China
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 Communication University of China filed Critical Communication University of China
Priority to CNB2007100654087A priority Critical patent/CN100428268C/en
Publication of CN101030257A publication Critical patent/CN101030257A/en
Application granted granted Critical
Publication of CN100428268C publication Critical patent/CN100428268C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

A method for dividing file image based on Chinese character feature includes fetching file image and converting image to be grey scale if image is color image, carrying out recurrence layering according to maximum value obtained based on ratio of maximum type space to minimum type internal space, sequencing each layered image and combining sequenced sub-layer images, carrying out text division on combined sub-layer image and combining divided results of various sub-layer images to be final result.

Description

File-image cutting method based on Hanzi features
Technical field
The present invention is a kind of file-image cutting method based on Hanzi features, cuts apart at colour or gray scale scanning image, belongs to the computer digital image processing technology field.
Background technology
The file and picture partitioning algorithm is widely used in printing, fax, OCR (Optical CharacterRecognition, optical character identification), Flame Image Process work such as file and picture compression, it makes the effective search and the storage of the text image in the large database be more prone to, and is the strong instrument that extracts document data from file and picture.
Existing file-image cutting method roughly can be divided into based on piecemeal and based on the dividing method of layering.Based on the dividing method of piecemeal, earlier input picture is carried out piecemeal, and then each subimage block is handled.Based on the dividing method of layering, earlier input picture is pressed certain criterion layering, then each sublayer image is handled.Carrying out layering based on the maximal value of distance ratio in maximum between class distance and the infima species is image layered common method.Specifically describe as follows:
1) the ratio J of distance in computed image histogram and maximum kind spacing thereof and the infima species f(t).
2) according to J fT when (t) getting maximal value ThValue is divided into image two-layer.
If the sum of all pixels of piece image I is n, gray level is [0, T-1], and wherein the pixel count of gray-scale value i is n iGradient threshold t ThIt is divided into two sub-tomographic images of A, B, and wherein the sum of all pixels of A is n A, gray level be [0,1 ..., t Th], the sum of all pixels of B is n B, gray level is [t Th+ 1,0,1 ..., T-1], then
n A = Σ i = 0 t th n i
n B = Σ i = t th + 1 T - 1 n i
n = n A + n B = Σ i = 0 T - 1 n i
The frequency h that each gray level i of sublayer image A, B and original image I occurs i A, h i BAnd h i IBe respectively
h i A = n i n A i=0,1,…,t th
h i B = n i n B i=t th+1,t th+2,…,T-1
h i I = n i n i=0,1,…,T-1
The Probability p that sublayer image A, B occur A, p BBe respectively
p A = n A n = Σ i = 0 t th h i I
p B = n B n = Σ i = t th + 1 T - 1 h i I = 1 - p A
The gray average m of sublayer image A, B and original image I A, m BBe respectively with m
m A = Σ i = 0 t th i h i A
m B = Σ i = t th + 1 T - 1 i h i B
m = Σ i = 0 T - 1 i h i I
When two sub-tomographic images are considered as two time-likes, their between class distance is
s b 2 ( t ) = p A ( m A - m ) 2 + p B ( m B - m ) 2 - - - ( 5 )
Distance is in the class
s w 2 ( t ) = p A Σ i = 0 t th ( i - m A ) 2 h i A + p B Σ i = t th + 1 T - 1 ( i - m B ) 2 h i B
= Σ i = 0 t th ( i - m A ) 2 h i I + Σ i = t th + 1 T - 1 ( i - m B ) 2 h i I
So, according in maximum kind spacing and the infima species apart from than the maximal value criterion, optimal threshold t ThShould satisfy
J f ( t ) = s b 2 ( t ) s w 2 ( t ) | t = t th → max
For the file and picture of complex background (character and patterning), still lack effective dividing method at present.(Yen-Lin Chen such as Yen-Lin Chen, Chung-Cheng Chiu and Bing-Fei Wu.Complex Document Image Segmentation using Localized Histogram Analysiswith Multi-Layer Matching and Clustering, 2004 IEEE InternationalConference on Systems, Man and Cybernetics:3063-3070) a kind of dividing method based on the zone has been proposed, this method is at first carried out even piecemeal to image, and utilize the histogram information antithetical phrase piece of each sub-piece to carry out layering, and then each sublayer is connected according to information such as sublayer edge of image, the sublayer that will belong to same type is connected to a big sublayer, at last text layers is carried out in these sublayers and judge, be partitioned into text.This method is calculated more complicated, image is carried out piecemeal handle the fracture that causes Chinese character easily.
Summary of the invention
The present invention proposes a kind of partitioning algorithm at complicated file and picture, this method is calculated simple, is not easy to cause the Chinese character fracture.
The invention belongs to image segmentation based on layering, according in maximum kind spacing and the infima species apart from than the maximal value criterion, input picture is carried out the recurrence layering, obtain a series of layering file and picture, and according to sublayer image pixel gray scale maximal value, to each tomographic image ordering.Merge rule according to the sublayer image, the result who sorts is carried out the sublayer image merge, obtain final plurality of sub tomographic image.Text segmentation is carried out in each sublayer after being combined, and each layer segmentation result merged, and obtains final split image.
Concrete innovative point: image layered recurrence stop criterion; The merging rule of relevant sublayer; Image segmentation based on Hanzi features.Particular content is as follows:
1, image layered recurrence stop criterion: in the maximum kind spacing of utilizing above-mentioned introduction and the infima species apart from than the maximal value criterion, input picture is divided into two-layer.The invention reside in, layering is continued in the sublayer of telling, till satisfying the recurrence stop criterion.Then and according to sublayer image pixel gray scale maximal value, sorted in a series of sublayers that are partitioned into.
2, the merging rule of relevant sublayer:, all be not beneficial to the text segmentation of image for ordering each sublayer image.The invention reside in,, utilize the merging rule that relevant sublayer is merged ordering each sublayer image.Sublayer image after the merging helps cutting apart of text.
3, based on the image segmentation of Hanzi features: the invention reside in, the connected region information that each sublayer image is comprised is calculated in the sublayer after being combined, and judges Chinese character zone and background area according to its feature, the background area is considered remove then.Segmentation result to each sublayer image is merged into final segmentation result.
Technical scheme of the present invention as shown in Figure 1.This file-image cutting method based on Hanzi features, with the image of gray scale or colored bmp form (or the image transitions of extended formatting is the bmp form) as input, be stored on hard disc of computer or the mobile storage medium, carry out computing and processing by computing machine again.Its main process is: computer system receives input picture, by segmentation procedure it is handled again.
The concrete grammar step is:
Behind the input file and picture, if coloured image then will transfer gray level image to, the grey level histogram of computed image then, utilize histogram that gray level image is carried out the recurrence layering, and the layering result sorted, according to merging criterion the correlator tomographic image is merged, the sublayer image after being combined carries out the dividing processing based on Hanzi features again, and merges the segmentation result of each layered image.
1, the method step of recurrence layering is as follows:
If gradation of image value t is in [a, b] (a, b are integer for 0≤a<256,0≤b<256, a<b) scope, primary gradient threshold is for making J f(t) obtain peaked t Th, image is divided into two-layer, the scope of its gray-scale value is respectively [a, t Th] and [t Th+ 1, b].Next, continue at [a, t Th] and [t Th+ 1, b] find out on the interval and make J fPairing gradient threshold t when (t) obtaining maximal value Th1And t Th2, with each sublayer image layering again.So carry out, up to satisfying following end condition:
If treat the interval [t of being of the gray-value variation of layered image 1, t 2] (t 1<t 2), this interval sum of all pixels, gray average and variance are respectively n t, m tAnd δ tWork as δ t<c * m t(0.01<c<0.3) or n tDuring>d * n (0.01<d<0.5), promptly stop this image is continued layering.Wherein, n is the sum of all pixels of original document image, and i is a pixel grayscale, h i tThe frequency that in treating layered image, occurs for i.
m t = Σ i = t 1 t 2 i h i t
δ t 2 = Σ i = t 1 t 2 n i ( i - m t ) 2
n t = Σ i = t 1 t 2 n i
After the recurrence layering is finished,, it is increased progressively (or successively decreasing) ordering according to each layering sub-image pixels grayscale maximal value.After the ordering, the gray-scale value scope of each sublayer image adjoins each other but non-overlapping copies.
2, the method step of sublayer merging is as follows:
The merging here is meant two sub-tomographic image additions, obtains a new sublayer image.For ordering each sublayer image, all be not beneficial to the text segmentation of image, need merge the correlator tomographic image.Judge at first whether need merge, merge if desired if working as anterior layer, should merge to which sublayer that is adjacent, as if having only an adjacent layer when anterior layer, then directly merging.The new sublayer image that obtains after being combined is judged, and is merged according to judgement, till not satisfying the merging condition.So go on, till the merging condition is not all satisfied in all sublayers.Merging can be undertaken by the order that increases progressively (perhaps successively decreasing).
If n altogether of ordering sublayer image, wherein i sub-tomographic image s iThe gray-scale value scope be [t i, t I+1-1], i=0,1 ..., n-1.To s i, n p(grey scale pixel value is at [t for the sum of expression effective pixel points i, t I+1-1] Nei pixel is a valid pixel, otherwise is inactive pixels), n PhRepresent total hole pixel number (between two effective pixel points with delegation, if having only an inactive pixels point, then these two effective pixel points are called the hole pixel), n r 0Connected region sum in the expression subimage, n RsRepresent that (little connected region is meant that the valid pixel that comprises counts less than the connected region of N to little connected region sum.Wherein, 0<N<50), n PsRepresent the effective pixel points sum that all little connected regions are contained, n R max pRepresent the contained effective pixel points sum in largest connected zone (largest connected zone is meant and comprises the maximum connected region of effective pixel number), n ρ sExpression valid pixel density is less than the effective pixel points sum that all connected regions comprised (valid pixel density is meant this connected region effective pixel points sum that comprises and the ratio that surrounds this connected region minimum rectangle area) of R, wherein, 0<R<0.5, then satisfy one of following 4 conditions, this layer s iNeed to merge:
(1) if n Ph>a * n p, then merge; (a>0.05)
(2) if n rs > b × n r 0 And n R max p<c * n p, then merge; (b>0.6, c>0.1)
(3) if n Ps>d * n p, then merge; (d>0.3)
(4) if n ρ s>e * n p, then merge.(e>0.3)
The determination methods that specifically merges to which layer is:
If sublayer s to be combined iPreceding one deck and the back one deck be respectively s I-1And s I+1, its gray-scale value scope is respectively [t I-1, t i-1] and [t I+1, t I+2-1], its connected region sum that comprises is respectively n r -1And n r 1If s iWith s I-1Merge, then new layer is s I-1', scope is [t I-1, t I+1-1], the connected region number is n rIf s iWith s I+1Merge, then new layer is s I+1', scope is [t i, t I+2-1], the connected region number is n r'.
Combining step is:
(1) calculates s I-1With s iThe ratio r of contained connected region number 1, r 1 = min ( n r - 1 , n r 0 ) max ( n r - 1 , n r 0 ) ; s I+1With s iThe ratio r of contained connected region number 2, r 2 = min ( n r 1 , n r 0 ) max ( n r 1 , n r 0 ) .
(2) calculate s I-1' with s I-1The ratio r of contained connected region number 1', r 1 ′ = n r n r - 1 ; s I+1' with s I+1The ratio r of contained connected region number 2', r 2 ′ = n r ′ n r 1 ;
(3) if (r 1+ r 1')≤(r 2+ r 2'), then with s iWith s I-1Merge; If (r 1+ r 1')>(r 2+ r 2'), then with s iWith s I+1Merge.
3, the text segmentation of sublayer image
Concrete steps are as follows:
For the subimage s after merging i(its wide and height is respectively l w, l h, total valid pixel number is n p), carry out region growing (promptly seeking out all connected regions that constitute by valid pixel), obtain a series of connected region.For i connected region, its valid pixel density is ρ i:
ρ i = n i w i × h i
Wherein, n iRepresent the valid pixel number that it comprises, w iAnd h iWide and high (is unit with the pixel count) of this connected region minimum rectangle surrounded in expression respectively.
For single connected region and surround the minimum rectangle of this connected region, the present invention proposes as gives a definition:
1) saltus step pixel p v: in delegation (perhaps in same row), each valid pixel adjacent with inactive pixels is the saltus step pixel, and all are positioned at the pixel of square boundary, though the inactive pixels of itself and square boundary outside is adjacent, does not belong to the saltus step pixel.
2) hole pixel p h: have only an inactive pixels between two saltus step pixels in delegation, these two saltus step pixels are the hole pixel;
3) saltus step row w v, comprise the row of saltus step pixel;
4) saltus step row h v: the row that comprise the saltus step pixel;
5) the capable w of hole h: the row that comprises the hole pixel;
6) outer saltus step pixel p Ov: for row, be meant first saltus step pixel or last saltus step pixel of certain saltus step row, wherein, first saltus step pixel left side is an inactive pixels, and last saltus step pixel right side is an inactive pixels.
7) the plain p of introskip transshaping Iv: for row, be meant the saltus step pixel outside certain saltus step row China and foreign countries' saltus step pixel.
8) outer saltus step row w v: the row that comprises outer saltus step pixel.
9) two outer saltus step row h v: the row that comprises two outer saltus step pixels.
On the basis of above definition, following Hanzi features has been proposed:
1) rectangle the ratio of width to height r wh = min ( w i , h i ) max ( w i , h i ) The ratio of little value in the rectangle between width and the height and big value between the two;
2) saltus step row average transition number of times m wv = n wpv n wv , For row, the ratio of all saltus step pixel counts and all saltus step line numbers;
3) saltus step column average transition times m hv = n hpv n hv , For row, the ratio of all saltus step pixel counts and all saltus step columns;
4) go the saltus step picture element density ρ wpv = n wpv n p , For row, the ratio of the total pixel number that all saltus step pixel counts and this sublayer image comprise;
5) row saltus step picture element density ρ hpv = n hpv n p , For row, the ratio of the total pixel number that all saltus step pixel counts and this sublayer image comprise;
6) saltus step line density ρ wv = n wv n w , The ratio of total line number that all saltus step line numbers and current sublayer image comprise;
7) saltus step row density ρ hv = n hv n h , The ratio of total columns that all saltus step columns and current sublayer image comprise;
8) hole line density ρ wh = n wh n w , The ratio of total line number that all line numbers that comprises the hole pixel and current sublayer image comprise;
9) outer saltus step line density ρ wov = n wov n wv , All comprise the sum of outer saltus step pixel (one or two) row and the ratio of total line number that current sublayer image comprises;
10) two outer saltus step line density ρ wbov = n wbov n wv , All comprise the sum of two outer saltus step pixel columns and the ratio of total line number that current sublayer image comprises.
Here, n WpvBe the saltus step pixel count (being saltus step pixel counts all on the horizontal direction) that total saltus step row comprises, n HpvBe the saltus step pixel count (being saltus step pixel counts all on the vertical direction) that total saltus step row comprise, n wBe total line number, n hBe total columns, n WvBe total saltus step line number (being total number of saltus step row), n HvBe total saltus step columns (being total number of saltus step row), n WhBe the line number (being the capable total number of hole) that comprises the hole pixel, n WovBe the line number (total number of promptly outer saltus step row) that comprises outer saltus step pixel, n WbovBe the line number (i.e. total number of two outer saltus step row) that comprises two outer saltus step pixels.
Make n PhThe hole pixel sum of representing current sublayer image, n PivThe introskip transshaping vegetarian refreshments sum of representing current sublayer image.
Segmentation procedure be two greatly the step, the first step is a coarse segmentation, second the step for the segmentation cut.
The process of coarse segmentation is, seeks all connected regions of this sublayer image earlier, then according to all the non-text connected regions in the image of following regular filtering sublayer:
1) for all connected regions, the person that one of meets the following conditions, then filtering:
A) if max is (w i, h i)<a 1, then filtering.
B) if max is (m Wv, m Hv)>b 11And ρ Wov<b 12, then filtering.
C) if n Ph>c 1, then filtering.
D) if n Piv<d 11And ρ i<d 12, then filtering.
E) if n Hp>e 1* n p, then filtering.
F) if r Wh<f 1, then filtering.
G) if ρ i<g 1, then filtering.
H) if ρ Wh>h 1, then filtering.
Wherein, 0<a 1<30, b 11>5,0.05<b 12<0.2, c 1>20, d 11>1, d 12>0.5,0.05<e 1<0.3,0<f 1<0.3,0<g 1<0.3, h 1>0.2.
2) for max (w i, h i)>k 2* max (l w, l h) connected region, the person that one of meets the following conditions, then filtering:
A) if min is (ρ Wv, ρ Hv)<a 2, then filtering.
B) if r Wh<b 2, then filtering.
C) if ρ i<c 2, then filtering.
Wherein, k 2>0.6,0.3<a 2<0.8,0.4<b 2<0.6,0.2<c 2<0.5.
3) for max (w i, h i)<k 3Connected region, the person that one of meets the following conditions, then filtering:
A) if max is (ρ Wpv, ρ Hpv)<a 3, then filtering.
B) if n p<b 3, then filtering.
C) if n Hp>c 3, then filtering.
Wherein, 10<k 3<30,0.6<a 3<1,0<b 3<30, c 3>10.
Each sublayer image through after above-mentioned cutting apart, is merged segmentation result and obtains the text segmentation image.
To the text image that above dividing method obtains, can also further cut apart, its step of cutting apart is:
1) for ρ i〉=k 4Connected region, satisfy r Wh>a 41And max (ρ Wv, ρ Hv)<a 42, then filtering;
Wherein, k 4>0.95, a 41>0.1,0.3<a 42<0.6.
2) for k 51≤ ρ i<k 52Connected region, the person that one of meets the following conditions, then filtering:
A) if r Wh≤ a 51, then filtering;
B) if r Wh>b 51And max (ρ Wv, ρ Hv)<b 52, then filtering;
C) if c 51≤ r Wh≤ c 52And max (ρ Wv, ρ Hv)<c 53, then filtering;
D) if d 51≤ r Wh≤ d 52, then filtering;
Wherein, 0.8<k 51<0.95,0.95<k 52<1,0<a 51<0.1, b 51>0.5, b 52>0.5,0<c 51<0.1,0.1<c 52<0.3, c 53>0.4,0.5<d 52<0.8,0.1<d 51<0.3.
3) for k 61≤ ρ i<k 62Connected region, the person that one of meets the following conditions, then filtering:
A) if r Wh>a 61And max (ρ Wpv, ρ Hpv)<a 62And n Piv<a 63, then filtering;
B) if b 61<r Wh<b 62And max (ρ Vw, ρ Vh)<b 63, then filtering;
C) if r Wh<c 6, then filtering;
Wherein, 0.7<k 61<0.8,0.8<k 62<0.95,0.3<a 61<0.5,0.4<a 62<0.6, a 63>1,0<b 61<0.2,0.2<b 62<0.4,0.6<b 63<1,0.05<c 6<0.2.
4) for k 71≤ ρ i<k 72Connected region, the person that one of meets the following conditions, then filtering:
A) if ρ Wbov<a 71And n Ph>a 72, then filtering;
B) if ρ i>b 71And r Wh>b 72And max (ρ Wv, ρ Hv)>b 73And n Piv<b 74, then filtering;
C) if r Wh<c 7, then filtering;
Wherein, 0.4<k 71<0.6,0.6<k 72<0.8,0.1<a 71<0.3, a 72>15,0.5<b 71<0.7,0.6<b 72<0.8, b 73>0.7, b 74>1,0.05<c 7<0.2.
5) for k 81≤ ρ i<k 82Connected region, the person that one of meets the following conditions, then filtering:
A) if r Wh>a 81And max (ρ Wv, ρ Hv)<a 82, then filtering;
B) if r Wh≤ b 8, then filtering;
Wherein, 0.1<k 81<0.3,0.3<k 82<0.6, a 81>0.1,0.2<a 82<0.5,0.1<b 8<0.3.
Connected region among the present invention can be 4 connected regions, also can be 8 connected regions.
The present invention is not only clear but also complete to the extraction of Chinese character in the file and picture of complex background, is not subjected to the influence of change color between the Chinese character.
Description of drawings
Fig. 1: entire system FB(flow block)
Fig. 2: the original image of test input
Fig. 3: to the recurrence layering subimage of Fig. 2
Fig. 4: the sublayer image after each tomographic image of Fig. 3 merged
The final segmentation result of Fig. 5: Fig. 2
Fig. 6: the original image of test input
Fig. 7: to the recurrence layering subimage of Fig. 6
Fig. 8: the sublayer image after each tomographic image of Fig. 7 merged
The final segmentation result of Fig. 9: Fig. 6
Embodiment
Dispose embodiments of the invention according to Fig. 1.Computing machine is " Tsing Hua Tong Fang's microcomputer, Intel (R) Celeron (R) CPU 3.20GHz, 256 MB of memory, a 80G hard disk " in the present embodiment.Adopt the VC++6.0 programming to realize.
Specific embodiments is:
1, coloured image changes the gray level image scheme:
If input picture is a coloured image, then with following formula conversion:
Y=0.299×R+0.587×G+0.144×B
Wherein, Y is the gray-scale value after changing, and R, G, B are respectively three color components of the coloured image before the conversion, and R represents red, and G represents green, and B represents blueness, and it is worth all in [0,255] scope.
2, recurrence is divided layered scheme:
If treat the interval [t of being of the gray-value variation of layered image 1, t 2] (t 1<t 2), work as δ t<c * m t(c=0.1) or n tDuring>d * n (d=0.2), stop this image is continued layering, otherwise, continue the recurrence layering, wherein, n is the pixel sum of input file and picture, n t, m tAnd δ tDifference interval for this reason sum of all pixels, gray average and variance.All satisfy above-mentionedly when stopping stratified condition when all sublayers of telling, stop layering, and each the sublayer sort ascending to telling.
3, sublayer Merge Scenarios:
The initial sub-layer of arranging from small to large with boundary value need to be judged whether to merge from small to large one by one.For sublayer s to be combined i, satisfying one of following 4 conditions, can merge:
(1) if n Ph>a * n p, then merge; (a=0.1)
(2) if n rs > b × n r 0 And n R max p<c * n p, then merge; (b=0.9, c=0.15)
(3) if n Ps>d * n p, then merge; (d=0.5)
(4) if n ρ s>e * n p, then merge.(e=0.6)
Wherein: N=20, R=0.3
Calculate r 1 = min ( n r - 1 , n r 0 ) max ( n r - 1 , n r 0 ) , r 2 = min ( n r 1 , n r 0 ) max ( n r 1 , n r 0 ) , r 1 ′ = n r n r - 1 , r 2 ′ = n r ′ n r 1
If (r 1+ r 1')≤(r 2+ r 2'), then with s iWith s I-1Merge; If (r 1+ r 1')>(r 2+ r 2'), then with s iWith s I+1Merge.
4, sublayer splitting scheme:
Successively each sublayer image is cut apart, comprised that coarse segmentation and segmentation cut.Coarse segmentation comprised for first to the 3rd step in the following step, and the segmentation steamed sandwich contained for the 4th to the 8th step.Concrete segmentation procedure is:
At first find out all connected regions of this tomographic image, non-text filed according to following regular filtering:
1) for all connected regions, the person that one of meets the following conditions, then filtering:
A) if max is (w i, h i)<a 1, then filtering.
B) if max is (m Wv, m Hv)>b 11And ρ Wov<b 12, then filtering.
C) if n Ph>c 1, then filtering.
D) if n Piv<d 11And ρ i<d 12, then filtering.
E) if n Hp>e 1* n p, then filtering.
F) if r Wh<f 1, then filtering.
G) if ρ i<g 1, then filtering.
H) if ρ Wh>h 1, then filtering.
Wherein, a 1=4, b 11=12, b 12=0.15, c 1=50, d 11=2, d 12=0.8, e 1=0.1, f 1=0.05, g 1=0.2, h 1=0.3.
2) for max (w i, h i)>k 2* max (l w, l h) connected region, the person that one of meets the following conditions, then filtering:
A) if min is (ρ Wv, ρ Hv)<a 2, then filtering.
B) if r Wh<b 2, then filtering.
C) if ρ i<c 2, then filtering.
Wherein, k 2=0.8, a 2=0.5, b 2=0.5, c 2=0.4.
3) for max (w i, h i)<k 3Connected region, the person that one of meets the following conditions, then filtering:
A) if max is (ρ Wpv, ρ Hpv)<a 3, then filtering.
B) if n p<b 3, then filtering.
C) if n Hp>c 3, then filtering.
Wherein, k 3=20, a 3=0.8, b 3=30, c 3=20.
4) for ρ i〉=k 4Connected region, satisfy r Wh>a 41And max (ρ Wv, ρ Hv)<a 42, then filtering;
Wherein, k 4=0.99, a 41=0.2, a 42=0.5.
5) for k 51≤ ρ i<k 52Connected region, the person that one of meets the following conditions, then filtering:
A) if r Wh≤ a 51, then filtering;
B) if r Wh>b 51And max (ρ Wv, ρ Hv)<b 52, then filtering;
C) if c 51≤ r Wh≤ c 52And max (ρ Wv, ρ Hv)<c 53, then filtering;
D) if d 51≤ r Wh≤ d 52, then filtering;
Wherein, k 51=0.9, k 52=0.99, a 51=0.05, b 51=0.7, b 52=0.6, c 51=0.05, c 52=0.2, c 53=0.5, d 51=0.2 d 52=0.7.
6) for k 61≤ ρ i<k 62Connected region, the person that one of meets the following conditions, then filtering:
A) if r Wh>a 61And max (ρ Wpv, ρ Hpv)<a 62And n Piv<a 63, then filtering;
B) if b 61<r Wh<b 62And max (ρ Vw, ρ Vh)<b 63, then filtering;
C) if r Wh<c 6, then filtering;
Wherein, k 61=0.75, k 62=0.9, a 61=0.35, a 62=0.5, a 63=3, b 61=0.1, b 62=0.1, b 63=0.8, c 6=0.1.
7) for k 71≤ ρ i<k 72Connected region, the person that one of meets the following conditions, then filtering:
A) if ρ Wbov<a 71And n Ph>a 72, then filtering;
B) if ρ i>b 71And r Wh>b 72And max (ρ Wv, ρ Hv)>b 73And n Piv<b 74, then filtering;
C) if r Wh<c 7, then filtering;
Wherein, k 71=0.5, k 72=0.75, a 71=0.2, a 72=25, b 71=0.6, b 72=0.7, b 73=0.8, b 74=3, c 7=0.1.
8) for k 81≤ ρ i<k 82Connected region, the person that one of meets the following conditions, then filtering:
A) if r Wh>a 81And max (ρ Wv, ρ Hv)<a 82, then filtering;
B) if r Wh≤ b 8, then filtering;
Wherein, k 81=0.2, k 82=0.5, a 81=0.15, a 82=0.3, b 8=0.15.
Treat each tomographic image cut apart finish after, its result is merged (addition), obtain final split image.
5, summary:
According to above step the file and picture of input is handled.At first when the recurrence layering, a width of cloth file and picture is divided for a series of onesize subimages, and according to the pixel grey scale maximal value sort ascending of subimage.Secondly, ordering each subimage is merged by merging criterion, obtained being beneficial to some layered images of text segmentation.Then, the Hanzi features that utilizes the present invention to stipulate is cut apart these sublayer images, and segmentation result is merged, and obtains final text segmentation image.
Utilize the method in the present embodiment, respectively Fig. 2, original image shown in Figure 6 are cut apart.Wherein, Fig. 2 is 24 color document images, 224 pixels of horizontal direction, 129 pixels of vertical direction.Sublayer image to the recurrence layered image of Fig. 2, after merging, segmentation result are respectively shown in Fig. 3,4,5.Show that for clear pixel color in each sublayer image and the final segmentation result image all changes for black.In the processing of present embodiment to Fig. 2, said connected region all is meant 4 connected regions.
Original image shown in Figure 6 is 24 color document images, 498 pixels of horizontal direction, and 291 pixels of vertical direction, the sublayer image to the recurrence layered image of Fig. 6, after merging, segmentation result are respectively shown in Fig. 7,8,9.Show that for clear pixel color in each sublayer image and the final segmentation result image all changes for black.In the processing to Fig. 6, said connected region all is meant 8 connected regions.
Experimental result shows that the present invention is to the extraction of Chinese character in the complicated file and picture, and is not only clear, and complete.

Claims (2)

1, based on the file-image cutting method of Hanzi features,, store the image in hard disc of computer or the movable storage device as input with gray scale or color document images, be read in the internal memory by program again and handle; If what read in is coloured image, then transfer gray level image earlier to, if gray level image then need not be changed; It is characterized in that concrete treatment step is as follows:
(1) original image is carried out the recurrence layering:
Utilize the ratio of distance in maximum kind spacing and the infima species to obtain peaked criterion, image is carried out the recurrence layering.Promptly when piece image obtains a segmentation threshold according to above-mentioned distance than criterion after, image is divided into two sub-tomographic images, and then these two sub-tomographic images are carried out layering respectively with this threshold value, till satisfying one of following two conditions:
1)δ t<c×m t; (0.01<c<0.3)
2)n t<d×n; (0.01<d<0.5)
m t = Σ i = t 1 t 2 i h i t
δ t 2 = Σ i = t 1 t 2 n i ( i - m t ) 2
n t = Σ i = t 1 t 2 n i
t 1And t 2Be respectively the upper bound and the lower bound (t that treat the layered image grey scale pixel value 1The expression minimum value, t 2The expression maximal value), n is the pixel sum of input file and picture, n t, m tAnd δ tBe respectively pixel sum, gray average and the variance for the treatment of layered image; I is a pixel grayscale, h i tThe frequency that in treating layered image, occurs for i;
After the recurrence layering is finished,, it is increased progressively (or successively decreasing) ordering according to each layering sub-image pixels grayscale maximal value;-
(2) merging of sublayer:
Sublayer image after the ordering is merged according to criterion; Criterion is: if the sublayer image satisfies one of following four conditions person, then need merge:
1) if n Ph>a * n p, then merge; (a>0.05)
2) if n rs > b × n r 0 And n Rmax p<c * n p, then merge; (b>0.6, c>0.1)
3) if n Ps>d * n p, then merge; (d>0.3)
4) if n ρ s>e * n p, then merge; (e>0.3)
Wherein, for for anterior layer, n pThe sum of expression effective pixel points, n PhRepresent total hole pixel number, n r 0Connected region sum in the expression subimage; n RsRepresent little connected region sum, little connected region is meant that the valid pixel that comprises counts less than the connected region of N, wherein, and 0<N<50; n PsRepresent the effective pixel points sum that all little connected regions are contained, n R max pRepresent the effective pixel points sum that largest connected zone is contained, n ρ sExpression valid pixel density is less than the effective pixel points sum that all connected regions comprised of R (0<R<0.5);
If judge that working as anterior layer needs to merge, the determination methods that then specifically merges to which layer is: if (r 1+ r 1')≤(r 2+ r 2'), then with s iWith s I-1Merge; If (r 1+ r 1')>(r 2+ r 2'), then with s iWith s I+1Merge;
Wherein, r 1 = min ( n r - 1 , n r 0 ) max ( n r - 1 , n r 0 ) , r 2 = min ( n r 1 , n r 0 ) max ( n r 1 , n r 0 ) , r 1 ′ = n r n r - 1 , r 2 ′ = n r ′ n r 1 .
Use s iAnterior layer, s are worked as in expression I-1And s I+1Be respectively when preceding one deck of anterior layer and after one deck, n r 0, n r -1And n r 1Represent s respectively i, s I-1And s I+1The total number of the connected region that comprises, n rExpression s iWith s I-1Connected region number after the merging; n r' expression s iWith s I+1Connected region number after the merging;
If the anterior layer of working as that needs to merge has only an adjacent layer, then directly merge to adjacent layer;
(3) text segmentation of sublayer image
For the subimage s after merging i, its wide and height is respectively l w, l h, total valid pixel number is n p, carry out region growing, obtain a series of connected region.For i connected region, its valid pixel density is ρ i:
ρ i = n i w i × h i
Wherein, n iRepresent the valid pixel number that it comprises, w iAnd h iWide and high (is unit with the pixel count) of this connected region minimum rectangle surrounded in expression respectively.
For single connected region and surround the minimum rectangle of this connected region, the present invention proposes as gives a definition:
1) saltus step pixel p v: in delegation (perhaps in same row), each valid pixel adjacent with inactive pixels is the saltus step pixel, and all are positioned at the pixel of square boundary, though the inactive pixels of itself and square boundary outside is adjacent, does not belong to the saltus step pixel;
2) hole pixel p h: have only an inactive pixels between two saltus step pixels in delegation, these two saltus step pixels are the hole pixel;
3) saltus step row w v, comprise the row of saltus step pixel;
4) saltus step row h v: the row that comprise the saltus step pixel;
5) the capable w of hole h: the row that comprises the hole pixel;
6) outer saltus step pixel p Ov: for row, be meant first saltus step pixel or last saltus step pixel of certain saltus step row, wherein, first saltus step pixel left side is an inactive pixels, and last saltus step pixel right side is an inactive pixels;
7) the plain p of introskip transshaping Iv: for row, be meant the saltus step pixel outside certain saltus step row China and foreign countries' saltus step pixel;
8) outer saltus step row w v: the row that comprises outer saltus step pixel;
9) two outer saltus step row h v: the row that comprises two outer saltus step pixels;
On the basis of above definition, following Hanzi features has been proposed:
1) rectangle the ratio of width to height r wh = min ( w i , h i ) max ( w i , h i ) ;
2) saltus step row average transition number of times m wv = n wpv n wv ;
3) saltus step column average transition times m hv = n hpv n hv ;
4) go the saltus step picture element density ρ wpv = n wpv n p ;
5) row saltus step picture element density ρ hpv = n hpv n p ;
6) saltus step line density ρ wv = n wv n w ;
7) saltus step row density ρ hv = n hv n h ;
8) hole line density ρ wh = n wh n w ;
9) outer saltus step line density ρ wov = n wov n wv ;
10) two outer saltus step line density ρ wbov = n wbov n wv ;
Here, n WpvBe the saltus step pixel count (being saltus step pixel counts all on the horizontal direction) that total saltus step row comprises, n HpvBe the saltus step pixel count (being saltus step pixel counts all on the vertical direction) that total saltus step row comprise, n wBe total line number, n hBe total columns, n WvBe total saltus step line number (being total number of saltus step row), n HvBe total saltus step columns (being total number of saltus step row), n WhBe the line number (being the capable total number of hole) that comprises the hole pixel, n WovBe the line number (total number of promptly outer saltus step row) that comprises outer saltus step pixel, n WbovBe the line number (i.e. total number of two outer saltus step row) that comprises two outer saltus step pixels;
Make n PhThe hole pixel sum of representing current sublayer image, n PivThe introskip transshaping vegetarian refreshments sum of representing current sublayer image;
The cutting procedure of sublayer image is, seeks all connected regions of this sublayer image, then according to all the non-text connected regions in the image of following regular filtering sublayer:
1) for all connected regions, the person that one of meets the following conditions, then filtering:
A) if max is (w i, h i)<a 1, then filtering;
B) if max is (m Wv, m Hv)>b 11And ρ Wov<b 12, then filtering;
C) if n Ph>c 1, then filtering;
D) if n Piv<d 11And ρ i<d 12, then filtering;
E) if n Hp>e 1* n p, then filtering;
F) if r Wh<f 1, then filtering;
G) if ρ i<g 1, then filtering;
H) if ρ Wh>h 1, then filtering;
Wherein, 0<a 1<30, b 11>5,0.05<b 12<0.2, c 1>20, d 11>1, d 12>0.5,0.05<e 1<0.3,0<f 1<0.3,0<g 1<0.3, h 1>0.2;
2) for max (w i, h i)>k 2* max (l w, l h) connected region, the person that one of meets the following conditions, then filtering:
A) if min is (ρ Wv, ρ Hv)<a 2, then filtering;
B) if r Wh<b 2, then filtering;
C) if ρ i<c 2, then filtering;
Wherein, k 2>0.6,0.3<a 2<0.8,0.4<b 2<0.6,0.2<c 2<0.5;
3) for max (w i, h i)<k 3Connected region, the person that one of meets the following conditions, then filtering:
A) if max is (ρ Wpv, ρ Hpv)<a 3, then filtering;
B) if n p<b 3, then filtering;
C) if n Hp>c 3, then filtering;
Wherein, 10<k 3<30,0.6<a 3<1,0<b 3<30, c 3>10;
Each sublayer image through after above-mentioned cutting apart, is merged segmentation result and obtains the text segmentation image.
2, the file-image cutting method based on Hanzi features according to claim 1 is characterized in that, the text segmentation of sublayer image is also comprised following filtering condition:
1) for ρ i〉=k 4Connected region, satisfy r Wh>a 41And max (ρ Wv, ρ Hv)<a 42, then filtering;
Wherein, k 4>0.95, a 41>0.1,0.3<a 42<0.6;
2) for k 51≤ ρ i<k 52Connected region, the person that one of meets the following conditions, then filtering:
A) if r Wh≤ a 51, then filtering;
B) if r Wh>b 51And max (ρ Wv, ρ Hv)<b 52, then filtering;
C) if c 51≤ r Wh≤ c 52And max (ρ Wv, ρ Hv)<c 53, then filtering;
D) if d 51≤ r Wh≤ d 52, then filtering;
Wherein, 0.8<k 51<0.95,0.95<k 52<1,0<a 51<0.1, b 51>0.5, b 52>0.5,0<c 51<0.1,0.1<c 52<0.3, c 53>0.4,0.5<d 52<0.8,0.1<d 51<0.3;
3) for k 61≤ ρ i<k 62Connected region, the person that one of meets the following conditions, then filtering:
A) if r Wh>a 61And max (ρ Wpv, ρ Hpv)<a 62And n Piv<a 63, then filtering;
B) if b 61<r Wh<b 62And max (ρ Vw, ρ Vh)<b 63, then filtering;
C) if r Wh<c 6, then filtering;
Wherein, 0.7<k 61<0.8,0.8<k 62<0.95,0.3<a 61<0.5,0.4<a 62<0.6, a 63>1,0<b 61<0.2,0.2<b 62<0.4,0.6<b 63<1,0.05<c 6<0.2;
4) for k 71≤ ρ i<k 72Connected region, the person that one of meets the following conditions, then filtering:
A) if ρ Wbov<a 71And n Ph>a 72, then filtering;
B) if ρ i>b 71And r Wh>b 72And max (ρ Wv, ρ Hv)>b 73And n Piv<b 74, then filtering;
C) if r Wh<c 7, then filtering;
Wherein, 0.4<k 71<0.6,0.6<k 72<0.8,0.1<a 71<0.3, a 72>15,0.5<b 71<0.7,0.6<b 72<0.8, b 73>0.7, b 74>1,0.05<c 7<0.2;
5) for k 81≤ ρ i<k 82Connected region, the person that one of meets the following conditions, then filtering:
A) if r Wh>a 81And max (ρ Wv, ρ Hv)<a 82, then filtering;
B) if r Wh≤ b 8, then filtering;
Wherein, 0.1<k 81<0.3,0.3<k 82<0.6, a 81>0.1,0.2<a 82<0.5,0.1<b 8<0.3.
CNB2007100654087A 2007-04-13 2007-04-13 File-image cutting method based on Chinese characteristics Expired - Fee Related CN100428268C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2007100654087A CN100428268C (en) 2007-04-13 2007-04-13 File-image cutting method based on Chinese characteristics

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2007100654087A CN100428268C (en) 2007-04-13 2007-04-13 File-image cutting method based on Chinese characteristics

Publications (2)

Publication Number Publication Date
CN101030257A true CN101030257A (en) 2007-09-05
CN100428268C CN100428268C (en) 2008-10-22

Family

ID=38715585

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2007100654087A Expired - Fee Related CN100428268C (en) 2007-04-13 2007-04-13 File-image cutting method based on Chinese characteristics

Country Status (1)

Country Link
CN (1) CN100428268C (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102089785A (en) * 2008-07-11 2011-06-08 佳能株式会社 Document managing apparatus, document managing method, and storage medium
CN101520845B (en) * 2008-02-29 2011-11-30 富士通株式会社 Layering method of color document images and device thereof
CN101706970B (en) * 2009-11-25 2011-12-21 广东威创视讯科技股份有限公司 Method and application for layered processing of operation objects
CN102332097A (en) * 2011-10-21 2012-01-25 中国科学院自动化研究所 Method for segmenting complex background text images based on image segmentation
CN104243987A (en) * 2014-09-29 2014-12-24 刘鹏 Self-adaptive sampling rate based image sampling method
CN104268506A (en) * 2014-09-15 2015-01-07 郑州天迈科技股份有限公司 Passenger flow counting detection method based on depth images
CN104484876A (en) * 2014-12-05 2015-04-01 中国海洋大学 Aquatic product parasite ultraviolet fluorescence imaging detection method based on automatic threshold segmentation
CN107770554A (en) * 2017-10-26 2018-03-06 胡明建 A kind of parallel displacement wavelet method is to design method that is image layered and compressing
CN109919146A (en) * 2019-02-02 2019-06-21 上海兑观信息科技技术有限公司 Picture character recognition methods, device and platform
CN111783383A (en) * 2019-04-02 2020-10-16 珠海金山办公软件有限公司 Configuration method and device for visual effect of document
CN114934467A (en) * 2022-07-08 2022-08-23 江苏永达电力金具有限公司 Parking space barrier gate control method, parking space barrier gate system and medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100416597C (en) * 2004-12-23 2008-09-03 佳能株式会社 Method and device for self-adaptive binary state of text, and storage medium
JP4386281B2 (en) * 2005-01-31 2009-12-16 キヤノン株式会社 Image processing method, image processing apparatus, and program
JP4756870B2 (en) * 2005-02-03 2011-08-24 キヤノン株式会社 Document processing apparatus, document processing method, and program

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101520845B (en) * 2008-02-29 2011-11-30 富士通株式会社 Layering method of color document images and device thereof
CN102089785B (en) * 2008-07-11 2014-01-08 佳能株式会社 Document managing apparatus, document managing method, and storage medium
US8650473B2 (en) 2008-07-11 2014-02-11 Canon Kabushiki Kaisha Document managing apparatus, document managing method, and storage medium
CN102089785A (en) * 2008-07-11 2011-06-08 佳能株式会社 Document managing apparatus, document managing method, and storage medium
CN101706970B (en) * 2009-11-25 2011-12-21 广东威创视讯科技股份有限公司 Method and application for layered processing of operation objects
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
CN104268506A (en) * 2014-09-15 2015-01-07 郑州天迈科技股份有限公司 Passenger flow counting detection method based on depth images
CN104268506B (en) * 2014-09-15 2017-12-15 郑州天迈科技股份有限公司 Passenger flow counting detection method based on depth image
CN104243987B (en) * 2014-09-29 2017-10-03 刘鹏 Image sampling method based on adaptive sample rate
CN104243987A (en) * 2014-09-29 2014-12-24 刘鹏 Self-adaptive sampling rate based image sampling method
CN104484876B (en) * 2014-12-05 2017-07-11 中国海洋大学 Aquatic products parasite Ultraluminescence imaging detection method based on automatic threshold segmentation
CN104484876A (en) * 2014-12-05 2015-04-01 中国海洋大学 Aquatic product parasite ultraviolet fluorescence imaging detection method based on automatic threshold segmentation
CN107770554A (en) * 2017-10-26 2018-03-06 胡明建 A kind of parallel displacement wavelet method is to design method that is image layered and compressing
CN107770554B (en) * 2017-10-26 2020-08-18 胡明建 Design method for layering and compressing image by parallel displacement wavelet method
CN109919146A (en) * 2019-02-02 2019-06-21 上海兑观信息科技技术有限公司 Picture character recognition methods, device and platform
CN111783383A (en) * 2019-04-02 2020-10-16 珠海金山办公软件有限公司 Configuration method and device for visual effect of document
CN111783383B (en) * 2019-04-02 2024-05-07 珠海金山办公软件有限公司 Configuration method and device for visual effect of document
CN114934467A (en) * 2022-07-08 2022-08-23 江苏永达电力金具有限公司 Parking space barrier gate control method, parking space barrier gate system and medium
CN114934467B (en) * 2022-07-08 2024-04-30 江苏永达电力金具有限公司 Parking space barrier control method, parking space barrier system and medium

Also Published As

Publication number Publication date
CN100428268C (en) 2008-10-22

Similar Documents

Publication Publication Date Title
CN101030257A (en) File-image cutting method based on Chinese characteristics
CN1258907C (en) Image processing equipment, image processing method and storage medium of image processing program
CN1311394C (en) Appts. and method for binary image
CN1184796C (en) Image processing method and equipment, image processing system and storage medium
CN1658227A (en) Method and apparatus for detecting text of video
CN1140878C (en) Character identifying/correcting mode
CN1588431A (en) Character extracting method from complecate background color image based on run-length adjacent map
CN1573742A (en) Image retrieving system, image classifying system, image retrieving program, image classifying program, image retrieving method and image classifying method
CN1818927A (en) Fingerprint identifying method and system
CN1452388A (en) Picture compression method and device, and picture coding device and method
CN1696959A (en) Detector for special shooted objects
CN1917578A (en) Data processing apparatus,data processing method and program
CN1684492A (en) Image dictionary creating apparatus, coding apparatus, image dictionary creating method
CN1735907A (en) Image analysis
CN1945599A (en) Image processing device, image processing method, and computer program product
CN1945602A (en) Characteristic selecting method based on artificial nerve network
CN1519757A (en) Image searching device, key word providing method and program of same
CN1794266A (en) Biocharacteristics fusioned identity distinguishing and identification method
CN1940967A (en) Method, apparatus, and program for dividing images
CN1664846A (en) On-line hand-written Chinese characters recognition method based on statistic structural features
CN1251130C (en) Method for identifying multi-font multi-character size print form Tibetan character
CN1973757A (en) Computerized disease sign analysis system based on tongue picture characteristics
CN1041773C (en) Character recognition method and apparatus based on 0-1 pattern representation of histogram of character image
CN1128463A (en) Object-by shape information compression apparatus and method thereof and coding method between motion picture compensation...
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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20081022

Termination date: 20150413

EXPY Termination of patent right or utility model