Patent application title: TEXT IMAGE TRIMMING METHOD
Inventors:
Teng Long (Shanghai, CN)
Bin Zhang (Shanghai, CN)
Bin Zhang (Shanghai, CN)
Xiping Luo (Shanghai, CN)
Assignees:
INTSIG INFORMATION CO., LTD.
IPC8 Class: AG06T700FI
USPC Class:
382176
Class name: Image analysis image segmentation distinguishing text from other regions
Publication date: 2013-09-26
Patent application number: 20130251262
Abstract:
A text image trimming method, according to the following steps: step 1,
obtaining text image data; step 2, using straight line detection method
to detect the straight lines of the text image, obtaining edges of a
trimmed quadrangle; step 3, detecting text on the image data, obtaining
the coordinates of the boundary points of a text region; and step 4,
obtaining the final trimming result according to the results of steps 2
and 3. The method can automatically detect the edges of the text region
and utilize the detected text region to verify and remove unrelated
redundant information thereby, allowing the user to only see the portion
containing the text region useful to the user when viewing image data.Claims:
1. A text image trimming method comprises following steps: Step 110,
obtaining text image data; gaining image data in the step 110 comprises
one of the following three methods: taking the image by a DC; scanning
the image by a scanner; opening an existing file that contains image
data, reading the data in the file and decompressing the data with a
standard algorithm; Step 120, using straight line detection method to
detect straight lines in the text image, obtaining the edges of a trimmed
quadrangle; obtaining at least one candidate quadrilateral area according
to the detected straight lines; Step 130, detecting text in the image
data, obtaining the coordinate of the boundary points of the text region;
Step 140, obtaining the final trimming result according to the results of
steps 120 and 130; specifically, the step 140 comprises following steps:
Step 210, forming a set of candidate quadrangles that composed of all the
quadrangles obtained in the step 120; Step 220, if the set of candidate
quadrangles is empty, go to step 260, otherwise, go to step 230; Step
230, popping a candidate quadrangle from the set of candidate
quadrangles; Step 240, determining if all the edge points of the text
region are in the candidate quadrangle, if they are, judge the candidate
quadrangle to be valid trimmed quadrangle and go to step 250, if they are
not, go to step 220; Step 250, returning to the valid trimmed quadrangle;
and Step 260, returning the valid trimmed quadrangle to user for manually
determining trimmed quadrangle; Step 150, the end.
2. A text image trimming method comprises following steps: Step 110, obtaining text image data; Step 120, using straight line detection method to detect straight lines in the text image, obtaining the edges of a trimmed quadrangle; Step 130, detecting text in the image data, obtaining the coordinates of the boundary points of the text region; Step 140, obtaining the final trimming result according to the results of steps 120 and 130; and Step 150, end of the method.
3. A text image trimming method according to claim 2, wherein the step 140 comprises following steps: Step 210, forming a set of candidate quadrangles that composed of all the quadrangles obtained in the step 120; Step 220, if the set of candidate quadrangles is empty, go to step 260, otherwise, go to step 230; Step 230, popping a candidate quadrangle from the set of candidate quadrangles; Step 240, determining if all the edge points of the text region are in the candidate quadrangle, if they are, judge the candidate quadrangle to be valid trimmed quadrangle and go to step 250, if they are not, go to step 220; Step 250, returning to the valid trimmed quadrangle; and Step 260, returning the valid trimmed quadrangle to user for manually determining trimmed quadrangle.
4. A text image trimming method according to claim 2, wherein the method of gaining image data in the step 110 comprises one of the following three methods: A: taking the image by a DC; B: scanning the image by a scanner; C: opening an existing file that contains image data, reading the data in the file and decompressing the data with a standard algorithm.
Description:
BACKGROUND OF THE PRESENT INVENTION
[0001] 1. Field of Invention
[0002] The present invention belongs to image-processing field, relates to a text image processing method, and especially relates to a text image trimming method.
[0003] 2. Description of Related Arts
[0004] Digital Camera (DC) is becoming more and more popular these years, at present, built-in DC is standard feature of a cellphone. These digital imaging devices are often used to shoot text images. Text image means the image contains one or more lines of printed text, such as image of a business card, a menu, a bill or a note .etc. The image taken by DC is different from that scanned by scanner, the differences includes, for example, that the image taken by DC is less clearer, the image taken by DC could be distortional because of the projection deformation of the subject such as business card, and the images taken by DC could also contain content or background other than the desired subject. Because of shooting habits or framing demands, the text image shot by user usually contains background, while what is needed is the text image without the background, just like the image scanned by a scanner.
[0005] There have been applications that can separate text image from its background, for example, the mobiReader, a business card editing software from the Apple's app store. It defines a preview area, and requires that user put the business card right in the preview area before shooting to obtain an image that only contains the content of the business card, then the effect of trimming can be achieved. However, this is a manual trimming method. There are other applications, such as the genius Scan from the Apple's app store, that can gain text region by using straight line detection method in image processing field because the shapes of the text images, for example, images of business cards, menus, bills or notes, are quadrangle with clear edge.
[0006] But when the text contains straight lines, the above-mentioned method may recognize the straight lines in the text as the edge of the text by mistake. With regards to this kind of images, other certain clues can be helpful to gain text image area, increase the accuracy of detecting the text region, and guarantee the trimming effect.
[0007] Regardless of whether a text image was taken by DC or scanned by a scanner, existing software, such as business-card-recognizing software or OCR software in the scanner, can detect and recognize the text in the text image.
SUMMARY OF THE PRESENT INVENTION
[0008] The object of the invention is to provide a text image trimming method which can automatically detect the edge of text region, verify and correct the edge according to the detected text region by using text-recognizing method, drastically increase the accuracy of text-area-detecting, thus eliminate redundant information and provide user the valuable parts that only contains text region when the user view the text image.
[0009] To achieve the above-mentioned objects, the present invention provides the following technical solution:
[0010] A text image trimming method, comprising:
[0011] Step 110, obtaining text image data;
[0012] Step 120, detecting straight lines in the text image by a method of straight line detection, obtaining the edges of a trimmed quadrangle;
[0013] Step 130, detecting text in the image data, and obtaining the coordingates of the boundary points of the text region;
[0014] Step 140, obtaing the final trimming result according to the results of steps 120 and 130; and
[0015] Step 150, end of the method.
[0016] As a preferred embodiment, the step 140 comprises following steps:
[0017] Step 210, forming a set of candidate quadrangles that composed of all the quadrangles obtained in the step 120;
[0018] Step 220, if the set of candidate quadrangles is empty, go to step 260, otherwise, go to step 230;
[0019] Step 230, popping a candidate quadrangle from the set of candidate quadrangles;
[0020] Step 240, determining if all the edge points of the text region are in the candidate quadrangle, if they are, judge the candidate quadrangle to be valid trimmed quadrangle and go to step 250, if they are not, go to step 220;
[0021] Step 250, returning to the valid trimmed quadrangle;
[0022] Step 260, returning the valid trimmed quadrangle to user for manually determining trimmed quadrangle.
[0023] As a preferred embodiment, the method of gaining image data in the step 110 comprises one of the following three methods:
[0024] A: taking the image by a DC;
[0025] B: scanning the image by a scanner;
[0026] C: opening an existing file that contains image data, reading the data in the file and decompressing the data with a standard algorithm.
[0027] In order to realize the present invention, the following hardware is needed: A device with general computing and storing devices, including CPU with a certain frequency, a memory used for computing, and a storing space used for storing system software, application software and all kinds of data. If the image is taken by a DC or scanned by a scanner, DC or scanner is needed. Given text image data that need to be preserved or viewed, the present invention automatically detects the edge of the text region, use text detection method to detect text region and validate and correct the edge according to the detected text region, thus the accuracy of detecting the edge of the text region is drastically increased.
[0028] The benificial effects of the envention comprises: an image trimming method according to the present invention, includes trimming the text image by using technoledge in image processing and pattern recogonition fields, and determining whether a trimmed quadrangle includes text region, thus more accurate trimmed text region can be obtained from trimmed canditate quadrangles, lesss manully cutting work is needed and the trouble of data missing because of the inacurate trimming is saved.
BRIEF DESCRIPTION OF THE DRAWINGS
[0029] FIG. 1 illustrates the flow chart of the text image trimming method according to the present invention;
[0030] FIG. 2 illustrates the flow chart of the method that is used to determine whether the trimmed quadrangle is valid;
[0031] FIG. 3 illustrates the original text image; and
[0032] FIG. 4 illustrates the text image that is processed by using the text trimming method according to the present invention.
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0033] The preferred embodiments of the present invention will be described in detail with drawings.
The First Embodiment
[0034] Please refer to FIG. 1, the present invention discloses a text image trimming method, the method comprises following steps:
[0035] [Step 110] obtaining text image data.
[0036] The method of obtaining image data comprises one of the following three methods:
[0037] A: taking the image by a DC;
[0038] B: scanning the image by a scanner;
[0039] C: opening an existing file that contains image data, reading the data in the file and decompressing the data with a standard algorithm.
[0040] [Step 120] using straight line detection method to detect straight lines in the text image, and obtaining the edges of a trimmed quadrangle.
[0041] [Step 130] detecting text in the image data, obtaining the coordingates of the boundary points of the text region;
[0042] [Step 140] obtaining the final trimming result according to the results of steps 120 and 130;
[0043] Please refer to FIG. 2, the step 140 specially comprises the following steps:
[0044] Step 210, forming a set of candidate quadrangles that composed of all the quadrangles obtained in the step 120;
[0045] Step 220, if the set of candidate quadrangles is empty, go to step 260, otherwise, go to step 230;
[0046] Step 230, popping a candidate quadrangle from the set of candidate quadrangles;
[0047] Step 240, determining if all the edge points of the text region are in the candidate quadrangle, if they are, judge the candidate quadrangle to be valid trimmed quadrangle and go to step 250, if they are not, go to step 220;
[0048] Step 250, returning to the valid trimmed quadrangle;
[0049] Step 260, returning the valid trimmed quadrangle to user for manually determining trimmed quadrangle.
[0050] [Step 150], the end.
[0051] To sum up, the text image trimming method according to the present invention adopts the technowledge in image processing, pattern recognition, determines whether the trimmed quadrangle contains text reginon when trimming the text image, thereby obtaining accurate text region. By using the method, more accurate trimmed text region can be obtained from trimmed canditate quadrangles, lesss manualy cutting work is needed and the trouble of data missing caused by inacurate trimming is saved.
The Second Embodiment
[0052] Generally, a image of a bill or notes in computer is as shown in FIG. 3, after using the method according to the present invention to read the data of the image, automatically trim, detect and correct the text region, the result text image is as shown in FIG. 4.
The Third Embodiment
[0053] iPhone has a built-in digital camera of 3 million pixels, using the method according to the present invention to automatically trim, detect and correct the text image shot by the camera, a rectagle image can be obtaind.
[0054] The description of the above embodiments is only to illustrate the principle and effect of the present invention, but is not intended to limit the present invention. Any persons skilled in the art can make modification or variation to the above embodiments without departing from the spirit and scope of the present invention. Any equivalent modification and change made by persons with ordinary skill in the art without departing from the spirit and technical thought disclosed in the present invention shall all fall within the scope of claims of the present invention.
User Contributions:
Comment about this patent or add new information about this topic:
People who visited this patent also read: | |
Patent application number | Title |
---|---|
20150056186 | COMBINATION THERAPY OF A TYPE II ANTI-CD20 ANTIBODY WITH AN ANTI-BCL-2 ACTIVE AGENT |
20150056185 | IMMUNOGLOBULIN CONSTANT REGION FC RECEPTOR BINDING AGENTS |
20150056184 | Protein Belonging to the TNF Superfamily Involved in Signal Transduction, Nucleic Acids Encoding Same and Methods of Use Thereof |
20150056183 | THERAPEUTIC CANINE IMMUNOGLOBULINS AND METHODS OF USING SAME |
20150056182 | DRUG CONTAINING CARRIER INTO CELL FOR FORMING IMMUNE COMPLEX |