WO2021129121A1 - 表格识别方法和装置、计算机可读存储介质 - Google Patents

表格识别方法和装置、计算机可读存储介质 Download PDF

Info

Publication number
WO2021129121A1
WO2021129121A1 PCT/CN2020/124426 CN2020124426W WO2021129121A1 WO 2021129121 A1 WO2021129121 A1 WO 2021129121A1 CN 2020124426 W CN2020124426 W CN 2020124426W WO 2021129121 A1 WO2021129121 A1 WO 2021129121A1
Authority
WO
WIPO (PCT)
Prior art keywords
cluster
text
recognized
score
contour line
Prior art date
Application number
PCT/CN2020/124426
Other languages
English (en)
French (fr)
Inventor
祁立
Original Assignee
北京同邦卓益科技有限公司
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 北京同邦卓益科技有限公司 filed Critical 北京同邦卓益科技有限公司
Publication of WO2021129121A1 publication Critical patent/WO2021129121A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/40Document-oriented image-based pattern recognition
    • G06V30/41Analysis of document content
    • G06V30/412Layout analysis of documents structured with printed lines or input boxes, e.g. business forms or tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition

Definitions

  • the present disclosure relates to the field of computers, and in particular to a method and device for identifying a table, and a computer-readable storage medium.
  • the recognition of image table files generally includes the following steps: 1) image preprocessing (for example, grayscale, binarization, various transformations); 2) contour recognition of the table; 3) text area recognition; 4) text Perform cutting or comparison; 5) Use the trained recognition model to recognize specific text.
  • the present disclosure proposes a form identification scheme, which can further improve the accuracy of form identification.
  • a form recognition method including: recognizing a first contour line of a form to be recognized;
  • the first contour line determine a plurality of first text areas of the table to be recognized
  • the second contour line determine a plurality of second text areas of the table to be recognized, and each second text area corresponds to a cell;
  • clustering the plurality of first text regions according to rows and columns respectively to calculate the row and column division points of the table to be recognized includes:
  • determining whether to merge the corresponding first text area includes:
  • the cluster score after merging is greater than the cluster score before merging, it is determined that the corresponding first text area is merged.
  • determining the clustering score respectively when the row coordinate interval and the column coordinate interval of the first text area overlap each other includes:
  • the cluster score is determined when the row coordinate interval or the column coordinate interval of the first text area overlaps.
  • the cluster score is positively correlated with intra-cluster homogeneity, wherein the intra-cluster homogeneity is positively correlated with the number of sample pairs that have intersections within the cluster; the cluster score is negatively correlated with inter-cluster discrimination , Where the discriminativeness between clusters is negatively related to the number of sample pairs that have no intersection between different clusters.
  • the cluster score is positively correlated with the ratio between homogeneity within a cluster and discriminativeness between clusters.
  • intra-cluster homogeneity is positively correlated with the degree of overlap between samples belonging to the same cluster, and negatively correlated with the number of sample pairs belonging to the same cluster; inter-cluster discrimination is related to the degree of overlap between samples belonging to the same cluster; The degree of overlap between each sample of a class is negatively correlated, and positively correlated with the number of sample pairs belonging to different clusters.
  • the form recognition method further includes: performing image preprocessing on the form to be recognized.
  • identifying the first contour line of the table to be recognized includes: using the findContours function to recognize the first contour line of the table to be recognized.
  • determining the plurality of first text regions of the table to be recognized according to the first contour line includes: determining the plurality of first text regions of the table to be recognized according to the first contour line and using a positive-negative offset comparison.
  • a form recognition device including: a first recognition unit configured to recognize a first contour line of a form to be recognized;
  • the first determining unit is configured to determine a plurality of first text regions of the table to be recognized according to the first contour line;
  • the clustering unit is configured to cluster the plurality of first text regions by rows and columns, respectively, to calculate the row and column division points of the table to be recognized;
  • the second recognition unit is configured to determine a second contour line of the table to be recognized
  • the second determining unit is configured to determine a plurality of second text regions of the table to be recognized according to the second contour line, and each second text region corresponds to a cell;
  • the third recognition unit is configured to use a text recognition model to recognize the text in each second text area;
  • the filling unit is configured to fill the recognized text content in each second text area into the corresponding cells.
  • a table identification device including: a memory and a processor coupled to the memory, the processor being configured to execute the above based on instructions stored in the memory device.
  • a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the table recognition method described in any of the above embodiments is implemented.
  • Fig. 1 shows a flowchart of some embodiments of a form recognition method according to the present disclosure
  • FIG. 2 shows a flowchart of some embodiments of calculating row and column division points of a table to be identified according to the present disclosure
  • FIG. 3 shows a block diagram of some embodiments of the form recognition apparatus according to the present disclosure
  • FIG. 4 shows a block diagram of other embodiments of the form recognition device according to the present disclosure.
  • Figure 5 shows a block diagram of a computer system for implementing some embodiments of the present disclosure.
  • Fig. 1 shows a flowchart of some embodiments of a form recognition method according to the present disclosure. As shown in Fig. 1, the form identification method includes steps S1-S7.
  • step S1 the first contour line of the table to be recognized is recognized.
  • the findContours function is used to identify the first contour line of the table to be identified.
  • the first contour line is, for example, the frame line of the table.
  • Use the findContours function to get the table list and ignore list to divide the cells of the table to be identified. For example, the outline of the table to be recognized in the picture is roughly positioned, and then the cells are cut into multiple small pictures for subsequent analysis and operation.
  • image preprocessing may be performed on the pictures of the table to be recognized.
  • Image preprocessing includes: grayscale, binarization, various transformations, and so on.
  • step S2 according to the first contour line, a plurality of first text regions of the table to be recognized are determined.
  • a positive and negative offset comparison is used to determine a plurality of first text regions of the table to be recognized.
  • a plurality of first text regions of the table to be recognized may be determined based on the grayscale difference between the background and the text in the picture.
  • step S3 the multiple first text regions are clustered by row and column respectively to calculate the row and column division points of the table to be recognized.
  • FIG. 2 shows a flowchart of some embodiments of calculating row and column division points of a table to be identified according to the present disclosure. As shown in FIG. 2, calculating the row and column division points of the table to be identified includes steps S31-S33.
  • step S31 the row coordinate interval and the column coordinate interval of the plurality of first text regions are extracted.
  • the extracted row coordinate interval or column coordinate interval may be regarded as a sample, and the number of samples is denoted as N, and N is a natural number greater than 1.
  • step S32 it is determined whether to merge the corresponding first text regions according to the overlap degree of the row coordinate interval and the column coordinate interval respectively.
  • the clustering score is determined when the row coordinate interval and the column coordinate interval of the first text area overlap.
  • the extracted row coordinate interval or column coordinate interval is regarded as a sample, and the number of samples is recorded as N, where N is a natural number greater than 1. Then, according to the number of sample pairs that have intersections in the cluster and the number of different clusters The number of sample pairs with no intersection, and the clustering score is determined when the row coordinate interval or the column coordinate interval of the first text area overlaps.
  • the cluster score is positively correlated with intra-cluster homogeneity, wherein the intra-cluster homogeneity is positively correlated with the number of sample pairs that have intersections within the cluster; the cluster score is negatively correlated with inter-cluster discrimination , Where the discriminativeness between clusters is negatively correlated with the number of sample pairs that have no intersection between different clusters.
  • intra-cluster homogeneity is positively correlated with the degree of overlap between samples belonging to the same cluster, and negatively correlated with the number of sample pairs belonging to the same cluster; inter-cluster discrimination is related to the degree of overlap between samples belonging to the same cluster; The degree of overlap between each sample of a class is negatively correlated, and positively correlated with the number of sample pairs belonging to different clusters.
  • represents the sum of is_inter(Sl, Sm) values of sample pairs belonging to the same cluster.
  • the cluster score after merging is greater than the cluster score before merging, it is determined that the corresponding first text area is merged. In the case where the cluster score after merging is smaller than the cluster score before merging, it is determined that the corresponding first text area is not merged. In the case where the cluster scores before and after merging remain unchanged, that is, when the merged cluster score is equal to the cluster score before merging, it can be judged that the corresponding first text area is merged, or it can be judged that the corresponding first text area is not merged .
  • step S33 based on the result of the merging, the row and column division points of the table to be identified are calculated.
  • the starting point coordinates are merged, and the rows and columns are crossed to calculate the final table row and column division point.
  • step S4 the second contour line of the table to be recognized is recognized according to the row and column dividing points. For example, by synthesizing the row and column dividing points, the row and column division of the table can be obtained.
  • step S5 according to the second contour line, a plurality of second text regions of the table to be recognized are determined, and each second text region corresponds to a cell.
  • step S5 may be performed in a manner similar to step S2.
  • a text recognition model is used to recognize the text in each second text area.
  • a text recognition model such as optical character recognition (OCR) can be used to recognize the text in each second text area.
  • OCR optical character recognition
  • step S7 the recognized text content in each second text area is respectively filled in the corresponding cells.
  • FIG. 3 shows a block diagram of some embodiments of the form recognition apparatus according to the present disclosure.
  • the form recognition device 3 includes:
  • the first recognition unit 31 is configured to recognize the first contour line of the table to be recognized, for example, execute step S1;
  • the first determining unit 32 is configured to determine a plurality of first text regions of the table to be recognized according to the first contour line, for example, perform step S2;
  • the clustering unit 33 is configured to cluster a plurality of first text regions by rows and columns respectively to calculate the row and column division points of the table to be recognized, for example, perform step S3;
  • the second recognition unit 34 is configured to determine the second contour line of the table to be recognized, for example, execute step S4;
  • the second determining unit 35 is configured to determine a plurality of second text regions of the table to be recognized according to the second contour line, and each second text region corresponds to a cell, for example, step S5 is executed;
  • the third recognition unit 36 is configured to use a text recognition model to recognize the text in each second text area, for example, perform step S6;
  • the filling unit 37 is configured to fill the recognized text content in each second text area into corresponding cells, for example, perform step S7.
  • FIG. 4 shows a block diagram of other embodiments of the form recognition apparatus according to the present disclosure.
  • the device 4 of this embodiment includes: a memory 41 and a processor 42 coupled to the memory 41.
  • the memory 41 is used to store instructions for executing the corresponding embodiment of the table recognition method.
  • the processor 42 is configured to execute the table recognition method in any of the embodiments of the present disclosure based on instructions stored in the memory 41.
  • the embodiments of the present disclosure may also adopt the form of a computer program product implemented on one or more non-volatile storage media containing computer program instructions. Therefore, the embodiments of the present disclosure also include a computer-readable storage medium on which computer instructions are stored, and when the instructions are executed by a processor, the table identification method in any of the foregoing embodiments is implemented.
  • Figure 5 is a block diagram illustrating a computer system for implementing some embodiments of the present disclosure.
  • the computer system 50 can be expressed in the form of a general-purpose computing device.
  • the computer system 50 includes a memory 510, a processor 520, and a bus 500 connecting different system components.
  • the memory 510 may include, for example, a system memory, a nonvolatile storage medium, and the like.
  • the system memory stores, for example, an operating system, an application program, a boot loader (Boot Loader), and other programs.
  • the system memory may include volatile storage media, such as random access memory (RAM) and/or cache memory.
  • the non-volatile storage medium stores, for example, instructions for executing the corresponding embodiment of the table recognition method.
  • Non-volatile storage media include, but are not limited to, magnetic disk storage, optical storage, flash memory, and the like.
  • the processor 520 can be implemented by a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistors and other discrete hardware components.
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA field programmable gate array
  • each module such as the judgment module and the determination module can be implemented by a central processing unit (CPU) running instructions for executing corresponding steps in a memory, or can be implemented by a dedicated circuit that executes the corresponding steps.
  • the bus 500 can use any bus structure among a variety of bus structures.
  • the bus structure includes, but is not limited to, an industry standard architecture (ISA) bus, a microchannel architecture (MCA) bus, and a peripheral component interconnect (PCI) bus.
  • ISA industry standard architecture
  • MCA microchannel architecture
  • PCI peripheral component interconnect
  • the computer system 50 may also include an input/output interface 530, a network interface 540, a storage interface 550, and the like. These interfaces 530, 540, 550, and the memory 510 and the processor 520 may be connected through a bus 500.
  • the input and output interface 530 can provide a connection interface for input and output devices such as a display, a mouse, and a keyboard.
  • the network interface 540 provides a connection interface for various networked devices.
  • the storage interface 540 provides a connection interface for external storage devices such as floppy disks, U disks, and SD cards.
  • These computer-readable program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable form recognition device to generate a machine, so that one or more of the instructions in the flowchart and/or block diagram are executed by the processor.
  • These computer-readable program instructions can also be stored in a computer-readable memory. These instructions make the computer work in a specific manner to produce an article of manufacture, including the realization of the functions specified in one or more blocks in the flowcharts and/or block diagrams. Instructions.
  • the present disclosure may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware.

