CN109948440A - Form image analytic method, device, computer equipment and storage medium - Google Patents

Form image analytic method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN109948440A
CN109948440A CN201910115443.8A CN201910115443A CN109948440A CN 109948440 A CN109948440 A CN 109948440A CN 201910115443 A CN201910115443 A CN 201910115443A CN 109948440 A CN109948440 A CN 109948440A
Authority
CN
China
Prior art keywords
form image
layout
image
target table
analytic method
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
CN201910115443.8A
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910115443.8A priority Critical patent/CN109948440A/en
Publication of CN109948440A publication Critical patent/CN109948440A/en
Pending legal-status Critical Current

Links

Landscapes

  • Character Input (AREA)

Abstract

The present invention proposes a kind of form image analytic method, which comprises List of input image, and the form image is pre-processed;Floor projection is carried out to pretreated form image and carries out upright projection, obtains the target table layout of the form image;It identifies the character content in the target table layout, the table of the form image is generated according to the character content and target table layout.The present invention can be realized by projection algorithm extracts tableau format and list data from the form image of no table line, solves the problems, such as that form analysis can only be carried out to the form image for having table line in the prior art.

Description

Form image analytic method, device, computer equipment and storage medium
Technical field
The present invention relates to computer processing technical field more particularly to a kind of form image analytic methods, device, computer Equipment and storage medium.
Background technique
Table is common data information carrier in document.Table in our daily lifes using more and more extensive, The form expression data of adopted table can be visual in image, and expression way is succinct.Currently, most enterprises especially IT, silver The industries such as row, finance, daily table incredible amount to be processed.In practical applications, we can encounter some comprising table Document is PDF format or picture format or the basic form image format without table line, in these cases, when us When needing to edit table, then it can not operate.Therefore, the analysis Yu identification of table are one in computer document processing Big event can bring great convenience for our work.Currently, the analysis of table and identification are widely used in various fields It closes, such as business and government organs, Table recognition has very high research and application value.
However, at least being had the following deficiencies: in the technology of existing Table recognition
Existing technical solution is to be based on having the case where table line to carry out form analysis, the table lattice when not having table line Formula picture not can be carried out table extraction then.
Summary of the invention
The present invention provides a kind of form image analytic method and corresponding device, mainly realizes through projection algorithm reality Tableau format and list data now are extracted from the form image of no table line, solving in the prior art can only be to there is table The form image of ruling carries out the problem of form analysis.
It the computer equipment that the present invention also provides a kind of for executing form image analytic method of the invention and readable deposits Storage media.
To solve the above problems, the present invention uses the technical solution of following various aspects:
In a first aspect, the present invention provides a kind of form image analytic method, which comprises
List of input image, and the form image is pre-processed;
Floor projection is carried out to pretreated form image and carries out upright projection, obtains the mesh of the form image Mark table-layout;
The character content in the target table layout is identified, according to the character content and the target table cloth Office generates the table of the form image.
Specifically, the List of input image, and the form image is pre-processed, comprising:
Binary conversion treatment is carried out to the form image and obtains binary map;
The cross-wise lines in the binary map are detected, and remove the cross-wise lines;
It detects vertical lines, and removes the vertical lines detected.
Specifically, described obtain binary map to form image progress binary conversion treatment, comprising:
Gray proces are carried out to the form image and obtain grayscale image;
The binary map is obtained with maximum stable extremal region algorithm to the grayscale image.
Specifically, described carry out floor projection to pretreated form image and carry out upright projection, obtain described The target table of form image is laid out, comprising:
Floor projection is carried out to pretreated form image and obtains row cutting region;
Upright projection is carried out to pretreated form image and obtains column cutting region;
Image segmentation is carried out to the form image according to the row cutting region and the column cutting region, generates institute State target table layout and several unit table images.
Preferably, the character content identified in the target table layout, according to the character content and institute State the table that target table layout generates the form image, comprising:
The bezel, cluster structure of the form image is drawn according to target table layout;
Identify the character content in the unit table images;
By in the corresponding filling bezel, cluster structure of the character content, the table of the form image is generated.
Specifically, described carry out floor projection to pretreated form image and carry out upright projection, obtain described Before the target table layout of form image, comprising:
Carrying out lateral expansion to the pretreated form image makes regional connectivity.
Specifically, further include:
It whether detects in the form image comprising grid lines;
If the form image includes grid lines, the original table-layout of the form image is extracted;
The original table-layout is compared with target table layout, to verify the target table layout.
Second aspect, the present invention provide a kind of form image resolver, which comprises
Input module is used for List of input image, and pre-processes to the form image;
Projection module obtains institute for carrying out floor projection to pretreated form image and carrying out upright projection State the target table layout of form image;
Generation module, the character content in target table layout out for identification, according to the character content and The target table layout generates the table of the form image.
The third aspect, the present invention provide a kind of computer readable storage medium, which is characterized in that described computer-readable to deposit It is stored with computer program on storage media, table described in any one of first aspect is realized when which is executed by processor The step of table images analytic method.
Fourth aspect, the present invention provide a kind of computer equipment, which is characterized in that described including memory and processor Computer-readable instruction is stored in memory, when the computer-readable instruction is executed by the processor, so that the place Device is managed to execute as described in any one of first aspect claim the step of form image analytic method.
Compared with the existing technology, technical solution of the present invention at least has following advantage:
1, the present invention provides a kind of form image analytic method, by List of input image, and to the form image into Row pretreatment;Floor projection is carried out to pretreated form image and carries out upright projection, obtains the form image Target table layout;The character content in the target table layout is identified, according to the character content and the target Table-layout generates the table of the form image.The present invention can realize the form image from no table line by projection algorithm In extract tableau format and list data, solve in the prior art can only to have table line form image carry out table The problem of parsing.
2, whether the present invention can also detect in the form image comprising grid lines;If the form image includes grid Line then extracts the original table-layout of the form image;The original table-layout and target table layout are carried out It compares, to verify the target table layout.Specifically, comparison result of the present invention can for the target table layout with The discrepancy of the original table-layout, when detecting the quantity of the discrepancy beyond preset value, then judgement is got The row cutting region or column cutting region inaccuracy, then reacquire the row cutting region and the column cutting area Domain simultaneously regenerates the target table layout.The present invention not only realizes the parsing of the form image of no table line, also realizes The table parsed is verified and adjusted, the applicability and flexibility of lifting scheme.
Detailed description of the invention
Fig. 1 is form image analytic method flow chart in one embodiment;
Fig. 2 is the grayscale image generated in one embodiment;
Fig. 3 is the binary map generated in one embodiment;
Fig. 4 is the cross-wise lines detection figure generated in one embodiment;
Fig. 5 is the removal cross-wise lines figure generated in one embodiment;
Fig. 6 is the vertical lines detection figure generated in one embodiment;
Fig. 7 is the vertical lines figure of removal generated in one embodiment;
Fig. 8 is the denoising figure generated in one embodiment;
Fig. 9 is the row cutting region figure generated in one embodiment;
Figure 10 is the transverse area connected graph generated in one embodiment;
Figure 11 is the column cutting region figure generated in one embodiment;
Figure 12 is form image resolver structural block diagram in one embodiment;
Figure 13 is the internal structure block diagram of computer equipment in one embodiment.
The object of the invention is realized, the embodiments will be further described with reference to the accompanying drawings for functional characteristics and advantage.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described.
In some processes of the description in description and claims of this specification and above-mentioned attached drawing, contain according to Multiple operations that particular order occurs, but it should be clearly understood that these operations can not be what appears in this article suitable according to its Sequence is executed or is executed parallel, and the serial number of operation such as S11, S12 etc. be only used for distinguishing each different operation, serial number It itself does not represent and any executes sequence.In addition, these processes may include more or fewer operations, and these operations can To execute or execute parallel in order.It should be noted that the description such as " first " herein, " second ", is for distinguishing not Same message, equipment, module etc., does not represent sequencing, does not also limit " first " and " second " and be different type.
It will appreciated by the skilled person that unless expressly stated, singular " one " used herein, " one It is a ", " described " and "the" may also comprise plural form.It is to be further understood that being arranged used in specification of the invention Diction " comprising " refer to that there are the feature, integer, step, operation, element and/or component, but it is not excluded that in the presence of or addition Other one or more features, integer, step, operation, element, component and/or their group.It should be understood that when we claim member Part is " connected " or when " coupled " to another element, it can be directly connected or coupled to other elements, or there may also be Intermediary element.In addition, " connection " used herein or " coupling " may include being wirelessly connected or wirelessly coupling.It is used herein to arrange Diction "and/or" includes one or more associated wholes for listing item or any cell and all combinations.
It will appreciated by the skilled person that unless otherwise defined, all terms used herein (including technology art Language and scientific term), there is meaning identical with the general understanding of those of ordinary skill in fields of the present invention.Should also Understand, those terms such as defined in the general dictionary, it should be understood that have in the context of the prior art The consistent meaning of meaning, and unless idealization or meaning too formal otherwise will not be used by specific definitions as here To explain.
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description in which the same or similar labels are throughly indicated same or similar element or has same or like function Element.Obviously, described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Based on this Embodiment in invention, those skilled in the art's every other implementation obtained without creative efforts Example, shall fall within the protection scope of the present invention.
Referring to Fig. 1, the embodiment of the present invention provides a kind of form image analytic method, as shown in Figure 1, the method includes Following steps:
S11, List of input image, and the form image is pre-processed.
In the embodiment of the present invention, the form image can may be for the photo of the table acquired by photographic device The form image intercepted by screenshot mode, such as the form image intercepted in PDF document.It is of the present invention to the table Image is pre-processed, specifically includes the following steps:
Step 1: carrying out binary conversion treatment to the form image obtains binary map.
In this step, following two sub-steps are specifically included:
A1, gray processing processing generation grayscale image, the grayscale image of generation are carried out to the form image.Referring to FIG. 2, Fig. 2 is the grayscale image of generation in a kind of embodiment.
A2, the binary map is obtained with MSER (maximum stable extremal region detection) algorithm to the gray scale picture again. Referring to FIG. 3, Fig. 3 is the binary map of generation in a kind of embodiment.As shown in Figure 3.It include several rectangles in the binary map Small box, the small box of the rectangle are the position where the text in the form image.
The basic principle of MSER algorithm is to take threshold value to carry out binary conversion treatment one width grayscale image (gray value is 0~255), Threshold value is incremented by successively from 0 to 255.The rising of threshold value being incremented by similar to the water surface in watershed algorithm, with the rising of the water surface, There are some shorter hills that can be submerged, if looked down from sky, is divided into land and two, waters part bigly, this is similar In binary map.In obtained all binary maps, certain connected regions in image are varied less, and even without variation, then should Region is thus referred to as maximum stable extremal region.
Above scheme can only detect the black region of grayscale image, cannot detect white area, therefore also need to original Figure is inverted, and then carries out threshold value again from 0~255 binary conversion treatment process.Both operation again be referred to as MSER+ and MSER-。
MSER algorithm is the detection method for being presently believed to the best affine-invariant features region of performance, uses different gray scale thresholds Value carries out binaryzation to image to obtain most stability region, and performance characteristic has following three points: variation affine to image grayscale has Invariance supports versus grayscale variation to have stability in region, and the size area in fine Chengdu different to region can carry out Detection.
In a kind of possible design, the extraction step of MSER maximum extreme value stability region includes: pixel sequence, extreme value area Domain generates, stability region determines, region fitting and region normalize.
Step 2: detecting the cross-wise lines in the binary map, and remove the cross-wise lines.
Following sub-step is specifically included in step 2:
B1, cross-wise lines detection is carried out to the binary map, detects cross-wise lines especially by lateral encroaching expansion fashion, Generate cross-wise lines detection figure.
Referring to FIG. 4, Fig. 4 is in a kind of embodiment, the cross-wise lines of generation detect figure.
As shown in figure 4, including 4 short lines and 7 long lines in the cross-wise lines detection figure.The cross detected Be lateral interference lines to lines, for example, in the binary map there may be linking together there are two the small box of rectangle after A cross-wise lines are constituted, these cross-wise lines can draw subsequent table and interfere, need to remove.
The cross-wise lines of B2, the removal cross-wise lines detection figure, generate removal cross-wise lines figure.Referring to FIG. 5, Fig. 5 is the removal cross-wise lines figure of generation in a kind of embodiment.Comparison diagram 5 and Fig. 3 are it is found that Fig. 5 is on the basis of Fig. 3 Eliminate the cross-wise lines of interference.
Step 3: detecting vertical lines, and remove the vertical lines detected.
Following sub-step is specifically included in step 3:
C1, vertical lines detection is carried out to the removal cross-wise lines figure, especially by vertical corrosion expansion fashion detection Vertical lines generate vertical lines detection figure.
Referring to FIG. 6, Fig. 6 is in a kind of embodiment, the vertical lines of generation detect figure.As shown in fig. 6, the vertical line It includes 5 in figure that item, which detects, and similarly, which is also interference lines, needs to remove.
C2, the vertical lines in Fig. 5 are removed according to the vertical lines detected, generate and removes vertical lines Figure.
Referring to FIG. 7, Fig. 7 is the vertical lines figure of the removal of generation in a kind of embodiment.Comparison diagram 7 and Fig. 5 it is found that Fig. 7 is the vertical lines that the interference of the leftmost side and the rightmost side is eliminated on the basis of Fig. 5.
C3, the vertical vertical corrosion of lines figure progress of the removal is denoised, generates denoising and scheme, as shown in Figure 8.
S12, floor projection is carried out to pretreated form image and carries out upright projection, obtain the form image Target table layout.
In the embodiment of the present invention, after generating the denoising figure, horizontal to the denoising figure progress floor projection acquisition Row cutting region generates row cutting region figure.
Referring to FIG. 9, Fig. 9 is in a kind of embodiment, the row cutting region figure that the present invention generates.As shown in figure 9, institute It states in row cutting region figure comprising white area and black region, wherein the black region is the back of the form image Scape part, the white area are row cutting region region.The row cutting region is that there are the regions of text.
Further, the present invention, which carries out lateral expansion to the row cutting region figure, that is, Fig. 7, makes regional connectivity, obtains transverse direction Regional connectivity figure.
Referring to FIG. 10, Figure 10 is in a kind of embodiment, the transverse area connected graph that the present invention generates.Such as Figure 10 institute Show, the transverse area connected graph includes white area and black region, and wherein white area is the back of the form image Scene area, black region are that there are the regions of text in the form image.
Further, the present invention obtains vertical column and cuts to the transverse area connected graph, that is, Fig. 9 progress upright projection Region is cut, column cutting region figure is obtained.
Figure 11 is please referred to, Figure 11 is the column cutting region figure that the present invention generates in a kind of embodiment.Such as Figure 11 institute Show, includes white area and black region in the column cutting region figure, wherein white area is column cutting region, is It projects to obtain by the black region in Figure 10, black region is background area, projects to obtain for the white area in Figure 10.
In the embodiment of the present invention, vertical throwing can be done to the form image by Python computer programming language Shadow.In a kind of possible design, the present invention specifically can use opencv cross-platform computer vision library to the form image Carry out upright projection.
Further, in the embodiment of the present invention, according to the row cutting region and the column cutting region to the table Image carries out image segmentation and obtains several white rectangle regions, and the distribution and quantity according to the white rectangle region determine The target table layout, wherein the target table layout includes at least the line number and columns of table.Specifically, can be with The columns that the quantity in white rectangle region in a line is laid out as the target table, by the number in white rectangle region in a column Measure the line number being laid out as the target table.
The white rectangle region is the unit table images for the table image segmentation.According to the white rectangle area Table is drawn in domain, obtains the form of the form image.
S13, character content in target table layout is identified, according to the character content and the object table Lattice layout generates the table of the form image.
In the embodiment of the present invention, the white rectangle that is obtained according to the row cut zone and the column split region segmentation Region is the unit table images of the form image, is further obtained and is identified in the unit table images using OCR identification model Character content.
Further, the line number and columns that obtain the form image draw the bezel, cluster knot of the form image later Structure, in the cell of the corresponding bezel, cluster structure for inserting the drafting of character content in each unit table images that will identify that To the editable table of the form image.
Preferably, whether the present invention can also detect in the form image comprising grid lines;If the form image packet Containing grid lines, then the original table-layout of the form image is extracted;By the original table-layout and the target table cloth Office is compared to obtain comparison result, to verify the target table layout.Wherein, the comparison result can be the target The discrepancy of table-layout and the original table-layout, for example, different line numbers and different columns etc..When the comparison When as a result having differences for target table layout with the original table-layout, then the target table layout is judged not Accurately.
In another embodiment, if the discrepancy quantity of comparison exceeds preset error range, the row cutting area is judged The acquisition inaccuracy of domain or the column cutting region, then need to reacquire the row cutting region and the column cutting area Domain, to be adjusted to target table layout, to regenerate the table of the form image.
Figure 12 is please referred to, in another embodiment, the present invention provides a kind of form image resolvers, comprising:
Input module 11 is used for List of input image, and pre-processes to the form image.
In the embodiment of the present invention, the form image can may be for the photo of the table acquired by photographic device The form image intercepted by screenshot mode, such as the form image intercepted in PDF document.It is of the present invention to the table Image is pre-processed, specifically includes the following steps:
Step 1: carrying out binary conversion treatment to the form image obtains binary map.
In this step, following two sub-steps are specifically included:
A1, gray processing processing generation grayscale image, the grayscale image of generation are carried out to the form image.Please continue to refer to Fig. 2, Fig. 2 are the grayscale image of generation in a kind of embodiment.
A2, the binary map is obtained with MSER (maximum stable extremal region detection) algorithm to the gray scale picture again. With continued reference to FIG. 3, Fig. 3 is the binary map of generation in a kind of embodiment.As shown in Figure 3.It include several in the binary map The small box of rectangle, the small box of the rectangle are the position where the text in the form image.
The basic principle of MSER algorithm is to take threshold value to carry out binary conversion treatment one width grayscale image (gray value is 0~255), Threshold value is incremented by successively from 0 to 255.The rising of threshold value being incremented by similar to the water surface in watershed algorithm, with the rising of the water surface, There are some shorter hills that can be submerged, if looked down from sky, is divided into land and two, waters part bigly, this is similar In binary map.In obtained all binary maps, certain connected regions in image are varied less, and even without variation, then should Region is thus referred to as maximum stable extremal region.
Above scheme can only detect the black region of grayscale image, cannot detect white area, therefore also need to original Figure is inverted, and then carries out threshold value again from 0~255 binary conversion treatment process.Both operation again be referred to as MSER+ and MSER-。
MSER algorithm is the detection method for being presently believed to the best affine-invariant features region of performance, uses different gray scale thresholds Value carries out binaryzation to image to obtain most stability region, and performance characteristic has following three points: variation affine to image grayscale has Invariance supports versus grayscale variation to have stability in region, and the size area in fine Chengdu different to region can carry out Detection.
In a kind of possible design, the extraction step of MSER maximum extreme value stability region includes: pixel sequence, extreme value area Domain generates, stability region determines, region fitting and region normalize.
Step 2: detecting the cross-wise lines in the binary map, and remove the cross-wise lines.
Following sub-step is specifically included in step 2:
B1, cross-wise lines detection is carried out to the binary map, detects cross-wise lines especially by lateral encroaching expansion fashion, Generate cross-wise lines detection figure.
With continued reference to FIG. 4, Fig. 4 is in a kind of embodiment, the cross-wise lines of generation detect figure.
As shown in figure 4, including 4 short lines and 7 long lines in the cross-wise lines detection figure.The cross detected Be lateral interference lines to lines, for example, in the binary map there may be linking together there are two the small box of rectangle after A cross-wise lines are constituted, these cross-wise lines can draw subsequent table and interfere, need to remove.
The cross-wise lines of B2, the removal cross-wise lines detection figure, generate removal cross-wise lines figure.Please continue to refer to Fig. 5, Fig. 5 are the removal cross-wise lines figure of generation in a kind of embodiment.Comparison diagram 5 and Fig. 3 are it is found that Fig. 5 is the base in Fig. 3 The cross-wise lines of interference are eliminated on plinth.
Step 3: detecting vertical lines, and remove the vertical lines detected.
Following sub-step is specifically included in step 3:
C1, vertical lines detection is carried out to the removal cross-wise lines figure, especially by vertical corrosion expansion fashion detection Vertical lines generate vertical lines detection figure.
With continued reference to FIG. 6, Fig. 6 is in a kind of embodiment, the vertical lines of generation detect figure.As shown in fig. 6, described perpendicular It include 5 into lines detection figure, similarly, which is also interference lines, needs to remove.
C2, the vertical lines in Fig. 5 are removed according to the vertical lines detected, generate and removes vertical lines Figure.
With continued reference to FIG. 7, Fig. 7 is the vertical lines figure of the removal of generation in a kind of embodiment.Comparison diagram 7 and Fig. 5 can Know, Fig. 7 is the vertical lines that the interference of the leftmost side and the rightmost side is eliminated on the basis of Fig. 5.
C3, the vertical vertical corrosion of lines figure progress of the removal is denoised, generates denoising and scheme, as shown in Figure 8.
Projection module 12 is obtained for carrying out floor projection to pretreated form image and carrying out upright projection The target table of the form image is laid out.
In the embodiment of the present invention, after generating the denoising figure, horizontal to the denoising figure progress floor projection acquisition Row cutting region generates row cutting region figure.
With continued reference to FIG. 9, Fig. 9 is in a kind of embodiment, the row cutting region figure that the present invention generates.Such as Fig. 9 institute Show, include white area and black region in the row cutting region figure, wherein the black region is the form image Background parts, the white area be row cutting region region.The row cutting region is that there are the regions of text.
Further, the present invention, which carries out lateral expansion to the row cutting region figure, that is, Fig. 7, makes regional connectivity, obtains transverse direction Regional connectivity figure.
With continued reference to FIG. 10, Figure 10 is in a kind of embodiment, the transverse area connected graph that the present invention generates.Such as figure Shown in 10, the transverse area connected graph includes white area and black region, and wherein white area is the form image Background area, black region be the form image on there are the regions of text.
Further, the present invention obtains vertical column and cuts to the transverse area connected graph, that is, Fig. 9 progress upright projection Region is cut, column cutting region figure is obtained.
Please continue to refer to Figure 11, Figure 11 is the column cutting region figure that the present invention generates in a kind of embodiment.Such as Figure 11 It is shown, it include white area and black region in the column cutting region figure, wherein and white area is column cutting region, To project to obtain by the black region in Figure 10, black region is background area, is projected for the white area in Figure 10 It arrives.
In the embodiment of the present invention, vertical throwing can be done to the form image by Python computer programming language Shadow.In a kind of possible design, the present invention specifically can use opencv cross-platform computer vision library to the form image Carry out upright projection.
Further, in the embodiment of the present invention, according to the row cutting region and the column cutting region to the table Image carries out image segmentation and obtains several white rectangle regions, and the distribution and quantity according to the white rectangle region determine The target table layout, wherein the target table layout includes at least the line number and columns of table.Specifically, can be with The columns that the quantity in white rectangle region in a line is laid out as the target table, by the number in white rectangle region in a column Measure the line number being laid out as the target table.
The white rectangle region is the unit table images for the table image segmentation.According to the white rectangle area Table is drawn in domain, obtains the form of the form image.
Generation module 13, the character content in target table layout out for identification, according to the character content with And the target table layout generates the table of the form image.
In the embodiment of the present invention, the white rectangle that is obtained according to the row cut zone and the column split region segmentation Region is the unit table images of the form image, is further obtained and is identified in the unit table images using OCR identification model Character content.
Further, the line number and columns that obtain the form image draw the bezel, cluster knot of the form image later Structure, in the cell of the corresponding bezel, cluster structure for inserting the drafting of character content in each unit table images that will identify that To the editable table of the form image.
Preferably, whether the present invention can also detect in the form image comprising grid lines;If the form image packet Containing grid lines, then the original table-layout of the form image is extracted;By the original table-layout and the target table cloth Office is compared to obtain comparison result, to verify the target table layout.Wherein, the comparison result can be the target The discrepancy of table-layout and the original table-layout, for example, different line numbers and different columns etc..When the comparison When as a result having differences for target table layout with the original table-layout, then the target table layout is judged not Accurately.
In another embodiment, if the discrepancy quantity of comparison exceeds preset error range, the row cutting area is judged The acquisition inaccuracy of domain or the column cutting region, then need to reacquire the row cutting region and the column cutting area Domain, to be adjusted to target table layout, to regenerate the table of the form image.
In another embodiment, the embodiment of the present invention provides a kind of computer readable storage medium, and the computer can It reads to be stored with computer program on storage medium, table described in any one technical solution is realized when which is executed by processor Method for analyzing image.Wherein, the computer readable storage medium includes but is not limited to that any kind of disk is (including floppy disk, hard Disk, CD, CD-ROM and magneto-optic disk), ROM (Read-Only Memory, read-only memory), RAM (Random AcceSS Memory, immediately memory), EPROM (EraSable Programmable Read-Only Memory, erasable programmable Read-only memory), EEPROM (Electrically EraSable Programmable Read-Only Memory, electrically erasable Programmable read only memory), flash memory, magnetic card or light card.It is, storage equipment includes by equipment (for example, calculating Machine, mobile phone) with any medium for the form storage or transmission information that can be read, it can be read-only memory, disk or CD etc..
A kind of computer readable storage medium provided in an embodiment of the present invention is, it can be achieved that List of input image, and to described Form image is pre-processed;Floor projection is carried out to pretreated form image and carries out upright projection, is obtained described The target table of form image is laid out;Identify the character content in target table layout, according to the character content with And the target table layout generates the table of the form image.The present invention can be realized by projection algorithm from no table line Form image in extract tableau format and list data, solving in the prior art can only be to the tabular drawing for having table line The problem of as carrying out form analysis.
In addition, the present invention provides a kind of computer equipments in another embodiment, and as shown in figure 13, the calculating Machine equipment includes the devices such as processor 303, memory 305, input unit 307 and display unit 309.Those skilled in the art It is appreciated that the structure devices shown in Figure 13 do not constitute the restriction to all computer equipments, it may include more than illustrating Or less component, or the certain components of combination.Memory 305 can be used for storing application program 301 and each functional module, place Reason device 303 runs the application program 301 for being stored in memory 305, at the various function application and data of equipment Reason.Memory 305 can be built-in storage or external memory, or including both built-in storage and external memory.Built-in storage It may include read-only memory (ROM), programming ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), flash memory or random access memory.External memory may include hard disk, floppy disk, ZIP disk, USB flash disk, tape Deng.Memory disclosed in this invention includes but is not limited to the memory of these types.Memory 305 disclosed in this invention As an example rather than as restriction.
Input unit 307 is used to receive the input of signal, and receives the keyword of user's input.Input unit 307 can Including touch panel and other input equipments.Touch panel collects the touch operation of user on it or nearby and (for example uses Family uses the operations of any suitable object or attachment on touch panel or near touch panel such as finger, stylus), and root According to the corresponding attachment device of preset driven by program;Other input equipments can include but is not limited to physical keyboard, function One of key (such as broadcasting control button, switch key etc.), trace ball, mouse, operating stick etc. are a variety of.Display unit 309 can be used for showing the information of user's input or be supplied to the information of user and the various menus of computer equipment.Display is single The forms such as liquid crystal display, Organic Light Emitting Diode can be used in member 309.Processor 303 is the control centre of computer equipment, benefit With the various pieces of various interfaces and the entire computer of connection, by running or executing the software being stored in memory 303 Program and/or module, and the data being stored in memory are called, perform various functions and handle data.Shown in Figure 13 One or more processors 303 be able to carry out, realize input module 11, projection module 12 shown in Figure 12 and generate mould The function of block 13.
In one embodiment, the computer equipment includes memory 305 and processor 303, the memory 305 In be stored with computer-readable instruction, when the computer-readable instruction is executed by the processor, so that the processor 303 The step of executing a kind of form image analytic method described in above embodiments.
A kind of computer equipment provided in an embodiment of the present invention is, it can be achieved that List of input image, and to the form image It is pre-processed;Floor projection is carried out to pretreated form image and carries out upright projection, obtains the form image Target table layout;The character content in the target table layout is identified, according to the character content and the mesh Mark table-layout generates the table of the form image.The present invention can realize the tabular drawing from no table line by projection algorithm Tableau format and list data are extracted as in, solving in the prior art can only be to the form image carry out table for having table line The problem of lattice parse.
In another embodiment, whether the present invention can also be realized in the detection form image comprising grid lines;If described Form image includes grid lines, then extracts the original table-layout of the form image;By the original table-layout with it is described Target table layout is compared, to verify the target table layout.Specifically, comparison result of the present invention can be institute The discrepancy for stating target table layout and the original table-layout, when the quantity for detecting the discrepancy exceeds preset value When, then judge the row cutting region got or column cutting region inaccuracy, then reacquires the row cutting area Domain and the column cutting region simultaneously regenerate the target table layout.The present invention not only realizes the table of no table line The parsing of image also achieves and the table parsed is verified and adjusted, the applicability and flexibility of lifting scheme.
The reality of above table method for analyzing image may be implemented in computer readable storage medium provided in an embodiment of the present invention Example is applied, concrete function realizes the explanation referred in embodiment of the method, and details are not described herein.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, which can be stored in a computer-readable storage and be situated between In matter, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, storage medium above-mentioned can be The non-volatile memory mediums such as magnetic disk, CD, read-only memory (Read-Only Memory, ROM) or random storage note Recall body (Random Access Memory, RAM) etc..
Each technical characteristic of embodiment described above can be combined arbitrarily, for simplicity of description, not to above-mentioned reality It applies all possible combination of each technical characteristic in example to be all described, as long as however, the combination of these technical characteristics is not deposited In contradiction, all should be considered as described in this specification.
The embodiments described above only express several embodiments of the present invention, and the description thereof is more specific and detailed, but simultaneously Limitations on the scope of the patent of the present invention therefore cannot be interpreted as.It should be pointed out that for those of ordinary skill in the art For, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to guarantor of the invention Protect range.Therefore, the scope of protection of the patent of the invention shall be subject to the appended claims.

