[go: up one dir, main page]

CN111079531A - Data structured output method and device, electronic equipment and storage medium - Google Patents

Data structured output method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111079531A
CN111079531A CN201911105610.7A CN201911105610A CN111079531A CN 111079531 A CN111079531 A CN 111079531A CN 201911105610 A CN201911105610 A CN 201911105610A CN 111079531 A CN111079531 A CN 111079531A
Authority
CN
China
Prior art keywords
bill
rectangular frame
area
detection
structured output
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
CN201911105610.7A
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.)
Taikang Insurance Group Co Ltd
Taikang Online Property Insurance Co Ltd
Original Assignee
Taikang Insurance Group Co Ltd
Taikang Online Property Insurance 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 Taikang Insurance Group Co Ltd, Taikang Online Property Insurance Co Ltd filed Critical Taikang Insurance Group Co Ltd
Priority to CN201911105610.7A priority Critical patent/CN111079531A/en
Publication of CN111079531A publication Critical patent/CN111079531A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/412Layout analysis of documents structured with printed lines or input boxes, e.g. business forms or tables
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/414Extracting the geometrical structure, e.g. layout tree; Block segmentation, e.g. bounding boxes for graphics or text
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/43Editing text-bitmaps, e.g. alignment, spacing; Semantic analysis of bitmaps of text without OCR

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Graphics (AREA)
  • Geometry (AREA)
  • Character Input (AREA)

Abstract

The invention provides a data structured output method and device based on table detection, electronic equipment and a storage medium, wherein the data structured output method based on the table detection comprises the following steps: acquiring a bill image to be identified; locating a document region in the document image; carrying out character detection on a bill area in the bill image, and detecting character positions to form a text line; performing table detection on the bill area to obtain the position of each rectangular frame in the bill area; correcting the text line according to the position of the rectangular frame; and performing character recognition according to the corrected text line. The method improves the accuracy of data structured output in the character recognition of the bill image, and has simple algorithm and small calculation amount.

Description