Landscapes

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

Abstract

本公开涉及表格识别方法和装置、计算机可读存储介质。表格识别方法,包括:识别待识别表格的第一轮廓线;根据第一轮廓线,确定待识别表格的多个第一文字区域;对多个第一文字区域分别按行和列进行聚类,以计算待识别表格的行列分割点;根据行列分割点,识别待识别表格的第二轮廓线;根据第二轮廓线,确定待识别表格的多个第二文字区域,每个第二文字区域对应一个单元格;使用文本识别模型,识别每个第二文字区域中的文字;将识别出的各个第二文字区域中的文字内容分别填入相应的单元格中。

Description

表格识别方法和装置、计算机可读存储介质
相关申请的交叉引用
本申请是以CN申请号为201911357969.3,申请日为2019年12月25日的申请为基础,并主张其优先权,该CN申请的公开内容在此作为整体引入本申请中。
技术领域
本公开涉及计算机领域,特别涉及一种表格识别方法和装置、计算机可读存储介质。
背景技术
在各行各业都存在大量图像表格文件,随着目前信息化、智能化技术的快速发展,对图像表格文件的自动数字化处理,有着越来越广泛的应用场景。
图像表格文件的识别一般包括如下步骤如下:1)图像预处理(例如,灰度化、二值化、各种变换);2)表格的轮廓线识别;3)文字区域识别;4)对文字进行切割或比对;5)使用训练好的识别模型识别具体文字。
在实际的表格图像中,存在各种各样的噪音或者水印等干扰信息,或者行列之间过于靠近,无法区分,导致识别出来文字分裂,或者缺失,不能很好地识别出整体表格。
发明内容
本公开提出了一种表格识别方案,能够进一步提高表格识别的准确性。
根据本公开的一些实施例,提供了一种表格识别方法,包括:识别待识别表格的第一轮廓线;
根据第一轮廓线,确定待识别表格的多个第一文字区域;
对多个第一文字区域分别按行和列进行聚类,以计算待识别表格的行列分割点;
根据行列分割点,识别待识别表格的第二轮廓线;
根据第二轮廓线,确定待识别表格的多个第二文字区域,每个第二文字区域对应一个单元格;
使用文本识别模型,识别每个第二文字区域中的文字;
将识别出的各个第二文字区域中的文字内容分别填入相应的单元格中。
在一些实施例中,对多个第一文字区域分别按照行和列进行聚类,以计算待识别表格的行列分割点包括:
提取多个第一文字区域的行坐标区间段和列坐标区间段;
分别根据行坐标区间段、列坐标区间段的交叠程度,判断是否合并相应的第一文字区域;
基于合并的结果,计算待识别表格的行列分割点。
在一些实施例中,判断是否合并相应的第一文字区域包括:
分别对第一文字区域的行坐标区间段、列坐标区间段有交叠的情况确定聚类评分;
在合并后的聚类评分大于合并前的聚类评分的情况下,判断为合并相应的第一文字区域。
在一些实施例中,分别对第一文字区域的行坐标区间段、列坐标区间段有交叠的情况确定聚类评分包括:
将提取出的行坐标区间段或列坐标区间段视为样本,样本数记为N,N为大于1的自然数;
根据聚类内有交集的样本对的数目和不同聚类间无交集的样本对的数目,对第一文字区域的行坐标区间段或列坐标区间段有交叠的情况确定聚类评分。
在一些实施例中,聚类评分与聚类内同质性正相关,其中聚类内同质性与聚类内有交集的样本对数目正相关;聚类评分与聚类间区分性负相关,其中聚类间区分性与不同聚类间无交集的样本对数目负相关。
在一些实施例中,聚类评分与聚类内同质性和聚类间区分性之间的比值正相关。
在一些实施例中,聚类评分表示为meric=score(Ci,Ci)/score(Ci,Cj)×(N-k)/(k–1),其中,k为聚类数目,Ci和Cj分别表示聚类i和聚类j,score(Ci,Ci)表示聚类内同质性且与聚类内有交集的样本对数目正相关,score(Ci,Cj)表示聚类间区分性且与不同聚类间无交集的样本对数目负相关。
在一些实施例中,聚类内同质性与属于同一聚类的各个样本之间的交叠程度正相关,与属于同一聚类的样本对数目负相关;聚类间区分性与属于不同聚类的各个样本之间的交叠程度负相关,与属于不同聚类的样本对数目正相关。
在一些实施例中,聚类内同质性表示为score(Ci,Ci)=∑is_inter(Sl,Sm)/n1,Sl和Sm分别表示属于同一聚类的样本l和m,n1为属于同一聚类的样本对数目, is_inter(Sl,Sm)表示样本l和m是否有交叠,有交叠的情况is_inter(Sl,Sm)=1,无交叠的情况is_inter(Sl,Sm)=0。
在一些实施例中,聚类间区分性表示为score(Ci,Cj)=1-∑is_inter(Sl,Sm)/n2,Sl和Sm分别表示属于不同聚类的样本l和m,n2为属于不同聚类的样本对数目,is_inter(Sl,Sm)表示样本l和m是否有交叠,有交叠的情况is_inter(Sl,Sm)=1,无交叠的情况is_inter(Sl,Sm)=0。
在一些实施例中,所述表格识别方法还包括:对待识别表格进行图像预处理。
在一些实施例中,识别待识别表格的第一轮廓线包括:使用findContours函数,识别待识别表格的第一轮廓线。
在一些实施例中,根据第一轮廓线,确定待识别表格的多个第一文字区域包括:根据第一轮廓线,利用正负向偏置对比,确定待识别表格的多个第一文字区域。
根据本公开的另一些实施例,提供一种表格识别装置,包括:第一识别单元,被配置为识别待识别表格的第一轮廓线;
第一确定单元,被配置为根据第一轮廓线,确定待识别表格的多个第一文字区域;
聚类单元,被配置为对多个第一文字区域分别按行和列进行聚类,以计算待识别表格的行列分割点;
第二识别单元,被配置为确定待识别表格的第二轮廓线;
第二确定单元,被配置为根据第二轮廓线,确定待识别表格的多个第二文字区域,每个第二文字区域对应一个单元格;
第三识别单元,被配置为使用文本识别模型,识别每个第二文字区域中的文字;
填充单元,被配置为将识别出的各个第二文字区域中的文字内容,分别填入相应的单元格中。
根据本公开的又一些实施例,提供一种表格识别装置,包括:存储器以及耦接至所述存储器的处理器,所述处理器被配置为基于存储在所述存储器装置中的指令,执行上述任一个实施例所述的表格识别方法。
根据本公开的另一些实施例,提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述任一个实施例所述的表格识别方法。
在上述实施例中,通过采用两阶段聚类策略,对所有识别出的文字区域信息分别进行行、列聚类,最终定位出整个表格的行列分割点;然后基于定位出的行列分割点重新划分表格,能够更准确地识别表格的轮廓线;最后基于准确识别的轮廓线重新识 别文字区域,保证整体识别的准确性,有效解决了相关技术中识别不准确的问题。
附图说明
构成说明书的一部分的附图描述了本公开的实施例,并且连同说明书一起用于解释本公开的原理。
参照附图,根据下面的详细描述,可以更加清楚地理解本公开,其中:
图1示出根据本公开的表格识别方法的一些实施例的流程图;
图2示出根据本公开的计算待识别表格的行列分割点的一些实施例的流程图;
图3示出根据本公开的表格识别装置的一些实施例的框图;
图4示出根据本公开的表格识别装置的另一些实施例的框图;
图5示出用于实现本公开一些实施例的计算机系统的框图。
具体实施方式
现在将参照附图来详细描述本公开的各种示例性实施例。应注意到:除非另外具体说明,否则在这些实施例中阐述的部件和步骤的相对布置、数字表达式和数值不限制本公开的范围。
同时,应当明白,为了便于描述,附图中所示出的各个部分的尺寸并不是按照实际的比例关系绘制的。
以下对至少一个示例性实施例的描述实际上仅仅是说明性的,决不作为对本公开及其应用或使用的任何限制。
对于相关领域普通技术人员已知的技术、方法和设备可能不作详细讨论,但在适当情况下,所述技术、方法和设备应当被视为授权说明书的一部分。
在这里示出和讨论的所有示例中,任何具体值应被解释为仅仅是示例性的,而不是作为限制。因此,示例性实施例的其它示例可以具有不同的值。
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步讨论。
图1示出根据本公开的表格识别方法的一些实施例的流程图。如图1所示,表格识别方法包括步骤S1-S7。
在步骤S1中,识别待识别表格的第一轮廓线。
在一些实施例中,使用findContours函数,识别待识别表格的第一轮廓线。第一 轮廓线例如为表格的框线。使用findContours函数获取表格(table)列表和忽略列表,以分割待识别表格的单元格。例如,对图片中的待识别表格的轮廓进行粗定位,然后按单元格裁剪成多个小图片,以便后续分析及操作。
在另一些实施例中,为了提高识别的准确性,可以对待识别表格的图片进行图像预处理。图像预处理包括:灰度化、二值化、各种变换、等等。
在步骤S2中,根据第一轮廓线,确定待识别表格的多个第一文字区域。
在一些实施例中,根据第一轮廓线,利用正负向偏置对比,确定待识别表格的多个第一文字区域。例如,可以基于图片中背景和文字的灰度差异,确定待识别表格的多个第一文字区域。
在步骤S3中,对多个第一文字区域分别按行和列进行聚类,以计算待识别表格的行列分割点。
图2示出根据本公开的计算待识别表格的行列分割点的一些实施例的流程图。如图2所示,计算待识别表格的行列分割点包括步骤S31-S33。
在步骤S31中,提取多个第一文字区域的行坐标区间段和列坐标区间段。
在一些实施例中,可以将提取出的行坐标区间段或列坐标区间段视为样本,样本数记为N,N为大于1的自然数。
在步骤S32中,分别根据行坐标区间段、列坐标区间段的交叠程度,判断是否合并相应的第一文字区域。
在一些实施例中,分别对第一文字区域的行坐标区间段、列坐标区间段有交叠的情况确定聚类评分。例如,将提取出的行坐标区间段或列坐标区间段视为样本,样本数记为N,N为大于1的自然数;然后,根据聚类内有交集的样本对的数目和不同聚类间无交集的样本对的数目,对第一文字区域的行坐标区间段或列坐标区间段有交叠的情况确定聚类评分。
在一些实施例中,聚类评分与聚类内同质性正相关,其中聚类内同质性与聚类内有交集的样本对数目正相关;聚类评分与聚类间区分性负相关,其中聚类间区分性与不同聚类间无交集的样本对数目负相关。例如,聚类评分表示为meric=score(Ci,Ci)/score(Ci,Cj)×(N-k)/(k–1),其中,k为聚类数目,Ci和Cj分别表示聚类i和聚类j,score(Ci,Ci)表示聚类内同质性且与聚类内有交集的样本对的数目正相关,score(Ci,Cj)表示聚类间区分性且与不同聚类间无交集的样本对的数目负相关。可以看出,聚类评分与聚类内同质性和聚类间区分性之间的比值正相关。
在一些实施例中,聚类内同质性与属于同一聚类的各个样本之间的交叠程度正相关,与属于同一聚类的样本对数目负相关;聚类间区分性与属于不同聚类的各个样本之间的交叠程度负相关,与属于不同聚类的样本对数目正相关。
例如,聚类内同质性表示为score(Ci,Ci)=∑is_inter(Sl,Sm)/n1,Sl和Sm分别表示属于同一聚类的样本l和m,n1为属于同一聚类的样本对的数目,is_inter(Sl,Sm)表示样本l和m是否有交叠,有交叠的情况is_inter(Sl,Sm)=1,无交叠的情况is_inter(Sl,Sm)=0。∑表示对属于同一聚类的样本对的is_inter(Sl,Sm)值求和。
聚类间区分性表示为score(Ci,Cj)=1-∑is_inter(Sl,Sm)/n2,Sl和Sm分别表示属于不同聚类的样本l和m,n2为属于不同聚类的样本对的数目,is_inter(Sl,Sm)表示样本l和m是否有交叠,有交叠的情况is_inter(Sl,Sm)=1,无交叠的情况is_inter(Sl,Sm)=0。∑表示对属于不同聚类的样本对的is_inter(Sl,Sm)值求和。
在合并后的聚类评分大于合并前的聚类评分的情况下,判断为合并相应的第一文字区域。而在合并后的聚类评分小于合并前的聚类评分的情况下,判断为不合并相应的第一文字区域。在合并前后聚类评分不变的情况下,即合并后的聚类评分等于合并前的聚类评分的情况,可以判断为合并相应的第一文字区域,也可以判断为不合并相应的第一文字区域。
在步骤S33中,基于合并的结果,计算待识别表格的行列分割点。
在一些实施例中,对于合并的样本,合并出起始点坐标,对行列做交叉,可算出最终的表格行列分割点。
下面返回图1继续描述后面的步骤S4-S7。
在步骤S4中,根据行列分割点,识别待识别表格的第二轮廓线。例如,综合行列分割点,即可以得到表格的行列划分。
在步骤S5中,根据第二轮廓线,确定待识别表格的多个第二文字区域,每个第二文字区域对应一个单元格。在一些实施例中,可以采用与步骤S2类似的方式执行步骤S5。
在步骤S6中,使用文本识别模型,识别每个第二文字区域中的文字。在一些实施例中,可以采用光学字符识别(OCR)等文本识别模型,识别每个第二文字区域中的文字。
在步骤S7中,将识别出的各个第二文字区域中的文字内容分别填入相应的单元格中。由此,可以得到整体识别准确性高的表格。
图3示出根据本公开的表格识别装置的一些实施例的框图。
如图3所示,表格识别装置3包括:
第一识别单元31,被配置为识别待识别表格的第一轮廓线,例如执行步骤S1;
第一确定单元32,被配置为根据第一轮廓线,确定待识别表格的多个第一文字区域,例如执行步骤S2;
聚类单元33,被配置为对多个第一文字区域分别按行和列进行聚类,以计算待识别表格的行列分割点,例如执行步骤S3;
第二识别单元34,被配置为确定待识别表格的第二轮廓线,例如执行步骤S4;
第二确定单元35,被配置为根据第二轮廓线,确定待识别表格的多个第二文字区域,每个第二文字区域对应一个单元格,例如执行步骤S5;
第三识别单元36,被配置为使用文本识别模型,识别每个第二文字区域中的文字,例如执行步骤S6;
填充单元37,被配置为将识别出的各个第二文字区域中的文字内容,分别填入相应的单元格中,例如执行步骤S7。
图4示出根据本公开的表格识别装置的另一些实施例的框图。
如图4所示,该实施例的装置4包括:存储器41以及耦接至该存储器41的处理器42。存储器41用于存储执行表格识别方法对应实施例的指令。处理器42被配置为基于存储在存储器41中的指令,执行本公开中任意一些实施例中的表格识别方法。
除了表格识别方法、装置之外,本公开实施例还可采用在一个或多个包含有计算机程序指令的非易失性存储介质上实施的计算机程序产品的形式。因此,本公开实施例还包括一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现前述任意实施例中的表格识别方法。
图5是示出用于实现本公开一些实施例的计算机系统的框图。
如图5所示,计算机系统50可以通用计算设备的形式表现。计算机系统50包括存储器510、处理器520和连接不同系统组件的总线500。
存储器510例如可以包括系统存储器、非易失性存储介质等。系统存储器例如存储有操作系统、应用程序、引导装载程序(Boot Loader)以及其他程序等。系统存储器可以包括易失性存储介质,例如随机存取存储器(RAM)和/或高速缓存存储器。非易失性存储介质例如存储有执行表格识别方法的对应实施例的指令。非易失性存储介质包括但不限于磁盘存储器、光学存储器、闪存等。
处理器520可以用通用处理器、数字信号处理器(DSP)、应用专用集成电路(ASIC)、现场可编程门阵列(FPGA)或其它可编程逻辑设备、分立门或晶体管等分立硬件组件方式来实现。相应地,诸如判断模块和确定模块的每个模块,可以通过中央处理器(CPU)运行存储器中执行相应步骤的指令来实现,也可以通过执行相应步骤的专用电路来实现。
总线500可以使用多种总线结构中的任意总线结构。例如,总线结构包括但不限于工业标准体系结构(ISA)总线、微通道体系结构(MCA)总线、外围组件互连(PCI)总线。
计算机系统50还可以包括输入输出接口530、网络接口540、存储接口550等。这些接口530、540、550以及存储器510和处理器520之间可以通过总线500连接。输入输出接口530可以为显示器、鼠标、键盘等输入输出设备提供连接接口。网络接口540为各种联网设备提供连接接口。存储接口540为软盘、U盘、SD卡等外部存储设备提供连接接口。
这里,参照根据本公开实施例的方法、装置和计算机程序产品的流程图和/或框图描述了本公开的各个方面。应当理解,流程图和/或框图的每个框以及各框的组合,都可以由计算机可读程序指令实现。
这些计算机可读程序指令可提供到通用计算机、专用计算机或其他可编程表格识别装置的处理器,以产生一个机器,使得通过处理器执行指令产生实现在流程图和/或框图中一个或多个框中指定的功能的装置。
这些计算机可读程序指令也可存储在计算机可读存储器中,这些指令使得计算机以特定方式工作,从而产生一个制造品,包括实现在流程图和/或框图中一个或多个框中指定的功能的指令。
本公开可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。
至此,已经通过示例对本公开的一些实施例进行了详细说明。应该理解,以上示例仅是为了进行说明,而不是为了限制本公开的范围。本领域的技术人员可以对以上实施例进行变化、修改、替换、变型、组合,而不脱离本公开的范围。