Claims (10)

1. a kind of form image analytic method, which is characterized in that the described method includes:
List of input image, and the form image is pre-processed;
Floor projection is carried out to pretreated form image and carries out upright projection, obtains the object table of the form image Lattice layout;
The character content in the target table layout is identified, according to the character content and target table layout life At the table of the form image.
2. form image analytic method according to claim 1, which is characterized in that the List of input image, and to institute Form image is stated to be pre-processed, comprising:
Binary conversion treatment is carried out to the form image and obtains binary map;
The cross-wise lines in the binary map are detected, and remove the cross-wise lines;
It detects vertical lines, and removes the vertical lines detected.
3. form image analytic method according to claim 2, which is characterized in that described to carry out two to the form image Value handles to obtain binary map, comprising:
Gray proces are carried out to the form image and obtain grayscale image;
The binary map is obtained with maximum stable extremal region algorithm to the grayscale image.
4. form image analytic method according to claim 1, which is characterized in that described to pretreated form image It carries out floor projection and carries out upright projection, obtain the target table layout of the form image, comprising:
Floor projection is carried out to pretreated form image and obtains row cutting region;
Upright projection is carried out to pretreated form image and obtains column cutting region;
Image segmentation is carried out to the form image according to the row cutting region and the column cutting region, generates the mesh Mark table-layout and several unit table images.
5. form image analytic method according to claim 4, which is characterized in that described to identify the target table cloth Character content in office generates the table of the form image, packet according to the character content and target table layout It includes:
The bezel, cluster structure of the form image is drawn according to target table layout;
Identify the character content in the unit table images;
By in the corresponding filling bezel, cluster structure of the character content, the table of the form image is generated.
6. form image analytic method according to claim 1, which is characterized in that described to pretreated form image Carry out floor projection and carry out upright projection, obtain the form image target table layout before, comprising:
Carrying out lateral expansion to the pretreated form image makes regional connectivity.
7. form image analytic method according to claim 1, which is characterized in that further include:
It whether detects in the form image comprising grid lines;
If the form image includes grid lines, the original table-layout of the form image is extracted;
The original table-layout is compared with target table layout, to verify the target table layout.
8. a kind of form image resolver, which is characterized in that the described method includes:
Input module is used for List of input image, and pre-processes to the form image;
Projection module obtains the table for carrying out floor projection to pretreated form image and carrying out upright projection The target table of table images is laid out;
Generation module, the character content in target table layout out for identification, according to the character content and described Target table layout generates the table of the form image.
9. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium Program, the computer program realize form image analytic method described in any one of claims 1 to 7 when being executed by processor Step.
10. a kind of computer equipment, which is characterized in that including memory and processor, be stored with computer in the memory Readable instruction, when the computer-readable instruction is executed by the processor so that the processor execute as claim 1 to Described in any one of 7 claims the step of form image analytic method.
CN201910115443.8A 2019-02-13 2019-02-13 Form image analytic method, device, computer equipment and storage medium Pending CN109948440A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910115443.8A CN109948440A (en) 2019-02-13 2019-02-13 Form image analytic method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910115443.8A CN109948440A (en) 2019-02-13 2019-02-13 Form image analytic method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN109948440A true CN109948440A (en) 2019-06-28

