WO2023216745A1 - Table reconstruction method and electronic device - Google Patents

Table reconstruction method and electronic device Download PDF

Info

Publication number
WO2023216745A1
WO2023216745A1 PCT/CN2023/084482 CN2023084482W WO2023216745A1 WO 2023216745 A1 WO2023216745 A1 WO 2023216745A1 CN 2023084482 W CN2023084482 W CN 2023084482W WO 2023216745 A1 WO2023216745 A1 WO 2023216745A1
Authority
WO
WIPO (PCT)
Prior art keywords
text
area
coordinates
abscissa
cell
Prior art date
Application number
PCT/CN2023/084482
Other languages
French (fr)
Chinese (zh)
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 WO2023216745A1 publication Critical patent/WO2023216745A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/40Document-oriented image-based pattern recognition
    • G06V30/41Analysis of document content
    • G06V30/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
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • 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
    • G06V30/14Image acquisition
    • G06V30/146Aligning or centring of the image pick-up or image-field
    • G06V30/147Determination of region of interest
    • 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/414Extracting the geometrical structure, e.g. layout tree; Block segmentation, e.g. bounding boxes for graphics or text

Definitions

  • the present application relates to the field of data processing technology, specifically, to a table reconstruction method and electronic equipment.
  • the purpose of the embodiments of the present application is to provide a table reconstruction method and electronic device, so as to reduce the deviation of the reconstructed table when reconstructing the table in the table image.
  • a method for table reconstruction including:
  • the text area recognition result contains the regional text content and regional location information of the text area
  • the regional location information determine the row coordinates of each table and the coordinates of each table column of the target table
  • the regional location information add the regional text content to the blank table to obtain the target table.
  • the table is reconstructed through the regional text content and regional position information of each text area identified in the image to be processed.
  • the framed table in the image to be processed can also be reconstructed without a frame in the image to be processed. table, improving the accuracy of table reconstruction.
  • the area position information includes the area vertex coordinates of the text area.
  • Performing text recognition on the image to be processed and obtaining the text area recognition result of the image to be processed includes: performing text detection on the image to be processed and obtaining multiple areas of the text area.
  • Vertex coordinates, the area vertex coordinates are the coordinates of the vertices of the text area; perform text recognition on the text area to obtain the area text content.
  • text recognition is performed on the graph to be processed, and the vertex coordinates of each area in the text area and the text content of the area are determined, so that the location and content of each text area can be accurately identified.
  • the regional vertex coordinates include the regional vertex abscissa and the regional vertex ordinate.
  • determining the table row coordinates and the table column coordinates of the target table includes: determining the maximum ordinate in each region vertex. The ordinate and the minimum ordinate; determine the maximum abscissa and the minimum abscissa in the abscissa of each area vertex;
  • the first area number is the number of text areas containing a certain ordinate
  • the second area number is the number of text areas containing a certain horizontal coordinate.
  • the number of text areas for coordinates determine the coordinates of each table row based on the maximum ordinate, the minimum ordinate, and the number of first areas; determine the coordinates of each table column based on the maximum abscissa, the minimum abscissa, and the number of second areas.
  • the row coordinates and column coordinates of each table are determined through the location of each text area, and the rows and columns of the frameless table can be identified, which improves the accuracy of table reconstruction.
  • determining the coordinates of each table row based on the maximum ordinate, the minimum ordinate, and the number of first areas includes: determining the trough ordinate and the trough ordinate based on each ordinate and its corresponding number of first areas.
  • the number of first areas is not higher than the number of first areas in the adjacent ordinates of the trough ordinate, and the adjacent ordinates of the trough ordinate are the previous ordinate and the next ordinate of the trough ordinate; according to the maximum ordinate,
  • the minimum vertical coordinate, and the trough vertical coordinate are used to obtain the coordinates of each table row.
  • the table row coordinates are determined based on the number of first areas of the text areas traversed by the horizontal lines where the vertical coordinates are located.
  • determining the coordinates of each table column according to the maximum abscissa, the minimum abscissa, and the number of second areas includes: determining the trough abscissa and the trough abscissa according to each abscissa and its corresponding number of second areas.
  • the number of second areas is not higher than the number of second areas of the adjacent abscissa of the wave trough abscissa, and the adjacent abscissas of the wave trough abscissa are the previous abscissa and the next abscissa of the trough abscissa; according to the maximum abscissa, The minimum abscissa and the trough abscissa are used to obtain the coordinates of each table column.
  • the table column coordinates are determined based on the number of second areas of the text areas where the vertical lines where the abscissa coordinates are located pass through. .
  • the method further includes: determining the cell position information of the cells in the blank table based on each table row coordinate and each table column coordinate; According to the area position information and cell position information, determine the target cell covered by the text area; among them, there are coordinate points in the text area that are located in the target cell and do not coincide with the boundary of the target cell; if it is determined that the text area covers If there are multiple target cells, merge the target cells.
  • multiple target cells covered by the text area are merged according to the area where the cell is located and the area where the text area is located, thereby solving the problem of how to set merged cells that exist in the table.
  • adding the regional text content to the blank table according to the regional location information to obtain the target table includes: performing the following steps for each cell in the blank table: if based on the regional location information, determine a If the cell only contains one text area, then the area text content in the text area contained in a cell is added to a cell; if it is determined based on the area position information that a cell contains at least two text areas, then the area text content is added according to the area position information. Position information, sort the regional text content in each text area contained in a cell, and add the sorted regional text content to a cell.
  • the regional text content of multiple text areas in the same cell is first sorted, and then the sorted regional text content is added to the cell, thus solving how to add multiple text areas to the same cell. Issues with area text content of text areas.
  • determining that a cell contains only one text area based on the area location information includes: determining the center point coordinates of the text area based on the area location information, and the center point coordinates are the coordinates of the center point of the text area; if According to the cell position information of a cell, it is determined that the center point coordinate of only one text area is located in the cell, then it is determined that a cell contains only one text area.
  • the text area contained in the cell can be quickly determined based on the coordinates of the center point of the text area and the area where the cell is located.
  • adding the regional text content in the text area contained in a cell to a cell includes: setting the attribute value of the text attribute of a cell to the text area contained in the cell.
  • the regional text content includes: setting the attribute value of the text attribute of a cell to the text area contained in the cell.
  • determining that a cell contains at least two text areas according to the area position information includes: if it is determined that the number of text areas is multiple, determining each text area separately according to the area position information of each text area. The center point coordinate of At least two text areas.
  • multiple text areas contained in a cell can be quickly determined based on the coordinates of the center point of the text area and the area where the cell is located.
  • the center point coordinates include the center point abscissa and the center point ordinate. Sorting the regional text content in each text area contained in a cell includes: in descending order of the center point ordinate. , sort the regional text content in each text area contained in a cell; sort the regional text content in each text area with the same central point ordinate in ascending order of the center point abscissa.
  • each text area in the same cell is sorted according to the abscissa coordinate and the ordinate coordinate of the center point of each text area.
  • adding the sorted regional text content to a cell includes: setting the attribute value of a text attribute of a cell to the sorted regional text content.
  • a table reconstruction device including:
  • the recognition unit is used to perform text recognition on the image to be processed and obtain the text area recognition result of the image to be processed.
  • the text area recognition result contains the regional text content and regional position information of the text area;
  • the determination unit is used to determine based on the regional position information.
  • the generating unit is used to generate a blank table based on the row coordinates and column coordinates of each table;
  • the obtaining unit is used to add the regional text content to the blank based on the regional location information form to obtain the target form.
  • the regional position information includes the regional vertex coordinates of the text area
  • the recognition unit is used to: perform text detection on the image to be processed, and obtain multiple regional vertex coordinates of the text area, where the regional vertex coordinates are the coordinates of the vertices of the text area; Perform text recognition on the text area to obtain the text content of the area.
  • the regional vertex coordinates include the regional vertex abscissa and the regional vertex ordinate
  • the determination unit is used to: determine the maximum ordinate and the minimum ordinate in the ordinate of each regional vertex; determine the maximum ordinate in the abscissa of each regional vertex.
  • the number of the first area is the number of text areas containing a certain ordinate
  • the second The number of areas is the number of text areas containing a certain abscissa; determine the coordinates of each table row based on the maximum ordinate, the minimum ordinate, and the number of first areas; determine the coordinates of each table row based on the maximum abscissa, the minimum abscissa, and the number of second areas , determine the coordinates of each table column.
  • the determining unit is configured to: determine the trough ordinate based on each ordinate and its corresponding number of first areas, and the number of the first areas of the trough ordinate is not higher than the number of adjacent ordinates of the trough ordinate.
  • the number of areas, The adjacent vertical coordinates of the trough vertical coordinate are the previous ordinate and the next ordinate of the trough vertical coordinate; according to the maximum ordinate, the minimum ordinate, and the trough vertical coordinate, the coordinates of each table row are obtained.
  • the determination unit is configured to: determine the trough abscissa according to each abscissa and its corresponding number of second areas, and the number of the second areas of the trough abscissa is not higher than the number of adjacent abscissas of the trough abscissa. Second, the number of areas.
  • the adjacent abscissas of the trough abscissa are the previous abscissa and the next abscissa of the trough. According to the maximum abscissa, the minimum abscissa, and the trough abscissa, the coordinates of each table column are obtained.
  • the generation unit is also used to: determine the cell position information of the cells in the blank table based on each table row coordinate and each table column coordinate; determine the text area coverage based on the area position information and the cell position information.
  • the target cell among them, there are coordinate points in the text area that are located in the target cell and do not coincide with the boundary of the target cell; if it is determined that there are multiple target cells covered by the text area, the target cells will be merged.
  • the unit is obtained by: performing the following steps for each cell in the blank table: if it is determined that a cell contains only one text area based on the area position information, then the text contained in a cell is The regional text content in the area is added to a cell; if it is determined that a cell contains at least two text areas according to the area position information, the area text in each text area contained in a cell is added according to the area position information. Sort the content and add the sorted range text content to a cell.
  • the obtaining unit is used to: determine the center point coordinates of the text area based on the area position information, and the center point coordinates are the coordinates of the center point of the text area; if based on the cell position information of a cell, determine only If the center point coordinates of a text area are located within the cell, it is determined that a cell contains only one text area.
  • the obtaining unit is used to: set the attribute value of the text attribute of a cell to the regional text content in the text area contained in the cell.
  • the obtaining unit is configured to: if it is determined that the number of text areas is multiple, determine the center point coordinates of each text area according to the area position information of each text area, and the center point coordinates are the center of the text area. The coordinates of the point; if based on the cell position information of a cell, it is determined that the center point coordinates of at least two text areas are located in the cell, then it is determined that a cell contains at least two text areas.
  • the center point coordinates include the center point abscissa and the center point ordinate
  • the obtaining unit is used to: according to the descending order of the center point ordinate, the regional text in each text area contained in a cell is Sort the content; sort the regional text content in each text area with the same central point ordinate in ascending order of the center point's abscissa.
  • the obtaining unit is used to: set the attribute value of the text attribute of a cell to the sorted regional text content.
  • an electronic device including a processor and a memory.
  • the memory stores computer-readable instructions.
  • various optional table reconstruction methods such as those mentioned above are executed. Implement the steps for the method provided in How.
  • a computer-readable storage medium on which a computer program is stored.
  • the steps of the method provided in any of the above optional implementations of table reconstruction are executed.
  • a computer program product is provided.
  • the computer program product When the computer program product is run on a computer, it causes the computer to perform the steps of the method provided in any of the above optional implementations of table reconstruction.
  • Figure 1 is a flow chart of a table reconstruction method provided by an embodiment of the present application.
  • Figure 2 is an example diagram of a user attribute table image provided by an embodiment of the present application.
  • Figure 3 is a specific flow chart of a method for reconstructing a user attribute table provided by an embodiment of the present application
  • Figure 4 is an example diagram 1 of a first curve provided by the embodiment of the present application.
  • Figure 5 is an example diagram 1 of a second curve provided by the embodiment of the present application.
  • Figure 6 is an example diagram of merging table images provided by the embodiment of the present application.
  • Figure 7 is a specific flow chart of a method for merging table reconstruction provided by an embodiment of the present application.
  • Figure 8 is an example of Figure 2 of a first curve provided by the embodiment of the present application.
  • Figure 9 is an example of Figure 2 of a second curve provided by the embodiment of the present application.
  • Figure 10 is a structural block diagram of a table reconstruction device provided by an embodiment of the present application.
  • Figure 11 is a schematic structural diagram of an electronic device in an embodiment of the present application.
  • Terminal device It can be a mobile terminal, a fixed terminal or a portable terminal, such as a mobile phone, a site, a unit, a device, a multimedia computer, a multimedia tablet, an Internet node, a communicator, a desktop computer, a laptop computer, a notebook computer, a netbook computer, Tablet computers, personal communication system devices, personal navigation devices, personal digital assistants, audio/video players, digital cameras/camcorders, positioning devices, television receivers, radio broadcast receivers, e-book devices, gaming devices, or any combination thereof, Includes accessories and peripherals for these devices or any combination thereof. It is also foreseeable that the terminal device can support any type of user-oriented interface (such as wearable devices), etc.
  • Server It can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, Cloud servers for middleware services, domain name services, security services, and basic cloud computing services such as big data and artificial intelligence platforms.
  • OCR Optical Character Recognition
  • Embodiments of the present application provide a table reconstruction method and electronic device.
  • the execution subject is an electronic device.
  • the electronic device may be a server or a terminal device.
  • FIG. 1 is a flow chart of a table reconstruction method provided by an embodiment of the present application.
  • the specific implementation process of the method is as follows:
  • Step 100 Perform text recognition on the image to be processed, and obtain the text area recognition result of the image to be processed.
  • step 100 when performing step 100, the following steps can be adopted:
  • S1001 Perform text detection on the image to be processed and obtain multiple area vertex coordinates of the text area.
  • text detection is performed on the image to be processed to obtain the regional vertex coordinates of one or more rectangular text areas.
  • the coordinates of the area vertices are the coordinates of the vertices of the text area.
  • the coordinates of the regional vertex include the horizontal coordinate of the regional vertex and the vertical coordinate of the regional vertex. Since the text area is a rectangle, the number of area vertex coordinates of each text area is 4.
  • the text area can also be in other shapes, such as a quadrilateral, which is not limited here.
  • S1002 Perform text recognition on the text area and obtain the text content of the area.
  • OCR technology is used to perform text recognition on the text area to obtain regional text content in the text area.
  • the regional text content is the information recognized in the text area.
  • Regional text content can include at least one of the following: text, formulas, and dates.
  • the regional text content can also be other types of information, which is not limited here.
  • S1003 Based on the regional vertex coordinates and regional text content of the text area, obtain the text area recognition result of the image to be processed.
  • the text area recognition result includes the area text content and area location information of the text area.
  • the area position information includes the area vertex coordinates of the text area.
  • the region vertex coordinates are used as the region position information in the text area recognition result.
  • Step 101 Determine the coordinates of each table row and each table column of the target table based on the area position information in the text area recognition result.
  • step 101 when performing step 101, the following steps can be taken:
  • S1011 Determine the maximum ordinate and the minimum ordinate among the ordinates of the vertices of each region.
  • the maximum ordinate and the minimum ordinate among the ordinates of all area vertices of each text area are determined.
  • S1012 Determine the maximum abscissa coordinate and the minimum abscissa coordinate among the vertex abscissas of each area.
  • the maximum abscissa and the minimum abscissa of the abscissas of all area vertices of each text area are determined.
  • the boundary of the target table can be determined by the maximum ordinate, minimum ordinate, maximum abscissa, and minimum abscissa.
  • S1013 Determine the number of first regions for each ordinate and the number of second regions for each abscissa according to the region location information.
  • the first area quantity is the number of text areas containing a certain vertical coordinate
  • the second area quantity is the number of text areas containing a certain abscissa.
  • the text area contains a certain vertical coordinate, which means that the vertical coordinate of the coordinate point in the text area is the above-mentioned certain vertical coordinate.
  • the text area contains a certain abscissa, which means that the abscissa of the coordinate point in the text area is the above-mentioned abscissa.
  • the abscissa interval and ordinate interval of the text area are determined based on the regional position information of the text area. If it is determined that a certain ordinate is located within the ordinate interval of the text area, it is determined that the text area contains the ordinate, If it is determined that a certain abscissa is located in the abscissa interval of the text area, then it is determined that the text area contains the abscissa.
  • the abscissa interval of a certain text area is determined based on the maximum and minimum values of the abscissa coordinates among the four area vertex coordinates of the text area.
  • the vertical coordinate interval of a text area is determined based on the maximum and minimum values of the vertical coordinate among the four regional vertex coordinates of the text area.
  • S1014 Determine the coordinates of each table row of the target table based on the maximum ordinate, the minimum ordinate, and the number of first areas.
  • each ordinate and its corresponding first area number the trough ordinate that meets the trough ordinate condition is determined, and each table row coordinate is obtained based on the maximum ordinate, the minimum ordinate, and the trough ordinate.
  • the condition of the trough ordinate is: the number of the first areas in the trough ordinate is not higher than the number of the first areas in the adjacent ordinate of the trough ordinate, and the adjacent ordinate of the trough ordinate is the previous ordinate of the trough ordinate. and the latter ordinate.
  • obtaining the coordinates of each table row based on the maximum ordinate, the minimum ordinate, and the trough ordinate includes: using the maximum ordinate and the minimum ordinate as table row coordinates; and generating based on each trough ordinate.
  • the trough ordinate interval (each ordinate within the trough ordinate interval is the trough ordinate), screen out the trough ordinate interval that does not include the maximum ordinate and the trough ordinate interval that does not include the minimum ordinate; in the filtered trough In the ordinate interval, if it is determined that the trough ordinate interval contains only one trough ordinate, then the trough ordinate interval will be used as the table row coordinate.
  • the trough ordinate interval contains multiple trough ordinates, then the trough ordinate interval will be used as the table row coordinate. Select a trough vertical coordinate as the table row coordinate.
  • a trough ordinate can be randomly selected from the trough ordinate interval. In actual applications, the specific method of selection can be set according to the actual application scenario, and is not limited here.
  • S1015 Determine the coordinates of each table column based on the maximum abscissa, the minimum abscissa, and the number of second areas.
  • each abscissa and its corresponding number of second areas determine the trough abscissa that meets the conditions of the trough abscissa, and obtain the coordinates of each table column based on the maximum abscissa, the minimum abscissa, and the trough abscissa.
  • the condition of the wave trough abscissa is: the number of the second areas of the wave trough abscissa is not higher than the number of the second areas of the adjacent abscissa of the wave trough abscissa, and the adjacent abscissa of the wave trough abscissa is the previous abscissa of the wave trough abscissa. and the latter abscissa.
  • the coordinates of each table column are obtained based on the maximum abscissa, the minimum abscissa, and the trough abscissa, including:
  • the trough abscissa interval of , and the trough abscissa interval that does not include the minimum abscissa; in the filtered trough abscissa interval If it is determined that the trough abscissa interval contains only one trough abscissa, then the trough abscissa is used as the table column coordinate. If it is determined that the trough abscissa interval contains multiple trough abscissas, then one trough abscissa is selected from the trough abscissa interval. Coordinates, as table column coordinates. Optionally, you can select a trough abscissa coordinate from the trough abscissa coordinate interval as the table column coordinate. In actual applications, the specific method of selection can be set according to the actual application scenario, and is not limited here.
  • Step 102 Generate a blank table based on the row coordinates of each table and the coordinates of each table column.
  • the target cell covered by the text area meets the following conditions: there is a coordinate point in the text area that is located within the target cell and does not coincide with the boundary of the target cell.
  • cell C is determined to be the target cell covered by text area A.
  • S1021 Determine the cell position information of the cells in the blank table based on the row coordinates of each table and the coordinates of each table column.
  • the cells in the blank table are rectangular, and the cell position information of the cell includes four cell vertex coordinates of the cell.
  • the cell vertex coordinates are the coordinates of the cell's vertex.
  • the cell vertex coordinates include the cell vertex ordinate and the cell vertex abscissa.
  • S1022 Determine the target cell covered by the text area based on the area position information and the cell position information.
  • the target text area in each text area if there are multiple text areas, then for the target text area in each text area (the target text area is any text area in each text area), if it is determined that the target cell covered by the target text area is If there are multiple, the target cells covered by the target text area will be merged.
  • Step 103 According to the region position information, add the regional text content in the text region recognition result to the blank table to obtain the target table.
  • a cell contains a text area, which means that all coordinate points in the text area are located in the cell, that is, the coverage area of the cell is not smaller than the text area.
  • determining that a cell contains only one text area based on the area location information may include: determining the center point coordinates of the text area based on the area location information. If based on the cell location information of a cell, determining only If the center point coordinate of a text area is located in the cell, it is determined that a cell contains only one text area.
  • the center point coordinates are the coordinates of the center point of the text area.
  • the coordinates of the center point include the abscissa coordinate of the center point and the ordinate coordinate of the center point. This is because in step 102, if the text area covers multiple cells, the multiple cells covered by the text area have been merged. The text area can only be located in one cell. Therefore, only the center point coordinates of the text area are used. , you can determine the cell where the text area is located.
  • adding the regional text content in the text area contained in a cell to a cell may include: setting the attribute value of the text attribute of a cell to the text area contained in the cell. The text content of the area within.
  • determining that a cell contains at least two text areas based on area location information may include: if it is determined that the number of text areas is multiple, determining each text area based on the area location information of each text area. The coordinates of the center point of the area. If, according to the cell position information of a cell, it is determined that the center point coordinates of at least two text areas are located in the cell, it is determined that a cell contains at least two text areas.
  • sorting the regional text content in each text area contained in a cell may include: sorting the regions in each text area contained in a cell in ascending order of the ordinate of the center point. Sort the text content; sort the regional text content in each text area with the same central point ordinate in ascending order of the center point's abscissa.
  • adding the sorted regional text content to a cell may include: setting the attribute value of a text attribute of a cell to the sorted regional text content.
  • the text content in each area can be sorted according to the actual application scenario, and there is no restriction here.
  • the target table corresponding to the image to be processed can be generated.
  • text recognition technology is used for text recognition to obtain the position and content of each text area in each image to be processed, which reduces the amount of development. Furthermore, the framed table in the image to be processed can be reconstructed, and The frameless table in the image to be processed can be reconstructed, which improves the accuracy of table reconstruction, and it can accurately identify merged cells and the situation where the same cell contains text content in multiple areas, further improving the accuracy of table reconstruction.
  • FIG. 2 is an example of a user attribute table image.
  • Figure 2 shows a user attribute table image containing multiple user attribute information.
  • the user attribute table image is an image to be processed that requires table reconstruction.
  • Figure 3 which is a specific flow chart of a method for reconstructing a user attribute table. The method shown in Figure 3 is used to reconstruct the user attribute table in the user attribute table image shown in Figure 2.
  • the specific implementation process of this method as follows:
  • Step 300 Perform text recognition on the user attribute table image, and obtain the text area recognition result of the user attribute table image.
  • OCR technology is used to perform text detection and text recognition on the user attribute table image shown in Figure 2, and the regional text content and regional location information of 34 text areas are obtained.
  • the area position information includes the vertex coordinates of each area of the text area, that is, the vertex coordinates of the first area, the vertex coordinates of the second area, the vertex coordinates of the third area, and the vertex coordinates of the fourth area.
  • the output format of the identified regional text content and the regional location information of each regional text content is ⁇ 'content':'regional text content','location':[first region vertex coordinates, second Area vertex coordinates, third area vertex coordinates, fourth area vertex coordinates] ⁇ .
  • the text area recognition results of the user attribute table image in Figure 2 are:
  • Step 301 Determine the maximum ordinate and the minimum ordinate among the ordinates of the vertices of each region in the text area recognition result.
  • Step 302 Determine the maximum abscissa and the minimum abscissa of the abscissas of the vertices of each region in the text area recognition result.
  • Step 303 Determine the number of first regions for each ordinate and the number of second regions for each abscissa according to the region position information in the text region recognition result.
  • the target ordinate in [table_bottom, table_top] ie [21, 268]
  • the target ordinate is any ordinate in [table_bottom, table_top]
  • determine the target ordinate line target ordinate line everyone on the table sits down
  • the ordinate of the punctuation point is the number of text areas passed through by the target ordinate)
  • the first area number of the target ordinate is obtained.
  • the target abscissa in [table_left, table_right] i.e.
  • the target abscissa is any abscissa in [table_left, table_right]
  • determine the target abscissa line each point on the target abscissa line
  • the abscissas of the coordinate points are the number of text areas passed through by the target abscissa line), and the second area number of the target abscissa line is obtained.
  • Step 304 Determine the coordinates of each table row of the target table based on the maximum ordinate, the minimum ordinate, and the number of first areas.
  • 21 and 268 are determined as table row coordinates, and based on the number of first areas in each ordinate, the first curve shown in Figure 4 is generated, and through the first curve in Figure 4, the The coordinates of multiple table rows are [67, 119, 172, 223, 259].
  • each ordinate may also be discontinuous (the ordinate is usually obtained by sampling), which is not limited here.
  • Step 305 Determine the coordinates of each table column based on the maximum abscissa, the minimum abscissa, and the number of second areas.
  • FIG. 5 is an example of the second curve.
  • 37 and 499 are determined as the abscissa of the table, and based on the number of the second areas of each abscissa, the second curve shown in Figure 5 is generated, and through the second curve in Figure 5, the number of The abscissa coordinates of each table are [139, 325, 456, 621] in order.
  • each abscissa may also be discontinuous (the abscissa is usually obtained by sampling), which is not limited here.
  • Step 306 Generate a blank table based on the row coordinates of each table and the coordinates of each table column.
  • Step 307 According to the area location information, add the area text content in the text area recognition result to the blank form to obtain the target form.
  • FIG. 6 is an example of merging table images.
  • the merged table image is an image to be processed that requires table reconstruction.
  • FIG 7 which is a specific flow chart of a method for reconstructing a merged table. The method shown in Figure 7 is used to reconstruct the merged table in the merged table image shown in Figure 6.
  • the specific implementation process of this method is as follows:
  • Step 700 Perform text recognition on the merged table image to obtain the text area recognition result of the user attribute table image.
  • the area position information includes the vertex coordinates of each area of the text area, that is, the vertex coordinates of the first area, the vertex coordinates of the second area, the vertex coordinates of the third area, and the vertex coordinates of the fourth area.
  • the output format of the identified regional text content and the regional location information of each regional text content is ⁇ 'content':'regional text content','location':[first region vertex coordinates, second Area vertex coordinates, third area vertex coordinates, fourth area vertex coordinates] ⁇ .
  • the text area recognition results of the merged table image in Figure 6 are:
  • Step 701 Determine the maximum ordinate and the minimum ordinate among the ordinates of the vertices of each region in the text area recognition result.
  • Step 702 Determine the maximum abscissa and the minimum abscissa of the abscissas of the vertices of each region in the text area recognition result.
  • Step 703 Determine the number of first regions for each ordinate and the number of second regions for each abscissa according to the region position information in the text region recognition result.
  • Step 704 Determine the coordinates of each table row of the target table based on the maximum ordinate, the minimum ordinate, and the number of first areas.
  • FIG. 8 is only used to illustrate the corresponding relationship between each ordinate and the number of first regions.
  • 84 and 250 are determined as table row coordinates, and based on the number of first areas in each ordinate, the first curve shown in Figure 8 is generated, and through the first curve in Figure 8, the The coordinates of multiple table rows are [137,195].
  • Step 705 Determine the coordinates of each table column based on the maximum abscissa, the minimum abscissa, and the number of second areas.
  • FIG. 9 is only used to illustrate the corresponding relationship between each abscissa and the number of second regions.
  • 213 and 728 are determined as the abscissas of the table, and based on the number of the second areas of each abscissa, the second curve shown in Figure 9 is generated, and through the second curve in Figure 9, the number of The abscissas of the tables are [437,586] in sequence.
  • Step 706 Generate a blank table based on the row coordinates of each table and the coordinates of each table column.
  • Step 707 According to the region position information, add the regional text content in the text region recognition result to the blank table to obtain the target table.
  • the embodiment of the present application also provides a device for table reconstruction. Since the principle of solving the problem of the above device and equipment is similar to a method for table reconstruction, the implementation of the above device can be referred to the implementation of the method. The repetitive parts will not be repeated.
  • FIG. 10 it is a schematic structural diagram of a table reconstruction device provided by an embodiment of the present application, including:
  • the recognition unit 1001 is used to perform text recognition on the image to be processed, and obtain the text area recognition result of the image to be processed.
  • the text area recognition result includes the regional text content and regional location information of the text area;
  • the determination unit 1002 is used to determine the table row coordinates and the table column coordinates of the target table according to the regional location information
  • the generation unit 1003 is used to generate a blank table based on the row coordinates of each table and the coordinates of each table column;
  • the obtaining unit 1004 is used to add the regional text content to the blank table according to the region location information to obtain the target table.
  • the area location information includes the area vertex coordinates of the text area
  • the identification unit 1001 is used to: perform text detection on the image to be processed, and obtain multiple area vertex coordinates of the text area, where the area vertex coordinates are the coordinates of the vertices of the text area. ; Perform text recognition on the text area and obtain the text content of the area.
  • the regional vertex coordinates include the regional vertex abscissa and the regional vertex ordinate.
  • the determining unit 1002 is used to: determine the maximum ordinate and the minimum ordinate in the ordinate of each regional vertex; determine the maximum ordinate in the abscissa of each regional vertex.
  • the maximum abscissa and the minimum abscissa according to the area position information, determine the number of the first area for each ordinate and the number of the second area for each abscissa.
  • the number of the first area is the number of text areas containing a certain ordinate.
  • the number of the second area is the number of text areas containing a certain abscissa; determine the coordinates of each table row based on the maximum ordinate, the minimum ordinate, and the number of the first area; determine the coordinates of each table row based on the maximum abscissa, the minimum abscissa, and the second area Quantity, determine the coordinates of each table column.
  • the determining unit 1002 is configured to determine the trough ordinate based on each ordinate and its corresponding number of first areas.
  • the number of first areas in the trough ordinate is not higher than the number of adjacent ordinates in the trough ordinate.
  • the number of the first area, the adjacent ordinates of the trough ordinate are the previous ordinate and the next ordinate of the trough ordinate; according to the maximum ordinate, the minimum ordinate, and the trough ordinate, the coordinates of each table row are obtained.
  • the determining unit 1002 is configured to: determine the trough abscissa according to each abscissa and its corresponding number of second areas.
  • the number of the second areas of the trough abscissa is not higher than the number of adjacent abscissas of the trough abscissa.
  • the second area quantity, the adjacent abscissa of the trough abscissa is the previous abscissa and the next abscissa of the trough; according to the maximum abscissa, the minimum abscissa, and the trough abscissa, the coordinates of each table column are obtained.
  • the generation unit 1003 is also used to: determine the cell position information of the cells in the blank table according to each table row coordinate and each table column coordinate; determine the text area according to the area position information and the cell position information.
  • the covered target cells where there are coordinate points in the text area that are within the target cells and do not coincide with the boundaries of the target cells; if it is determined that there are multiple target cells covered by the text area, the target cells will be merged.
  • the obtaining unit 1004 is used to: perform the following steps for each cell in the blank table: if it is determined that a cell contains only one text area according to the area position information, then the The regional text content in the text area is added to a cell; if it is determined that a cell contains at least two text areas according to the area position information, then the areas in each text area contained in a cell are added according to the area position information. Sort the text content and add the sorted range text content to a cell.
  • the obtaining unit 1004 is used to: determine the center point coordinates of the text area based on the area position information, and the center point coordinates are the coordinates of the center point of the text area; if based on the cell position information of a cell, determine only If the center point coordinate of a text area is located in the cell, it is determined that a cell contains only one text area.
  • the obtaining unit 1004 is used to: set the attribute value of the text attribute of a cell to the regional text content in the text area contained in the cell.
  • the obtaining unit 1004 is configured to: if it is determined that the number of text areas is multiple, determine the center point coordinates of each text area according to the area position information of each text area, and the center point coordinates are The coordinates of the center point; if based on the cell position information of a cell, it is determined that the center point coordinates of at least two text areas are located in the cell, then it is determined that a cell contains at least two text areas.
  • the center point coordinates include the center point abscissa and the center point ordinate.
  • the obtaining unit 1004 is used to: according to the descending order of the center point ordinate, the areas within each text area contained in a cell are Sort the text content; sort the regional text content in each text area with the same central point ordinate in ascending order of the center point's abscissa.
  • the obtaining unit 1004 is used to set the attribute value of the text attribute of a cell to the sorted regional text content.
  • Figure 11 shows a schematic structural diagram of an electronic device 1100.
  • the electronic device 1100 includes a processor 1110 and a memory 1120 .
  • it may also include a power supply 1130 , a display unit 1140 , and an input unit 1150 .
  • the processor 1110 is the control center of the electronic device 1100. It uses various interfaces and lines to connect various components, and executes various functions of the electronic device 1100 by running or executing software programs and/or data stored in the memory 1120, thereby controlling the electronic device 1100. Device 1100 performs overall monitoring.
  • the processor 1110 executes each step in the above embodiment when calling the computer program stored in the memory 1120.
  • the processor 1110 may include one or more processing units; preferably, the processor 1110 may integrate an application processor and a modem processor, where the application processor mainly processes operating systems, user interfaces, applications, etc., The modem processor primarily handles wireless communications. It can be understood that the above modem processor may not be integrated into the processor 1110.
  • the processor and memory can be implemented on a single chip, and in some embodiments, they can also be implemented on separate chips.
  • the memory 1120 may mainly include a program storage area and a data storage area, where the program storage area may store operating systems, various applications, etc.; the storage data area may store data created according to the use of the electronic device 1100 , etc.
  • the memory 1120 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
  • the electronic device 1100 also includes a power supply 1130 (such as a battery) that supplies power to various components.
  • the power supply can be logically connected to the processor 1110 through a power management system, thereby managing functions such as charging, discharging, and power consumption through the power management system.
  • the display unit 1140 may be used to display information input by the user or information provided to the user, as well as various menus of the electronic device 1100, etc. In the embodiment of the present invention, it is mainly used to display the display interface of each application in the electronic device 1100 and the display interface. text, pictures and other objects.
  • the display unit 1140 may include a display panel 1141.
  • the display panel 1141 can be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), etc.
  • the input unit 1150 may be used to receive information such as numbers or characters input by the user.
  • the input unit 1150 may include a touch panel 1151 and other input devices 1152.
  • the touch panel 1151 also called a touch screen, can collect the user's touch operations on or near it (for example, the user uses any suitable object or accessory such as a finger, a touch pen, etc. on or near the touch panel 1151. nearby operations).
  • the touch panel 1151 can detect the user's touch operation and detect the signals brought by the touch operation, convert these signals into contact point coordinates, send them to the processor 1110, and receive and execute the commands sent by the processor 1110. .
  • the touch panel 1151 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave.
  • Other input devices 1152 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, power on/off keys, etc.), trackball, mouse, joystick, etc.
  • the touch panel 1151 can cover the display panel 1141.
  • the touch panel 1151 detects a touch operation on or near it, it is sent to the processor 1110 to determine the type of the touch event, and then the processor 1110 determines the type of the touch event according to the type of the touch event.
  • Corresponding visual output is provided on display panel 1141.
  • the touch panel 1151 and the display panel 1141 are used as two independent components to implement the input and output functions of the electronic device 1100, in some implementations
  • the touch panel 1151 and the display panel 1141 can be integrated to implement the input and output functions of the electronic device 1100 .
  • the electronic device 1100 may also include one or more sensors, such as a pressure sensor, a gravity acceleration sensor, a proximity light sensor, and the like. Of course, according to the needs of specific applications, the above-mentioned electronic device 1100 may also include other components such as cameras. Since these components are not the key components used in the embodiments of this application, they are not shown in Figure 11 and will not be described in detail. .
  • FIG. 11 is only an example of an electronic device and does not constitute a limitation on the electronic device. It may include more or fewer components than shown in the figure, or some components may be combined, or different components may be used.
  • a computer-readable storage medium has a computer program stored thereon.
  • the communication device can perform each step in the above embodiment.
  • each of the above parts is divided into modules (or units) according to their functions and described separately.
  • the functions of each module (or unit) can be implemented in the same or multiple software or hardware.
  • embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment that combines software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
  • computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions
  • the device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
  • These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device.
  • Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.