Claims (15)

  1. 一种表格识别方法,包括:
    识别待识别表格的第一轮廓线;
    根据第一轮廓线,确定待识别表格的多个第一文字区域;
    对多个第一文字区域分别按行和列进行聚类,以计算待识别表格的行列分割点;
    根据行列分割点,识别待识别表格的第二轮廓线;
    根据第二轮廓线,确定待识别表格的多个第二文字区域,每个第二文字区域对应一个单元格;
    使用文本识别模型,识别每个第二文字区域中的文字;
    将识别出的各个第二文字区域中的文字内容分别填入相应的单元格中。
  2. 根据权利要求1所述的表格识别方法,其中,对多个第一文字区域分别按照行和列进行聚类,以计算待识别表格的行列分割点包括:
    提取多个第一文字区域的行坐标区间段和列坐标区间段;
    分别根据行坐标区间段、列坐标区间段的交叠程度,判断是否合并相应的第一文字区域;
    基于合并的结果,计算待识别表格的行列分割点。
  3. 根据权利要求2所述的表格识别方法,其中,判断是否合并相应的第一文字区域包括:
    分别对第一文字区域的行坐标区间段、列坐标区间段有交叠的情况确定聚类评分;
    在合并后的聚类评分大于合并前的聚类评分的情况下,判断为合并相应的第一文字区域。
  4. 根据权利要求3所述的表格识别方法,其中,分别对第一文字区域的行坐标区间段、列坐标区间段有交叠的情况确定聚类评分包括:
    将提取出的行坐标区间段或列坐标区间段视为样本,样本数记为N,N为大于1的自然数;
    根据聚类内有交集的样本对的数目和不同聚类间无交集的样本对的数目,对第一 文字区域的行坐标区间段或列坐标区间段有交叠的情况确定聚类评分。
  5. 根据权利要求4所述的表格识别方法,其中:
    聚类评分与聚类内同质性正相关,其中聚类内同质性与聚类内有交集的样本对数目正相关;
    聚类评分与聚类间区分性负相关,其中聚类间区分性与不同聚类间无交集的样本对数目负相关。
  6. 根据权利要求5所述的表格识别方法,其中,聚类评分与聚类内同质性和聚类间区分性之间的比值正相关。
  7. 根据权利要求5所述的表格识别方法,其中,聚类评分表示为meric=score(Ci,Ci)/score(Ci,Cj)×(N-k)/(k–1),其中,k为聚类数目,Ci和Cj分别表示聚类i和聚类j,score(Ci,Ci)表示聚类内同质性,score(Ci,Cj)表示聚类间区分性。
  8. 根据权利要求5至7任一项所述的表格识别方法,其中:
    聚类内同质性与属于同一聚类的各个样本之间的交叠程度正相关,与属于同一聚类的样本对数目负相关;
    聚类间区分性与属于不同聚类的各个样本之间的交叠程度负相关,与属于不同聚类的样本对数目正相关。
  9. 根据权利要求8所述的表格识别方法,其中,聚类内同质性表示为score(Ci,Ci)=∑is_inter(Sl,Sm)/n1,Sl和Sm分别表示属于同一聚类的样本l和m,n1为属于同一聚类的样本对数目,is_inter(Sl,Sm)表示样本l和m是否有交叠,有交叠的情况is_inter(Sl,Sm)=1,无交叠的情况is_inter(Sl,Sm)=0。
  10. 根据权利要求8所述的表格识别方法,其中,聚类间区分性表示为score(Ci,Cj)=1-∑is_inter(Sl,Sm)/n2,Sl和Sm分别表示属于不同聚类的样本l和m,n2为属于不同聚类的样本对数目,is_inter(Sl,Sm)表示样本l和m是否有交叠,有交叠的情况is_inter(Sl,Sm)=1,无交叠的情况is_inter(Sl,Sm)=0。
  11. 根据权利要求1至5中任一项所述的表格识别方法,其中,根据第一轮廓线,确定待识别表格的多个第一文字区域包括:
    根据第一轮廓线,利用正负向偏置对比,确定待识别表格的多个第一文字区域。
  12. 根据权利要求1至5中任一项所述的表格识别方法,其中,识别待识别表格的第一轮廓线包括:使用findContours函数,识别待识别表格的第一轮廓线。
  13. 一种表格识别装置,包括:
    第一识别单元,被配置为识别待识别表格的第一轮廓线;
    第一确定单元,被配置为根据第一轮廓线,确定待识别表格的多个第一文字区域;
    聚类单元,被配置为对多个第一文字区域分别按行和列进行聚类,以计算待识别表格的行列分割点;
    第二识别单元,被配置为确定待识别表格的第二轮廓线;
    第二确定单元,被配置为根据第二轮廓线,确定待识别表格的多个第二文字区域,每个第二文字区域对应一个单元格;
    第三识别单元,被配置为使用文本识别模型,识别每个第二文字区域中的文字;
    填充单元,被配置为将识别出的各个第二文字区域中的文字内容,分别填入相应的单元格中。
  14. 一种表格识别装置,包括:
    存储器;和
    耦接至所述存储器的处理器,所述处理器被配置为基于存储在所述存储器中的指令,执行如权利要求1-12中任一项所述的表格识别方法。
  15. 一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如权利要求1-12中任一项所述的表格识别方法。