Family

ID=67006548

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910115443.8A Pending CN109948440A (en) 2019-02-13 2019-02-13 Form image analytic method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109948440A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110516208A (en) * 2019-08-12 2019-11-29 深圳智能思创科技有限公司 A kind of system and method extracted for PDF document table
CN112036294A (en) * 2020-08-28 2020-12-04 山谷网安科技股份有限公司 Method and device for automatically identifying paper table structure

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110516208A (en) * 2019-08-12 2019-11-29 深圳智能思创科技有限公司 A kind of system and method extracted for PDF document table
CN110516208B (en) * 2019-08-12 2023-06-09 深圳智能思创科技有限公司 System and method for extracting PDF document form
CN112036294A (en) * 2020-08-28 2020-12-04 山谷网安科技股份有限公司 Method and device for automatically identifying paper table structure
CN112036294B (en) * 2020-08-28 2023-08-25 山谷网安科技股份有限公司 Method and device for automatically identifying paper form structure

Similar Documents

Publication Publication Date Title
US10191889B2 (en) Systems, apparatuses and methods for generating a user interface by performing computer vision and optical character recognition on a graphical representation
Laine et al. A standalone OCR system for mobile cameraphones
CN109685870B (en) Information labeling method and device, labeling equipment and storage medium
CN101375278A (en) Strategies for processing annotations
US20200402242A1 (en) Image analysis method and apparatus, and electronic device and readable storage medium
CN104978576A (en) Character identification method and device thereof
CN112308069A (en) Click test method, device, equipment and storage medium for software interface
CN109948440A (en) Form image analytic method, device, computer equipment and storage medium
CN109766891A (en) Obtain the method and computer readable storage medium of installations and facilities information
CN112149680B (en) Method and device for detecting and identifying wrong words, electronic equipment and storage medium
CN111340020A (en) Formula identification method, device, equipment and storage medium
WO2015021857A1 (en) Method and apparatus for data processing
CN112052005A (en) Interface processing method, device, equipment and storage medium
Lyu et al. The early Japanese books reorganization by combining image processing and deep learning
CN110532415A (en) Picture search processing method, device, equipment and storage medium
CN111523292B (en) Method and device for acquiring image information
US20150186718A1 (en) Segmentation of Overwritten Online Handwriting Input
KR101772831B1 (en) Method and apparatus of building intermediate character library
CN112395834B (en) Brain graph generation method, device and equipment based on picture input and storage medium
CN115101069A (en) Voice control method, device, equipment, storage medium and program product
CN110909739B (en) Picture identification and operation method and device, computer equipment and storage medium
CN102722490A (en) A character-capturing method and a character-capturing device of an electronic reader and the same
CN106648925B (en) Mobile terminal and method for acquiring character string information thereof
CN113688803B (en) Formula identification method and device, electronic equipment and storage medium
KR102595789B1 (en) Automatic recognition of electronic circuit diagram image and netlist conversion method

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