A wired table reconstruction method, device and medium based on seed point growth
The table box line chart is screened and segmented by the method of seed point growth to determine the seed growth points, solving the problems of low accuracy and complex operation in the prior art wired table reconstruction, and achieving high accuracy and low complexity table reconstruction.
Patent Information
- Application Number
- CN202410236729.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-01
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2044-03-01
AI Technical Summary
The existing wired table reconstruction methods have low reconstruction accuracy and complex reconstruction process operations, making it difficult to adapt to diverse table forms and high hardware resource consumption.
The method based on seed point growth is adopted to reconstruct the table frame lines and cell coordinates by screening candidate features, judging pixel continuity, segmenting table frame lines and cell coordinates.
It realizes high-precision table reconstruction and simplified operation processes, reduces hardware resource requirements, and adapts to diversified table forms.
Smart Images

Figure CN118097696B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical fields of computer vision and machine learning, and in particular, to a wired table reconstruction method, device, and medium based on seed point growth. Background Art
[0002] With the continuous development of digital office, most tables are stored as structured and semi-structured data. Due to requirements such as transmission and reading, there is still a large amount of table data in the form of unstructured data such as pictures and pdf scans. They often contain a large amount of valuable information but cannot be directly processed and analyzed by a computer. Therefore, the reconstruction of tables is particularly important in large-scale text and image table analysis work. The existing neural network-based table detection and recovery mainly rely on the training of annotated table data. When a table that is very different from the annotated data appears, the model will fail to reconstruct. In practical applications, tables are in various forms, and it is difficult for the annotated data to cover completely, with low accuracy and complex operations; at the same time, a large number of data sets and deep networks mean expensive hardware resources and training costs, which are not suitable for small-scale enterprises and daily use. Summary of the Invention
[0003] The embodiments of this application provide a wired table reconstruction method, device, and medium based on seed point growth, which solve the technical problems of low reconstruction accuracy and complex reconstruction process operation of the existing wired table reconstruction methods.
[0004] In a first aspect, the embodiments of this application provide a wired table reconstruction method based on seed point growth. The method includes: screening candidate features corresponding to the wired table image to be recognized to obtain candidate data; where the candidate data includes: candidate lines and candidate points; the candidate lines correspond to the table frame lines, and the candidate points correspond to the frame line intersection points; according to the candidate data, judging whether the number of consecutive pixels meets a preset judgment threshold to obtain a table judgment result, and based on the table judgment result, obtaining a table frame line diagram; based on the intersection coordinates of the table frame line diagram, segmenting the wired table image to obtain virtual minimum cells; obtaining the center coordinates of the virtual minimum cells to determine the seed growth points, and performing seed growth at the seed growth points to obtain cell coordinate data; where the cell coordinate data includes: cell absolute coordinates and cell relative coordinates.
[0005] In an implementation manner of this application, screening the corresponding candidate features based on the wired table image to be recognized to obtain candidate data specifically includes: based on the wired table image to be recognized, selecting straight lines as candidate lines through a straight line detection method; where the straight lines include horizontal straight lines and vertical straight lines; according to the candidate lines, judging whether there are vertical intersections between the candidate lines to obtain a judgment result; in the case where the judgment result is that there are vertical intersections between the candidate lines, obtaining the vertical intersections to obtain candidate points.
[0006] In one implementation manner of the present application, based on the table judgment result, a table frame line diagram is obtained, specifically including: when the table judgment result is that the candidate data is the table frame line, determining the coordinate position of the table, and screening the actual dotted lines of the table to obtain the table frame line diagram; when the table judgment result is that the candidate data is the table content, stopping processing the table content.
[0007] In one implementation manner of the present application, based on the intersection coordinates of the table frame line diagram, the wired table image is segmented to obtain virtual minimum cells, specifically including: based on the intersection coordinates of the table frame line diagram, determining the corresponding segmentation starting point; according to the segmentation starting point, performing horizontal segmentation and vertical segmentation to obtain virtual minimum cells.
[0008] In one implementation manner of the present application, cell coordinate data is obtained by performing seed growth at the seed growth point, specifically including: according to the seed growth point, determining the growth starting point coordinates; based on the growth starting point coordinates, performing horizontal growth and vertical growth, and stopping growth when meeting the preset growth conditions to obtain the cell coordinate data.
[0009] In one implementation manner of the present application, before screening the corresponding candidate features from the wired table image to be recognized to obtain candidate data, the method further includes: performing frame line highlighting processing on the wired table image to obtain the wired table image to be recognized; wherein, the frame line highlighting processing includes: erosion and dilation.
[0010] In one implementation manner of the present application, before performing frame line highlighting processing on the wired table image to obtain the wired table image to be recognized, the method further includes: obtaining the wired table image to be processed, and performing image quality processing on the wired table image to be processed to obtain the wired table image; wherein, the image quality processing includes: geometric distortion correction, high-light and shadow removal, watermark removal, contrast adjustment, noise removal, and high-resolution reconstruction.
[0011] In one implementation manner of the present application, after obtaining the cell coordinate data by performing seed growth at the seed growth point, the method further includes: based on the cell coordinate data, recognizing the table content of the corresponding cell by a preset OCR method to obtain cell recognition data; wherein, the OCR method is an optical character recognition method; according to the cell recognition data, a reconstructed table is obtained by matching the corresponding relative coordinates of the cell.
[0012] In a second aspect, an embodiment of the present application further provides a wired table reconstruction device based on seed point growth, characterized in that the device includes:
[0013] At least one processor;
[0014] and a memory communicatively connected to at least one processor;
[0015] Wherein, the memory stores instructions executable by at least one processor, and the instructions are executed by at least one processor to enable the at least one processor to: screen candidate features corresponding to the wired table image to be recognized to obtain candidate data; wherein, the candidate data includes: candidate lines and candidate points; the candidate lines correspond to table frame lines, and the candidate points correspond to frame line intersection points; according to the candidate data, determine whether the pixel continuous quantity meets a preset judgment threshold to obtain a table judgment result, and based on the table judgment result, obtain a table frame line diagram; based on the intersection coordinates of the table frame line diagram, segment the wired table image to obtain virtual minimum cells; obtain the central coordinates of the virtual minimum cells to determine seed growth points, and perform seed growth at the seed growth points to obtain cell coordinate data; wherein, the cell coordinate data includes: cell absolute coordinates and cell relative coordinates.
[0016] In a third aspect, an embodiment of the present application further provides a non-volatile computer storage medium for a wired table reconstruction method based on seed point growth, storing computer-executable instructions, characterized in that the computer-executable instructions are set to: screen candidate features corresponding to the wired table image to be recognized to obtain candidate data; wherein, the candidate data includes: candidate lines and candidate points; the candidate lines correspond to table frame lines, and the candidate points correspond to frame line intersection points; according to the candidate data, determine whether the pixel continuous quantity meets a preset judgment threshold to obtain a table judgment result, and based on the table judgment result, obtain a table frame line diagram; based on the intersection coordinates of the table frame line diagram, segment the wired table image to obtain virtual minimum cells; obtain the central coordinates of the virtual minimum cells to determine seed growth points, and perform seed growth at the seed growth points to obtain cell coordinate data; wherein, the cell coordinate data includes: cell absolute coordinates and cell relative coordinates.
[0017] An embodiment of the present application provides a wired table reconstruction method, device and medium based on seed point growth. By determining the central position of the cell and adopting the way of seed growth, the reconstruction of the target table image is completed, solving the technical problems of low reconstruction accuracy and complex reconstruction process operation in the existing wired table reconstruction methods, and realizing high accuracy of wired table reconstruction and low operation complexity of the reconstruction process. Description of the Drawings
[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation of the present application. In the drawings:
[0019] Figure 1Flowchart of a wired table reconstruction method based on seed point growth provided by an embodiment of the present application;
[0020] Figure 2 Table frame line diagram provided by an embodiment of the present application;
[0021] Figure 3 Virtual minimum cell diagram provided by an embodiment of the present application;
[0022] Figure 4 Seed growth schematic diagram provided by an embodiment of the present application;
[0023] Figure 5 Internal structure schematic diagram of a wired table reconstruction device based on seed point growth provided by an embodiment of the present application. Detailed implementation manners
[0024] To make the objectives, technical solutions, and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below in conjunction with specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0025] An embodiment of the present application provides a wired table reconstruction method, device, and medium based on seed point growth. By determining the center position of the cell and adopting the method of seed growth, the reconstruction of the target table image is completed, solving the technical problems of low reconstruction accuracy and complex reconstruction process operation in the existing wired table reconstruction methods, and realizing high accuracy in wired table reconstruction and low operation complexity in the reconstruction process.
[0026] The technical solutions proposed in the embodiments of the present application will be described in detail below with reference to the drawings.
[0027] Figure 1 Flowchart of a wired table reconstruction method based on seed point growth provided by an embodiment of the present application. As Figure 1 shown, a wired table reconstruction method based on seed point growth provided by an embodiment of the present application specifically includes the following steps:
[0028] Step 101: Screen the candidate features corresponding to the wired table image to be recognized to obtain candidate data.
[0029] Among them, the candidate data includes: candidate lines and candidate points; the candidate lines correspond to the table frame lines, and the candidate points correspond to the frame line intersection points.
[0030] Specifically, it includes: based on the wired table image to be recognized, selecting straight lines as candidate lines through a straight line detection method; wherein, the straight lines include horizontal straight lines and vertical straight lines; judging whether there are vertical intersections between the candidate lines according to the candidate lines to obtain a judgment result; and obtaining vertical intersections to obtain candidate points when the judgment result is that there are vertical intersections between the candidate lines.
[0031] This application provides a reconstructed data basis for the subsequent process by judging the candidate data in the wired table image to be recognized, and can improve the accuracy of wired table reconstruction.
[0032] Before screening corresponding candidate features from the wired table image to be recognized to obtain candidate data, the method further includes: performing frame line highlighting processing on the wired table image to obtain the wired table image to be recognized; wherein, the frame line highlighting processing includes: erosion and dilation.
[0033] This application makes the frame lines of the wired table image clearer and enhances the restoration degree of the wired table image by performing erosion and dilation operations on the wired table image.
[0034] Before performing frame line highlighting processing on the wired table image to obtain the wired table image to be recognized, the method further includes: obtaining the wired table image to be processed and performing image quality processing on the wired table image to be processed to obtain the wired table image; wherein, the image quality processing includes: geometric distortion correction, highlight and shadow removal, watermark removal, contrast adjustment, noise removal, and high-resolution reconstruction.
[0035] This application preprocesses the wired table image to be processed, improves the image quality, facilitates subsequent related processing, and improves the efficiency of the operation process.
[0036] In the embodiment of this application, it is explained in detail through the following Example 1.
[0037] Example 1: After scanning to obtain the wired table image to be processed, due to the limitations of the scanning device, there will be a lot of image noise in the wired table image to be processed. In order to obtain a higher-quality image, denoising methods such as geometric distortion correction, highlight and shadow removal, watermark removal, contrast adjustment, noise removal, and high-resolution reconstruction are performed on the wired table image to be processed to obtain the wired table image.
[0038] Since it is necessary to restore the frame lines and the final effect needs to match table type software such as EXCEL, the frame lines need to be restored next. Since there may be some text connected to the frame lines around the frame lines, or the frame lines are distorted due to scanning and cannot be restored in the previous step; it is cleared by the erosion method, wherein the erosion method is an image algorithm that can eliminate unnecessary pixels within a certain range.
[0039] After erosion, the frame line may become thinner (ie, the eroded pixels are slightly more), and the frame line needs to be restored through the expansion method; similarly, the expansion method is to supplement the missing pixels.
[0040] After the highlighting process is completed, a wired table image to be identified is obtained. The image has a frame line and text in the cells. The frame line is composed of mutually perpendicular horizontal and vertical lines. The system identifies based on this feature and filters out pixels that meet the feature. In addition, some text such as "十" will also be selected.
[0041] Next, the intersection of mutually perpendicular horizontal and vertical lines is selected, that is, the intersection of the frame lines; similarly, the intersection of text that meets the conditions will also be selected.
[0042] Step 102: determine whether the number of consecutive pixels meets a preset judgment threshold according to the candidate data, obtain a table judgment result, and obtain a table frame line diagram based on the table judgment result.
[0043] Specifically, it includes: when the table judgment result is that the candidate data is a table frame line, determining the coordinate position of the table, and screening the actual points and lines of the table to obtain a table frame line diagram; when the table judgment result is that the candidate data is a table content, stopping processing the table content.
[0044] The present application determines whether a corresponding pixel is a frame line pixel by identifying the pixel continuity of the corresponding feature, thereby improving the accuracy of restoring the frame line.
[0045] Figure 2 A table frame diagram provided for an embodiment of the present application.
[0046] In the examples of the present application, detailed explanation is given by the following Example 2.
[0047] Example 2: Since some texts such as "十" also appear in the candidate data after screening, the candidate data needs to be purified to obtain candidate data that actually only belongs to the frame line pixels.
[0048] Determine the continuity of the pixels corresponding to the candidate data. When the maximum pixel length of the text is 125, the projection of continuous pixels on the coordinate system that exceeds 125 pixels is identified as partial pixels of the frame line, and those that are shorter than this pixel length are identified as text and other data in the cell.
[0049] The candidate data that does not meet the requirements are denoised, and the obtained data is the real data of the frame line, and the intersection point is also the real intersection point. The real table frame line diagram can be deduced through the above denoised data.
[0050] Step 103 : segment the wired table image based on the intersection coordinates of the table frame line diagram to obtain a virtual minimum cell.
[0051] Specifically, based on the intersection coordinates of the table frame line graph, determine the corresponding segmentation starting point; according to the segmentation starting point, perform horizontal segmentation and vertical segmentation to obtain virtual minimum cells.
[0052] This application divides the table frame line graph through the data of the table frame line graph, that is, coordinates, to obtain virtual minimum cells, which meets the actual requirements of table software and improves the restoration degree and accuracy of reconstruction.
[0053] Figure 3 It is a virtual minimum cell graph provided by an embodiment of this application.
[0054] In the embodiment of this application, it is explained in detail through Example 3 below.
[0055] Example 3: In table type software such as EXCEL, the basic cells can be merged to obtain a larger merged cell. Since this operation is extremely common and has a high occurrence frequency in actual applications, it is necessary to restore the initial state of the cells.
[0056] From Figure 2 each intersection point in it is used as the segmentation starting point, perform horizontal segmentation and vertical segmentation to obtain virtual minimum cells, and the virtual minimum cells are essentially the corresponding basic cells in the software.
[0057] Step 104, obtain the center coordinates of the virtual minimum cell to determine the seed growth point, and perform seed growth at the seed growth point to obtain cell coordinate data.
[0058] Among them, the cell coordinate data includes: cell absolute coordinates and cell relative coordinates.
[0059] Specifically, according to the seed growth point, determine the growth starting point coordinates; based on the growth starting point coordinates, perform horizontal growth and vertical growth, and stop growing when meeting the preset growth conditions to obtain cell coordinate data.
[0060] After obtaining the cell coordinate data by performing seed growth at the seed growth point, the method further includes: based on the cell coordinate data, identify the table content of the corresponding cell through a preset OCR method to obtain cell recognition data; where the OCR method is an optical character recognition method; according to the cell recognition data, obtain the reconstructed table by matching the corresponding cell relative coordinates.
[0061] Figure 4 It is a seed growth schematic diagram provided by an embodiment of this application.
[0062] In the embodiment of this application, it is explained in detail through Example 4 below.
[0063] Example 4: After confirming the virtual minimum cell, it is necessary to restore the current cell. Since part of the current cell is in the state of a merged cell, it is necessary to restore its merging path, that is, which basic cells the merged cell is merged from.
[0064] Obtain the center coordinates of the virtual minimum cell to determine the seed growth point, perform horizontal growth and vertical growth, and stop when touching the real cell border to obtain cell coordinate data.
[0065] The coordinates where Seed Point 1 and Seed Point 8 are located are the growth starting point coordinates. After performing horizontal growth and vertical growth, the coordinate data from the seed point to each surrounding border can be obtained, which is the cell coordinate data.
[0066] Through the cell coordinate data, the absolute coordinates of the actual cells in the wired table on the wired table scan image can be obtained, as well as the relative coordinates restored to table type software such as EXCEL after reconstruction. Through the absolute coordinates and relative coordinates, the to-be-processed wired table image (scan) can be accurately converted into the editable mode of EXCEL.
[0067] The above is the method embodiment proposed by this application. Based on the same inventive concept, the embodiment of this application also provides a wired table reconstruction device based on seed point growth, and its structure is as Figure 2 shown.
[0068] Figure 2 It is a schematic internal structure diagram of a wired table reconstruction device based on seed point growth provided by the embodiment of this application. As Figure 5 shown, the device includes:
[0069] At least one processor 501;
[0070] And a memory 502 communicatively connected to at least one processor;
[0071] Wherein, the memory 502 stores instructions executable by at least one processor, and the instructions are executed by at least one processor 501 so that at least one processor 501 can:
[0072] Screen the candidate features corresponding to the wired table image to be recognized to obtain candidate data; wherein, the candidate data includes: candidate lines and candidate points; the candidate lines correspond to the table frame lines, and the candidate points correspond to the intersections of the frame lines; according to the candidate data, determine whether the pixel continuous quantity meets the preset judgment threshold to obtain the table judgment result, and based on the table judgment result, obtain the table frame line diagram; based on the intersection coordinates of the table frame line diagram, segment the wired table image to obtain the virtual minimum cell; obtain the center coordinates of the virtual minimum cell to determine the seed growth point, and perform seed growth at the seed growth point to obtain the cell coordinate data; wherein, the cell coordinate data includes: the absolute cell coordinates and the relative cell coordinates.
[0073] Some embodiments of the present application provide a Figure 1 non-volatile computer storage medium for a wired table reconstruction method based on seed point growth, storing computer-executable instructions, and the computer-executable instructions are set as:
[0074] Screen the candidate features corresponding to the wired table image to be recognized to obtain candidate data; wherein, the candidate data includes: candidate lines and candidate points; the candidate lines correspond to the table frame lines, and the candidate points correspond to the intersections of the frame lines; according to the candidate data, determine whether the pixel continuous quantity meets the preset judgment threshold to obtain the table judgment result, and based on the table judgment result, obtain the table frame line diagram; based on the intersection coordinates of the table frame line diagram, segment the wired table image to obtain the virtual minimum cell; obtain the center coordinates of the virtual minimum cell to determine the seed growth point, and perform seed growth at the seed growth point to obtain the cell coordinate data; wherein, the cell coordinate data includes: the absolute cell coordinates and the relative cell coordinates.
[0075] The various embodiments in the present application are described in a progressive manner. The same or similar parts among the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the embodiments of the Internet of Things devices and media, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0076] The systems and media provided by the embodiments of the present application correspond one-to-one with the methods. Therefore, the systems and media also have beneficial technical effects similar to the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the systems and media will not be elaborated here.
[0077] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) that contain computer-usable program code.
[0078] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram can be implemented by computer program instructions, and the combination of the flows and / or blocks in the flowchart and / or block diagram can also be implemented. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the specified functions in Figure 1 one or more flows Figure 1 or a combination of multiple flows and / or blocks.
[0079] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including instruction means, and the instruction means implement the specified functions in Figure 1 one or more flows Figure 1 or a combination of multiple flows and / or blocks.
[0080] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the specified functions in Figure 1 one or more flows Figure 1 or a combination of multiple flows and / or blocks.
[0081] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and a memory.
[0082] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM), and / or non-volatile memory in the form of, for example, read-only memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
[0083] A computer-readable medium includes both permanent and non-permanent, removable and non-removable media and can implement information storage by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transitory medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer-readable medium does not include transitory computer-readable media, such as modulated data signals and carrier waves.
[0084] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or apparatus comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or apparatus. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising the element.
[0085] The above are only embodiments of the present application and are not used to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.
Claims
1. A method for reconstructing a wired table based on seed point growth, characterized in that The method includes: Screening candidate features corresponding to the wired table image to be recognized to obtain candidate data; wherein, the candidate data includes: candidate lines and candidate points; the candidate lines correspond to the table frame lines, and the candidate points correspond to the frame line intersection points; According to the candidate data, judging whether the pixel continuous quantity meets a preset judgment threshold to obtain a table judgment result, and based on the table judgment result, obtaining a table frame line diagram; Based on the intersection coordinates of the table frame line diagram, segmenting the wired table image to obtain virtual minimum cells; Obtaining the central coordinates of the virtual minimum cells to determine seed growth points, and performing seed growth at the seed growth points to obtain cell coordinate data; wherein, the cell coordinate data includes: cell absolute coordinates and cell relative coordinates; Based on the wired table image to be recognized, screening corresponding candidate features to obtain candidate data, specifically including: Based on the wired table image to be recognized, selecting straight lines as candidate lines through a straight line detection method; wherein, the straight lines include horizontal straight lines and vertical straight lines; According to the candidate lines, judging whether there are vertical intersection points between the candidate lines to obtain a judgment result; In the case that the judgment result is that there are vertical intersection points between the candidate lines, obtaining the vertical intersection points to obtain the candidate points; Based on the table judgment result, obtaining a table frame line diagram, specifically including: In the case that the table judgment result is that the candidate data is the table frame line, determining the coordinate position of the table, and screening the actual point lines of the table to obtain the table frame line diagram; In the case that the table judgment result is that the candidate data is the table content, stopping processing the table content; Based on the intersection coordinates of the table frame line diagram, segmenting the wired table image to obtain virtual minimum cells, specifically including: Based on the intersection coordinates of the table frame line diagram, determining corresponding segmentation starting points; According to the segmentation starting points, performing horizontal segmentation and vertical segmentation to obtain the virtual minimum cells; Performing seed growth at the seed growth points to obtain cell coordinate data, specifically including: According to the seed growth points, determining the growth starting point coordinates; Based on the growth starting point coordinates, performing horizontal growth and vertical growth, and stopping growth when meeting preset growth conditions to obtain cell coordinate data.
2. The wired table reconstruction method based on seed point growth according to claim 1, characterized in that Before screening corresponding candidate features based on the wired table image to be recognized to obtain candidate data, the method further includes: Performing frame line highlighting processing on the wired table image to obtain the wired table image to be recognized; wherein, the frame line highlighting processing includes: erosion and dilation.
3. The wired table reconstruction method based on seed point growth according to claim 2, wherein Before performing frame line highlighting processing on the wired table image to obtain the wired table image to be recognized, the method further includes: Obtaining the wired table image to be processed, and performing image quality processing on the wired table image to be processed to obtain the wired table image; wherein, the image quality processing includes: geometric distortion correction, highlight and shadow removal, watermark removal, contrast adjustment, noise removal, and high-resolution reconstruction.
4. A wired table reconstruction method based on seed point growth according to claim 1, characterized in that After obtaining cell coordinate data by growing seeds at the seed growth points, the method further includes: Based on the cell coordinate data, identifying the table content of the corresponding cell through a preset OCR method to obtain cell identification data; wherein, the OCR method is an optical character recognition method; According to the cell identification data, obtaining a reconstructed table by matching the relative coordinates of the corresponding cell.
5. A wired table reconstruction device based on seed point growth, characterized in that, The device includes: At least one processor; And a memory communicatively connected to the at least one processor; Wherein, the memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to: Screen candidate features corresponding to the wired table image to be recognized to obtain candidate data; wherein, the candidate data includes: candidate lines and candidate points; the candidate lines correspond to table frame lines, and the candidate points correspond to the intersection points of the frame lines; According to the candidate data, determining whether the number of consecutive pixels meets a preset judgment threshold to obtain a table judgment result, and based on the table judgment result, obtaining a table frame line diagram; Based on the intersection coordinates of the table frame line diagram, segmenting the wired table image to obtain virtual minimum cells; Obtaining the center coordinates of the virtual minimum cells to determine the seed growth points, and growing seeds at the seed growth points to obtain cell coordinate data; wherein, the cell coordinate data includes: cell absolute coordinates and cell relative coordinates; Screening corresponding candidate features based on the wired table image to be recognized to obtain candidate data, specifically including: Based on the wired table image to be recognized, selecting straight lines as candidate lines through a straight line detection method; wherein, the straight lines include horizontal straight lines and vertical straight lines; According to the candidate lines, determining whether there are vertical intersection points between the candidate lines to obtain a judgment result; In the case where the judgment result is that there are vertical intersection points between the candidate lines, obtaining the vertical intersection points to obtain the candidate points; Obtaining a table frame line diagram based on the table judgment result, specifically including: In the case where the table judgment result is that the candidate data is the table frame line, determining the coordinate position of the table and screening the actual point lines of the table to obtain the table frame line diagram; In the case where the table judgment result is that the candidate data is the table content, stopping processing the table content; Segmenting the wired table image based on the intersection coordinates of the table frame line diagram to obtain virtual minimum cells, specifically including: Based on the intersection coordinates of the table frame line diagram, determining the corresponding segmentation starting point; According to the segmentation starting point, performing horizontal segmentation and vertical segmentation to obtain the virtual minimum cells; Growing seeds at the seed growth points to obtain cell coordinate data, specifically including: According to the seed growth points, determining the growth starting point coordinates; Based on the growth starting point coordinates, performing horizontal growth and vertical growth, and stopping growth when meeting the preset growth conditions to obtain cell coordinate data.
6. A non-volatile computer storage medium for a wired table reconstruction method based on seed point growth, storing computer-executable instructions, characterized in that, The computer-executable instructions are set to: Screen the candidate features corresponding to the wired table image to be recognized to obtain candidate data; wherein, the candidate data includes: candidate lines and candidate points; the candidate lines correspond to the table frame lines, and the candidate points correspond to the frame line intersection points; According to the candidate data, judge whether the pixel continuous quantity meets a preset judgment threshold to obtain a table judgment result, and based on the table judgment result, obtain a table frame line diagram; Based on the intersection coordinates of the table frame line diagram, segment the wired table image to obtain virtual minimum cells; Obtain the central coordinates of the virtual minimum cells to determine the seed growth points, and perform seed growth at the seed growth points to obtain cell coordinate data; wherein, the cell coordinate data includes: cell absolute coordinates and cell relative coordinates; Based on the wired table image to be recognized, screen the corresponding candidate features to obtain candidate data, specifically including: Based on the wired table image to be recognized, select straight lines as candidate lines through a straight line detection method; wherein, the straight lines include horizontal straight lines and vertical straight lines; According to the candidate lines, judge whether there are vertical intersections between the candidate lines to obtain a judgment result; In the case where the judgment result is that there are vertical intersections between the candidate lines, obtain the vertical intersections to obtain the candidate points; Based on the table judgment result, obtain a table frame line diagram, specifically including: In the case where the table judgment result is that the candidate data is the table frame line, determine the coordinate position of the table, and screen the actual point lines of the table to obtain the table frame line diagram; In the case where the table judgment result is that the candidate data is the table content, stop processing the table content; Based on the intersection coordinates of the table frame line diagram, segment the wired table image to obtain virtual minimum cells, specifically including: Based on the intersection coordinates of the table frame line diagram, determine the corresponding segmentation starting point; According to the segmentation starting point, perform horizontal segmentation and vertical segmentation to obtain the virtual minimum cells; Perform seed growth at the seed growth points to obtain cell coordinate data, specifically including: According to the seed growth points, determine the growth starting point coordinates; Based on the growth starting point coordinates, perform horizontal growth and vertical growth, and stop growing when meeting the preset growth conditions to obtain cell coordinate data.
Citation Information
Patent Citations
Table extraction method, apparatus and device, and storage medium
CN114357958A
Form line detection method and device, computer equipment and storage medium
CN114463764A