PCT/CN2020/124426 2019-12-25 2020-10-28 表格识别方法和装置、计算机可读存储介质 WO2021129121A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911357969.3 2019-12-25
CN201911357969.3A CN111144282B (zh) 2019-12-25 2019-12-25 表格识别方法和装置、计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2021129121A1 true WO2021129121A1 (zh) 2021-07-01

Family

ID=70520071

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/124426 WO2021129121A1 (zh) 2019-12-25 2020-10-28 表格识别方法和装置、计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN111144282B (zh)
WO (1) WO2021129121A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116168404A (zh) * 2023-01-31 2023-05-26 苏州爱语认知智能科技有限公司 基于空间变换的智能文档处理方法和系统

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111144282B (zh) * 2019-12-25 2023-12-05 北京同邦卓益科技有限公司 表格识别方法和装置、计算机可读存储介质
CN111931229B (zh) * 2020-07-10 2023-07-11 深信服科技股份有限公司 一种数据识别方法、装置和存储介质
CN111860502A (zh) * 2020-07-15 2020-10-30 北京思图场景数据科技服务有限公司 图片表格的识别方法、装置、电子设备及存储介质
CN117195846B (zh) * 2023-11-07 2024-03-01 江西五十铃汽车有限公司 一种专家表管理方法、系统、存储介质及设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013084071A (ja) * 2011-10-07 2013-05-09 Hitachi Computer Peripherals Co Ltd 帳票認識方法および帳票認識装置
CN108416279A (zh) * 2018-02-26 2018-08-17 阿博茨德(北京)科技有限公司 文档图像中的表格解析方法及装置
CN109993112A (zh) * 2019-03-29 2019-07-09 杭州睿琪软件有限公司 一种图片中表格的识别方法及装置
CN110334585A (zh) * 2019-05-22 2019-10-15 平安科技(深圳)有限公司 表格识别方法、装置、计算机设备和存储介质
CN111144282A (zh) * 2019-12-25 2020-05-12 北京同邦卓益科技有限公司 表格识别方法和装置、计算机可读存储介质

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3402755B2 (ja) * 1994-06-14 2003-05-06 株式会社リコー 領域分割方法
US6006240A (en) * 1997-03-31 1999-12-21 Xerox Corporation Cell identification in table analysis
US6757870B1 (en) * 2000-03-22 2004-06-29 Hewlett-Packard Development Company, L.P. Automatic table detection method and system
US7587088B2 (en) * 2006-04-24 2009-09-08 Baumer Optronic Gmbh Method and apparatus for image processing
CN103377177B (zh) * 2012-04-27 2016-03-30 北大方正集团有限公司 一种数字版式文件中识别表格的方法及装置
CN106897690B (zh) * 2017-02-22 2018-04-13 南京述酷信息技术有限公司 Pdf表格提取方法
US10242257B2 (en) * 2017-05-18 2019-03-26 Wipro Limited Methods and devices for extracting text from documents
CN107862303B (zh) * 2017-11-30 2019-04-26 平安科技(深圳)有限公司 表格类图像的信息识别方法、电子装置及可读存储介质
CN108446264B (zh) * 2018-03-26 2022-02-15 阿博茨德(北京)科技有限公司 Pdf文档中的表格矢量解析方法及装置
CN110390269B (zh) * 2019-06-26 2023-08-01 平安科技(深圳)有限公司 Pdf文档表格提取方法、装置、设备及计算机可读存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013084071A (ja) * 2011-10-07 2013-05-09 Hitachi Computer Peripherals Co Ltd 帳票認識方法および帳票認識装置
CN108416279A (zh) * 2018-02-26 2018-08-17 阿博茨德(北京)科技有限公司 文档图像中的表格解析方法及装置
CN109993112A (zh) * 2019-03-29 2019-07-09 杭州睿琪软件有限公司 一种图片中表格的识别方法及装置
CN110334585A (zh) * 2019-05-22 2019-10-15 平安科技(深圳)有限公司 表格识别方法、装置、计算机设备和存储介质
CN111144282A (zh) * 2019-12-25 2020-05-12 北京同邦卓益科技有限公司 表格识别方法和装置、计算机可读存储介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116168404A (zh) * 2023-01-31 2023-05-26 苏州爱语认知智能科技有限公司 基于空间变换的智能文档处理方法和系统
CN116168404B (zh) * 2023-01-31 2023-12-22 苏州爱语认知智能科技有限公司 基于空间变换的智能文档处理方法和系统