Abstract

The present application belongs to the technical field of data processing. Disclosed are a table reconstruction method and an electronic device. The method comprises: performing text recognition on an image to be processed, so as to obtain a text area recognition result of said image, wherein the text area recognition result includes area text content and area position information of a text area; according to the area position information, determining each table row coordinate and each table column coordinate of a target table; generating a blank table according to each table row coordinate and each table column coordinate; and according to the area position information, adding the area text content into the blank table, so as to obtain the target table. In this way, a framed table or a frameless table in an image to be processed can be reconstructed, thereby improving the accuracy and application range of table reconstruction.

Description

一种表格重建的方法及电子设备A table reconstruction method and electronic device
相关申请的交叉引用Cross-references to related applications
本申请要求在2022年05月13日提交中国专利局、申请号为202210523453.7、申请名称为“一种表格重建的方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application submitted to the China Patent Office on May 13, 2022, with application number 202210523453.7 and application title "A method and electronic device for table reconstruction", the entire content of which is incorporated herein by reference. Applying.
技术领域Technical field
本申请涉及数据处理技术领域,具体而言,涉及一种表格重建的方法及电子设备。The present application relates to the field of data processing technology, specifically, to a table reconstruction method and electronic equipment.
背景技术Background technique
随着信息化技术的发展,信息无纸化办公的普及,人们对数据处理的便捷性要求越来越高。在一些办公场景中,通常需要将表格图像进行表格识别以及表格重建,以获得重建后的表格。With the development of information technology and the popularization of paperless information office, people have higher and higher requirements for the convenience of data processing. In some office scenarios, it is usually necessary to perform table recognition and table reconstruction on table images to obtain reconstructed tables.
现有技术下,通常是采用膨胀腐蚀等图像处理操作,确定表格图像中的线条,并根据各线条以及各线条的交点坐标,重建表格。Under the existing technology, image processing operations such as dilation and corrosion are usually used to determine the lines in the table image, and the table is reconstructed based on the coordinates of each line and the intersection point of each line.
但是,若表格图像中的表格包含无边框的单元格或者边框不明显的单元格,则采用这种方式,重建的表格存在一定的偏差。However, if the table in the table image contains borderless cells or cells with unclear borders, there will be a certain deviation in the reconstructed table using this method.
发明内容Contents of the invention
本申请实施例的目的在于提供一种表格重建的方法及电子设备,用以在重建表格图像中的表格时,减少重建的表格的偏差。The purpose of the embodiments of the present application is to provide a table reconstruction method and electronic device, so as to reduce the deviation of the reconstructed table when reconstructing the table in the table image.
一方面,提供一种表格重建的方法,包括:On the one hand, a method for table reconstruction is provided, including:
对待处理图像进行文本识别,获得待处理图像的文本区域识别结果,文本区域识别结果中包含文本区域的区域文本内容以及区域位置信息;Perform text recognition on the image to be processed, and obtain the text area recognition result of the image to be processed. The text area recognition result contains the regional text content and regional location information of the text area;
根据区域位置信息,确定目标表格的各个表格行坐标以及各个表格列坐标;According to the regional location information, determine the row coordinates of each table and the coordinates of each table column of the target table;
根据各个表格行坐标以及各个表格列坐标,生成空白表格;Generate a blank table based on the row coordinates of each table and the coordinates of each table column;
根据区域位置信息,将区域文本内容添加到空白表格中,获得目标表格。According to the regional location information, add the regional text content to the blank table to obtain the target table.
在上述实现过程中,通过待处理图像中识别出的各文本区域的区域文本内容以及区域位置信息,重建表格,可以重建待处理图像中的有框表格,也可以重建待处理图像中的无框表格,提高了表格重建的准确率。In the above implementation process, the table is reconstructed through the regional text content and regional position information of each text area identified in the image to be processed. The framed table in the image to be processed can also be reconstructed without a frame in the image to be processed. table, improving the accuracy of table reconstruction.
一种实施方式中,区域位置信息包括文本区域的区域顶点坐标,对待处理图像进行文本识别,获得待处理图像的文本区域识别结果,包括:对待处理图像进行文本检测,获得文本区域的多个区域顶点坐标,区域顶点坐标为文本区域的顶点的坐标;对文本区域进行文本识别,获得区域文本内容。In one embodiment, the area position information includes the area vertex coordinates of the text area. Performing text recognition on the image to be processed and obtaining the text area recognition result of the image to be processed includes: performing text detection on the image to be processed and obtaining multiple areas of the text area. Vertex coordinates, the area vertex coordinates are the coordinates of the vertices of the text area; perform text recognition on the text area to obtain the area text content.
在上述实现过程中,对待处理图进行文本识别,确定文本区域中的各区域顶点坐标以及区域文本内容,从而可以准确识别出各文本区域的位置以及内容。In the above implementation process, text recognition is performed on the graph to be processed, and the vertex coordinates of each area in the text area and the text content of the area are determined, so that the location and content of each text area can be accurately identified.
一种实施方式中,区域顶点坐标包括区域顶点横坐标和区域顶点纵坐标,根据区域位置信息,确定目标表格的各个表格行坐标以及各个表格列坐标,包括:确定各区域顶点纵坐标中的最大纵坐标和最小纵坐标;确定各区域顶点横坐标中的最大横坐标和最小横坐标; 根据区域位置信息,确定各个纵坐标的第一区域数量和各个横坐标的第二区域数量,第一区域数量为包含某一纵坐标的文本区域的个数,第二区域数量为包含某一横坐标的文本区域的个数;根据最大纵坐标、最小纵坐标,以及第一区域数量,确定各个表格行坐标;根据最大横坐标、最小横坐标,以及第二区域数量,确定各个表格列坐标。In one implementation, the regional vertex coordinates include the regional vertex abscissa and the regional vertex ordinate. According to the regional position information, determining the table row coordinates and the table column coordinates of the target table includes: determining the maximum ordinate in each region vertex. The ordinate and the minimum ordinate; determine the maximum abscissa and the minimum abscissa in the abscissa of each area vertex; According to the area position information, determine the number of first areas for each ordinate and the number of second areas for each abscissa. The first area number is the number of text areas containing a certain ordinate, and the second area number is the number of text areas containing a certain horizontal coordinate. The number of text areas for coordinates; determine the coordinates of each table row based on the maximum ordinate, the minimum ordinate, and the number of first areas; determine the coordinates of each table column based on the maximum abscissa, the minimum abscissa, and the number of second areas.
在上述实现过程中,通过各文本区域所在的位置,确定出各表格行坐标和表格列坐标,可以识别出无框表格的行和列,提高了表格重建的准确率。In the above implementation process, the row coordinates and column coordinates of each table are determined through the location of each text area, and the rows and columns of the frameless table can be identified, which improves the accuracy of table reconstruction.
一种实施方式中,根据最大纵坐标、最小纵坐标,以及第一区域数量,确定各个表格行坐标,包括:根据各个纵坐标及其对应的第一区域数量,确定波谷纵坐标,波谷纵坐标的第一区域数量不高于波谷纵坐标的相邻纵坐标的第一区域数量,波谷纵坐标的相邻纵坐标为波谷纵坐标的前一个纵坐标以及后一个纵坐标;根据最大纵坐标、最小纵坐标,以及波谷纵坐标,获得各个表格行坐标。In one implementation, determining the coordinates of each table row based on the maximum ordinate, the minimum ordinate, and the number of first areas includes: determining the trough ordinate and the trough ordinate based on each ordinate and its corresponding number of first areas. The number of first areas is not higher than the number of first areas in the adjacent ordinates of the trough ordinate, and the adjacent ordinates of the trough ordinate are the previous ordinate and the next ordinate of the trough ordinate; according to the maximum ordinate, The minimum vertical coordinate, and the trough vertical coordinate, are used to obtain the coordinates of each table row.
在上述实现过程中,由于表格行坐标所在的横线穿过的文本区域的数量相对较少,因此,根据各纵坐标所在的横线穿过的文本区域的第一区域数量,确定表格行坐标。In the above implementation process, since the number of text areas traversed by the horizontal lines where the table row coordinates are located is relatively small, the table row coordinates are determined based on the number of first areas of the text areas traversed by the horizontal lines where the vertical coordinates are located. .
一种实施方式中,根据最大横坐标、最小横坐标,以及第二区域数量,确定各个表格列坐标,包括:根据各个横坐标及其对应的第二区域数量,确定波谷横坐标,波谷横坐标的第二区域数量不高于波谷横坐标的相邻横坐标的第二区域数量,波谷横坐标的相邻横坐标为波谷横坐标的前一个横坐标以及后一个横坐标;根据最大横坐标、最小横坐标,以及波谷横坐标,获得各个表格列坐标。In one implementation, determining the coordinates of each table column according to the maximum abscissa, the minimum abscissa, and the number of second areas includes: determining the trough abscissa and the trough abscissa according to each abscissa and its corresponding number of second areas. The number of second areas is not higher than the number of second areas of the adjacent abscissa of the wave trough abscissa, and the adjacent abscissas of the wave trough abscissa are the previous abscissa and the next abscissa of the trough abscissa; according to the maximum abscissa, The minimum abscissa and the trough abscissa are used to obtain the coordinates of each table column.
在上述实现过程中,由于表格列坐标所在的竖线穿过的文本区域的数量相对较少,因此,根据各横坐标所在的竖线穿过的文本区域的第二区域数量,确定表格列坐标。In the above implementation process, since the number of text areas that the vertical lines where the table column coordinates are located passes through is relatively small, therefore, the table column coordinates are determined based on the number of second areas of the text areas where the vertical lines where the abscissa coordinates are located pass through. .
一种实施方式中,在根据各个表格行坐标以及各个表格列坐标,生成空白表格之后,方法还包括:根据各个表格行坐标以及各个表格列坐标,确定空白表格中单元格的单元格位置信息;根据区域位置信息,以及单元格位置信息,确定文本区域覆盖的目标单元格;其中,文本区域中存在位于目标单元格内且不与目标单元格的边界重合的坐标点;若确定文本区域覆盖的目标单元格为多个,则将目标单元格合并。In one embodiment, after generating a blank table based on each table row coordinate and each table column coordinate, the method further includes: determining the cell position information of the cells in the blank table based on each table row coordinate and each table column coordinate; According to the area position information and cell position information, determine the target cell covered by the text area; among them, there are coordinate points in the text area that are located in the target cell and do not coincide with the boundary of the target cell; if it is determined that the text area covers If there are multiple target cells, merge the target cells.
在上述实现过程中,根据单元格所在的区域,以及文本区域所在的区域,将文本区域所覆盖的多个目标单元格合并,从而解决了如何设置表格中存在的合并单元格的问题。In the above implementation process, multiple target cells covered by the text area are merged according to the area where the cell is located and the area where the text area is located, thereby solving the problem of how to set merged cells that exist in the table.
一种实施方式中,根据区域位置信息,将区域文本内容添加到空白表格中,获得目标表格,包括:分别针对空白表格中的每一单元格,执行以下步骤:若根据区域位置信息,确定一个单元格仅包含一个文本区域,则将一个单元格包含的文本区域内的区域文本内容,添加到一个单元格内;若根据区域位置信息,确定一个单元格包含至少两个文本区域,则按照区域位置信息,将一个单元格包含的各文本区域内的区域文本内容进行排序,并将排序后的区域文本内容添加到一个单元格内。In one implementation, adding the regional text content to the blank table according to the regional location information to obtain the target table includes: performing the following steps for each cell in the blank table: if based on the regional location information, determine a If the cell only contains one text area, then the area text content in the text area contained in a cell is added to a cell; if it is determined based on the area position information that a cell contains at least two text areas, then the area text content is added according to the area position information. Position information, sort the regional text content in each text area contained in a cell, and add the sorted regional text content to a cell.
在上述实现过程中,先将同一单元格内的多个文本区域的区域文本内容进行排序后,再将排序后的区域文本内容添加到单元格内,从而解决了如何向同一单元格添加多个文本区域的区域文本内容的问题。In the above implementation process, the regional text content of multiple text areas in the same cell is first sorted, and then the sorted regional text content is added to the cell, thus solving how to add multiple text areas to the same cell. Issues with area text content of text areas.
一种实施方式中,若根据区域位置信息,确定一个单元格仅包含一个文本区域,包括:根据区域位置信息,确定文本区域的中心点坐标,中心点坐标为文本区域的中心点的坐标;若根据一个单元格的单元格位置信息,确定仅有一个文本区域的中心点坐标位于单元格内,则确定一个单元格仅包含一个文本区域。 In one embodiment, determining that a cell contains only one text area based on the area location information includes: determining the center point coordinates of the text area based on the area location information, and the center point coordinates are the coordinates of the center point of the text area; if According to the cell position information of a cell, it is determined that the center point coordinate of only one text area is located in the cell, then it is determined that a cell contains only one text area.
在上述实现过程中,根据文本区域的中心点坐标,以及单元格所在的区域,可以快速确定单元格中包含的文本区域。In the above implementation process, the text area contained in the cell can be quickly determined based on the coordinates of the center point of the text area and the area where the cell is located.
一种实施方式中,将一个单元格包含的文本区域内的区域文本内容,添加到一个单元格内,包括:将一个单元格的文本属性的属性值,设置为一个单元格包含的文本区域内的区域文本内容。In one implementation, adding the regional text content in the text area contained in a cell to a cell includes: setting the attribute value of the text attribute of a cell to the text area contained in the cell. The regional text content.
在上述实现过程中,通过设置文本属性,可以在单元格内添加区域文本内容。In the above implementation process, by setting the text attribute, you can add regional text content within the cell.
一种实施方式中,根据区域位置信息,确定一个单元格包含至少两个文本区域,包括:若确定文本区域的数量为多个,则根据各文本区域的区域位置信息,分别确定每一文本区域的中心点坐标,中心点坐标为文本区域的中心点的坐标;若根据一个单元格的单元格位置信息,确定存在至少两个文本区域的中心点坐标位于单元格内,则确定一个单元格包含至少两个文本区域。In one implementation, determining that a cell contains at least two text areas according to the area position information includes: if it is determined that the number of text areas is multiple, determining each text area separately according to the area position information of each text area. The center point coordinate of At least two text areas.
在上述实现过程中,根据文本区域的中心点坐标,以及单元格所在的区域,可以快速确定单元格中包含的多个文本区域。In the above implementation process, multiple text areas contained in a cell can be quickly determined based on the coordinates of the center point of the text area and the area where the cell is located.
一种实施方式中,中心点坐标包括中心点横坐标和中心点纵坐标,将一个单元格包含的各文本区域内的区域文本内容进行排序,包括:按照中心点纵坐标由大到下的顺序,将一个单元格包含的各文本区域内的区域文本内容进行排序;按照中心点横坐标由小到大的顺序,将中心点纵坐标相同的各文本区域内的区域文本内容再次进行排序。In one implementation, the center point coordinates include the center point abscissa and the center point ordinate. Sorting the regional text content in each text area contained in a cell includes: in descending order of the center point ordinate. , sort the regional text content in each text area contained in a cell; sort the regional text content in each text area with the same central point ordinate in ascending order of the center point abscissa.
在上述实现过程中,根据各文本区域的中心点横坐标和中心点纵坐标,实现对同一单元格内的各文本区域的排序。In the above implementation process, each text area in the same cell is sorted according to the abscissa coordinate and the ordinate coordinate of the center point of each text area.
一种实施方式中,将排序后的区域文本内容添加到一个单元格内,包括:将一个单元格的文本属性的属性值设置为排序后的区域文本内容。In one implementation, adding the sorted regional text content to a cell includes: setting the attribute value of a text attribute of a cell to the sorted regional text content.
在上述实现过程中,通过设置文本属性,可以在单元格内添加区域文本内容。In the above implementation process, by setting the text attribute, you can add regional text content within the cell.
一方面,提供一种表格重建的装置,包括:On the one hand, a table reconstruction device is provided, including:
识别单元,用于对待处理图像进行文本识别,获得待处理图像的文本区域识别结果,文本区域识别结果中包含文本区域的区域文本内容以及区域位置信息;确定单元,用于根据区域位置信息,确定目标表格的各个表格行坐标以及各个表格列坐标;生成单元,用于根据各个表格行坐标以及各个表格列坐标,生成空白表格;获得单元,用于根据区域位置信息,将区域文本内容添加到空白表格中,获得目标表格。The recognition unit is used to perform text recognition on the image to be processed and obtain the text area recognition result of the image to be processed. The text area recognition result contains the regional text content and regional position information of the text area; the determination unit is used to determine based on the regional position information. The row coordinates of each table and the coordinates of each column of the target table; the generating unit is used to generate a blank table based on the row coordinates and column coordinates of each table; the obtaining unit is used to add the regional text content to the blank based on the regional location information form to obtain the target form.
一种实施方式中,区域位置信息包括文本区域的区域顶点坐标,识别单元用于:对待处理图像进行文本检测,获得文本区域的多个区域顶点坐标,区域顶点坐标为文本区域的顶点的坐标;对文本区域进行文本识别,获得区域文本内容。In one embodiment, the regional position information includes the regional vertex coordinates of the text area, and the recognition unit is used to: perform text detection on the image to be processed, and obtain multiple regional vertex coordinates of the text area, where the regional vertex coordinates are the coordinates of the vertices of the text area; Perform text recognition on the text area to obtain the text content of the area.
一种实施方式中,区域顶点坐标包括区域顶点横坐标和区域顶点纵坐标,确定单元用于:确定各区域顶点纵坐标中的最大纵坐标和最小纵坐标;确定各区域顶点横坐标中的最大横坐标和最小横坐标;根据区域位置信息,确定各个纵坐标的第一区域数量和各个横坐标的第二区域数量,第一区域数量为包含某一纵坐标的文本区域的个数,第二区域数量为包含某一横坐标的文本区域的个数;根据最大纵坐标、最小纵坐标,以及第一区域数量,确定各个表格行坐标;根据最大横坐标、最小横坐标,以及第二区域数量,确定各个表格列坐标。In one embodiment, the regional vertex coordinates include the regional vertex abscissa and the regional vertex ordinate, and the determination unit is used to: determine the maximum ordinate and the minimum ordinate in the ordinate of each regional vertex; determine the maximum ordinate in the abscissa of each regional vertex. The abscissa and the minimum abscissa; according to the area position information, determine the number of the first area for each ordinate and the number of the second area for each abscissa. The number of the first area is the number of text areas containing a certain ordinate, and the second The number of areas is the number of text areas containing a certain abscissa; determine the coordinates of each table row based on the maximum ordinate, the minimum ordinate, and the number of first areas; determine the coordinates of each table row based on the maximum abscissa, the minimum abscissa, and the number of second areas , determine the coordinates of each table column.
一种实施方式中,确定单元用于:根据各个纵坐标及其对应的第一区域数量,确定波谷纵坐标,波谷纵坐标的第一区域数量不高于波谷纵坐标的相邻纵坐标的第一区域数量, 波谷纵坐标的相邻纵坐标为波谷纵坐标的前一个纵坐标以及后一个纵坐标;根据最大纵坐标、最小纵坐标,以及波谷纵坐标,获得各个表格行坐标。In one embodiment, the determining unit is configured to: determine the trough ordinate based on each ordinate and its corresponding number of first areas, and the number of the first areas of the trough ordinate is not higher than the number of adjacent ordinates of the trough ordinate. The number of areas, The adjacent vertical coordinates of the trough vertical coordinate are the previous ordinate and the next ordinate of the trough vertical coordinate; according to the maximum ordinate, the minimum ordinate, and the trough vertical coordinate, the coordinates of each table row are obtained.
一种实施方式中,确定单元用于:根据各个横坐标及其对应的第二区域数量,确定波谷横坐标,波谷横坐标的第二区域数量不高于波谷横坐标的相邻横坐标的第二区域数量,波谷横坐标的相邻横坐标为波谷横坐标的前一个横坐标以及后一个横坐标;根据最大横坐标、最小横坐标,以及波谷横坐标,获得各个表格列坐标。In one embodiment, the determination unit is configured to: determine the trough abscissa according to each abscissa and its corresponding number of second areas, and the number of the second areas of the trough abscissa is not higher than the number of adjacent abscissas of the trough abscissa. Second, the number of areas. The adjacent abscissas of the trough abscissa are the previous abscissa and the next abscissa of the trough. According to the maximum abscissa, the minimum abscissa, and the trough abscissa, the coordinates of each table column are obtained.
一种实施方式中,生成单元还用于:根据各个表格行坐标以及各个表格列坐标,确定空白表格中单元格的单元格位置信息;根据区域位置信息,以及单元格位置信息,确定文本区域覆盖的目标单元格;其中,文本区域中存在位于目标单元格内且不与目标单元格的边界重合的坐标点;若确定文本区域覆盖的目标单元格为多个,则将目标单元格合并。In one implementation, the generation unit is also used to: determine the cell position information of the cells in the blank table based on each table row coordinate and each table column coordinate; determine the text area coverage based on the area position information and the cell position information. The target cell; among them, there are coordinate points in the text area that are located in the target cell and do not coincide with the boundary of the target cell; if it is determined that there are multiple target cells covered by the text area, the target cells will be merged.
一种实施方式中,获得单元用于:分别针对空白表格中的每一单元格,执行以下步骤:若根据区域位置信息,确定一个单元格仅包含一个文本区域,则将一个单元格包含的文本区域内的区域文本内容,添加到一个单元格内;若根据区域位置信息,确定一个单元格包含至少两个文本区域,则按照区域位置信息,将一个单元格包含的各文本区域内的区域文本内容进行排序,并将排序后的区域文本内容添加到一个单元格内。In one implementation, the unit is obtained by: performing the following steps for each cell in the blank table: if it is determined that a cell contains only one text area based on the area position information, then the text contained in a cell is The regional text content in the area is added to a cell; if it is determined that a cell contains at least two text areas according to the area position information, the area text in each text area contained in a cell is added according to the area position information. Sort the content and add the sorted range text content to a cell.
一种实施方式中,获得单元用于:根据区域位置信息,确定文本区域的中心点坐标,中心点坐标为文本区域的中心点的坐标;若根据一个单元格的单元格位置信息,确定仅有一个文本区域的中心点坐标位于单元格内,则确定一个单元格仅包含一个文本区域。In one implementation, the obtaining unit is used to: determine the center point coordinates of the text area based on the area position information, and the center point coordinates are the coordinates of the center point of the text area; if based on the cell position information of a cell, determine only If the center point coordinates of a text area are located within the cell, it is determined that a cell contains only one text area.
一种实施方式中,获得单元用于:将一个单元格的文本属性的属性值,设置为一个单元格包含的文本区域内的区域文本内容。In one implementation, the obtaining unit is used to: set the attribute value of the text attribute of a cell to the regional text content in the text area contained in the cell.
一种实施方式中,获得单元用于:若确定文本区域的数量为多个,则根据各文本区域的区域位置信息,分别确定每一文本区域的中心点坐标,中心点坐标为文本区域的中心点的坐标;若根据一个单元格的单元格位置信息,确定存在至少两个文本区域的中心点坐标位于单元格内,则确定一个单元格包含至少两个文本区域。In one implementation, the obtaining unit is configured to: if it is determined that the number of text areas is multiple, determine the center point coordinates of each text area according to the area position information of each text area, and the center point coordinates are the center of the text area. The coordinates of the point; if based on the cell position information of a cell, it is determined that the center point coordinates of at least two text areas are located in the cell, then it is determined that a cell contains at least two text areas.
一种实施方式中,中心点坐标包括中心点横坐标和中心点纵坐标,获得单元用于:按照中心点纵坐标由大到下的顺序,将一个单元格包含的各文本区域内的区域文本内容进行排序;按照中心点横坐标由小到大的顺序,将中心点纵坐标相同的各文本区域内的区域文本内容再次进行排序。In one implementation, the center point coordinates include the center point abscissa and the center point ordinate, and the obtaining unit is used to: according to the descending order of the center point ordinate, the regional text in each text area contained in a cell is Sort the content; sort the regional text content in each text area with the same central point ordinate in ascending order of the center point's abscissa.
一种实施方式中,获得单元用于:将一个单元格的文本属性的属性值设置为排序后的区域文本内容。In one implementation, the obtaining unit is used to: set the attribute value of the text attribute of a cell to the sorted regional text content.
一方面,提供了一种电子设备,包括处理器以及存储器,存储器存储有计算机可读取指令,当计算机可读取指令由处理器执行时,运行如上述任一种表格重建的各种可选实现方式中提供的方法的步骤。On the one hand, an electronic device is provided, including a processor and a memory. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, various optional table reconstruction methods such as those mentioned above are executed. Implement the steps for the method provided in How.
一方面,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时运行如上述任一种表格重建的各种可选实现方式中提供的方法的步骤。In one aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method provided in any of the above optional implementations of table reconstruction are executed.
一方面,提供了一种计算机程序产品,计算机程序产品在计算机上运行时,使得计算机执行如上述任一种表格重建的各种可选实现方式中提供的方法的步骤。On the one hand, a computer program product is provided. When the computer program product is run on a computer, it causes the computer to perform the steps of the method provided in any of the above optional implementations of table reconstruction.
本申请的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本申请而了解。本申请的目的和其他优点可通过在所写的说明书、权利要求书、以及附图中所特别指出的结构来实现和获得。 Additional features and advantages of the application will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
附图说明Description of drawings
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例中所需要使用的附图作简单地介绍,应当理解,以下附图仅示出了本申请的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required to be used in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present application, therefore This should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without exerting creative efforts.
图1为本申请实施例提供的一种表格重建的方法的流程图;Figure 1 is a flow chart of a table reconstruction method provided by an embodiment of the present application;
图2为本申请实施例提供的一种用户属性表格图像的示例图;Figure 2 is an example diagram of a user attribute table image provided by an embodiment of the present application;
图3为本申请实施例提供的一种用户属性表格重建的方法的具体流程图;Figure 3 is a specific flow chart of a method for reconstructing a user attribute table provided by an embodiment of the present application;
图4为本申请实施例提供的一种第一曲线的示例图一;Figure 4 is an example diagram 1 of a first curve provided by the embodiment of the present application;
图5为本申请实施例提供的一种第二曲线的示例图一;Figure 5 is an example diagram 1 of a second curve provided by the embodiment of the present application;
图6为本申请实施例提供的一种合并表格图像的示例图;Figure 6 is an example diagram of merging table images provided by the embodiment of the present application;
图7为本申请实施例提供的一种合并表格重建的方法的具体流程图;Figure 7 is a specific flow chart of a method for merging table reconstruction provided by an embodiment of the present application;
图8为本申请实施例提供的一种第一曲线的示例图二;Figure 8 is an example of Figure 2 of a first curve provided by the embodiment of the present application;
图9为本申请实施例提供的一种第二曲线的示例图二;Figure 9 is an example of Figure 2 of a second curve provided by the embodiment of the present application;
图10为本申请实施例提供的一种表格重建的装置的结构框图;Figure 10 is a structural block diagram of a table reconstruction device provided by an embodiment of the present application;
图11为本申请实施方式中一种电子设备的结构示意图。Figure 11 is a schematic structural diagram of an electronic device in an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本申请实施例的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供的本申请的实施例的详细描述并非旨在限制要求保护的本申请的范围,而是仅仅表示本申请的选定实施例。基于本申请的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and illustrated in the figures herein may be arranged and designed in a variety of different configurations. Accordingly, the following detailed description of the embodiments of the application provided in the appended drawings is not intended to limit the scope of the claimed application, but rather to represent selected embodiments of the application. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without any creative work shall fall within the scope of protection of this application.
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。同时,在本申请的描述中,术语“第一”、“第二”等仅用于区分描述,而不能理解为指示或暗示相对重要性。It should be noted that similar reference numerals and letters represent similar items in the following figures, therefore, once an item is defined in one figure, it does not need further definition and explanation in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", etc. are only used to differentiate the description and cannot be understood as indicating or implying relative importance.
首先对本申请实施例中涉及的部分用语进行说明,以便于本领域技术人员理解。First, some terms involved in the embodiments of this application will be described to facilitate understanding by those skilled in the art.
终端设备:可以是移动终端、固定终端或便携式终端,例如移动手机、站点、单元、设备、多媒体计算机、多媒体平板、互联网节点、通信器、台式计算机、膝上型计算机、笔记本计算机、上网本计算机、平板计算机、个人通信系统设备、个人导航设备、个人数字助理、音频/视频播放器、数码相机/摄像机、定位设备、电视接收器、无线电广播接收器、电子书设备、游戏设备或者其任意组合,包括这些设备的配件和外设或者其任意组合。还可预见到的是,终端设备能够支持任意类型的针对用户的接口(例如可穿戴设备)等。Terminal device: It can be a mobile terminal, a fixed terminal or a portable terminal, such as a mobile phone, a site, a unit, a device, a multimedia computer, a multimedia tablet, an Internet node, a communicator, a desktop computer, a laptop computer, a notebook computer, a netbook computer, Tablet computers, personal communication system devices, personal navigation devices, personal digital assistants, audio/video players, digital cameras/camcorders, positioning devices, television receivers, radio broadcast receivers, e-book devices, gaming devices, or any combination thereof, Includes accessories and peripherals for these devices or any combination thereof. It is also foreseeable that the terminal device can support any type of user-oriented interface (such as wearable devices), etc.
服务器:可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务以及大数据和人工智能平台等基础云计算服务的云服务器。Server: It can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, Cloud servers for middleware services, domain name services, security services, and basic cloud computing services such as big data and artificial intelligence platforms.
光学字符识别(Optical Character Recognition,OCR):是指电子设备检查纸上打印的字符,通过检测暗、亮的模式确定其形状,然后用字符识别方法将形状翻译成计算机文字 的过程。Optical Character Recognition (OCR): refers to electronic equipment checking characters printed on paper, determining their shape by detecting dark and light patterns, and then using character recognition methods to translate the shape into computer text the process of.
为了在重建表格图像中的表格时,可以减少重建的表格的偏差。本申请实施例提供了一种表格重建的方法及电子设备。In order to reduce the deviation of the reconstructed table when reconstructing the table in the table image. Embodiments of the present application provide a table reconstruction method and electronic device.
本申请实施例中,执行主体为电子设备,可选的,电子设备可以为服务器,也可以为终端设备。In this embodiment of the present application, the execution subject is an electronic device. Optionally, the electronic device may be a server or a terminal device.
参阅图1所示,为本申请实施例提供的一种表格重建的方法的流程图,该方法的具体实施流程如下:Refer to Figure 1, which is a flow chart of a table reconstruction method provided by an embodiment of the present application. The specific implementation process of the method is as follows:
步骤100:对待处理图像进行文本识别,获得待处理图像的文本区域识别结果。Step 100: Perform text recognition on the image to be processed, and obtain the text area recognition result of the image to be processed.
具体的,执行步骤100时,可以采用以下步骤:Specifically, when performing step 100, the following steps can be adopted:
S1001:对待处理图像进行文本检测,获得文本区域的多个区域顶点坐标。S1001: Perform text detection on the image to be processed and obtain multiple area vertex coordinates of the text area.
一种实施方式中,文本区域为矩形,则对待处理图像进行文本检测,获得一个或多个矩形的文本区域的区域顶点坐标。In one implementation, if the text area is a rectangle, text detection is performed on the image to be processed to obtain the regional vertex coordinates of one or more rectangular text areas.
需要说明的是,区域顶点坐标为文本区域的顶点的坐标。区域顶点坐标包括区域顶点横坐标和区域顶点纵坐标。由于文本区域为矩形,因此,每一文本区域的区域顶点坐标的数量为4个。It should be noted that the coordinates of the area vertices are the coordinates of the vertices of the text area. The coordinates of the regional vertex include the horizontal coordinate of the regional vertex and the vertical coordinate of the regional vertex. Since the text area is a rectangle, the number of area vertex coordinates of each text area is 4.
实际应用中,文本区域也可以为其它形状,如,四边形,在此不作限制。In actual applications, the text area can also be in other shapes, such as a quadrilateral, which is not limited here.
S1002:对文本区域进行文本识别,获得区域文本内容。S1002: Perform text recognition on the text area and obtain the text content of the area.
一种实施方式中,采用OCR技术,对文本区域进行文本识别,获得文本区域中的区域文本内容。In one implementation, OCR technology is used to perform text recognition on the text area to obtain regional text content in the text area.
其中,区域文本内容为文本区域内识别出的信息。区域文本内容可以包括以下至少一种:文字、公式以及日期。Among them, the regional text content is the information recognized in the text area. Regional text content can include at least one of the following: text, formulas, and dates.
实际应用中,区域文本内容也可以为其它类型的信息,在此不作限制。In actual applications, the regional text content can also be other types of information, which is not limited here.
S1003:基于文本区域的区域顶点坐标以及区域文本内容,获得待处理图像的文本区域识别结果。S1003: Based on the regional vertex coordinates and regional text content of the text area, obtain the text area recognition result of the image to be processed.
其中,文本区域识别结果中包含文本区域的区域文本内容以及区域位置信息。区域位置信息包括文本区域的区域顶点坐标。Among them, the text area recognition result includes the area text content and area location information of the text area. The area position information includes the area vertex coordinates of the text area.
一种实施方式中,将区域顶点坐标作为文本区域识别结果中的区域位置信息。In one implementation, the region vertex coordinates are used as the region position information in the text area recognition result.
步骤101:根据文本区域识别结果中的区域位置信息,确定目标表格的各个表格行坐标以及各个表格列坐标。Step 101: Determine the coordinates of each table row and each table column of the target table based on the area position information in the text area recognition result.
具体的,执行步骤101时,可以采用以下步骤:Specifically, when performing step 101, the following steps can be taken:
S1011:确定各区域顶点纵坐标中的最大纵坐标和最小纵坐标。S1011: Determine the maximum ordinate and the minimum ordinate among the ordinates of the vertices of each region.
一种实施方式中,文本区域为多个,则确定各个文本区域的所有区域顶点纵坐标中的最大纵坐标和最小纵坐标。In one implementation, if there are multiple text areas, then the maximum ordinate and the minimum ordinate among the ordinates of all area vertices of each text area are determined.
S1012:确定各区域顶点横坐标中的最大横坐标和最小横坐标。S1012: Determine the maximum abscissa coordinate and the minimum abscissa coordinate among the vertex abscissas of each area.
一种实施方式中,文本区域为多个,则确定各个文本区域的所有区域顶点横坐标中的最大横坐标和最小横坐标。In one implementation, if there are multiple text areas, then the maximum abscissa and the minimum abscissa of the abscissas of all area vertices of each text area are determined.
这样,就可以通过最大纵坐标、最小纵坐标、最大横坐标和最小横坐标,确定目标表格的边界。In this way, the boundary of the target table can be determined by the maximum ordinate, minimum ordinate, maximum abscissa, and minimum abscissa.
S1013:根据区域位置信息,确定各个纵坐标的第一区域数量和各个横坐标的第二区域数量。 S1013: Determine the number of first regions for each ordinate and the number of second regions for each abscissa according to the region location information.
其中,第一区域数量为包含某一纵坐标的文本区域的个数,第二区域数量为包含某一横坐标的文本区域的个数。需要说明的是,文本区域包含某一纵坐标,是指文本区域中存在坐标点的纵坐标为上述某一纵坐标。文本区域包含某一横坐标,是指文本区域中存在坐标点的横坐标为上述某一横坐标。Among them, the first area quantity is the number of text areas containing a certain vertical coordinate, and the second area quantity is the number of text areas containing a certain abscissa. It should be noted that the text area contains a certain vertical coordinate, which means that the vertical coordinate of the coordinate point in the text area is the above-mentioned certain vertical coordinate. The text area contains a certain abscissa, which means that the abscissa of the coordinate point in the text area is the above-mentioned abscissa.
一种实施方式中,根据文本区域的区域位置信息,确定文本区域的横坐标区间和纵坐标区间,若确定某一纵坐标位于文本区域的纵坐标区间内,则确定文本区域包含该纵坐标,若确定某一横坐标位于文本区域的横坐标区间,则确定文本区域包含该横坐标。In one implementation, the abscissa interval and ordinate interval of the text area are determined based on the regional position information of the text area. If it is determined that a certain ordinate is located within the ordinate interval of the text area, it is determined that the text area contains the ordinate, If it is determined that a certain abscissa is located in the abscissa interval of the text area, then it is determined that the text area contains the abscissa.
作为一个示例,以各文本区域中的任意一个文本区域为例,某一文本区域的横坐标区间是根据该文本区域的4个区域顶点坐标中的横坐标的最大值和最小值确定的,某一文本区域的纵坐标区间是根据该文本区域的4个区域顶点坐标中的纵坐标的最大值和最小值确定的。As an example, taking any text area in each text area as an example, the abscissa interval of a certain text area is determined based on the maximum and minimum values of the abscissa coordinates among the four area vertex coordinates of the text area. The vertical coordinate interval of a text area is determined based on the maximum and minimum values of the vertical coordinate among the four regional vertex coordinates of the text area.
这样,就可以确定出每一纵坐标线(纵坐标线中各坐标点的纵坐标均相同)穿过的文本区域的第一区域数量,以及每一横坐标线(横坐标线中各坐标点的横坐标均相同)穿过的文本区域的第二区域数量。In this way, it is possible to determine the first area number of the text area that each ordinate line (the ordinates of each coordinate point in the ordinate line is the same) passes through, and the number of first areas of each abscissa line (each coordinate point in the abscissa line The number of the second area of the text area that the abscissas are the same) passes through.
S1014:根据最大纵坐标、最小纵坐标,以及第一区域数量,确定目标表格的各个表格行坐标。S1014: Determine the coordinates of each table row of the target table based on the maximum ordinate, the minimum ordinate, and the number of first areas.
具体的,根据各个纵坐标及其对应的第一区域数量,确定符合波谷纵坐标条件的波谷纵坐标,并根据最大纵坐标、最小纵坐标,以及波谷纵坐标,获得各个表格行坐标。Specifically, according to each ordinate and its corresponding first area number, the trough ordinate that meets the trough ordinate condition is determined, and each table row coordinate is obtained based on the maximum ordinate, the minimum ordinate, and the trough ordinate.
其中,波谷纵坐标条件为:波谷纵坐标的第一区域数量不高于波谷纵坐标的相邻纵坐标的第一区域数量,波谷纵坐标的相邻纵坐标为波谷纵坐标的前一个纵坐标以及后一个纵坐标。Among them, the condition of the trough ordinate is: the number of the first areas in the trough ordinate is not higher than the number of the first areas in the adjacent ordinate of the trough ordinate, and the adjacent ordinate of the trough ordinate is the previous ordinate of the trough ordinate. and the latter ordinate.
一种实施方式中,根据最大纵坐标、最小纵坐标,以及波谷纵坐标,获得各个表格行坐标,包括:将最大纵坐标和最小纵坐标,均作为表格行坐标;根据各波谷纵坐标,生成波谷纵坐标区间(波谷纵坐标区间内的各纵坐标均为波谷纵坐标),筛选出未包含最大纵坐标的波谷纵坐标区间以及未包含最小纵坐标的波谷纵坐标区间;在筛选出的波谷纵坐标区间中,若确定波谷纵坐标区间中仅包含一个波谷纵坐标,则将该波谷纵坐标作为表格行坐标,若确定波谷纵坐标区间中包含多个波谷纵坐标,则从波谷纵坐标区间中选取一个波谷纵坐标,作为表格行坐标。可选的,可以从波谷纵坐标区间中随机选取一个波谷纵坐标。实际应用中,可以根据实际应用场景设置选取的具体方式,在此不作限制。In one implementation, obtaining the coordinates of each table row based on the maximum ordinate, the minimum ordinate, and the trough ordinate includes: using the maximum ordinate and the minimum ordinate as table row coordinates; and generating based on each trough ordinate. The trough ordinate interval (each ordinate within the trough ordinate interval is the trough ordinate), screen out the trough ordinate interval that does not include the maximum ordinate and the trough ordinate interval that does not include the minimum ordinate; in the filtered trough In the ordinate interval, if it is determined that the trough ordinate interval contains only one trough ordinate, then the trough ordinate interval will be used as the table row coordinate. If it is determined that the trough ordinate interval contains multiple trough ordinates, then the trough ordinate interval will be used as the table row coordinate. Select a trough vertical coordinate as the table row coordinate. Optionally, a trough ordinate can be randomly selected from the trough ordinate interval. In actual applications, the specific method of selection can be set according to the actual application scenario, and is not limited here.
S1015:根据最大横坐标、最小横坐标,以及第二区域数量,确定各个表格列坐标。S1015: Determine the coordinates of each table column based on the maximum abscissa, the minimum abscissa, and the number of second areas.
具体的,根据各个横坐标及其对应的第二区域数量,确定符合波谷横坐标条件的波谷横坐标,并根据最大横坐标、最小横坐标,以及波谷横坐标,获得各个表格列坐标。Specifically, according to each abscissa and its corresponding number of second areas, determine the trough abscissa that meets the conditions of the trough abscissa, and obtain the coordinates of each table column based on the maximum abscissa, the minimum abscissa, and the trough abscissa.
其中,波谷横坐标条件为:波谷横坐标的第二区域数量不高于波谷横坐标的相邻横坐标的第二区域数量,波谷横坐标的相邻横坐标为波谷横坐标的前一个横坐标以及后一个横坐标。Among them, the condition of the wave trough abscissa is: the number of the second areas of the wave trough abscissa is not higher than the number of the second areas of the adjacent abscissa of the wave trough abscissa, and the adjacent abscissa of the wave trough abscissa is the previous abscissa of the wave trough abscissa. and the latter abscissa.
一种实施方式中,根据最大横坐标、最小横坐标,以及波谷横坐标,获得各个表格列坐标,包括:In one implementation, the coordinates of each table column are obtained based on the maximum abscissa, the minimum abscissa, and the trough abscissa, including:
将最大横坐标和最小横坐标,均作为表格列坐标;根据各波谷横坐标,生成波谷横坐标区间(波谷横坐标区间内的各横坐标均为波谷横坐标);筛选出未包含最大横坐标的波谷横坐标区间以及未包含最小横坐标的波谷横坐标区间;在筛选出的波谷横坐标区间中, 若确定波谷横坐标区间中仅包含一个波谷横坐标,则将该波谷横坐标作为表格列坐标,若确定波谷横坐标区间中包含多个波谷横坐标,则从波谷横坐标区间中选取一个波谷横坐标,作为表格列坐标。可选的,可以从波谷横坐标区间中选取一个波谷横坐标,作为表格列坐标。实际应用中,可以根据实际应用场景设置选取的具体方式,在此不作限制。Use the maximum abscissa and the minimum abscissa as table column coordinates; generate a trough abscissa interval based on each trough abscissa (each abscissa within the trough abscissa interval is a trough abscissa); filter out the maximum abscissa that does not include the trough abscissa. The trough abscissa interval of , and the trough abscissa interval that does not include the minimum abscissa; in the filtered trough abscissa interval, If it is determined that the trough abscissa interval contains only one trough abscissa, then the trough abscissa is used as the table column coordinate. If it is determined that the trough abscissa interval contains multiple trough abscissas, then one trough abscissa is selected from the trough abscissa interval. Coordinates, as table column coordinates. Optionally, you can select a trough abscissa coordinate from the trough abscissa coordinate interval as the table column coordinate. In actual applications, the specific method of selection can be set according to the actual application scenario, and is not limited here.
步骤102:根据各个表格行坐标以及各个表格列坐标,生成空白表格。Step 102: Generate a blank table based on the row coordinates of each table and the coordinates of each table column.
进一步的,还可以将空白表格中文本区域覆盖的目标单元格合并。文本区域覆盖的目标单元格符合以下条件:文本区域中存在位于目标单元格内且不与目标单元格的边界重合的坐标点。Furthermore, you can also merge the target cells covered by the text area in the blank table. The target cell covered by the text area meets the following conditions: there is a coordinate point in the text area that is located within the target cell and does not coincide with the boundary of the target cell.
例如,若文本区域A中的坐标点b位于单元格C内,且不与单元格C的边界重合,则确定单元格C为文本区域A覆盖的目标单元格。For example, if coordinate point b in text area A is located in cell C and does not coincide with the boundary of cell C, then cell C is determined to be the target cell covered by text area A.
其中,对空白表格中文本区域覆盖的目标单元格合并时,可以包括:Among them, when merging the target cells covered by the text area in the blank table, you can include:
S1021:根据各个表格行坐标以及各个表格列坐标,确定空白表格中单元格的单元格位置信息。S1021: Determine the cell position information of the cells in the blank table based on the row coordinates of each table and the coordinates of each table column.
一种实施方式中,空白表格中的单元格为矩形,单元格的单元格位置信息包括该单元格的四个单元格顶点坐标。单元格顶点坐标为单元格的顶点的坐标。单元格顶点坐标包括单元格顶点纵坐标以及单元格顶点横坐标。In one implementation, the cells in the blank table are rectangular, and the cell position information of the cell includes four cell vertex coordinates of the cell. The cell vertex coordinates are the coordinates of the cell's vertex. The cell vertex coordinates include the cell vertex ordinate and the cell vertex abscissa.
S1022:根据区域位置信息,以及单元格位置信息,确定文本区域覆盖的目标单元格。S1022: Determine the target cell covered by the text area based on the area position information and the cell position information.
S1023:若确定文本区域覆盖的目标单元格为多个,则将目标单元格合并。S1023: If it is determined that the text area covers multiple target cells, merge the target cells.
一种实施方式中,若文本区域为多个,则针对各文本区域中的目标文本区域(目标文本区域是各文本区域中的任一文本区域),若确定目标文本区域覆盖的目标单元格为多个,则将目标文本区域覆盖的各目标单元格合并。In one implementation, if there are multiple text areas, then for the target text area in each text area (the target text area is any text area in each text area), if it is determined that the target cell covered by the target text area is If there are multiple, the target cells covered by the target text area will be merged.
步骤103:根据区域位置信息,将文本区域识别结果中的区域文本内容添加到空白表格中,获得目标表格。Step 103: According to the region position information, add the regional text content in the text region recognition result to the blank table to obtain the target table.
具体的,分别针对空白表格中的每一单元格,执行以下步骤:Specifically, perform the following steps for each cell in the blank table:
S1031:若根据区域位置信息,确定一个单元格仅包含一个文本区域,则将一个单元格包含的文本区域内的区域文本内容,添加到一个单元格内。S1031: If it is determined that a cell contains only one text area based on the area position information, then the area text content in the text area contained in a cell is added to a cell.
其中,一个单元格包含一个文本区域,是指该文本区域内的所有坐标点均位于该单元格内,即该单元格的覆盖区域不小于该文本区域。Among them, a cell contains a text area, which means that all coordinate points in the text area are located in the cell, that is, the coverage area of the cell is not smaller than the text area.
一种实施方式中,根据区域位置信息,确定一个单元格仅包含一个文本区域,可以包括:根据区域位置信息,确定文本区域的中心点坐标,若根据一个单元格的单元格位置信息,确定仅有一个文本区域的中心点坐标位于单元格内,则确定一个单元格仅包含一个文本区域。其中,中心点坐标为文本区域的中心点的坐标。中心点坐标包括中心点横坐标和中心点纵坐标。这是由于在步骤102中,若文本区域覆盖多个单元格,则已经将文本区域覆盖的多个单元格合并,文本区域仅能位于一个单元格内,因此,仅根据文本区域的中心点坐标,就可以确定文本区域所在的单元格。In one implementation, determining that a cell contains only one text area based on the area location information may include: determining the center point coordinates of the text area based on the area location information. If based on the cell location information of a cell, determining only If the center point coordinate of a text area is located in the cell, it is determined that a cell contains only one text area. Among them, the center point coordinates are the coordinates of the center point of the text area. The coordinates of the center point include the abscissa coordinate of the center point and the ordinate coordinate of the center point. This is because in step 102, if the text area covers multiple cells, the multiple cells covered by the text area have been merged. The text area can only be located in one cell. Therefore, only the center point coordinates of the text area are used. , you can determine the cell where the text area is located.
一种实施方式中,将一个单元格包含的文本区域内的区域文本内容,添加到一个单元格内,可以包括:将一个单元格的文本属性的属性值,设置为一个单元格包含的文本区域内的区域文本内容。In one implementation, adding the regional text content in the text area contained in a cell to a cell may include: setting the attribute value of the text attribute of a cell to the text area contained in the cell. The text content of the area within.
S1032:若根据区域位置信息,确定一个单元格包含至少两个文本区域,则按照区域位置信息,将一个单元格包含的各文本区域内的区域文本内容进行排序,并将排序后的区 域文本内容添加到一个单元格内。S1032: If it is determined that a cell contains at least two text areas according to the area position information, then the area text content in each text area contained in a cell is sorted according to the area position information, and the sorted areas are Field text content is added to a cell.
一种实施方式中,根据区域位置信息,确定一个单元格包含至少两个文本区域,可以包括:若确定文本区域的数量为多个,则根据各文本区域的区域位置信息,分别确定每一文本区域的中心点坐标。若根据一个单元格的单元格位置信息,确定存在至少两个文本区域的中心点坐标位于单元格内,则确定一个单元格包含至少两个文本区域。In one implementation, determining that a cell contains at least two text areas based on area location information may include: if it is determined that the number of text areas is multiple, determining each text area based on the area location information of each text area. The coordinates of the center point of the area. If, according to the cell position information of a cell, it is determined that the center point coordinates of at least two text areas are located in the cell, it is determined that a cell contains at least two text areas.
一种实施方式中,将一个单元格包含的各文本区域内的区域文本内容进行排序,可以包括:按照中心点纵坐标由大到下的顺序,将一个单元格包含的各文本区域内的区域文本内容进行排序;按照中心点横坐标由小到大的顺序,将中心点纵坐标相同的各文本区域内的区域文本内容再次进行排序。In one implementation, sorting the regional text content in each text area contained in a cell may include: sorting the regions in each text area contained in a cell in ascending order of the ordinate of the center point. Sort the text content; sort the regional text content in each text area with the same central point ordinate in ascending order of the center point's abscissa.
一种实施方式中,将排序后的区域文本内容添加到一个单元格内,可以包括:将一个单元格的文本属性的属性值设置为排序后的区域文本内容。In one implementation, adding the sorted regional text content to a cell may include: setting the attribute value of a text attribute of a cell to the sorted regional text content.
这是由于若一个单元格内有多个区域文本内容,此时通过OCR技术识别,会将单元格内的内容识别成多个文本区域内存,如,一个换行会识别成两个区域文本内容。因此,需要对同一单元格中包含多个区域文本内容进行排序。This is because if there are multiple areas of text content in a cell, the content in the cell will be recognized as multiple areas of text through OCR technology recognition. For example, a line break will be recognized as two areas of text content. Therefore, it is necessary to sort the text content of multiple ranges in the same cell.
实际应用中,可以根据实际应用场景对各区域文本内容进行排序,在此不作限制。In actual applications, the text content in each area can be sorted according to the actual application scenario, and there is no restriction here.
需要说明的,单元格为空时,由于单元格内不包含文本区域,因此,不需要对空的单元格进行其它处理。It should be noted that when the cell is empty, since the cell does not contain a text area, there is no need to perform other processing on the empty cell.
这样,就可以生成待处理图像对应的目标表格。In this way, the target table corresponding to the image to be processed can be generated.
本申请实施例中,采用了文本识别技术进行文本识别,以获得各待处理图像中各文本区域的位置以及内容,减少了开发量,再者,可以重建待处理图像中的有框表格,也可以重建待处理图像中的无框表格,提高了表格重建的准确率,以及能够准确识别合并单元格以及同一单元格内包含多个区域文本内容的情况,进一步提高了表格重建的准确率。In the embodiment of this application, text recognition technology is used for text recognition to obtain the position and content of each text area in each image to be processed, which reduces the amount of development. Furthermore, the framed table in the image to be processed can be reconstructed, and The frameless table in the image to be processed can be reconstructed, which improves the accuracy of table reconstruction, and it can accurately identify merged cells and the situation where the same cell contains text content in multiple areas, further improving the accuracy of table reconstruction.
下面采用一个具体的应用场景,对上述实施例进行举例说明。参阅图2所示,为一种用户属性表格图像的示例图。图2中示出了包含多个用户属性信息的用户属性表格图像,该用户属性表格图像为需要表格重建的待处理图像。参阅图3所示,为一种用户属性表格重建的方法的具体流程图,采用图3所示的方法,重建图2所示的用户属性表格图像中的用户属性表格,该方法的具体实施流程如下:A specific application scenario is used below to illustrate the above embodiment. Refer to Figure 2, which is an example of a user attribute table image. Figure 2 shows a user attribute table image containing multiple user attribute information. The user attribute table image is an image to be processed that requires table reconstruction. Refer to Figure 3, which is a specific flow chart of a method for reconstructing a user attribute table. The method shown in Figure 3 is used to reconstruct the user attribute table in the user attribute table image shown in Figure 2. The specific implementation process of this method as follows:
步骤300:对用户属性表格图像进行文本识别,获得用户属性表格图像的文本区域识别结果。Step 300: Perform text recognition on the user attribute table image, and obtain the text area recognition result of the user attribute table image.
具体的,采用OCR技术,对图2所示的用户属性表格图像进行文本检测以及文本识别,获得34个文本区域的区域文本内容以及区域位置信息。区域位置信息包括文本区域的各区域顶点坐标,即第一区域顶点坐标、第二区域顶点坐标、第三区域顶点坐标,以及第四区域顶点坐标。Specifically, OCR technology is used to perform text detection and text recognition on the user attribute table image shown in Figure 2, and the regional text content and regional location information of 34 text areas are obtained. The area position information includes the vertex coordinates of each area of the text area, that is, the vertex coordinates of the first area, the vertex coordinates of the second area, the vertex coordinates of the third area, and the vertex coordinates of the fourth area.
一种实施方式中,识别出的各区域文本内容以及各区域文本内容的区域位置信息的输出格式为{'content':'区域文本内容','location':[第一区域顶点坐标,第二区域顶点坐标,第三区域顶点坐标,第四区域顶点坐标]}。图2中用户属性表格图像的文本区域识别结果为:In one implementation, the output format of the identified regional text content and the regional location information of each regional text content is {'content':'regional text content','location':[first region vertex coordinates, second Area vertex coordinates, third area vertex coordinates, fourth area vertex coordinates]}. The text area recognition results of the user attribute table image in Figure 2 are:
{'content':'Salary','location':[245,40,245,21,288,22,287,41]};{'content':'Salary','location':[245,40,245,21,288,22,287,41]};
{'content':'WorkAge','location':[438,40,439,22,499,23,499,40]};{'content':'WorkAge','location':[438,40,439,22,499,23,499,40]};
{'content':'Name','location':[144,39,144,22,185,23,185,40]};{'content':'Name','location':[144,39,144,22,185,23,185,40]};
{'content':'Number','location':[37,39,37,23,90,23,90,39]}; {'content':'Number','location':[37,39,37,23,90,23,90,39]};
{'content':'Bonus','location':[347,39,347,23,389,23,389,39]};{'content':'Bonus','location':[347,39,347,23,389,23,389,39]};
{'content':'1000','location':[249,84,249,66,284,66,284,84]};{'content':'1000','location':[249,84,249,66,284,66,284,84]};
{'content':'LiLei','location':[149,83,149,66,182,66,182,83]};{'content':'LiLei','location':[149,83,149,66,182,66,182,83]};
{'content':'1','location':[56,84,56,66,71,66,71,84]};{'content':'1','location':[56,84,56,66,71,66,71,84]};
{'content':'10','location':[358,83,358,67,378,67,378,83]};{'content':'10','location':[358,83,358,67,378,67,378,83]};
{'content':'10','location':[459,83,459,67,479,67,479,83]};{'content':'10','location':[459,83,459,67,479,67,479,83]};
{'content':'Han','location':[150,118,150,102,180,102,180,118]};{'content':'Han','location':[150,118,150,102,180,102,180,118]};
{'content':'20','location':[459,127,459,110,479,110,479,127]};{'content':'20','location':[459,127,459,110,479,110,479,127]};
{'content':'2','location':[56,127,56,110,71,110,71,127]};{'content':'2','location':[56,127,56,110,71,110,71,127]};
{'content':'3000','location':[249,127,249,111,284,111,284,127]};{'content':'3000','location':[249,127,249,111,284,111,284,127]};
{'content':'90','location':[358,127,358,111,378,111,378,127]};{'content':'90','location':[358,127,358,111,378,111,378,127]};
{'content':'Meimei','location':[141,135,141,119,190,119,190,135]};{'content':'Meimei','location':[141,135,141,119,190,119,190,135]};
{'content':'Weiyin','location':[142,163,142,146,188,146,188,163]};{'content':'Weiyin','location':[142,163,142,146,188,146,188,163]};
{'content':'5000','location':[249,171,249,154,284,154,284,171]};{'content':'5000','location':[249,171,249,154,284,154,284,171]};
{'content':'888','location':[354,171,354,154,381,154,381,171]};{'content':'888','location':[354,171,354,154,381,154,381,171]};
{'content':'30','location':[459,171,459,154,479,154,479,171]};{'content':'30','location':[459,171,459,154,479,154,479,171]};
{'content':'3','location':[56,171,56,154,71,154,71,171]};{'content':'3','location':[56,171,56,154,71,154,71,171]};
{'content':'Wang','location':[143,179,143,160,187,162,186,181]};{'content':'Wang','location':[143,179,143,160,187,162,186,181]};
{'content':'Fangzheng','location':[129,207,129,189,200,190,200,207]};{'content':'Fangzheng','location':[129,207,129,189,200,190,200,207]};
{'content':'8000','location':[249,215,249,198,284,198,284,215]};{'content':'8000','location':[249,215,249,198,284,198,284,215]};
{'content':'40','location':[458,215,458,198,480,198,480,215]};{'content':'40','location':[458,215,458,198,480,198,480,215]};
{'content':'4','location':[56,216,56,198,71,198,71,216]};{'content':'4','location':[56,216,56,198,71,198,71,216]};
{'content':'303','location':[354,215,354,199,381,199,381,215]};{'content':'303','location':[354,215,354,199,381,199,381,215]};
{'content':'Dashi','location':[145,224,145,206,184,205,184,223]};{'content':'Dashi','location':[145,224,145,206,184,205,184,223]};
{'content':'Chongxu','location':[135,251,136,234,195,235,194,252]};{'content':'Chongxu','location':[135,251,136,234,195,235,194,252]};
{'content':'10000','location':[246,259,246,242,287,242,287,259]};{'content':'10000','location':[246,259,246,242,287,242,287,259]};
{'content':'400','location':[354,258,354,242,382,242,382,258]};{'content':'400','location':[354,258,354,242,382,242,382,258]};
{'content':'50','location':[459,259,459,242,479,242,479,259]};{'content':'50','location':[459,259,459,242,479,242,479,259]};
{'content':'5','location':[56,259,56,242,71,242,71,259]};{'content':'5','location':[56,259,56,242,71,242,71,259]};
{'content':'Daozhang','location':[132,267,133,249,198,250,197,268]}]。{'content':'Daozhang','location':[132,267,133,249,198,250,197,268]}].
步骤301:确定文本区域识别结果中各区域顶点纵坐标中的最大纵坐标和最小纵坐标。Step 301: Determine the maximum ordinate and the minimum ordinate among the ordinates of the vertices of each region in the text area recognition result.
具体的,通过图2中各文本区域的各区域顶点纵坐标,确定最大纵坐标table_top=268,最小纵坐标table_bottom=21。Specifically, through the vertical coordinates of the vertices of each text area in Figure 2, the maximum vertical coordinate table_top=268 and the minimum vertical coordinate table_bottom=21 are determined.
步骤302:确定文本区域识别结果中各区域顶点横坐标中的最大横坐标和最小横坐标。Step 302: Determine the maximum abscissa and the minimum abscissa of the abscissas of the vertices of each region in the text area recognition result.
具体的,通过图2中各文本区域的各区域顶点横坐标,确定最大横坐标table_right=499,最小横坐标table_left=37。Specifically, through the abscissa coordinates of the vertices of each text area in Figure 2, the maximum abscissa table_right=499 and the minimum abscissa table_left=37 are determined.
步骤303:根据文本区域识别结果中的区域位置信息,确定各个纵坐标的第一区域数量和各个横坐标的第二区域数量。Step 303: Determine the number of first regions for each ordinate and the number of second regions for each abscissa according to the region position information in the text region recognition result.
具体的,针对[table_bottom,table_top](即[21,268])中的目标纵坐标(目标纵坐标为[table_bottom,table_top]中的任一纵坐标),确定目标纵坐标线(目标纵坐标线上的各坐 标点的纵坐标均目标纵坐标)穿过的文本区域的个数,获得目标纵坐标的第一区域数量。针对[table_left,table_right](即[37,499])中的目标横坐标(目标横坐标为[table_left,table_right]中的任一横坐标),确定目标横坐标线(目标横坐标线上的各坐标点的横坐标均为目标横坐标线)穿过的文本区域的个数,获得目标横坐标线的第二区域数量。Specifically, for the target ordinate in [table_bottom, table_top] (ie [21, 268]) (the target ordinate is any ordinate in [table_bottom, table_top]), determine the target ordinate line (target ordinate line Everyone on the table sits down The ordinate of the punctuation point is the number of text areas passed through by the target ordinate), and the first area number of the target ordinate is obtained. For the target abscissa in [table_left, table_right] (i.e. [37, 499]) (the target abscissa is any abscissa in [table_left, table_right]), determine the target abscissa line (each point on the target abscissa line The abscissas of the coordinate points are the number of text areas passed through by the target abscissa line), and the second area number of the target abscissa line is obtained.
步骤304:根据最大纵坐标、最小纵坐标,以及第一区域数量,确定目标表格的各个表格行坐标。Step 304: Determine the coordinates of each table row of the target table based on the maximum ordinate, the minimum ordinate, and the number of first areas.
参阅图4所示,为第一曲线的示例图一。一种实施方式中,将21和268,确定为表格行坐标,并基于各纵坐标的第一区域数量,生成图4所示的第一曲线,以及通过图4中的第一曲线,确定出多个表格行坐标依次为[67,119,172,223,259]。Refer to Figure 4, which is an example of the first curve. In one implementation, 21 and 268 are determined as table row coordinates, and based on the number of first areas in each ordinate, the first curve shown in Figure 4 is generated, and through the first curve in Figure 4, the The coordinates of multiple table rows are [67, 119, 172, 223, 259].
需要说明的是,图4中展示的第一曲线上的点是连续的,仅用于示例性说明各纵坐标与第一区域数量之间的对应关系。实际应用中,各纵坐标也可以是不连续的(纵坐标通常是采样获取的),在此不作限制。It should be noted that the points on the first curve shown in Figure 4 are continuous and are only used to illustrate the corresponding relationship between each ordinate and the number of the first regions. In practical applications, each ordinate may also be discontinuous (the ordinate is usually obtained by sampling), which is not limited here.
步骤305:根据最大横坐标、最小横坐标,以及第二区域数量,确定各个表格列坐标。Step 305: Determine the coordinates of each table column based on the maximum abscissa, the minimum abscissa, and the number of second areas.
参阅图5所示,为第二曲线的示例图一。一种实施方式中,将37和499确定为表格横坐标,并基于各横坐标的第二区域数量,生成图5所示的第二曲线,以及通过图5中的第二曲线,确定出多个表格横坐标,依次为[139,325,456,621]。Refer to Figure 5, which is an example of the second curve. In one implementation, 37 and 499 are determined as the abscissa of the table, and based on the number of the second areas of each abscissa, the second curve shown in Figure 5 is generated, and through the second curve in Figure 5, the number of The abscissa coordinates of each table are [139, 325, 456, 621] in order.
需要说明的是,图5中展示的第二曲线上的点是连续的,仅用于示例性说明各横坐标与第二区域数量之间的对应关系。实际应用中,各横坐标也可以是不连续的(横坐标通常是采样获取的),在此不作限制。It should be noted that the points on the second curve shown in Figure 5 are continuous and are only used to illustrate the corresponding relationship between each abscissa and the number of second regions. In practical applications, each abscissa may also be discontinuous (the abscissa is usually obtained by sampling), which is not limited here.
步骤306:根据各个表格行坐标以及各个表格列坐标,生成空白表格。Step 306: Generate a blank table based on the row coordinates of each table and the coordinates of each table column.
步骤307:根据区域位置信息,将文本区域识别结果中的区域文本内容添加到空白表格中,获得目标表格。Step 307: According to the area location information, add the area text content in the text area recognition result to the blank form to obtain the target form.
例如,图2中,第二列的位置的坐标在波谷[139,325]之间,第二行的位置在波谷[67,119]之间,则根据“Han”和“Meimei”的区域位置信息,确定“Han”和“Meimei”均位于第二列第二行,且“Han”位于“Meimei”的上方。For example, in Figure 2, the coordinates of the second column are between troughs [139,325], and the position of the second row is between troughs [67,119], then based on the regional location information of "Han" and "Meimei", determine " Han" and "Meimei" are both located in the second column and row, and "Han" is located above "Meimei".
这样,就可以重建图2所示的用户属性表格图像中的用户属性表格。In this way, the user attribute table in the user attribute table image shown in Figure 2 can be reconstructed.
下面采用另一个具体的应用场景,对上述实施例进行举例说明。参阅图6所示,为一种合并表格图像的示例图。该合并表格图像为需要表格重建的待处理图像。参阅图7所示,为一种合并表格重建的方法的具体流程图,采用图7所示的方法,重建图6所示的合并表格图像中的合并表格,该方法的具体实施流程如下:Another specific application scenario is used below to illustrate the above embodiment. Refer to Figure 6, which is an example of merging table images. The merged table image is an image to be processed that requires table reconstruction. Refer to Figure 7, which is a specific flow chart of a method for reconstructing a merged table. The method shown in Figure 7 is used to reconstruct the merged table in the merged table image shown in Figure 6. The specific implementation process of this method is as follows:
步骤700:对合并表格图像进行文本识别,获得用户属性表格图像的文本区域识别结果。Step 700: Perform text recognition on the merged table image to obtain the text area recognition result of the user attribute table image.
具体的,采用OCR技术,对图6所示的合并表格图像进行文本检测以及文本识别,获得8个文本区域的区域文本内容以及区域位置信息。区域位置信息包括文本区域的各区域顶点坐标,即第一区域顶点坐标、第二区域顶点坐标、第三区域顶点坐标,以及第四区域顶点坐标。Specifically, OCR technology is used to perform text detection and text recognition on the merged table image shown in Figure 6, and the regional text content and regional location information of 8 text areas are obtained. The area position information includes the vertex coordinates of each area of the text area, that is, the vertex coordinates of the first area, the vertex coordinates of the second area, the vertex coordinates of the third area, and the vertex coordinates of the fourth area.
一种实施方式中,识别出的各区域文本内容以及各区域文本内容的区域位置信息的输出格式为{'content':'区域文本内容','location':[第一区域顶点坐标,第二区域顶点坐标,第三区域顶点坐标,第四区域顶点坐标]}。图6中合并表格图像的文本区域识别结果为:In one implementation, the output format of the identified regional text content and the regional location information of each regional text content is {'content':'regional text content','location':[first region vertex coordinates, second Area vertex coordinates, third area vertex coordinates, fourth area vertex coordinates]}. The text area recognition results of the merged table image in Figure 6 are:
{'content':'500','location':[642,137,642,84,728,84,728,137]}; {'content':'500','location':[642,137,642,84,728,84,728,137]};
{'content':'1000','location':[481,136,480,94,583,92,584,133]};{'content':'1000','location':[481,136,480,94,583,92,584,133]};
{'content':'Lilei','location':[286,131,286,102,366,102,366,131]};{'content':'Lilei','location':[286,131,286,102,366,102,366,131]};
{'content':'500','location':[641,193,642,140,728,142,727,195]};{'content':'500','location':[641,193,642,140,728,142,727,195]};
{'content':'2000','location':[477,193,477,142,586,141,586,192]};{'content':'2000','location':[477,193,477,142,586,141,586,192]};
{'content':'HanMeimel','location':[213,190,213,157,437,157,437,190]};{'content':'HanMeimel','location':[213,190,213,157,437,157,437,190]};
{'content':'3000','location':[555,250,553,202,661,198,663,246]};{'content':'3000','location':[555,250,553,202,661,198,663,246]};
{'content':'ChongXu','location':[246,247,245,217,413,216,413,246]}]。{'content':'ChongXu','location':[246,247,245,217,413,216,413,246]}].
步骤701:确定文本区域识别结果中各区域顶点纵坐标中的最大纵坐标和最小纵坐标。Step 701: Determine the maximum ordinate and the minimum ordinate among the ordinates of the vertices of each region in the text area recognition result.
具体的,通过图6中各文本区域的各区域顶点纵坐标,确定最大纵坐标table_top=250,最小纵坐标table_bottom=84。Specifically, through the vertical coordinates of the vertices of each text area in Figure 6, the maximum vertical coordinate table_top=250 and the minimum vertical coordinate table_bottom=84 are determined.
步骤702:确定文本区域识别结果中各区域顶点横坐标中的最大横坐标和最小横坐标。Step 702: Determine the maximum abscissa and the minimum abscissa of the abscissas of the vertices of each region in the text area recognition result.
具体的,通过图6中各文本区域的各区域顶点横坐标,确定最大横坐标table_right=728,最小横坐标table_left=213。Specifically, through the abscissa coordinates of the vertices of each text area in Figure 6, the maximum abscissa table_right=728 and the minimum abscissa table_left=213 are determined.
步骤703:根据文本区域识别结果中的区域位置信息,确定各个纵坐标的第一区域数量和各个横坐标的第二区域数量。Step 703: Determine the number of first regions for each ordinate and the number of second regions for each abscissa according to the region position information in the text region recognition result.
步骤704:根据最大纵坐标、最小纵坐标,以及第一区域数量,确定目标表格的各个表格行坐标。Step 704: Determine the coordinates of each table row of the target table based on the maximum ordinate, the minimum ordinate, and the number of first areas.
参阅图8所示,为第一曲线的示例图二。图8仅用于示例性说明各纵坐标与第一区域数量之间的对应关系。一种实施方式中,将84和250,确定为表格行坐标,并基于各纵坐标的第一区域数量,生成图8所示的第一曲线,以及通过图8中的第一曲线,确定出多个表格行坐标依次为[137,195]。Refer to Figure 8, which is an example of the first curve. FIG. 8 is only used to illustrate the corresponding relationship between each ordinate and the number of first regions. In one implementation, 84 and 250 are determined as table row coordinates, and based on the number of first areas in each ordinate, the first curve shown in Figure 8 is generated, and through the first curve in Figure 8, the The coordinates of multiple table rows are [137,195].
步骤705:根据最大横坐标、最小横坐标,以及第二区域数量,确定各个表格列坐标。Step 705: Determine the coordinates of each table column based on the maximum abscissa, the minimum abscissa, and the number of second areas.
参阅图9所示,为第二曲线的示例图二。图9仅用于示例性说明各横坐标与第二区域数量之间的对应关系。一种实施方式中,将213和728确定为表格横坐标,并基于各横坐标的第二区域数量,生成图9所示的第二曲线,以及通过图9中的第二曲线,确定出多个表格横坐标,依次为[437,586]。Refer to Figure 9, which is an example of the second curve. FIG. 9 is only used to illustrate the corresponding relationship between each abscissa and the number of second regions. In one implementation, 213 and 728 are determined as the abscissas of the table, and based on the number of the second areas of each abscissa, the second curve shown in Figure 9 is generated, and through the second curve in Figure 9, the number of The abscissas of the tables are [437,586] in sequence.
步骤706:根据各个表格行坐标以及各个表格列坐标,生成空白表格。Step 706: Generate a blank table based on the row coordinates of each table and the coordinates of each table column.
步骤707:根据区域位置信息,将文本区域识别结果中的区域文本内容添加到空白表格中,获得目标表格。Step 707: According to the region position information, add the regional text content in the text region recognition result to the blank table to obtain the target table.
基于同一发明构思,本申请实施例中还提供了一种表格重建的装置,由于上述装置及设备解决问题的原理与一种表格重建的方法相似,因此,上述装置的实施可以参见方法的实施,重复之处不再赘述。Based on the same inventive concept, the embodiment of the present application also provides a device for table reconstruction. Since the principle of solving the problem of the above device and equipment is similar to a method for table reconstruction, the implementation of the above device can be referred to the implementation of the method. The repetitive parts will not be repeated.
如图10所示,其为本申请实施例提供的一种表格重建的装置的结构示意图,包括:As shown in Figure 10, it is a schematic structural diagram of a table reconstruction device provided by an embodiment of the present application, including:
识别单元1001,用于对待处理图像进行文本识别,获得待处理图像的文本区域识别结果,文本区域识别结果中包含文本区域的区域文本内容以及区域位置信息;The recognition unit 1001 is used to perform text recognition on the image to be processed, and obtain the text area recognition result of the image to be processed. The text area recognition result includes the regional text content and regional location information of the text area;
确定单元1002,用于根据区域位置信息,确定目标表格的各个表格行坐标以及各个表格列坐标;The determination unit 1002 is used to determine the table row coordinates and the table column coordinates of the target table according to the regional location information;
生成单元1003,用于根据各个表格行坐标以及各个表格列坐标,生成空白表格;The generation unit 1003 is used to generate a blank table based on the row coordinates of each table and the coordinates of each table column;
获得单元1004,用于根据区域位置信息,将区域文本内容添加到空白表格中,获得目标表格。 The obtaining unit 1004 is used to add the regional text content to the blank table according to the region location information to obtain the target table.
一种实施方式中,区域位置信息包括文本区域的区域顶点坐标,识别单元1001用于:对待处理图像进行文本检测,获得文本区域的多个区域顶点坐标,区域顶点坐标为文本区域的顶点的坐标;对文本区域进行文本识别,获得区域文本内容。In one embodiment, the area location information includes the area vertex coordinates of the text area, and the identification unit 1001 is used to: perform text detection on the image to be processed, and obtain multiple area vertex coordinates of the text area, where the area vertex coordinates are the coordinates of the vertices of the text area. ; Perform text recognition on the text area and obtain the text content of the area.
一种实施方式中,区域顶点坐标包括区域顶点横坐标和区域顶点纵坐标,确定单元1002用于:确定各区域顶点纵坐标中的最大纵坐标和最小纵坐标;确定各区域顶点横坐标中的最大横坐标和最小横坐标;根据区域位置信息,确定各个纵坐标的第一区域数量和各个横坐标的第二区域数量,第一区域数量为包含某一纵坐标的文本区域的个数,第二区域数量为包含某一横坐标的文本区域的个数;根据最大纵坐标、最小纵坐标,以及第一区域数量,确定各个表格行坐标;根据最大横坐标、最小横坐标,以及第二区域数量,确定各个表格列坐标。In one implementation, the regional vertex coordinates include the regional vertex abscissa and the regional vertex ordinate. The determining unit 1002 is used to: determine the maximum ordinate and the minimum ordinate in the ordinate of each regional vertex; determine the maximum ordinate in the abscissa of each regional vertex. The maximum abscissa and the minimum abscissa; according to the area position information, determine the number of the first area for each ordinate and the number of the second area for each abscissa. The number of the first area is the number of text areas containing a certain ordinate. The number of the second area is the number of text areas containing a certain abscissa; determine the coordinates of each table row based on the maximum ordinate, the minimum ordinate, and the number of the first area; determine the coordinates of each table row based on the maximum abscissa, the minimum abscissa, and the second area Quantity, determine the coordinates of each table column.
一种实施方式中,确定单元1002用于:根据各个纵坐标及其对应的第一区域数量,确定波谷纵坐标,波谷纵坐标的第一区域数量不高于波谷纵坐标的相邻纵坐标的第一区域数量,波谷纵坐标的相邻纵坐标为波谷纵坐标的前一个纵坐标以及后一个纵坐标;根据最大纵坐标、最小纵坐标,以及波谷纵坐标,获得各个表格行坐标。In one implementation, the determining unit 1002 is configured to determine the trough ordinate based on each ordinate and its corresponding number of first areas. The number of first areas in the trough ordinate is not higher than the number of adjacent ordinates in the trough ordinate. The number of the first area, the adjacent ordinates of the trough ordinate are the previous ordinate and the next ordinate of the trough ordinate; according to the maximum ordinate, the minimum ordinate, and the trough ordinate, the coordinates of each table row are obtained.
一种实施方式中,确定单元1002用于:根据各个横坐标及其对应的第二区域数量,确定波谷横坐标,波谷横坐标的第二区域数量不高于波谷横坐标的相邻横坐标的第二区域数量,波谷横坐标的相邻横坐标为波谷横坐标的前一个横坐标以及后一个横坐标;根据最大横坐标、最小横坐标,以及波谷横坐标,获得各个表格列坐标。In one implementation, the determining unit 1002 is configured to: determine the trough abscissa according to each abscissa and its corresponding number of second areas. The number of the second areas of the trough abscissa is not higher than the number of adjacent abscissas of the trough abscissa. The second area quantity, the adjacent abscissa of the trough abscissa is the previous abscissa and the next abscissa of the trough; according to the maximum abscissa, the minimum abscissa, and the trough abscissa, the coordinates of each table column are obtained.
一种实施方式中,生成单元1003还用于:根据各个表格行坐标以及各个表格列坐标,确定空白表格中单元格的单元格位置信息;根据区域位置信息,以及单元格位置信息,确定文本区域覆盖的目标单元格;其中,文本区域中存在位于目标单元格内且不与目标单元格的边界重合的坐标点;若确定文本区域覆盖的目标单元格为多个,则将目标单元格合并。In one implementation, the generation unit 1003 is also used to: determine the cell position information of the cells in the blank table according to each table row coordinate and each table column coordinate; determine the text area according to the area position information and the cell position information. The covered target cells; where there are coordinate points in the text area that are within the target cells and do not coincide with the boundaries of the target cells; if it is determined that there are multiple target cells covered by the text area, the target cells will be merged.
一种实施方式中,获得单元1004用于:分别针对空白表格中的每一单元格,执行以下步骤:若根据区域位置信息,确定一个单元格仅包含一个文本区域,则将一个单元格包含的文本区域内的区域文本内容,添加到一个单元格内;若根据区域位置信息,确定一个单元格包含至少两个文本区域,则按照区域位置信息,将一个单元格包含的各文本区域内的区域文本内容进行排序,并将排序后的区域文本内容添加到一个单元格内。In one implementation, the obtaining unit 1004 is used to: perform the following steps for each cell in the blank table: if it is determined that a cell contains only one text area according to the area position information, then the The regional text content in the text area is added to a cell; if it is determined that a cell contains at least two text areas according to the area position information, then the areas in each text area contained in a cell are added according to the area position information. Sort the text content and add the sorted range text content to a cell.
一种实施方式中,获得单元1004用于:根据区域位置信息,确定文本区域的中心点坐标,中心点坐标为文本区域的中心点的坐标;若根据一个单元格的单元格位置信息,确定仅有一个文本区域的中心点坐标位于单元格内,则确定一个单元格仅包含一个文本区域。In one implementation, the obtaining unit 1004 is used to: determine the center point coordinates of the text area based on the area position information, and the center point coordinates are the coordinates of the center point of the text area; if based on the cell position information of a cell, determine only If the center point coordinate of a text area is located in the cell, it is determined that a cell contains only one text area.
一种实施方式中,获得单元1004用于:将一个单元格的文本属性的属性值,设置为一个单元格包含的文本区域内的区域文本内容。In one implementation, the obtaining unit 1004 is used to: set the attribute value of the text attribute of a cell to the regional text content in the text area contained in the cell.
一种实施方式中,获得单元1004用于:若确定文本区域的数量为多个,则根据各文本区域的区域位置信息,分别确定每一文本区域的中心点坐标,中心点坐标为文本区域的中心点的坐标;若根据一个单元格的单元格位置信息,确定存在至少两个文本区域的中心点坐标位于单元格内,则确定一个单元格包含至少两个文本区域。In one implementation, the obtaining unit 1004 is configured to: if it is determined that the number of text areas is multiple, determine the center point coordinates of each text area according to the area position information of each text area, and the center point coordinates are The coordinates of the center point; if based on the cell position information of a cell, it is determined that the center point coordinates of at least two text areas are located in the cell, then it is determined that a cell contains at least two text areas.
一种实施方式中,中心点坐标包括中心点横坐标和中心点纵坐标,获得单元1004用于:按照中心点纵坐标由大到下的顺序,将一个单元格包含的各文本区域内的区域文本内容进行排序;按照中心点横坐标由小到大的顺序,将中心点纵坐标相同的各文本区域内的区域文本内容再次进行排序。 In one implementation, the center point coordinates include the center point abscissa and the center point ordinate. The obtaining unit 1004 is used to: according to the descending order of the center point ordinate, the areas within each text area contained in a cell are Sort the text content; sort the regional text content in each text area with the same central point ordinate in ascending order of the center point's abscissa.
一种实施方式中,获得单元1004用于:将一个单元格的文本属性的属性值设置为排序后的区域文本内容。In one implementation, the obtaining unit 1004 is used to set the attribute value of the text attribute of a cell to the sorted regional text content.
图11示出了一种电子设备1100的结构示意图。参阅图11所示,电子设备1100包括:处理器1110以及存储器1120,可选的,还可以包括电源1130、显示单元1140、输入单元1150。Figure 11 shows a schematic structural diagram of an electronic device 1100. Referring to FIG. 11 , the electronic device 1100 includes a processor 1110 and a memory 1120 . Optionally, it may also include a power supply 1130 , a display unit 1140 , and an input unit 1150 .
处理器1110是电子设备1100的控制中心,利用各种接口和线路连接各个部件,通过运行或执行存储在存储器1120内的软件程序和/或数据,执行电子设备1100的各种功能,从而对电子设备1100进行整体监控。The processor 1110 is the control center of the electronic device 1100. It uses various interfaces and lines to connect various components, and executes various functions of the electronic device 1100 by running or executing software programs and/or data stored in the memory 1120, thereby controlling the electronic device 1100. Device 1100 performs overall monitoring.
本申请实施例中,处理器1110调用存储器1120中存储的计算机程序时执行上述实施例中的各个步骤。In the embodiment of the present application, the processor 1110 executes each step in the above embodiment when calling the computer program stored in the memory 1120.
可选的,处理器1110可包括一个或多个处理单元;优选的,处理器1110可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器1110中。在一些实施例中,处理器、存储器、可以在单一芯片上实现,在一些实施例中,它们也可以在独立的芯片上分别实现。Optionally, the processor 1110 may include one or more processing units; preferably, the processor 1110 may integrate an application processor and a modem processor, where the application processor mainly processes operating systems, user interfaces, applications, etc., The modem processor primarily handles wireless communications. It can be understood that the above modem processor may not be integrated into the processor 1110. In some embodiments, the processor and memory can be implemented on a single chip, and in some embodiments, they can also be implemented on separate chips.
存储器1120可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、各种应用等;存储数据区可存储根据电子设备1100的使用所创建的数据等。此外,存储器1120可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件等。The memory 1120 may mainly include a program storage area and a data storage area, where the program storage area may store operating systems, various applications, etc.; the storage data area may store data created according to the use of the electronic device 1100 , etc. In addition, the memory 1120 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
电子设备1100还包括给各个部件供电的电源1130(比如电池),电源可以通过电源管理系统与处理器1110逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗等功能。The electronic device 1100 also includes a power supply 1130 (such as a battery) that supplies power to various components. The power supply can be logically connected to the processor 1110 through a power management system, thereby managing functions such as charging, discharging, and power consumption through the power management system.
显示单元1140可用于显示由用户输入的信息或提供给用户的信息以及电子设备1100的各种菜单等,本发明实施例中主要用于显示电子设备1100中各应用的显示界面以及显示界面中显示的文本、图片等对象。显示单元1140可以包括显示面板1141。显示面板1141可以采用液晶显示屏(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置。The display unit 1140 may be used to display information input by the user or information provided to the user, as well as various menus of the electronic device 1100, etc. In the embodiment of the present invention, it is mainly used to display the display interface of each application in the electronic device 1100 and the display interface. text, pictures and other objects. The display unit 1140 may include a display panel 1141. The display panel 1141 can be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), etc.
输入单元1150可用于接收用户输入的数字或字符等信息。输入单元1150可包括触控面板1151以及其他输入设备1152。其中,触控面板1151,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触摸笔等任何适合的物体或附件在触控面板1151上或在触控面板1151附近的操作)。The input unit 1150 may be used to receive information such as numbers or characters input by the user. The input unit 1150 may include a touch panel 1151 and other input devices 1152. Among them, the touch panel 1151, also called a touch screen, can collect the user's touch operations on or near it (for example, the user uses any suitable object or accessory such as a finger, a touch pen, etc. on or near the touch panel 1151. nearby operations).
具体的,触控面板1151可以检测用户的触摸操作,并检测触摸操作带来的信号,将这些信号转换成触点坐标,发送给处理器1110,并接收处理器1110发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板1151。其他输入设备1152可以包括但不限于物理键盘、功能键(比如音量控制按键、开关机按键等)、轨迹球、鼠标、操作杆等中的一种或多种。Specifically, the touch panel 1151 can detect the user's touch operation and detect the signals brought by the touch operation, convert these signals into contact point coordinates, send them to the processor 1110, and receive and execute the commands sent by the processor 1110. . In addition, the touch panel 1151 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. Other input devices 1152 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, power on/off keys, etc.), trackball, mouse, joystick, etc.
当然,触控面板1151可覆盖显示面板1141,当触控面板1151检测到在其上或附近的触摸操作后,传送给处理器1110以确定触摸事件的类型,随后处理器1110根据触摸事件的类型在显示面板1141上提供相应的视觉输出。虽然在图11中,触控面板1151与显示面板1141是作为两个独立的部件来实现电子设备1100的输入和输出功能,但是在某些实施 例中,可以将触控面板1151与显示面板1141集成而实现电子设备1100的输入和输出功能。Of course, the touch panel 1151 can cover the display panel 1141. When the touch panel 1151 detects a touch operation on or near it, it is sent to the processor 1110 to determine the type of the touch event, and then the processor 1110 determines the type of the touch event according to the type of the touch event. Corresponding visual output is provided on display panel 1141. Although in Figure 11, the touch panel 1151 and the display panel 1141 are used as two independent components to implement the input and output functions of the electronic device 1100, in some implementations For example, the touch panel 1151 and the display panel 1141 can be integrated to implement the input and output functions of the electronic device 1100 .
电子设备1100还可包括一个或多个传感器,例如压力传感器、重力加速度传感器、接近光传感器等。当然,根据具体应用中的需要,上述电子设备1100还可以包括摄像头等其它部件,由于这些部件不是本申请实施例中重点使用的部件,因此,在图11中没有示出,且不再详述。The electronic device 1100 may also include one or more sensors, such as a pressure sensor, a gravity acceleration sensor, a proximity light sensor, and the like. Of course, according to the needs of specific applications, the above-mentioned electronic device 1100 may also include other components such as cameras. Since these components are not the key components used in the embodiments of this application, they are not shown in Figure 11 and will not be described in detail. .
本领域技术人员可以理解,图11仅仅是电子设备的举例,并不构成对电子设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件。Those skilled in the art can understand that FIG. 11 is only an example of an electronic device and does not constitute a limitation on the electronic device. It may include more or fewer components than shown in the figure, or some components may be combined, or different components may be used.
本申请实施例中,一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时,使得通信设备可以执行上述实施例中的各个步骤。In the embodiment of the present application, a computer-readable storage medium has a computer program stored thereon. When the computer program is executed by the processor, the communication device can perform each step in the above embodiment.
为了描述的方便,以上各部分按照功能划分为各模块(或单元)分别描述。当然,在实施本申请时可以把各模块(或单元)的功能在同一个或多个软件或硬件中实现。For the convenience of description, each of the above parts is divided into modules (or units) according to their functions and described separately. Of course, when implementing this application, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will understand that embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment that combines software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each process and/or block in the flowchart illustrations and/or block diagrams, and combinations of processes and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device produce a use A device for realizing the functions specified in one process or multiple processes of the flowchart and/or one block or multiple blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions The device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。 These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device. Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.