Data structured output method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of computer application, in particular to a data structured output method and device based on table detection, electronic equipment and a storage medium.
Background
In the field of character recognition, especially for recognition of medical insurance statement, since most documents of the medical insurance statement are in the form of tables, the character content in each cell in the tables needs to be detected and recognized, and key attribute items such as insured person information, medical expenses, compensation amount and the like are structurally output according to business requirements, which has extremely high requirements on recognition accuracy.
However, in actual operation, due to the limitation of cell size, sometimes an attribute is printed in several rows in one cell, or the entire cell is printed to be close to an adjacent cell, which may interfere with subsequent character recognition and data structured output, resulting in wrong final output result.
For example, as shown in table one, in the existing text detection recognition, both the "address" and "diagnosis" attribute items in the third row of data correspond to a value of "Ning group old femoral fracture on sand slope Touchancun village", which is obviously wrong, and a semantic conflict occurs
Address Diagnosis of
Shangning group of sand slope town furnace pond village Fracture of femur
Shangning group of sand slope town furnace pond village Old fracture of femur
Watch 1
For another example, as shown in table two, the value of "address" is only recognized as "luo fei qinglong", which is also erroneous and semantically incomplete.
Figure BDA0002269524340000011
Watch two
For such problems, the existing solutions are distinguished from semantics, however, the method needs to establish a corresponding database, is complex and tedious, is not well implemented at present, and has no other methods for solving the problems.
Disclosure of Invention
The present invention is directed to a method, an apparatus, an electronic device, and a storage medium for structured data output based on table detection, which overcome at least some of the limitations and disadvantages of the related art.
According to one aspect of the invention, a data structured output method based on table detection is provided, which comprises the following steps: acquiring a bill image to be identified; locating a document region in the document image; carrying out character detection on a bill area in the bill image, and detecting character positions to form a text line; performing table detection on the bill area to obtain the position of each rectangular frame in the bill area; correcting the text line according to the position of the rectangular frame; and performing character recognition according to the corrected text line.
In some embodiments of the present invention, the table detecting the bill area to obtain the position of each rectangular frame in the bill area includes: correcting at least the bill area for skew; detecting a plurality of transverse lines extending along a first direction and a plurality of longitudinal lines extending along a second direction in the bill area after the inclination correction, wherein the first direction is perpendicular to the second direction; acquiring the intersection point of each transverse line and each longitudinal line; and obtaining the position of each rectangular frame in the bill area according to the intersection point.
In some embodiments of the invention, said at least tilt-correcting the document area comprises: detecting a plurality of first-class straight lines in the bill area by adopting a Hough straight line detection algorithm, wherein an included angle between each first-class straight line and a first direction is smaller than a preset angle threshold value, and the length of each first-class straight line is larger than a preset length threshold value; calculating the mean value of included angles between each first type of straight line and the first direction or the second direction; and correcting the bill area based on the included angle mean value relative to the first direction or the second direction for calculating the included angle mean value.
In some embodiments of the present invention, corrosion and expansion of opencv is used to detect transverse lines extending in a first direction and longitudinal lines extending in a second direction in the tilt-corrected document area.
In some embodiments of the present invention, the obtaining the position of each rectangular frame in the note area according to the intersection further includes: determining a quasi-rectangular frame included in the bill area according to the intersection point; screening the quasi-rectangular frame according to one or more of the width, the height and the area of the quasi-rectangular frame according to preset parameters; and taking the screened quasi-rectangular frame as the rectangular frame.
In some embodiments of the present invention, the modifying the text line according to the position of the rectangular frame includes: splitting text lines respectively positioned in different rectangular boxes; and/or merging lines of text that are located in the same rectangular box.
In some embodiments of the present invention, after the table detection on the note area obtains the position of each rectangular box in the note area, and before the correction on the text line according to the position of the rectangular box, the method includes: and enabling the position information of the text line to correspond to the position information of the rectangular frame.
According to another aspect of the present invention, there is also provided a data structured output device based on table detection, including: the acquisition module is used for acquiring a bill image to be identified; the positioning module is used for positioning a bill area in the bill image; the text detection module is used for carrying out character detection on the bill area in the bill image and detecting the position of characters to form a text line; the rectangular frame detection module is used for carrying out table detection on the bill area to obtain the position of each rectangular frame in the bill area; the correction module is used for correcting the text line according to the position of the rectangular frame; and the recognition module is used for carrying out character recognition according to the corrected text line.
According to still another aspect of the present invention, there is also provided an electronic apparatus, including: a processor; a storage medium having stored thereon a computer program which, when executed by the processor, performs the steps as described above.
According to yet another aspect of the present invention, there is also provided a storage medium having stored thereon a computer program which, when executed by a processor, performs the steps as described above.
Compared with the prior art, the invention has the advantages that:
on one hand, through the positioning of table detection auxiliary character detection, the problem that text semantic deficits and semantic conflicts occur in character recognition due to the fact that only one line can be detected in the text detection, and therefore errors of data structured output are caused is solved, and therefore the accuracy of data structured output in bill recognition is improved; on the other hand, the number of manual entries is reduced through accurate character recognition, so that the cost input is reduced, a large amount of manpower, material resources and financial resources are saved, and the resource allocation is optimized; on the other hand, the method corrects and calibrates the character detection positioning through the table detection, has simple algorithm and low calculation amount and reduces the system load, and simultaneously directly divides the area through the correction and calibration instead of a simple rectangular frame, can further reduce the calculation amount of subsequent character recognition and improve the character recognition efficiency.
Drawings
The above and other features and advantages of the present invention will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings.
Fig. 1 shows a flowchart of a data structured output method based on table detection according to an embodiment of the present invention.
FIG. 2 shows a flow diagram of table detection according to an embodiment of the invention.
FIG. 3 illustrates a flow diagram of bill section rectification according to an embodiment of the present invention.
FIG. 4 shows a flow diagram of rectangular box filtering according to an embodiment of the invention.
Fig. 5 to 9 illustrate a process of table detection according to an embodiment of the present invention.
FIG. 10 is a block diagram of a data structured output device based on table detection according to an embodiment of the present invention.
Fig. 11 schematically illustrates a computer-readable storage medium in an exemplary embodiment of the invention.
Fig. 12 schematically illustrates an electronic device in an exemplary embodiment of the invention.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Furthermore, the drawings are merely schematic illustrations of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the steps. For example, some steps may be decomposed, and some steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
Fig. 1 shows a flowchart of a data structured output method based on table detection according to an embodiment of the present invention. Referring to fig. 1, the data structured output method based on table detection includes the following steps:
step S110: and acquiring a bill image to be identified.
Step S120: a document region in the document image is located.
Specifically, step S120 may locate the entire document region in the image by using a deep learning algorithm, and may remove the influence of the straight lines of other regions on the table detection. For example, step S120 may be implemented by using a learning algorithm such as a hidden markov model or fast R-CNN, which is not described herein.
Step S130: and carrying out character detection on the bill area in the bill image, and detecting the position of characters to form a text line.
Specifically, in the invention, the character detection of the bill area in the bill image is merged and split according to the character position and the character interval, thereby forming the text line. And scanning the characters according to lines, starting from the first character for each line of characters, merging the characters into a text line when the character interval is smaller than a preset threshold value, and starting a new text line when the character interval is larger than the preset threshold value. As in table 1 in the background art, the text lines "address", "diagnosis", "sand slope town stove pond village shanning group", "femoral fracture", and "sand slope town stove pond village shanning group old femoral fracture" can be formed by step S120. For another example, in table 2 in the background art, the text lines "address", "rochony dragon", and "village three groups" can be formed in step S130.
Further, each text line is associated with coordinates (for example, an upper left corner coordinate, an upper right corner coordinate, a lower left corner coordinate, a lower right corner coordinate, a midpoint coordinate, and the like, which is not limited by the present invention) of at least one predetermined position of the text line on the bill image, a width, and a height.
Step S140: and performing table detection on the bill area to obtain the position of each rectangular frame in the bill area.
Step S140 will be described with reference to fig. 2 to 9. Specifically, the obtained position of the rectangular frame may be associated with coordinates (for example, an upper left corner coordinate, an upper right corner coordinate, a lower left corner coordinate, a lower right corner coordinate, a midpoint coordinate, and the like, which are not limited by the present invention) of at least one predetermined position of the rectangular frame on the document image 100, the width and the height. In some variations, the obtained position of the rectangular frame may be associated with coordinates (for example, an upper left corner coordinate, an upper right corner coordinate, a lower left corner coordinate, a lower right corner coordinate, a midpoint coordinate, and the like, which are not limited by the present invention) of at least one predetermined position of the rectangular frame on the bill area, a width, and a height, and the position of the rectangular frame on the bill image 100 may be obtained through coordinate conversion, so as to be mapped with the position of the text line.
Step S150: and correcting the text line according to the position of the rectangular frame.
Specifically, the step S150 of correcting the text line according to the position of the rectangular frame may include the steps of: splitting text lines respectively positioned in different rectangular boxes; and/or merging lines of text that are located in the same rectangular box. Still taking the table one and the table two in the background art as an example, in the table one, the positions of the text rows "address", "diagnosis", "sand slope and furnace pond village shanning group", "femoral fracture", and "sand slope and furnace pond village shanning group old femoral fracture" are mapped with the positions of the rectangular frames, and the "sand slope and furnace pond village shanning group old femoral fracture" is split into the text rows "sand slope and furnace pond shanning group" and "old femoral fracture" by the rectangular frames; in table two, the positions of the text lines "address", "compass country dragon" and "village three groups" are mapped with the positions of the rectangular boxes, and the "compass country dragon" and the text line "village three groups" are located in the same rectangular box, so that the text lines "compass country dragon" and the text line "village three groups" are merged into the text line "compass country dragon three groups". The steps provided in the present invention are described above only schematically, and the present invention is not limited thereto.
Step S160: and performing character recognition according to the corrected text line, thereby obtaining the data structured output.
Therefore, in the data structured output method based on the table detection provided by the invention, on one hand, through the positioning of the table detection auxiliary character detection, the problem that the text semantic incomplete and semantic conflict occur in character recognition due to the fact that the text detection can only detect a single line is solved, so that the error of the data structured output is caused, and the accuracy of the data structured output in bill recognition is improved; on the other hand, the number of manual entries is reduced through accurate character recognition, so that the cost input is reduced, a large amount of manpower, material resources and financial resources are saved, and the resource allocation is optimized; on the other hand, the method corrects and calibrates the character detection positioning through the table detection, has simple algorithm and low calculation amount and reduces the system load, and simultaneously directly divides the area through the correction and calibration instead of a simple rectangular frame, can further reduce the calculation amount of subsequent character recognition and improve the character recognition efficiency.
In an embodiment of the present invention, the step S140 performs table detection on the bill area to obtain a specific implementation of the position of each rectangular frame in the bill area, referring to fig. 2, fig. 2 shows a flowchart of table detection according to an embodiment of the present invention. Fig. 2 shows the following steps together:
step S141: at least the bill section is corrected for skew.
Specifically, since the obtained bill image may be tilted by shooting, scanning, etc. (as shown in fig. 5), in order to avoid the impact of strokes of characters on the table detection in the table detection, the bill region needs to be first subjected to tilt correction (as shown in fig. 7), and one implementation of the tilt correction can be seen in fig. 3.
Step S142: and detecting a plurality of transverse lines extending along a first direction and a plurality of longitudinal lines extending along a second direction in the bill area after the inclination correction, wherein the first direction is perpendicular to the second direction.
Specifically, the first direction is, for example, a row direction of characters, and the second direction is, for example, a vertical direction of characters. In step S142, a plurality of transverse lines extending in the first direction and a plurality of longitudinal lines extending in the second direction may be detected in the bill region after the inclination correction by erosion and expansion of opencv. Further, erosion and dilation are achieved by image morphology in opencv. Respectively defining a horizontal structural element and a vertical structural element, setting the size of the structural element, convolving the corrected bill area with the structural element, and solving the local maximum value and the local minimum value to detect the horizontal line and the vertical line in the graph.
Step S143: intersections of the transverse lines and the longitudinal lines are obtained (as shown in fig. 8).
Step S144: and obtaining the position of each rectangular frame in the bill area according to the intersection point.
Specifically, step S144 may determine the intersection points as the vertices of the rectangular frames, so as to obtain the positions of the rectangular frames in the bill area by drawing the outlines of the rectangular frames in the bill area (as shown in fig. 9).
In an embodiment of the present invention, a specific implementation of the step S141 for at least correcting the tilt of the bill area can be seen in fig. 3, and fig. 3 shows a flowchart for correcting the bill area according to an embodiment of the present invention. Fig. 3 shows the following steps in total:
step S1411: and detecting a plurality of first-class straight lines in the bill area by adopting a Hough straight line detection algorithm, wherein an included angle between each first-class straight line and the first direction is smaller than a preset angle threshold, and the length of each first-class straight line is larger than a preset length threshold.
In particular, the first type of straight line is defined so that the hough straight line detection algorithm can detect a long horizontal line of a place table in the bill area. The detected first straight lines can be seen in fig. 6 as thick solid lines.
Step S1412: and calculating the mean value of included angles between each first-class straight line and the first direction or the second direction.
Preferably, step S1412 calculates the mean of the included angles between each of the first straight lines and the first direction, so as to determine the angle of deflection of the current bill area relative to the horizontal direction. Step S1412 may also calculate a mean value of included angles between each of the first type lines and the second direction, so as to determine an angle of the current bill area with respect to the vertical deflection.
Step S1413: and correcting the bill area based on the included angle mean value relative to the first direction or the second direction for calculating the included angle mean value.
In other words, in step S1442, when the reference direction when calculating the mean value of the included angle is the first direction, step S1443 corrects the bill area based on the mean value of the included angle relative to the first direction; in step S1442, when the reference direction when the mean value of the included angle is calculated is the second direction, step S1443 corrects the bill area based on the mean value of the included angle with respect to the second direction. After correction as shown in fig. 7.
Further, if only the document region is corrected in step S141, after step S140 and before step S150, the method further includes converting the coordinates of the rectangular frame in the corrected document region into the coordinates of the rectangular frame in the document image, or converting the coordinates of the text line in the document image into the coordinates of the text line in the corrected document image according to the correction in step S1443, so as to realize that the position information of the rectangular frame and the position information of the text line are located in the same coordinate system. If the whole document image is rectified in step S141, after step S140 and before step S150, the method further includes converting the coordinates of the text line in the document image into the coordinates of the text line in the rectified document image according to the rectification in step S1443, so as to realize that the position information of the rectangular frame and the position information of the text line are located in the same coordinate system.
In an embodiment of the present invention, the step S144 further includes a step of filtering the rectangular frame, and referring to fig. 4, fig. 4 shows a flowchart of filtering the rectangular frame according to an embodiment of the present invention. Fig. 4 shows the following steps in total:
step S1441: and determining a quasi-rectangular frame included in the bill area according to the intersection point.
Step S1442: and screening the quasi-rectangular frame according to one or more of the width, the height and the area of the quasi-rectangular frame according to preset parameters.
Step S1443: and taking the screened quasi-rectangular frame as the rectangular frame.
Thus, the preset parameters may include, for example, an upper limit and a lower limit, and only quasi-rectangular frames within the upper limit and the lower limit are reserved as the rectangular frames. Therefore, the undersized rectangular frame at the detection position can be screened out due to the influence of strokes of characters or image noise through the reduction of the lower limit; the oversize cells can be prevented from being culled by increasing the upper limit. The preset parameters may be manually set, or in other embodiments, the preset parameters may be updated by self-learning, for example, manually selecting a small rectangular frame and/or manually adding a large rectangular frame according to the multiple table detection results, so as to lower the lower limit of the preset parameters and/or increase the upper limit of the preset parameters.
The above description is only illustrative of various implementations of the present invention, and various embodiments may be implemented alone or in combination, and the present invention is not limited thereto.
The data structured output device based on table detection provided by the invention is described in the following with reference to fig. 10. Fig. 10 is a block diagram illustrating a data structured output apparatus based on table detection according to an embodiment of the present invention. The data structured output device 200 based on table detection includes an acquisition module 210, a positioning module 220, a text detection module 230, a rectangular box detection module 240, a correction module 250, and a recognition module 260.
The obtaining module 210 is used for obtaining an image of a bill to be identified.
The locating module 220 is used to locate a document region in the document image. The text detection module 230 is used for performing text detection on the bill area in the bill image, and detecting the position of the text to form a text line.
The rectangular frame detection module 240 is configured to perform table detection on the bill area to obtain a position of each rectangular frame in the bill area.
The correcting module 250 is configured to correct the text line according to the position of the rectangular frame.
The recognition module 260 is used for performing character recognition according to the corrected text line.
In the data structured output device based on the table detection in the exemplary embodiment of the invention, on one hand, the problem of errors of data structured output caused by text semantic incomplete and semantic conflict in character recognition due to the fact that only one line can be detected by text detection is solved by the table detection to assist the positioning of the character detection, thereby improving the accuracy of data structured output in bill recognition; on the other hand, the number of manual entries is reduced through accurate character recognition, so that the cost input is reduced, a large amount of manpower, material resources and financial resources are saved, and the resource allocation is optimized; on the other hand, the method corrects and calibrates the character detection positioning through the table detection, has simple algorithm and low calculation amount and reduces the system load, and simultaneously directly divides the area through the correction and calibration instead of a simple rectangular frame, can further reduce the calculation amount of subsequent character recognition and improve the character recognition efficiency.
The above block diagrams schematically illustrate various embodiments of the present invention, and the combination of blocks and the division of blocks are within the scope of the present invention without departing from the spirit of the present invention.
The above description is only for the purpose of schematically describing one embodiment of the present invention and will not be repeated herein. In an exemplary embodiment of the present invention, a computer-readable storage medium is further provided, on which a computer program is stored, which when executed by, for example, a processor, may implement the steps of the data structured output method based on table detection described in any one of the above embodiments. In some possible embodiments, the various aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above section of the table-based detected data structured output method of this description, when said program product is run on the terminal device.
Referring to fig. 11, a program product 700 for implementing the above method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable storage medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the tenant computing device, partly on the tenant device, as a stand-alone software package, partly on the tenant computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing devices may be connected to the tenant computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
In an exemplary embodiment of the invention, there is also provided an electronic device that may include a processor and a memory for storing executable instructions of the processor. Wherein the processor is configured to execute the steps of the table detection-based data structured output method in any of the above embodiments via execution of the executable instructions.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 800 according to this embodiment of the invention is described below with reference to fig. 12. The electronic device 800 shown in fig. 12 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 12, the electronic device 800 is embodied in the form of a general purpose computing device. The components of the electronic device 800 may include, but are not limited to: at least one processing unit 810, at least one memory unit 820, a bus 830 connecting the various system components (including the memory unit 820 and the processing unit 810), a display unit 840, and the like.
Wherein the storage unit stores program code, which can be executed by the processing unit 810, so that the processing unit 810 performs the steps according to various exemplary embodiments of the present invention described in the section of the above table detection-based data structured output method of the present specification. For example, the processing unit 810 may perform the steps shown in fig. 1.
The memory unit 820 may include readable media in the form of volatile memory units such as a random access memory unit (RAM)8201 and/or a cache memory unit 8202, and may further include a read only memory unit (ROM) 8203.
The memory unit 820 may also include a program/utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 830 may be any of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 800 may also communicate with one or more external devices 900 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a tenant to interact with the electronic device 800, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 800 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 850. Also, the electronic device 800 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 860. The network adapter 860 may communicate with other modules of the electronic device 800 via the bus 830. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiment of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above data structured output method based on table detection according to the embodiment of the present invention.
Compared with the prior art, the invention has the advantages that:
through data transmission and information communication between the hospital information system and the rehabilitation special system, the problem that a doctor needs to cross the work of the hospital information system and the rehabilitation special system is solved, the business process and the data interaction of the medical advice refining business between the hospital information system and the rehabilitation special system are optimized, the problems of time delay and waiting of the medical advice refining business are solved, the medical advice refining efficiency is improved, and the omission phenomenon of medical advice refining work is reduced.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.