Also Published As

Publication number Publication date
CN111144282A (zh) 2020-05-12
CN111144282B (zh) 2023-12-05

Similar Documents

Publication Publication Date Title
WO2021129121A1 (zh) 表格识别方法和装置、计算机可读存储介质
US10565703B2 (en) Image inspection device, image inspection method, and image inspection program
CN107784288B (zh) 一种基于深度神经网络的迭代定位式人脸检测方法
CN111831629B (zh) 一种数据处理方法及装置
CN111143578A (zh) 基于神经网络抽取事件关系的方法、装置和处理器
WO2023050651A1 (zh) 图像语义分割方法、装置、设备及存储介质
CN110969600A (zh) 一种产品缺陷检测方法、装置、电子设备及存储介质
CN110889437A (zh) 一种图像处理方法、装置、电子设备及存储介质
CN114677695A (zh) 表格解析方法、装置、计算机设备和存储介质
CN111159167B (zh) 标注质量检测装置和方法
WO2020155831A1 (zh) 数据标签生成、模型训练、事件识别方法和装置
US10782942B1 (en) Rapid onboarding of data from diverse data sources into standardized objects with parser and unit test generation
WO2023159527A1 (zh) 检测器训练方法、装置及存储介质
CN113344079B (zh) 一种图像标签半自动标注方法、系统、终端及介质
CN112101024B (zh) 基于app信息的目标对象识别系统
CN114372060A (zh) 数据存储方法、装置、设备及存储介质
CN110598196A (zh) 一种缺失外边框的表格数据提取方法、装置和存储介质
CN111738290B (zh) 图像检测方法、模型构建和训练方法、装置、设备和介质
US20110099137A1 (en) Graphical user interface component classification
CN112464660A (zh) 文本分类模型构建方法以及文本数据处理方法
WO2024031881A1 (zh) 一种操作行为识别方法及装置
WO2020228179A1 (zh) 一种图片实例检测方法、装置、计算机设备及存储介质
CN114021716A (zh) 一种模型训练的方法、系统及电子设备
CN106997462A (zh) 一种量子线路图像识别方法
CN113283513A (zh) 基于目标互换和度量学习的小样本目标检测方法及系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20905005

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 03.11.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20905005

Country of ref document: EP

Kind code of ref document: A1