Claims (16)

  1. 一种表格重建的方法,其特征在于,包括:A method for table reconstruction, which is characterized by including:
    对待处理图像进行文本识别,获得所述待处理图像的文本区域识别结果,所述文本区域识别结果中包含文本区域的区域文本内容以及区域位置信息;Perform text recognition on the image to be processed, and obtain the text area recognition result of the image to be processed, where the text area recognition result includes the regional text content and regional location information of the text area;
    根据所述区域位置信息,确定目标表格的各个表格行坐标以及各个表格列坐标;Determine each table row coordinate and each table column coordinate of the target table according to the regional location information;
    根据各个表格行坐标以及各个表格列坐标,生成空白表格;Generate a blank table based on the row coordinates of each table and the coordinates of each table column;
    根据所述区域位置信息,将所述区域文本内容添加到所述空白表格中,获得所述目标表格。According to the area location information, the area text content is added to the blank form to obtain the target form.
  2. 如权利要求1所述的方法,其特征在于,所述区域位置信息包括所述文本区域的区域顶点坐标,所述对待处理图像进行文本识别,获得所述待处理图像的文本区域识别结果,包括:The method of claim 1, wherein the area location information includes the area vertex coordinates of the text area, and the text recognition of the image to be processed is performed to obtain the text area recognition result of the image to be processed, including :
    对所述待处理图像进行文本检测,获得所述文本区域的多个区域顶点坐标,所述区域顶点坐标为所述文本区域的顶点的坐标;Perform text detection on the image to be processed to obtain multiple area vertex coordinates of the text area, where the area vertex coordinates are the coordinates of the vertices of the text area;
    对所述文本区域进行文本识别,获得所述区域文本内容。Perform text recognition on the text area to obtain the text content of the area.
  3. 如权利要求2所述的方法,其特征在于,所述区域顶点坐标包括区域顶点横坐标和区域顶点纵坐标,所述根据所述区域位置信息,确定目标表格的各个表格行坐标以及各个表格列坐标,包括:The method of claim 2, wherein the regional vertex coordinates include the regional vertex abscissa and the regional vertex ordinate, and the coordinates of each table row and each table column of the target table are determined based on the regional location information. Coordinates, including:
    确定各区域顶点纵坐标中的最大纵坐标和最小纵坐标;Determine the maximum vertical coordinate and the minimum vertical coordinate among the vertical coordinates of the vertices of each region;
    确定各区域顶点横坐标中的最大横坐标和最小横坐标;Determine the maximum abscissa and minimum abscissa of the abscissa of each area vertex;
    根据所述区域位置信息,确定各个纵坐标的第一区域数量和各个横坐标的第二区域数量,所述第一区域数量为包含某一纵坐标的文本区域的个数,所述第二区域数量为包含某一横坐标的文本区域的个数;According to the area position information, the first area number of each ordinate and the second area number of each abscissa are determined, the first area number is the number of text areas containing a certain ordinate, and the second area The number is the number of text areas containing a certain abscissa;
    根据所述最大纵坐标、所述最小纵坐标,以及所述第一区域数量,确定各个表格行坐标;Determine the coordinates of each table row according to the maximum ordinate, the minimum ordinate, and the number of first areas;
    根据所述最大横坐标、所述最小横坐标,以及所述第二区域数量,确定各个表格列坐标。Each table column coordinate is determined according to the maximum abscissa, the minimum abscissa, and the second area number.
  4. 如权利要求3所述的方法,其特征在于,所述根据所述最大纵坐标、所述最小纵坐标,以及所述第一区域数量,确定各个表格行坐标,包括:The method of claim 3, wherein determining the coordinates of each table row based on the maximum ordinate, the minimum ordinate, and the number of first areas includes:
    根据各个纵坐标及其对应的第一区域数量,确定波谷纵坐标,所述波谷纵坐标的第一区域数量不高于所述波谷纵坐标的相邻纵坐标的第一区域数量,所述波谷纵坐标的相邻纵坐标为所述波谷纵坐标的前一个纵坐标以及后一个纵坐标;Determine the trough ordinate according to each ordinate and its corresponding number of first areas. The number of first areas in the trough ordinate is not higher than the number of first areas in adjacent ordinates of the trough ordinate. The trough ordinate is The adjacent ordinates of the ordinate are the previous ordinate and the next ordinate of the trough ordinate;
    根据所述最大纵坐标、所述最小纵坐标,以及所述波谷纵坐标,获得各个表格行坐标。According to the maximum ordinate, the minimum ordinate, and the trough ordinate, the coordinates of each table row are obtained.
  5. 如权利要求3所述的方法,其特征在于,所述根据所述最大横坐标、所述最小横坐标,以及所述第二区域数量,确定各个表格列坐标,包括:The method of claim 3, wherein determining the coordinates of each table column based on the maximum abscissa, the minimum abscissa, and the number of second areas includes:
    根据各个横坐标及其对应的第二区域数量,确定波谷横坐标,所述波谷横坐标的第二区域数量不高于所述波谷横坐标的相邻横坐标的第二区域数量,所述波谷横坐标的相邻横坐标为所述波谷横坐标的前一个横坐标以及后一个横坐标;The wave trough abscissa is determined according to each abscissa and its corresponding number of second areas. The number of the second areas of the wave trough abscissa is not higher than the number of second areas of the adjacent abscissa of the wave trough abscissa. The wave trough abscissa is The adjacent abscissas of the abscissa are the previous abscissa and the next abscissa of the wave trough abscissa;
    根据所述最大横坐标、所述最小横坐标,以及所述波谷横坐标,获得各个表格列坐标。According to the maximum abscissa, the minimum abscissa, and the trough abscissa, the coordinates of each table column are obtained.
  6. 如权利要求1-5任一项所述的方法,其特征在于,在所述根据各个表格行坐标以及 各个表格列坐标,生成空白表格之后,所述方法还包括:The method according to any one of claims 1 to 5, characterized in that, according to the row coordinates of each table and After generating the coordinates of each table column and generating a blank table, the method also includes:
    根据各个表格行坐标以及各个表格列坐标,确定所述空白表格中单元格的单元格位置信息;Determine the cell position information of the cells in the blank table according to the coordinates of each table row and the coordinates of each table column;
    根据所述区域位置信息,以及所述单元格位置信息,确定所述文本区域覆盖的目标单元格;其中,所述文本区域中存在位于所述目标单元格内且不与所述目标单元格的边界重合的坐标点;According to the area position information and the cell position information, the target cell covered by the text area is determined; wherein, there is a cell in the text area that is located within the target cell and is not related to the target cell. Coordinate points where the boundaries coincide;
    若确定所述文本区域覆盖的目标单元格为多个,则将所述目标单元格合并。If it is determined that the text area covers multiple target cells, the target cells are merged.
  7. 如权利要求1-5任一项所述的方法,其特征在于,所述根据所述区域位置信息,将所述区域文本内容添加到所述空白表格中,获得所述目标表格,包括:The method according to any one of claims 1 to 5, wherein adding the regional text content to the blank form according to the regional location information to obtain the target form includes:
    分别针对所述空白表格中的每一单元格,执行以下步骤:For each cell in the blank table, perform the following steps:
    若根据所述区域位置信息,确定一个单元格仅包含一个文本区域,则将所述一个单元格包含的文本区域内的区域文本内容,添加到所述一个单元格内;If it is determined that a cell contains only one text area based on the area position information, then add the area text content in the text area contained in the one cell to the one cell;
    若根据所述区域位置信息,确定一个单元格包含至少两个文本区域,则按照所述区域位置信息,将所述一个单元格包含的各文本区域内的区域文本内容进行排序,并将排序后的区域文本内容添加到所述一个单元格内。If it is determined that one cell contains at least two text areas according to the area position information, then the area text content in each text area contained in the one cell is sorted according to the area position information, and the sorted The range of text content is added to the one cell.
  8. 如权利要求7所述的方法,其特征在于,所述若根据所述区域位置信息,确定一个单元格仅包含一个文本区域,包括:The method of claim 7, wherein determining that a cell contains only one text area based on the area location information includes:
    根据所述区域位置信息,确定所述文本区域的中心点坐标,所述中心点坐标为所述文本区域的中心点的坐标;Determine the center point coordinates of the text area according to the area position information, and the center point coordinates are the coordinates of the center point of the text area;
    若根据所述一个单元格的单元格位置信息,确定仅有一个文本区域的中心点坐标位于所述单元格内,则确定所述一个单元格仅包含一个文本区域。If, according to the cell position information of the one cell, it is determined that the center point coordinate of only one text area is located in the cell, it is determined that the one cell contains only one text area.
  9. 如权利要求7所述的方法,其特征在于,所述将所述一个单元格包含的文本区域内的区域文本内容,添加到所述一个单元格内,包括:The method of claim 7, wherein adding the regional text content in the text area contained in the one cell to the one cell includes:
    将所述一个单元格的文本属性的属性值,设置为所述一个单元格包含的文本区域内的区域文本内容。Set the attribute value of the text attribute of the one cell to the regional text content in the text area contained in the one cell.
  10. 如权利要求7所述的方法,其特征在于,所述根据所述区域位置信息,确定一个单元格包含至少两个文本区域,包括:The method of claim 7, wherein determining that one cell contains at least two text areas based on the area position information includes:
    若确定文本区域的数量为多个,则根据各文本区域的所述区域位置信息,分别确定每一文本区域的中心点坐标,所述中心点坐标为所述文本区域的中心点的坐标;If it is determined that the number of text areas is multiple, then determine the center point coordinates of each text area according to the area position information of each text area, and the center point coordinates are the coordinates of the center point of the text area;
    若根据所述一个单元格的单元格位置信息,确定存在至少两个文本区域的中心点坐标位于所述单元格内,则确定所述一个单元格包含至少两个文本区域。If it is determined that the center point coordinates of at least two text areas are located in the cell according to the cell position information of the one cell, then it is determined that the one cell contains at least two text areas.
  11. 如权利要求10所述的方法,其特征在于,所述中心点坐标包括中心点横坐标和中心点纵坐标,所述将所述一个单元格包含的各文本区域内的区域文本内容进行排序,包括:The method of claim 10, wherein the coordinates of the center point include the abscissa coordinate of the center point and the ordinate of the center point, and the regional text content in each text area contained in the one cell is sorted, include:
    按照中心点纵坐标由大到下的顺序,将所述一个单元格包含的各文本区域内的区域文本内容进行排序;Sort the regional text content in each text area contained in the one cell in ascending order of the ordinate of the center point;
    按照中心点横坐标由小到大的顺序,将中心点纵坐标相同的各文本区域内的区域文本内容再次进行排序。According to the ascending order of the abscissa coordinate of the center point, the regional text content in each text area with the same ordinate of the center point is sorted again.
  12. 如权利要求7所述的方法,其特征在于,所述将排序后的区域文本内容添加到所述一个单元格内,包括:The method of claim 7, wherein adding the sorted regional text content to one of the cells includes:
    将所述一个单元格的文本属性的属性值设置为所述排序后的区域文本内容。 Set the attribute value of the text attribute of the one cell to the sorted area text content.
  13. 一种表格重建的装置,其特征在于,包括:A device for table reconstruction, which is characterized by including:
    识别单元,用于对待处理图像进行文本识别,获得所述待处理图像的文本区域识别结果,所述文本区域识别结果中包含文本区域的区域文本内容以及区域位置信息;A recognition unit, configured to perform text recognition on the image to be processed, and obtain the text area recognition result of the image to be processed, where the text area recognition result includes the regional text content and regional location information of the text area;
    确定单元,用于根据所述区域位置信息,确定目标表格的各个表格行坐标以及各个表格列坐标;A determination unit configured to determine the coordinates of each table row and the coordinates of each table column of the target table based on the regional location information;
    生成单元,用于根据各个表格行坐标以及各个表格列坐标,生成空白表格;The generation unit is used to generate a blank table based on the row coordinates of each table and the coordinates of each table column;
    获得单元,用于根据所述区域位置信息,将所述区域文本内容添加到所述空白表格中,获得所述目标表格。An obtaining unit is configured to add the regional text content to the blank form according to the regional location information to obtain the target form.
  14. 一种电子设备,其特征在于,包括处理器以及存储器,所述存储器存储有计算机可读取指令,当所述计算机可读取指令由所述处理器执行时,运行如权利要求1-12任一所述方法。An electronic device, characterized in that it includes a processor and a memory, and the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the operation is as described in any of claims 1-12. 1. The method described.
  15. 一种计算机可读存储介质,其特征在于,所述存储介质存储有计算机程序,所述计算机程序可由处理器执行以完成权利要求1-12任一所述的方法。A computer-readable storage medium, characterized in that the storage medium stores a computer program, and the computer program can be executed by a processor to complete the method of any one of claims 1-12.
  16. 一种计算机程序产品,其特征在于,所述计算机程序产品在计算机上运行时,使得所述计算机执行如权利要求1-12任一所述的方法。 A computer program product, characterized in that when the computer program product is run on a computer, it causes the computer to execute the method according to any one of claims 1-12.