Claims (10)

1. A data structured output method based on table detection is characterized by comprising the following steps:
acquiring a bill image to be identified;
locating a document region in the document image;
carrying out character detection on a bill area in the bill image, and detecting character positions to form a text line;
performing table detection on the bill area to obtain the position of each rectangular frame in the bill area;
correcting the text line according to the position of the rectangular frame; and
and performing character recognition according to the corrected text line.
2. The method for structured output of data based on form inspection as claimed in claim 1, wherein the form inspection of the bill area to obtain the position of each rectangular frame in the bill area comprises:
correcting at least the bill area for skew;
detecting a plurality of transverse lines extending along a first direction and a plurality of longitudinal lines extending along a second direction in the bill area after the inclination correction, wherein the first direction is perpendicular to the second direction;
acquiring the intersection point of each transverse line and each longitudinal line; and
and obtaining the position of each rectangular frame in the bill area according to the intersection point.
3. The method for structured output of data based on form detection as claimed in claim 2, wherein said at least tilt correction of said document fields comprises:
detecting a plurality of first-class straight lines in the bill area by adopting a Hough straight line detection algorithm, wherein an included angle between each first-class straight line and a first direction is smaller than a preset angle threshold value, and the length of each first-class straight line is larger than a preset length threshold value;
calculating the mean value of included angles between each first type of straight line and the first direction or the second direction;
and correcting the bill area based on the included angle mean value relative to the first direction or the second direction for calculating the included angle mean value.
4. The method for structured output of data based on form detection according to claim 2, wherein a plurality of transverse lines extending in the first direction and a plurality of longitudinal lines extending in the second direction are detected in the bill area after skew correction by erosion and expansion of opencv.
5. The method for structured output of data based on form detection as claimed in claim 2, wherein said obtaining the position of each rectangular box in said document area according to said intersection further comprises:
determining a quasi-rectangular frame included in the bill area according to the intersection point;
screening the quasi-rectangular frame according to one or more of the width, the height and the area of the quasi-rectangular frame according to preset parameters;
and taking the screened quasi-rectangular frame as the rectangular frame.
6. A method for structured output of data based on form detection as recited in claim 1, wherein said modifying said text line based on the position of said rectangular box comprises:
splitting text lines respectively positioned in different rectangular boxes; and/or
And merging the text lines positioned in the same rectangular box.
7. The method for outputting structured data based on table check of claim 1, wherein after the table check of the document area obtains the position of each rectangular frame in the document area, and before the text line is corrected according to the position of the rectangular frame, the method comprises:
and enabling the position information of the text line to correspond to the position information of the rectangular frame.
8. A data structured output device based on table detection, comprising:
the acquisition module is used for acquiring a bill image to be identified;
a positioning module for positioning the bill region in the bill image
The text detection module is used for carrying out character detection on the bill area in the bill image and detecting the position of characters to form a text line;
the rectangular frame detection module is used for carrying out table detection on the bill area to obtain the position of each rectangular frame in the bill area;
the correction module is used for correcting the text line according to the position of the rectangular frame; and
and the recognition module is used for performing character recognition according to the corrected text line.
9. An electronic device, characterized in that the electronic device comprises:
a processor;
memory on which a computer program is stored which, when executed by the processor, carries out the table detection-based data structured output method according to one of claims 1 to 7.
10. A storage medium, characterized in that the storage medium has stored thereon a computer program which, when being executed by a processor, executes the data structured output method based on table detection according to any one of claims 1 to 7.
CN201911105610.7A 2019-11-12 2019-11-12 Data structured output method and device, electronic equipment and storage medium Pending CN111079531A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911105610.7A CN111079531A (en) 2019-11-12 2019-11-12 Data structured output method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911105610.7A CN111079531A (en) 2019-11-12 2019-11-12 Data structured output method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111079531A true CN111079531A (en) 2020-04-28

