[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN108133169A - Line processing method and device for text image - Google Patents

Line processing method and device for text image Download PDF

Info

Publication number
CN108133169A
CN108133169A CN201611099659.2A CN201611099659A CN108133169A CN 108133169 A CN108133169 A CN 108133169A CN 201611099659 A CN201611099659 A CN 201611099659A CN 108133169 A CN108133169 A CN 108133169A
Authority
CN
China
Prior art keywords
text
connected domain
image
domain
journey
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.)
Pending
Application number
CN201611099659.2A
Other languages
Chinese (zh)
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.)
Beijing Xintang Sichuang Educational Technology Co Ltd
Original Assignee
Beijing Xintang Sichuang Educational Technology Co Ltd
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 Beijing Xintang Sichuang Educational Technology Co Ltd filed Critical Beijing Xintang Sichuang Educational Technology Co Ltd
Priority to CN201611099659.2A priority Critical patent/CN108133169A/en
Publication of CN108133169A publication Critical patent/CN108133169A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/40Document-oriented image-based pattern recognition
    • G06V30/41Analysis of document content
    • G06V30/413Classification of content, e.g. text, photographs or tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/40Document-oriented image-based pattern recognition
    • G06V30/41Analysis of document content
    • G06V30/416Extracting the logical structure, e.g. chapters, sections or page numbers; Identifying elements of the document, e.g. authors

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Artificial Intelligence (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the application provides an in-line processing method and device for text images, wherein the method comprises the following steps: extracting an image connected domain of the text image, and classifying the image connected domain; initializing each text line by using the image connected domain and taking a preset width as a line window; and sequentially merging the image connected domains of all classes into all initialization text lines to which the image connected domains belong. The method and the device for analyzing the text image can analyze the layout of the text image accurately and conveniently and form a line.

Description

A kind of embark on journey processing method and its device for text image
Technical field
The application belongs to image identification technical field, and in particular to it is a kind of for text image embark on journey processing method and its Device.
Background technology
In the text image that image acquiring device is used to shoot, often due to the problem of shooting angle, can exist compared with Big text distortion phenomenon causes to be difficult to effective printed page analysis to the text image of shooting, eventually lead to text diagram As being difficult to identify.
Current printed page analysis system generally use text correction, the flow of printed page analysis.Text correction utilizes text Domain information is connected, the text (tilting, perspective) of deformation is corrected, during embarking on journey, row is used to the text corrected The mode of projection is completed to embark on journey.
But prior art needs first correct text, final result of the effect dependent on correction of embarking on journey.But In shooting image process, since the angle of shooting is of all kinds, it is difficult to text image is carried out single correction (such as In scan text image, inclined situation is generally only existed), it generally requires to carry out a variety of corrections.In addition, for formula text figure Picture, since text information is limited, it is difficult to preferably be corrected using limited information, correction result is difficult to full in many cases Foot projects rows of requirement.
Therefore, how the accurate space of a whole page for being easily directed to text image is analyzed and is embarked on journey, and is become in the prior art urgently The technical issues of need to solving.
Invention content
One of the technical issues of the embodiment of the present application solves is to provide a kind of processing method of embarking on journey for text image And its device, accurately easily it can be analyzed and be embarked on journey for the space of a whole page of text image.
The embodiment of the present application provides a kind of processing method of embarking on journey for text image, including:
The image connectivity domain of the text image is extracted, and is classified to described image connected domain;
Using described image connected domain, each line of text is initialized using preset width as window of embarking on journey;
Described image connected domain of all categories is incorporated to each initialization line of text of its ownership successively.
In the embodiment of the present application, the image connectivity domain of the extraction text image, and to described image connected domain It is further included before being classified:
Remove the even effect of uneven illumination in the text image, and by the text image binaryzation.
In the embodiment of the present application, the even effect of uneven illumination in the removal text image, and by the text It is further included after image binaryzation:
Picture size analysis is carried out to the text image after binary conversion treatment, obtains the text in the text image Size.
In the embodiment of the present application, the image connectivity domain of the extraction text image, and to described image connected domain Classification is carried out to include:
If the length and width of the connected domain are identical, the connected domain is classified as text connected domain;
If the area of the connected domain is more than or equal to preset area high threshold, the connected domain is classified as Big connected domain;
If the area of the connected domain is less than preset area Low threshold, the connected domain is classified as small connection Domain;
If the connected domain length-width ratio is more than or less than set high-low threshold value, the connected domain is classified as Special connected domain.
In the embodiment of the present application, the image connectivity domain of the extraction text image, and to described image connected domain Classification is carried out to further include:
The connected domain that size is less than to the text size of preset value is deleted as noise connected domain.
In the embodiment of the present application, the image connectivity domain of the extraction text image, and to described image connected domain Classification is carried out to further include:
The width and height of the text connected domain boundary rectangle are counted, the two average value is calculated and obtains the text image The width of middle text character is high.
In the embodiment of the present application, it is described using described image connected domain, it is initial using preset width as window of embarking on journey Change each line of text to include:
The central point of text connected domain is detected whether in the center baseline range of the window of embarking on journey to be inserted entered a profession;
Such as in the range of, then the text connected domain is inserted into described to be inserted enter a profession, and update its row information;
If not in the range of, then newline is set up into the text connected domain position.
In the embodiment of the present application, each initialization that described image connected domain of all categories is incorporated to its ownership successively Line of text includes:
Special connected domain, small connected domain and big connected domain are incorporated to successively in each initialization line of text.
In the embodiment of the present application, it is described that special connected domain, small connected domain and big connected domain are incorporated to each initialization successively It is further included in line of text:
The high variation of row of the initialization line of text is enabled to be less than default changing value, and the high variation of the row is along the row Center line symmetrically change.
In the embodiment of the present application, it further includes:
If there is overlapped initialization line of text, then it is new to merge the initialization line of text of the overlapping Row.
The corresponding above method, the application provide a kind of processing unit of embarking on journey for text image, including:
Sort module for extracting the image connectivity domain of the text image, and classifies to described image connected domain;
For utilizing described image connected domain, each text is initialized using preset width as window of embarking on journey for initial module Row;
Module is inserted into, for described image connected domain of all categories to be incorporated to each initialization line of text of its ownership successively.
In the embodiment of the present application, it further includes:
Preprocessing module, for removing the even effect of uneven illumination in the text image, and by the text image two Value.
In the embodiment of the present application, it further includes:
Analysis module for carrying out picture size analysis to the text image after binary conversion treatment, obtains the text Text size in this image.
In the embodiment of the present application, the sort module includes:
The connected domain if the length and width for the connected domain are identical, are classified as text and connected by text classification unit Logical domain;
Macrotaxonomy unit, will if the area for the connected domain is more than or equal to preset area high threshold The connected domain is classified as big connected domain;
Subclassification unit, if the area for the connected domain is less than preset area Low threshold, by the connection Domain is classified as small connected domain;
Special sort unit, if being more than or less than set high-low threshold value for the connected domain length-width ratio, The connected domain is classified as special connected domain.
In the embodiment of the present application, the sort module further includes:
Filter element, the connected domain for size to be less than to the text size of preset value are deleted as noise connected domain It removes.
In the embodiment of the present application, the sort module further includes:
Dimension cells for counting the width and height of the text connected domain boundary rectangle, calculate the two average value and obtain The width for obtaining text character in the text image is high.
In the embodiment of the present application, the initial module includes:
Detection unit, for detect the central point of text connected domain whether the window of embarking on journey to be inserted entered a profession center baseline In the range of;
The text connected domain for such as in the range of, is then inserted into described to be inserted enter a profession, and update by first Construction Bank's unit Its row information;
Second Construction Bank's unit, for if not in the range of, then the text connected domain position being set up newline.
In the embodiment of the present application, the insertion module is specifically used for special connected domain, small connected domain and big connected domain It is incorporated to successively in each initialization line of text.
In the embodiment of the present application, the variation that the insertion module is additionally operable to enable the row of the initialization line of text high is less than Default changing value, and the high variation of the row symmetrically changes along the center line of the row.
In the embodiment of the present application, it further includes:
Merging module, for if there is overlapped initialization line of text, then by the initialization text of the overlapping Row carries out merging into newline.
The embodiment of the present application extracts the image connectivity domain of the text image, and classifies to described image connected domain, Using described image connected domain, each line of text is initialized using preset width as window of embarking on journey, described in will be of all categories Image connectivity domain is incorporated to each initialization line of text of its ownership successively.Therefore, in printed page analysis process, the embodiment of the present application It does not need to carry out any correction to text, can directly be embarked on journey process by the information of connected domain, and be directed to all kinds of figures As connected domain has carried out different processing, make to all kinds of well adapting to property of image.
Description of the drawings
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or it will show below There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments described in application, for those of ordinary skill in the art, can also be obtained according to these attached drawings other Attached drawing.
Fig. 1 is a kind of one embodiment flow chart of processing method of embarking on journey for text image that the application provides;
Fig. 2 is an embodiment flow of step S1 in a kind of processing method of embarking on journey for text image that the application provides Figure;
Fig. 3 is that the application connected domain carries out one exemplary schematic diagram of classification;
Fig. 4 is another embodiment stream of step S1 in a kind of processing method of embarking on journey for text image that the application provides Cheng Tu;
Fig. 5 is one exemplary schematic diagram of the application erased noise connected domain;
Fig. 6 is the another embodiment stream of step S1 in a kind of processing method of embarking on journey for text image that the application provides Cheng Tu;
Fig. 7 is an embodiment flow of step S2 in a kind of processing method of embarking on journey for text image that the application provides Figure;
Fig. 8 is a kind of another embodiment flow chart of processing method of embarking on journey for text image that the application provides;
Fig. 9 a to Fig. 9 c are an exemplary schematic diagrames of the application step S01 processing text images;
Figure 10 is a kind of processing method another embodiment flow chart of embarking on journey for text image that the application provides;
Figure 11 is a kind of processing method another embodiment flow chart of embarking on journey for text image that the application provides;
Figure 12 is an exemplary schematic diagram of the application step S4 processing text images;
Figure 13 is a kind of one example structure figure of processing unit of embarking on journey for text image that the application provides;
Figure 14 is an embodiment of sort module in a kind of processing unit of embarking on journey for text image that the application provides Structure chart;
Figure 15 is another implementation of sort module in a kind of processing unit of embarking on journey for text image that the application provides Example structure chart;
Figure 16 is another implementation of sort module in a kind of processing unit of embarking on journey for text image that the application provides Example structure chart;
Figure 17 is an embodiment of initial module in a kind of processing unit of embarking on journey for text image that the application provides Structure chart;
Figure 18 is another example structure figure of a kind of processing unit of embarking on journey for text image that the application provides;
Figure 19 is a kind of processing unit another embodiment structure chart of embarking on journey for text image that the application provides;
Figure 20 is a kind of processing unit another embodiment structure chart of embarking on journey for text image that the application provides;
Figure 21 is the hardware configuration signal of the electronic equipment for the processing method of embarking on journey for text image that the application provides Figure.
Specific embodiment
The embodiment of the present application extracts the image connectivity domain of the text image, and classifies to described image connected domain, Using described image connected domain, each line of text is initialized using preset width as window of embarking on journey, described in will be of all categories Image connectivity domain is incorporated to each initialization line of text of its ownership successively.Therefore, in printed page analysis process, the embodiment of the present application It does not need to carry out any correction to text, can directly be embarked on journey process by the information of connected domain, and be directed to all kinds of figures As connected domain has carried out different processing, make to all kinds of well adapting to property of image.
Although the application can have many various forms of embodiments, in the accompanying drawings display and will herein in detail The specific embodiment of description, it should be appreciated that the disclosure of this embodiment should be considered as the example of principle, and be not intended to this Shen It please be limited to the specific embodiment being shown and described.In the following description, identical label shows for describing the several of attached drawing Identical, similar or corresponding part in figure.
As used herein, "one" or " one kind " of term are defined as one (kind) or more than one (kind).As herein It is used, term " multiple " is defined as two or more than two.As used herein, term " other " is defined as at least again It is one or more.As used herein, term "comprising" and/or " having " are defined to include (that is, open language).Such as Used herein, term " coupling " is defined as connecting, but is not necessarily to be directly connected to, and is not necessarily mechanically to connect. As used herein, term " program " or " computer program " or similar terms are defined as designed on the computer systems The instruction sequence of execution." program " or " computer program " may include subprogram, function, process, object method, object implementatio8, Executable application, applet, servlet, source code, object code, shared library/dynamic load library and/or design are used In the other instruction sequences performed on the computer systems.
Table is referred to " one embodiment ", " some embodiments ", " embodiment " or similar terms in entire this document Show that a particular feature, structure, or characteristic described in conjunction with the embodiments is included at least one embodiment of the invention.Therefore, exist The appearance of this word in the various places of entire this specification need not all represent identical embodiment.It is in addition, described specific Feature, structure or characteristic can combine in any suitable manner in one or more embodiments without limitation.
As used herein, term "or" should be construed as inclusive or represent any one or any group It closes.Therefore, " A, B or C " expression " following any one:A;B;C;A and B;A and C;B and C;A, B and C ".Only when element, When function, step or the combination of action inherently mutually exclusive in some way, it will the exception of this definition occurs.
In order to which those skilled in the art is made to more fully understand the technical solution in the application, below in conjunction with the embodiment of the present application In attached drawing, the technical solution in the embodiment of the present application is clearly and completely described, it is clear that described embodiment is only It is some embodiments of the present application, instead of all the embodiments.Based on the embodiment in the application, ordinary skill people Member's all other embodiments obtained should all belong to the range of the application protection.
Further illustrate that the application implements with reference to illustrations.
Referring to Fig. 1, one embodiment of the application provides a kind of processing method of embarking on journey for text image, including:
The image connectivity domain of S1, the extraction text image, and classify to described image connected domain.
Visually apparently, the point to communicate with each other forms a region, and disconnected point forms different regions. Such a all points communicate with each other the set formed, we are known as a connected region.
In the application one in the specific implementation, referring to Fig. 2, the step S1 includes:
If S11, the length and width of the connected domain are identical, the connected domain is classified as text connected domain.
If the area of S12, the connected domain is more than or equal to preset area high threshold, by the connected domain point Class is big connected domain.
Specifically, the area high threshold is area>400*width*width, wherein width are text in text image The width of the stroke of character.
If the area of S13, the connected domain is less than preset area Low threshold, the connected domain is classified as little Lian Logical domain.
If S14, the connected domain length-width ratio are more than or less than set high-low threshold value, by the connected domain point Class is special connected domain.
Specifically, the special connected domain includes:The symbols such as branch in formula, braces.
Referring to Fig. 3, label 31 is text connected domain in the text image 3 of acquisition, and big connection is not included in text image 3 Domain, label 32 are small connected domain, and label 33 is special connected domain.
It is another in the application in the specific implementation, referring to Fig. 4, the step S1 is further included:
S10, connected domain of the size less than the text size of preset value is deleted as noise connected domain.
Before the application classifies to image connectivity domain, first using size be less than preset value text size connected domain as Noise connected domain is deleted.That is, if the size of connected domain is less than the text size of preset value, assert that the connected domain is Noise connected domain, is deleted.
Specifically, the connected domain after 3 erased noise connected domain of text image is as shown in Figure 5.
Another in the specific implementation, referring to Fig. 6 in the application, the step S1 is further included:
The width and height of S15, the statistics text connected domain boundary rectangle calculate the two average value and obtain the text The width of text character is high in image.
Specifically, the application calculates all boundary rectangle width according to the width and height of boundary rectangle in Fig. 4 and Fig. 5 Average value so as to obtain the width of text character in the text image, calculates all boundary rectangle height averages, so as to obtain Obtain the height of text character in the text image.
S2, using described image connected domain, initialize each line of text using preset width as window of embarking on journey.
Specifically, the preset width is 4 times of character durations, and those of ordinary skill in the art can also use according to demand Other preset values.
Another in the specific implementation, referring to Fig. 7 in the application, the step S2 includes:
S21, the central point of text connected domain is detected whether in the center baseline range of the window of embarking on journey to be inserted entered a profession.
Specifically, the application first from left to right sorts the text connected domain according to x coordinate, then will be after sequence The text connected domain is embarked on journey successively according to its x coordinate and y-coordinate.
During the embarking on journey of the text connected domain, in order to reduce since line of text distortion caused by shooting is made to embarking on journey Into influence, choose 4 times of width as window of embarking on journey.In the window, it can be assumed that there is no distortion changes for text connected domain Shape, window of embarking on journey slide change with the addition of text connected domain.Criterion of embarking on journey is:When text connected domain is in window of embarking on journey When being less than default center baseline range with the connected domain center parallax range entered a profession, the connected domain belongs to the row, by described in Connected domain is entered a profession, and otherwise, the connected domain is set up newline.
S22, such as in the range of, then the text connected domain is inserted into described to be inserted enter a profession, and update its row information.
S23, if not in the range of, then newline is set up into the text connected domain position.
Specifically, during the application judges whether that all text connected domains are already inserted into and are embarked on journey, if also presence is not inserted Enter the text connected domain in being embarked on journey, then return to step S21;If there is no the text connected domain being not inserted into being embarked on journey, then Terminate to initialize each line of text.
S3, each initialization line of text that described image connected domain of all categories is incorporated to its ownership successively.
Due to initializing each line of text using the text connected domain, the step S3 is specially:
Special connected domain, small connected domain and big connected domain are incorporated to successively in each initialization line of text.
After row information initialization is completed, special connected domain, small connected domain and big connected domain are incorporated to each row successively successively In the middle, the rule being incorporated to is:After being incorporated to the connected domain, there is not acute variation in row height, when going out existing High variation, it is necessary to assure Capable upper edge and lower edge changes simultaneously, and changes basically identical.
The step S3 is further included:
The high variation of row of the initialization line of text is enabled to be less than default changing value, and the high variation of the row is along the row Center line symmetrically change.Therefore, the application ensures that special connected domain, small connected domain and big connected domain are incorporated to each initialization successively In line of text, row height symmetrically changes along the center line of the row, and changes and be less than default changing value.
In another embodiment of the application, including above-mentioned steps S1-S3, referring to Fig. 8, further included before the step S1:
The even effect of uneven illumination in S01, the removal text image, and by the text image binaryzation.
Specifically, due to the limitation of shooting condition, the text image of shooting can have that uneven illumination is even, pretreatment Process needs to remove the even effect of uneven illumination, and carry out binaryzation to text image.
Referring specifically to Fig. 9 a to Fig. 9 c, Fig. 9 a are the gray document image of input, and Fig. 9 b are that removal background illumination influences Text image, Fig. 9 c are the image of binaryzation.
In another embodiment of the application, including above-mentioned steps S1-S3, referring to Figure 10, also wrapped after the step S01 It includes:
S02, picture size analysis is carried out to the text image after binary conversion treatment, obtained in the text image Text size.
Since text image comes from image capture device shooting, in many cases, due to shooting angle, the limit of distance It makes, the size neither one fixed range of text in image.In order to unified analysis scale, need it is existing to image text into Row dimensional analysis.
Specifically, the analysis of the application image text scale calculates text pen using the black run length in statistical picture The strategy of width is drawn, i.e., the highest black distance of swimming of the frequency of occurrences is the stroke width of text as in the text image in the picture Text size.
In another embodiment of the application, including above-mentioned steps S1-S3, referring to Figure 11, the method further includes:
S4, if there is overlapped initialization line of text, then the initialization line of text of the overlapping is merged For newline.
It, will be described heavy when there are (Figure 12 a) during overlapped initialization line of text referring specifically to attached drawing 12a and Figure 12 b Folded initialization line of text is merged as newline (Figure 12 b).
Referring to Figure 13, the corresponding above method, another embodiment of the application provides a kind of processing of embarking on journey for text image Device, including:
Sort module 131 for extracting the image connectivity domain of the text image, and divides described image connected domain Class.
For utilizing described image connected domain, each text is initialized using preset width as window of embarking on journey for initial module 132 One's own profession.
Module 133 is inserted into, for described image connected domain of all categories to be incorporated to each initialization text of its ownership successively Row.
Visually apparently, the point to communicate with each other forms a region, and disconnected point forms different regions. Such a all points communicate with each other the set formed, we are known as a connected region.
In the application one in the specific implementation, referring to Figure 14, the sort module 131 includes:
The connected domain if the length and width for the connected domain are identical, is classified as text by text classification unit 1311 This connected domain;
Macrotaxonomy unit 1312, if the area of text stroke for being included in the connected domain is more than or equal in advance If area high threshold, then the connected domain is classified as big connected domain;
Subclassification unit 1313, if the area of text stroke for being included in the connected domain is less than preset area The connected domain is then classified as small connected domain by Low threshold;
Special sort unit 1314, if being more than or less than set height threshold for the connected domain length-width ratio Value, then be classified as special connected domain by the connected domain.
Specifically, the area high threshold is area>400*width*width, wherein width are text in text image The width of the stroke of character.
Specifically, the special connected domain includes:The symbols such as branch in formula, braces.
Referring to Fig. 3, label 31 is text connected domain in the text image 3 of acquisition, and big connection is not included in text image 3 Domain, label 32 are small connected domain, and label 33 is special connected domain.
It is another in the application in the specific implementation, referring to Figure 15, the sort module 131 further includes:
Filter element 1315 connects for deleting size using the text size less than the noise of preset value text size Domain.
Before the application classifies to image connectivity domain, first using size be less than preset value text size connected domain as Noise connected domain is deleted.That is, if the size of connected domain is less than the text size of preset value, assert that the connected domain is Noise connected domain, is deleted.
Specifically, the connected domain after 3 erased noise connected domain of text image is as shown in Figure 5.
Another in the specific implementation, referring to Figure 16 in the application, the sort module 131 further includes:
For counting the width and height of the text connected domain boundary rectangle, it is average to calculate the two for dimension cells 1316 The width that value obtains text character in the text image is high.
Specifically, the application calculates all boundary rectangle width according to the width and width of boundary rectangle in Fig. 4 and Fig. 5 Average value so as to obtain the height of text character in the text image, calculates all boundary rectangle height averages, so as to obtain Obtain the length of text character in the text image.
Specifically, for the preset length of window of embarking on journey for 4 times of character durations, those of ordinary skill in the art also can basis Demand uses other preset values.
Another in the specific implementation, referring to Figure 17 in the application, the initial module 122 includes:
Detection unit 1221, for whether detecting the central point of text connected domain at the center of window of embarking on journey to be inserted entered a profession In baseline range.
First Construction Bank's unit 1222, for such as in the range of, then by the text connected domain be inserted into it is described it is to be inserted enter a profession, and Update its row information.
Second Construction Bank's unit 1223, for if not in the range of, then the text connected domain position being set up newline.
Specifically, the application first from left to right sorts the text connected domain according to x coordinate, then will be after sequence The text connected domain is embarked on journey successively according to its x coordinate and y-coordinate.
During the embarking on journey of the text connected domain, in order to reduce the influence distorted due to line of text caused by shooting, 4 times of character durations are chosen as window of embarking on journey.In the window, it can be assumed that torsional deformation is not present in text connected domain row, Window of embarking on journey slides change with the addition of text connected domain.Criterion of embarking on journey is:When text connected domain in window of embarking on journey with When the connected domain center parallax range entered a profession is less than default center baseline range, the connected domain belongs to the row, by the company Logical domain is entered a profession, and otherwise, the connected domain is set up newline.
Specifically, during the application judges whether that all text connected domains are already inserted into and are embarked on journey, if also presence is not inserted Enter the text connected domain in being embarked on journey, then return to detection unit;If there is no the text connected domain being not inserted into being embarked on journey, then Terminate to initialize each line of text.
Due to initializing each line of text using the text connected domain, the insertion module 123 is specifically used for special company Logical domain, small connected domain and big connected domain are incorporated to successively in each initialization line of text.
After row information initialization is completed, special connected domain, small connected domain and big connected domain are incorporated to each row successively successively In the middle, the rule being incorporated to is:After being incorporated to the connected domain, there is not acute variation in row height, when going out existing High variation, it is necessary to assure Capable upper edge and lower edge changes simultaneously, and changes basically identical.
The step is inserted into the variation that module 123 is additionally operable to enable the row of the initialization line of text high and is less than default variation Value, and the high variation of the row symmetrically changes along the center line of the row.Therefore, the application ensures special connected domain, small connection Domain and big connected domain are incorporated to successively in each initialization line of text, and row height symmetrically changes along the center line of the row, and variation is less than Default changing value.
In another embodiment of the application, including above-mentioned sort module 131, initial module 132, module 133 is inserted into, referring to Figure 18 is further included:
Preprocessing module 130, for removing the even effect of uneven illumination in the text image, and by the text image Binaryzation.
Specifically, due to the limitation of shooting condition, the text image of shooting can have that uneven illumination is even, pretreatment Process needs to remove the even effect of uneven illumination, and carry out binaryzation to text image.
Referring specifically to Fig. 9 a to Fig. 9 c, Fig. 9 a are the gray document image of input, and Fig. 9 b are that removal background illumination influences Text image, Fig. 9 c are the image of binaryzation.
In another embodiment of the application, including above-mentioned sort module 131, initial module 132, module 133 is inserted into, referring to Figure 19 is further included:
Analysis module 1300 for carrying out picture size analysis to the text image after binary conversion treatment, obtains institute State the text size in text image.
Since text image comes from image capture device shooting, in many cases, due to shooting angle, the limit of distance It makes, the size neither one fixed range of text in image.In order to unified analysis scale, need it is existing to image text into Row dimensional analysis.
Specifically, the analysis of the application image text scale calculates text pen using the black run length in statistical picture The strategy of width is drawn, i.e., the highest black distance of swimming of the frequency of occurrences is the stroke width of text as in the text image in the picture Text size.
In another embodiment of the application, including above-mentioned sort module 131, initial module 132, module 133 is inserted into, referring to Figure 20 is further included:
Merging module 134, for if there is overlapped initialization line of text, then by the initialization of overlapping text One's own profession is merged as newline.
Referring specifically to attached drawing 11, when there are during overlapped initialization line of text, by the initialization text of the overlapping Row carries out merging into newline.
Figure 21 is hardware architecture diagram of the application for the electronic equipment of the processing method of embarking on journey of text image.According to Shown in Figure 21, which includes:
One or more processors 2110 and memory 2120, in Figure 21 by taking a processor 2110 as an example.
It can also include for the equipment of the processing method of embarking on journey of text image:Input unit 2130 and output device 2130。
Processor 2110, memory 2120, input unit 2130 and output device 2130 can by bus or other Mode connects, in Figure 21 for being connected by bus.
Memory 2120 is used as a kind of non-volatile computer readable storage medium storing program for executing, available for storing non-volatile software journey Sequence, non-volatile computer executable program and module, such as the processing of embarking on journey for text image in the embodiment of the present application Corresponding program instruction/the module of method is (for example, sort module 131, initial module 132, insertion module shown in attached drawing 13 133).Processor 2110 is stored in non-volatile software program, instruction and module in memory 2120 by operation, so as to The various function application of execute server and data processing realize that above method embodiment is directed to the place that embarks on journey of text image Reason method.
Memory 2120 can include storing program area and storage data field, wherein, storing program area can store operation system System, the required application program of at least one function;Storage data field can be stored according to the processing dress of embarking on journey for text image That puts uses created data etc..In addition, memory 2120 can include high-speed random access memory 2120, can also wrap Include nonvolatile memory 2120, for example, at least a magnetic disk storage 2120, flush memory device or other nonvolatile solid states Memory 2120.In some embodiments, memory 2120 is optional including relative to the remotely located storage of processor 2110 Device 2120, these remote memories 2120 can pass through network connection to audio mode selector.The example packet of above-mentioned network It includes but is not limited to internet, intranet, LAN, mobile radio communication and combinations thereof.
Input unit 2130 can receive the place that embarks on journey of the number or character information and generation of input with being directed to text image Manage the user setting of device and the key signals input that function control is related.Output device 2130 may include the equipment such as loud speaker.
One or more of modules are stored in the memory 2120, when by one or more of processors During 2110 execution, the processing method of embarking on journey for text image in above-mentioned any means embodiment is performed.
The said goods can perform the method that the embodiment of the present application is provided, and has the corresponding function module of execution method and has Beneficial effect.The not technical detail of detailed description in the present embodiment, reference can be made to the method that the embodiment of the present application is provided.
The electronic equipment of the embodiment of the present application exists in a variety of forms, including but not limited to:
(1) mobile communication equipment:The characteristics of this kind equipment is that have mobile communication function, and to provide speech, data It communicates as main target.This Terminal Type includes:Smart mobile phone (such as iPhone), multimedia handset, functional mobile phone and low Hold mobile phone etc..
(2) super mobile personal computer equipment:This kind equipment belongs to the scope of personal computer, there is calculating and processing work( Can, generally also have mobile Internet access characteristic.This Terminal Type includes:PDA, MID and UMPC equipment etc., such as iPad.
(3) portable entertainment device:This kind equipment can show and play multimedia content.The kind equipment includes:Audio, Video player (such as iPod), handheld device, e-book and intelligent toy and portable car-mounted navigation equipment.
(4) server:The equipment for providing the service of calculating, the composition of server are total including processor, hard disk, memory, system Line etc., server is similar with general computer architecture, but due to needing to provide highly reliable service, in processing energy Power, stability, reliability, safety, scalability, manageability etc. are more demanding.
(21) other have the function of the electronic device of data interaction.
The apparatus embodiments described above are merely exemplary, wherein the module illustrated as separating component can To be or may not be physically separate, the component shown as module may or may not be physics mould Block, you can be located at a place or can also be distributed on multiple network modules.It can be selected according to the actual needs In some or all of module realize the purpose of this embodiment scheme.Those of ordinary skill in the art are not paying creativeness Labour in the case of, you can to understand and implement.
It will be understood by those skilled in the art that embodiments herein can be provided as method, apparatus (equipment) or computer Program product.Therefore, in terms of the application can be used complete hardware embodiment, complete software embodiment or combine software and hardware Embodiment form.Moreover, the meter for wherein including computer usable program code in one or more can be used in the application The computer journey that calculation machine usable storage medium is implemented on (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) The form of sequence product.
The application is with reference to the method, apparatus (equipment) of embodiment and the flow chart and/or box of computer program product Figure describes.It should be understood that each flow and/or the side in flowchart and/or the block diagram can be realized by computer program instructions The combination of flow and/or box in frame and flowchart and/or the block diagram.These computer program instructions can be provided to logical With the processor of computer, special purpose computer, Embedded Processor or other programmable data processing devices to generate a machine Device so that the instruction generation performed by computer or the processor of other programmable data processing devices is used to implement in flow The device of function specified in one flow of figure or multiple flows and/or one box of block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works so that the instruction generation being stored in the computer-readable memory includes referring to Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or The function of being specified in multiple boxes.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted Series of operation steps are performed on calculation machine or other programmable devices to generate computer implemented processing, so as in computer or The instruction offer performed on other programmable devices is used to implement in one flow of flow chart or multiple flows and/or block diagram one The step of function of being specified in a box or multiple boxes.
Although the preferred embodiment of the application has been described, those skilled in the art once know basic creation Property concept, then additional changes and modifications may be made to these embodiments.So appended claims be intended to be construed to include it is excellent It selects embodiment and falls into all change and modification of the application range.Obviously, those skilled in the art can be to the application Various modification and variations are carried out without departing from spirit and scope.If in this way, these modifications and variations of the application Belong within the scope of the application claim and its equivalent technologies, then the application is also intended to exist comprising these modification and variations It is interior.

Claims (20)

1. a kind of processing method of embarking on journey for text image, which is characterized in that including:
The image connectivity domain of the text image is extracted, and is classified to described image connected domain;
Using described image connected domain, each line of text is initialized using preset width as window of embarking on journey;
Described image connected domain of all categories is incorporated to each initialization line of text of its ownership successively.
2. the method as described in claim 1, which is characterized in that the image connectivity domain of the extraction text image, and it is right Described image connected domain further includes before being classified:
Remove the even effect of uneven illumination in the text image, and by the text image binaryzation.
3. method as claimed in claim 2, which is characterized in that the even effect of uneven illumination in the removal text image Should, and will be further included after the text image binaryzation:
Picture size analysis is carried out to the text image after binary conversion treatment, obtains the text ruler in the text image It is very little.
4. method as described in claim 1, which is characterized in that the image connectivity domain of the extraction text image, and to institute It states image connectivity domain and classify and include:
If the length and width of the connected domain are identical, the connected domain is classified as text connected domain;
If the area of the connected domain is more than or equal to preset area high threshold, the connected domain is classified as Dalian Logical domain;
If the area of the connected domain is less than preset area Low threshold, the connected domain is classified as small connected domain;
If the connected domain length-width ratio is more than or less than set high-low threshold value, it is special that the connected domain is classified as Connected domain.
5. method as claimed in claim 4, which is characterized in that the image connectivity domain of the extraction text image, and it is right Described image connected domain carries out classification and further includes:
The connected domain that size is less than to the text size of preset value is deleted as noise connected domain.
6. method as claimed in claim 5, which is characterized in that the image connectivity domain of the extraction text image, and it is right Described image connected domain carries out classification and further includes:
The width and height of the text connected domain boundary rectangle are counted, the two average value is calculated and obtains the text image Chinese The width of this character is high.
7. method as claimed in claim 4, which is characterized in that it is described to utilize described image connected domain, made with preset width Each line of text is initialized for window of embarking on journey to include:
The central point of text connected domain is detected whether in the center baseline range of the window of embarking on journey to be inserted entered a profession;
Such as in the range of, then the text connected domain is inserted into described to be inserted enter a profession, and update its row information;
If not in the range of, then newline is set up into the text connected domain position.
8. the method for claim 7, which is characterized in that described that described image connected domain of all categories is incorporated to it successively Each initialization line of text of ownership includes:
Special connected domain, small connected domain and big connected domain are incorporated to successively in each initialization line of text.
9. method as claimed in claim 8, which is characterized in that it is described by special connected domain, small connected domain and big connected domain according to Secondary be incorporated in each initialization line of text further includes:
The high variation of row of the initialization line of text is enabled to be less than default changing value, and the high variation of the row is along the row Heart line symmetrically changes.
10. the method as described in claim 1, which is characterized in that further include:
If there is overlapped initialization line of text, then the initialization line of text of the overlapping is merged as newline.
11. a kind of processing unit of embarking on journey for text image, which is characterized in that including:
Sort module for extracting the image connectivity domain of the text image, and classifies to described image connected domain;
For utilizing described image connected domain, each line of text is initialized using preset width as window of embarking on journey for initial module;
Module is inserted into, for described image connected domain of all categories to be incorporated to each initialization line of text of its ownership successively.
12. device as claimed in claim 11, which is characterized in that further include:
Preprocessing module, for removing the even effect of uneven illumination in the text image, and by the text image binaryzation.
13. device as claimed in claim 12, which is characterized in that further include:
Analysis module for carrying out picture size analysis to the text image after binary conversion treatment, obtains the text diagram Text size as in.
14. device as claimed in claim 11, which is characterized in that the sort module includes:
The connected domain if the length and width for the connected domain are identical, is classified as text connected domain by text classification unit;
Macrotaxonomy unit, if the area for the connected domain is more than or equal to preset area high threshold, by described in Connected domain is classified as big connected domain;
Subclassification unit, if the area for the connected domain is less than preset area Low threshold, by the connected domain point Class is small connected domain;
Special sort unit, if being more than or less than set high-low threshold value for the connected domain length-width ratio, by institute It states connected domain and is classified as special connected domain.
15. device as claimed in claim 14, which is characterized in that the sort module further includes:
Filter element, the connected domain for size to be less than to the text size of preset value are deleted as noise connected domain.
16. device as claimed in claim 15, which is characterized in that the sort module further includes:
Dimension cells for counting the width and height of the text connected domain boundary rectangle, calculate the two average value and obtain institute The width for stating text character in text image is high.
17. device as claimed in claim 14, which is characterized in that the initial module includes:
Detection unit, for detect the central point of text connected domain whether the window of embarking on journey to be inserted entered a profession center baseline range It is interior;
The text connected domain for such as in the range of, is then inserted into described to be inserted enter a profession, and update its row by first Construction Bank's unit Information;
Second Construction Bank's unit, for if not in the range of, then the text connected domain position being set up newline.
18. device as claimed in claim 17, which is characterized in that the insertion module is specifically used for special connected domain, small Connected domain and big connected domain are incorporated to successively in each initialization line of text.
19. device as claimed in claim 18, which is characterized in that the insertion module is additionally operable to enable the initialization line of text The high variation of row be less than default changing value, and the high variation of the row symmetrically changes along the center line of the row.
20. device as claimed in claim 10, which is characterized in that further include:
Merging module, for if there is overlapped initialization line of text, then the initialization text of the overlapping being advanced Row merges into newline.
CN201611099659.2A 2016-12-01 2016-12-01 Line processing method and device for text image Pending CN108133169A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611099659.2A CN108133169A (en) 2016-12-01 2016-12-01 Line processing method and device for text image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611099659.2A CN108133169A (en) 2016-12-01 2016-12-01 Line processing method and device for text image

Publications (1)

Publication Number Publication Date
CN108133169A true CN108133169A (en) 2018-06-08

Family

ID=62388265

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611099659.2A Pending CN108133169A (en) 2016-12-01 2016-12-01 Line processing method and device for text image

Country Status (1)

Country Link
CN (1) CN108133169A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109508244A (en) * 2018-10-18 2019-03-22 北京新唐思创教育科技有限公司 Data processing method and computer readable medium
CN109871743A (en) * 2018-12-29 2019-06-11 口碑(上海)信息技术有限公司 The localization method and device of text data, storage medium, terminal
CN109919155A (en) * 2019-03-13 2019-06-21 厦门商集网络科技有限责任公司 A kind of the inclination angle antidote and terminal of text image
CN109948598A (en) * 2019-05-15 2019-06-28 达而观信息科技(上海)有限公司 Document layout intelligent analysis method and device
WO2020177584A1 (en) * 2019-03-01 2020-09-10 华为技术有限公司 Graphic typesetting method and related device
CN114067150A (en) * 2021-11-19 2022-02-18 王海丰 Method and system for generating text line in any direction

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050271275A1 (en) * 2004-06-04 2005-12-08 Benq Corporation Text character identification system and method thereof
CN102314608A (en) * 2010-06-30 2012-01-11 汉王科技股份有限公司 Method and device for extracting rows from character image
CN102567300A (en) * 2011-12-29 2012-07-11 方正国际软件有限公司 Picture document processing method and device
CN104182744A (en) * 2013-05-24 2014-12-03 佳能株式会社 Text detection method and device, and text message extraction method and system
CN105844207A (en) * 2015-01-15 2016-08-10 富士通株式会社 Text line extraction method and text line extraction equipment
CN106156772A (en) * 2015-03-25 2016-11-23 佳能株式会社 For determining the method and apparatus of word spacing and for the method and system of participle

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050271275A1 (en) * 2004-06-04 2005-12-08 Benq Corporation Text character identification system and method thereof
CN102314608A (en) * 2010-06-30 2012-01-11 汉王科技股份有限公司 Method and device for extracting rows from character image
CN102567300A (en) * 2011-12-29 2012-07-11 方正国际软件有限公司 Picture document processing method and device
CN104182744A (en) * 2013-05-24 2014-12-03 佳能株式会社 Text detection method and device, and text message extraction method and system
CN105844207A (en) * 2015-01-15 2016-08-10 富士通株式会社 Text line extraction method and text line extraction equipment
CN106156772A (en) * 2015-03-25 2016-11-23 佳能株式会社 For determining the method and apparatus of word spacing and for the method and system of participle

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109508244A (en) * 2018-10-18 2019-03-22 北京新唐思创教育科技有限公司 Data processing method and computer readable medium
CN109508244B (en) * 2018-10-18 2021-03-12 北京新唐思创教育科技有限公司 Data processing method and computer readable medium
CN109871743A (en) * 2018-12-29 2019-06-11 口碑(上海)信息技术有限公司 The localization method and device of text data, storage medium, terminal
WO2020177584A1 (en) * 2019-03-01 2020-09-10 华为技术有限公司 Graphic typesetting method and related device
US11790584B2 (en) 2019-03-01 2023-10-17 Huawei Technologies Co., Ltd. Image and text typesetting method and related apparatus thereof
CN109919155A (en) * 2019-03-13 2019-06-21 厦门商集网络科技有限责任公司 A kind of the inclination angle antidote and terminal of text image
CN109948598A (en) * 2019-05-15 2019-06-28 达而观信息科技(上海)有限公司 Document layout intelligent analysis method and device
CN114067150A (en) * 2021-11-19 2022-02-18 王海丰 Method and system for generating text line in any direction

Similar Documents

Publication Publication Date Title
CN108133169A (en) Line processing method and device for text image
CN109325954B (en) Image segmentation method and device and electronic equipment
CN109255352B (en) Target detection method, device and system
CN109697416B (en) Video data processing method and related device
US8792722B2 (en) Hand gesture detection
US8750573B2 (en) Hand gesture detection
CN110363091B (en) Face recognition method, device and equipment under side face condition and storage medium
CN110222573B (en) Face recognition method, device, computer equipment and storage medium
CN109117773B (en) Image feature point detection method, terminal device and storage medium
US20200125876A1 (en) Method and Device for License Plate Positioning
WO2017045443A1 (en) Image retrieval method and system
CN106250838A (en) vehicle identification method and system
CN111597884A (en) Facial action unit identification method and device, electronic equipment and storage medium
WO2015195301A1 (en) Obtaining structural information from images
CN105144239A (en) Image processing device, program, and image processing method
CN104239879B (en) The method and device of separating character
US10860877B2 (en) Logistics parcel picture processing method, device and system
US20170323149A1 (en) Rotation invariant object detection
CN112085701A (en) Face ambiguity detection method and device, terminal equipment and storage medium
CN110163095B (en) Loop detection method, loop detection device and terminal equipment
CN104268864A (en) Card edge extracting method and device
CN111488810A (en) Face recognition method and device, terminal equipment and computer readable medium
CN108520263B (en) Panoramic image identification method and system and computer storage medium
CN113269752A (en) Image detection method, device terminal equipment and storage medium
KR20190011722A (en) Estimation of human orientation in images using depth information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20180608

RJ01 Rejection of invention patent application after publication