PCT/CN2023/084482 2022-05-13 2023-03-28 Table reconstruction method and electronic device WO2023216745A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210523453.7A CN114943978B (en) 2022-05-13 2022-05-13 Table reconstruction method and electronic equipment
CN202210523453.7 2022-05-13

Publications (1)

Publication Number Publication Date
WO2023216745A1 true WO2023216745A1 (en) 2023-11-16

Family

ID=82906729

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/084482 WO2023216745A1 (en) 2022-05-13 2023-03-28 Table reconstruction method and electronic device

Country Status (2)

Country Link
CN (1) CN114943978B (en)
WO (1) WO2023216745A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114943978B (en) * 2022-05-13 2023-10-03 上海弘玑信息技术有限公司 Table reconstruction method and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190294399A1 (en) * 2018-03-26 2019-09-26 Abc Fintech Co., Ltd. Method and device for parsing tables in pdf document
CN112396048A (en) * 2020-11-17 2021-02-23 中国平安人寿保险股份有限公司 Picture information extraction method and device, computer equipment and storage medium
CN114463765A (en) * 2022-02-10 2022-05-10 微民保险代理有限公司 Table information extraction method and device and storage medium
CN114943978A (en) * 2022-05-13 2022-08-26 上海弘玑信息技术有限公司 Table reconstruction method and electronic equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09330377A (en) * 1996-06-10 1997-12-22 Hitachi Ltd Device and method for recognizing handwritten character
CN110334585B (en) * 2019-05-22 2023-10-24 平安科技(深圳)有限公司 Table identification method, apparatus, computer device and storage medium
CN111985465A (en) * 2020-08-17 2020-11-24 中移(杭州)信息技术有限公司 Text recognition method, device, equipment and storage medium
CN113239227B (en) * 2021-06-02 2023-11-17 泰康保险集团股份有限公司 Image data structuring method, device, electronic equipment and computer readable medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190294399A1 (en) * 2018-03-26 2019-09-26 Abc Fintech Co., Ltd. Method and device for parsing tables in pdf document
CN112396048A (en) * 2020-11-17 2021-02-23 中国平安人寿保险股份有限公司 Picture information extraction method and device, computer equipment and storage medium
CN114463765A (en) * 2022-02-10 2022-05-10 微民保险代理有限公司 Table information extraction method and device and storage medium
CN114943978A (en) * 2022-05-13 2022-08-26 上海弘玑信息技术有限公司 Table reconstruction method and electronic equipment