Family

ID=70310840

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911105610.7A Pending CN111079531A (en) 2019-11-12 2019-11-12 Data structured output method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111079531A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111739119A (en) * 2020-05-15 2020-10-02 广州明珞汽车装备有限公司 Method, system, device and storage medium for inserting picture frame
CN111814673A (en) * 2020-07-08 2020-10-23 重庆农村商业银行股份有限公司 Method, device and equipment for correcting text detection bounding box and storage medium
CN112115932A (en) * 2020-08-19 2020-12-22 泰康保险集团股份有限公司 Text extraction method and device, electronic equipment and storage medium
CN112149561A (en) * 2020-09-23 2020-12-29 杭州睿琪软件有限公司 Image processing method and apparatus, electronic device, and storage medium
CN112418204A (en) * 2020-11-18 2021-02-26 杭州未名信科科技有限公司 Text recognition method, system and computer medium based on paper document
CN114120300A (en) * 2021-10-20 2022-03-01 前锦网络信息技术(上海)有限公司 Picture correction method and device
CN115690789A (en) * 2021-07-27 2023-02-03 Oppo广东移动通信有限公司 Information processing method, device, mobile terminal and storage medium
CN115705733A (en) * 2021-08-11 2023-02-17 京东科技信息技术有限公司 Model recognition result positioning method and device, electronic equipment, computer medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106446881A (en) * 2016-07-29 2017-02-22 北京交通大学 Method for extracting lab test result from medical lab sheet image
CN108875721A (en) * 2017-12-18 2018-11-23 南通艾思达智能科技有限公司 A kind of more specification text cooperatives positioning and extracting method
CN109117814A (en) * 2018-08-27 2019-01-01 北京京东金融科技控股有限公司 Image processing method, device, electronic equipment and medium
CN109685052A (en) * 2018-12-06 2019-04-26 泰康保险集团股份有限公司 Method for processing text images, device, electronic equipment and computer-readable medium
CN110263694A (en) * 2019-06-13 2019-09-20 泰康保险集团股份有限公司 A kind of bank slip recognition method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106446881A (en) * 2016-07-29 2017-02-22 北京交通大学 Method for extracting lab test result from medical lab sheet image
CN108875721A (en) * 2017-12-18 2018-11-23 南通艾思达智能科技有限公司 A kind of more specification text cooperatives positioning and extracting method
CN109117814A (en) * 2018-08-27 2019-01-01 北京京东金融科技控股有限公司 Image processing method, device, electronic equipment and medium
CN109685052A (en) * 2018-12-06 2019-04-26 泰康保险集团股份有限公司 Method for processing text images, device, electronic equipment and computer-readable medium
CN110263694A (en) * 2019-06-13 2019-09-20 泰康保险集团股份有限公司 A kind of bank slip recognition method and device

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111739119A (en) * 2020-05-15 2020-10-02 广州明珞汽车装备有限公司 Method, system, device and storage medium for inserting picture frame
CN111814673A (en) * 2020-07-08 2020-10-23 重庆农村商业银行股份有限公司 Method, device and equipment for correcting text detection bounding box and storage medium
CN111814673B (en) * 2020-07-08 2023-05-26 重庆农村商业银行股份有限公司 Method, device, equipment and storage medium for correcting text detection bounding box
CN112115932A (en) * 2020-08-19 2020-12-22 泰康保险集团股份有限公司 Text extraction method and device, electronic equipment and storage medium
CN112115932B (en) * 2020-08-19 2023-11-14 泰康保险集团股份有限公司 Text extraction method and device, electronic equipment and storage medium
CN112149561A (en) * 2020-09-23 2020-12-29 杭州睿琪软件有限公司 Image processing method and apparatus, electronic device, and storage medium
CN112149561B (en) * 2020-09-23 2024-04-16 杭州睿琪软件有限公司 Image processing method and device, electronic equipment and storage medium
CN112418204A (en) * 2020-11-18 2021-02-26 杭州未名信科科技有限公司 Text recognition method, system and computer medium based on paper document
CN115690789A (en) * 2021-07-27 2023-02-03 Oppo广东移动通信有限公司 Information processing method, device, mobile terminal and storage medium
CN115705733A (en) * 2021-08-11 2023-02-17 京东科技信息技术有限公司 Model recognition result positioning method and device, electronic equipment, computer medium
CN114120300A (en) * 2021-10-20 2022-03-01 前锦网络信息技术(上海)有限公司 Picture correction method and device

Similar Documents

Publication Publication Date Title
CN111079531A (en) Data structured output method and device, electronic equipment and storage medium
CN109344831B (en) Data table identification method and device and terminal equipment
US20230021040A1 (en) Methods and systems for automated table detection within documents
CN108734089B (en) Method, device, equipment and storage medium for identifying table content in picture file
CN110765996B (en) Text information processing method and device
CN112016304A (en) Text error correction method and device, electronic equipment and storage medium
US11631265B2 (en) Automated learning of document data fields
RU2723293C1 (en) Identification of fields and tables in documents using neural networks using global document context
CN109947924B (en) Dialogue system training data construction method and device, electronic equipment and storage medium
CN113343740A (en) Table detection method, device, equipment and storage medium
US8750571B2 (en) Methods of object search and recognition
EP3182365B1 (en) Writing board detection and correction
US11727701B2 (en) Techniques to determine document recognition errors
CN112818667B (en) Address correction method, system, device and storage medium
CN111651971A (en) Form information transcription method, system, electronic equipment and storage medium
CN113762455B (en) Detection model training method, single word detection method, device, equipment and medium
CN114445840B (en) Table text processing method, device, electronic device and readable medium
CN110110320B (en) Automatic contract checking method, device, medium and electronic equipment
CN113963364A (en) Target laboratory test report generation method and device, electronic equipment and storage medium
US12299076B1 (en) Data interpretation analysis
CN102855477B (en) Method and device for recognizing direction of characters in image block
EP2138959A1 (en) Word recognizing method and word recognizing program
CN114220011B (en) Cargo quantity identification method, device, electronic device and storage medium
CN115761778A (en) Document reconstruction method, device, equipment and storage medium
RU2597163C2 (en) Comparing documents using reliable source

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200428