Also Published As

Publication number Publication date
CN114943978A (en) 2022-08-26
CN114943978B (en) 2023-10-03

Similar Documents

Publication Publication Date Title
WO2018072663A1 (en) Data processing method and device, classifier training method and system, and storage medium
US7760189B2 (en) Touchpad diagonal scrolling
US8427438B2 (en) Virtual input tools
US20160342779A1 (en) System and method for universal user interface configurations
TWI611338B (en) Method for zooming screen and electronic apparatus and computer program product using the same
CN103135884A (en) Input method, system and device for searching in circle selection mode
EP3493112B1 (en) Image processing method, computer device, and computer readable storage medium
US9588678B2 (en) Method of operating electronic handwriting and electronic device for supporting the same
US20110265034A1 (en) Method for handling objects representing annotations on an interactive input system and interactive input system executing the method
US10445417B2 (en) Entry of values into multiple fields of a form using touch screens
US8938123B2 (en) Electronic device and handwritten document search method
WO2016018683A1 (en) Image based search to identify objects in documents
US10049114B2 (en) Electronic device, method and storage medium
US9529526B2 (en) Information processing method and information processing device
WO2023216745A1 (en) Table reconstruction method and electronic device
CN102063620A (en) Handwriting identification method, system and terminal
CN116168038B (en) Image reproduction detection method and device, electronic equipment and storage medium
WO2020000970A1 (en) Method and apparatus for identifying user's interest, and terminal device and storage medium
US20150134641A1 (en) Electronic device and method for processing clip of electronic document
US20130346893A1 (en) Electronic device and method for editing document using the electronic device
CN107291367B (en) Use method and device of eraser
US20160026613A1 (en) Processing image to identify object for insertion into document
US20180336173A1 (en) Augmenting digital ink strokes
CN107402673A (en) A kind of global search method, terminal and computer-readable recording medium
CN111221917A (en) Intelligent partition storage method and device and computer readable storage medium

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: 23802521

Country of ref document: EP

Kind code of ref document: A1