Table generation method and device based on image data, equipment and medium

By combining image enhancement and visual detection techniques with projection analysis and mapping relationship generation, this method overcomes the dependence of existing table detection and extraction methods on high-quality datasets, enabling efficient recognition and structured processing of complex tables and improving the level of document automation in the medical and financial fields.

CN120874793APending Publication Date: 2025-10-31PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511059905.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-30
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

Existing table detection and extraction methods in the medical and financial fields heavily rely on high-quality manually labeled datasets. They are sensitive to factors such as table layout, font, and image quality, lack generalization ability, and are difficult to adapt to complex situations, thus affecting business efficiency and accuracy.

Method used

By using image enhancement processing, visual table detection, horizontal and vertical projection, and mapping relationship generation, structured spreadsheets are constructed to improve the accuracy and efficiency of table data recognition.

Benefits of technology

It significantly improves the recognition accuracy and detection efficiency of image and table data, can adapt to complex backgrounds and special layouts, and can automatically parse merged cells across rows, thus improving the automated processing capability of document tables.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120874793A_ABST
    Figure CN120874793A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, can be applied to business system platforms of financial science and technology, medical health and the like, and discloses a table generation method, device and equipment based on image data and a medium, the method comprises the following steps: obtaining an initial document image, and carrying out image enhancement processing on the initial document image to obtain a to-be-identified document image; performing visual table detection on the to-be-identified document image to obtain a target table area in the to-be-identified document image, and performing horizontal projection and vertical projection on the target table area to obtain a target table layout; extracting target table data of each table unit in the target table layout, and constructing a mapping relationship between the table units and the target table data; and generating a corresponding structured spreadsheet according to the target table layout, and filling the target table data into the structured spreadsheet according to the mapping relationship. According to the invention, the image table data identification accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a method, apparatus, device, and medium for generating tables based on image data. Background Technology

[0002] Current table detection and extraction methods heavily rely on high-quality manually labeled datasets and are sensitive to factors such as table layout, font, and image quality, resulting in a serious lack of generalization ability in real-world business documents such as those in finance, insurance, and healthcare.

[0003] For example, in the healthcare field, table detection and extraction technology is crucial for medical record management, medical expense calculation, and research data statistics. However, current technology heavily relies on high-quality manually labeled datasets and is extremely sensitive to factors such as table layout, font, and image quality, resulting in severely insufficient generalization ability in practical applications. Hospitals routinely receive a large number of medical forms submitted by patients, such as examination reports and expense lists. These forms often feature diverse fonts, illegible handwriting, and even handwritten corrections, and are frequently accompanied by noise interference, multi-column layouts, and merged cells. Existing technologies struggle to accurately detect table boundaries and identify table structures in the face of these complexities, making it difficult to precisely extract table data, such as patients' examination indicators and expense details. This severely impacts the efficiency of electronic medical record management and hinders the accurate collection and analysis of medical research data, significantly impeding subsequent medical quality assessments and disease research.

[0004] For example, in the fintech industry, table inspection and extraction are crucial steps in processing business documents such as financial statements, contracts, and transaction records. When processing financial contracts, the tables may contain complex terms, have irregular structures, and include merged cells. Historical financial archives are often in PDF format or scanned images, with disorganized table layouts, multi-column formatting, and noise interference. Existing models struggle to adapt to these changes, failing to accurately extract table information from contracts, such as transaction amounts and terms. They also struggle to accurately obtain financial data from financial statements for risk assessment and auditing, significantly limiting the efficiency and accuracy of fintech data processing and analysis, and impacting the normal operation of financial businesses and decision-making.

[0005] Therefore, improving the accuracy and efficiency of image and table data recognition has become an urgent problem to be solved. Summary of the Invention

[0006] This invention provides a method, apparatus, device, and medium for generating tables based on image data, the main purpose of which is to solve the problem of low accuracy in recognizing image table data.

[0007] In a first aspect, to achieve the above objectives, the present invention provides a table generation method based on image data, comprising: An initial document image is acquired, and image enhancement processing is performed on the initial document image to obtain the document image to be identified; Visual table detection is performed on the document image to be identified to obtain the target table region in the document image to be identified, and the target table region is horizontally and vertically projected to obtain the target table layout. Extract the target table data of each table cell in the target table layout, and construct the mapping relationship between the table cell and the target table data; A corresponding structured spreadsheet is generated based on the target table layout, and the target table data is filled into the structured spreadsheet according to the mapping relationship.

[0008] Secondly, the present invention also provides a table generation apparatus based on image data, comprising: The image enhancement module is used to acquire an initial document image and perform image enhancement processing on the initial document image to obtain a document image to be recognized. The table layout recognition module is used to perform visual table detection on the document image to be recognized, obtain the target table region in the document image to be recognized, and perform horizontal and vertical projection on the target table region to obtain the target table layout. The mapping relationship generation module is used to extract the target table data of each table cell in the target table layout and construct the mapping relationship between the table cell and the target table data; The structured table construction module is used to generate a corresponding structured spreadsheet based on the target table layout, and to fill the target table data into the structured spreadsheet according to the mapping relationship.

[0009] Thirdly, the present invention also provides an electronic device, the electronic device comprising: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the image data-based table generation method described above.

[0010] Fourthly, the present invention also provides a computer-readable storage medium storing at least one computer program, which is executed by a processor in an electronic device to implement the above-described table generation method based on image data.

[0011] In this embodiment of the invention, the efficiency and accuracy of computer processing document images are improved. Grayscale processing converts a three-channel color image into a single channel, accelerating subsequent calculations. Noise suppression employs adaptive nonlocal mean denoising technology, which eliminates scanning noise while preserving text edge details, improving recognition accuracy and ensuring text readability. The invention also significantly enhances the computer's ability to parse document tables. The visual detection stage uses edge enhancement and feature clustering techniques to accurately locate table areas in complex backgrounds, improving layout parsing accuracy. Through refined data extraction and intelligent mapping construction techniques, the automation level of computer processing of table documents is significantly improved. A bidirectional association mechanism between identifier encoding and content features enables automatic parsing of complex structures such as merged cells across rows and diagonal headers, improving the efficiency of mapping relationship construction. Finally, layout parsing and intelligent filling techniques significantly improve the efficiency and accuracy of computer automated processing of table documents. The invention accurately parses the row and column structures and merging relationships of complex tables, is compatible with special layouts such as cross-row and cross-column layouts and diagonal headers, improving parsing accuracy, table data generation accuracy, and table generation efficiency. Attached Figure Description

[0012] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 This is a schematic diagram of an application environment for a table generation method based on image data according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating a method for generating tables based on image data according to an embodiment of the present invention. Figure 3 This is a schematic diagram illustrating the process of horizontal and vertical projection of a target table area according to an embodiment of the present invention. Figure 4 This is a schematic diagram of a module for a table generation device based on image data according to an embodiment of the present invention; Figure 5 A schematic diagram of the structure of an electronic device that implements a table generation method based on image data, according to an embodiment of the present invention; Figure 6 This is another structural schematic diagram of an electronic device that implements a table generation method based on image data, according to an embodiment of the present invention.

[0014] The objectives, features, and advantages of this invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0015] To enable those skilled in the art to better understand the technical solutions of this disclosure, and to fully understand and implement the process of how this disclosure applies technical means to solve technical problems and achieve corresponding technical effects, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, not all embodiments. The embodiments of this disclosure and the various features within them can be combined with each other without conflict, and the resulting technical solutions are all within the protection scope of this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without creative effort should fall within the protection scope of this disclosure.

[0016] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0017] This application provides a method for generating tables based on image data. The execution entity of this method includes, but is not limited to, at least one electronic device that can be configured to execute the device provided in this application, such as a server or a terminal. In other words, the method for generating tables based on image data can be executed by software or hardware installed on a terminal device or a server device. The server includes, but is not limited to, a single server, a server cluster, a cloud server, or a cluster of cloud servers. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0018] This invention discloses a table generation method based on image data, which can be applied to applications such as... Figure 1In this application environment, the client communicates with the server via a network. The server can obtain the initial document image from the client, improving the computer's processing efficiency and recognition accuracy for document images. Grayscale processing converts the three-channel color image into a single channel, accelerating subsequent calculations. Noise suppression uses adaptive non-local mean denoising technology, which eliminates scanning noise while preserving text edge details, improving recognition accuracy and ensuring text readability. It significantly enhances the computer's ability to parse document tables. The visual detection stage employs edge enhancement and feature clustering techniques to accurately locate table areas in complex backgrounds, improving layout parsing accuracy. Through refined data extraction and intelligent mapping construction technology, it significantly improves the automation level of computer processing of table documents. A bidirectional association mechanism between identifier encoding and content features enables automatic parsing of complex structures such as merged cells across rows and diagonal headers, improving the efficiency of mapping relationship construction. Through layout parsing and intelligent fill technology, it significantly improves the efficiency and accuracy of computer automated processing of table documents, accurately parsing the row and column structure and merging relationships of complex tables. It is compatible with special layouts such as cross-row and cross-column layouts and diagonal headers, improving parsing accuracy, table data generation accuracy, and table generation efficiency. Finally, the structured spreadsheet is output and fed back to the client. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The invention will now be described in detail through specific embodiments.

[0019] Reference Figure 2 The diagram shown is a flowchart illustrating a table generation method based on image data according to an embodiment of the present invention. In this embodiment, the table generation method based on image data includes: S1. Obtain an initial document image, and perform image enhancement processing on the initial document image to obtain the document image to be identified.

[0020] In this embodiment of the invention, the initial document image refers to the original file that has been converted into a digital image format (such as JPG, PNG, TIFF, etc.) for the first time by a device such as a scanner, digital camera, or smart terminal. Such images are the basic materials for document digitization and are widely used in fields such as file management, OCR recognition, electronic medical records, and financial document processing.

[0021] In detail, traditional scanners capture reflected light from a document line by line using CCD or CIS sensors, and generate high-resolution images in conjunction with a light source system (such as an LED array). Alternatively, portable digital cameras or mobile phone cameras can be used to capture documents with high-pixel sensors (such as 100-megapixel CMOS), combined with optical image stabilization (OIS) and phase detection autofocus (PDAF) technologies to ensure image sharpness, thereby obtaining an initial document image.

[0022] For example, in the healthcare scenario, taking the digitization of electronic medical records as an example, a tertiary hospital adopted a solution of "intelligent scanning terminal + edge computing" to achieve rapid conversion of paper medical records. The high-speed scanner deployed at the nurse station supports double-sided synchronous scanning and can process multiple documents per minute. With the built-in optical character preprocessing module, it can automatically recognize key information such as handwritten doctor's signatures and test report values ​​in the medical records, providing high-fidelity input for the AI-assisted diagnostic system.

[0023] For example, fintech scenarios focus on bill processing and anti-fraud applications. A bank's credit card center deployed a "smart teller machine" that integrates a high-speed scanner and a liveness detection camera. After a customer inserts their ID card, the system uses visible light + infrared dual-mode imaging technology to simultaneously collect the text and anti-counterfeiting watermark on the document surface. Combined with optical character recognition and deep learning models, it can complete the verification of document authenticity and automatic information filling in a short time. It also supports customers to take pictures of documents such as contracts and invoices with their mobile phones, achieving accurate and contextualized acquisition of initial document images, laying a reliable data foundation for subsequent document analysis.

[0024] In this embodiment of the invention, the step of performing image enhancement processing on the initial document image to obtain the document image to be identified includes: The initial document image is converted to grayscale to obtain a grayscale document image; The grayscale document image is subjected to noise suppression processing to obtain a denoised document image; The denoised document image is subjected to illumination equalization processing to obtain an equalized document image, and the equalized document image is subjected to edge enhancement processing to obtain an enhanced document image. The enhanced document image is then subjected to image tilt correction to obtain the document image to be identified.

[0025] In detail, image enhancement processing significantly improves the accuracy of subsequent optical character recognition or content analysis through multi-step collaborative optimization. Among them, grayscale processing is the basic step of image preprocessing, which aims to convert color document images (RGB three channels) into single-channel grayscale images. The grayscale value of each pixel is calculated by weighted averaging, that is, different weights are assigned to the red (R), green (G), and blue (B) channels respectively (usually 0.299, 0.587, and 0.114), simulating the differences in human eye sensitivity to different colors.

[0026] For example, the red stamp and black text in medical bills will form a clearer contrast due to the difference in brightness after grayscale conversion, while reducing the interference of color noise on subsequent processing, and single-channel data can reduce computational complexity.

[0027] Furthermore, the noise suppression processing filters out random noise (such as film grain and sensor thermal noise) introduced during scanning or shooting, including median filtering and adaptive nonlocal mean denoising. The median filtering replaces the center value by taking the median of the pixel neighborhood through a sliding window, which can effectively eliminate salt-and-pepper noise (such as black spots caused by paper jams in scanners) while preserving the sharpness of text edges. The adaptive nonlocal mean denoising is based on image patch similarity, using strong noise reduction for smooth areas (such as ticket backgrounds) and weak noise reduction for textured areas (such as handwritten signatures), avoiding excessive blurring of key information and improving the clarity of module boundaries.

[0028] Specifically, illumination equalization processing is used to correct local overexposure or overexposure in document images caused by uneven light sources. By dynamically adjusting the pixel brightness distribution, the grayscale histogram of the entire image tends to be more uniform. In practice, the image is divided into several sub-blocks, the local mean and variance of each sub-block are calculated, and then gamma correction or histogram specification techniques are used to enhance the brightness of low-light areas (such as text under the shadow of a folder) and restore details in high-exposure areas (such as reflective film).

[0029] Meanwhile, edge enhancement processing improves the clarity of character outlines by strengthening the boundary between text and background. This includes the Laplacian operator and anisotropic diffusion. The Laplacian operator detects edges through second-order differential and has a strong response to vertical or horizontal lines (such as table lines). The anisotropic diffusion simulates the heat conduction process, suppressing diffusion in edge areas (maintaining sharpness) and promoting diffusion in smooth areas (eliminating noise), thus achieving a balance between "preserving edges and reducing noise".

[0030] Furthermore, image tilt correction addresses the issue of shooting angle deviation by detecting the document's main direction and rotating it to the horizontal. It then uses Hough transform to detect straight line features in the image (such as table borders and text baselines), fits the optimal rotation angle using the least squares method, and finally achieves lossless rotation using bilinear interpolation.

[0031] In this embodiment of the invention, the efficiency and accuracy of computer processing document images are improved. Grayscale processing converts a three-channel color image into a single channel, accelerating subsequent calculations. Noise suppression adopts adaptive nonlocal mean denoising technology, which eliminates scanning noise while preserving text edge details, thereby improving recognition accuracy. Illumination equalization combined with dynamic histogram adjustment solves the problem of local information loss caused by uneven light source, ensuring text readability.

[0032] S2. Perform visual table detection on the document image to be identified to obtain the target table region in the document image to be identified, and perform horizontal and vertical projection on the target table region to obtain the target table layout.

[0033] In this embodiment of the invention, table regions are accurately extracted from the document image to be identified through edge detection, line filtering, and cluster analysis. Then, projection analysis is performed on the table regions to obtain the layout structure and form a complete table layout. This effectively solves the technical problem of table detection and layout recognition in complex documents, and can adapt to document images of different styles and qualities, laying a good foundation for subsequent table data extraction and structured processing.

[0034] In this embodiment of the invention, the step of performing visual table detection on the document image to be identified to obtain the target table region in the document image to be identified includes: Edge detection is performed on the document image to be identified to obtain the line structure of the document image to be identified; The line structure is subjected to line detection, and the detected lines are filtered according to the preset table line features to obtain candidate lines that meet the table line features; Cluster analysis is performed on the candidate lines to obtain a table frame; Based on the table outline, potential table regions are determined, and connected component analysis is performed on the potential table regions to obtain the closure score of the potential table regions. The potential table regions are filtered according to the preset table scoring threshold and the closure score to obtain candidate table regions; The candidate table region is subjected to nonmaximum suppression processing to obtain the target table region.

[0035] In detail, edge detection is the foundation of table structure analysis, aiming to extract line features in the image. The Canny edge detection algorithm is used, which uses a dual threshold strategy (high threshold to suppress weak edges, low threshold to connect discontinuous edges) and non-maximum suppression technology to filter out interfering edges such as text strokes and background textures while preserving the horizontal and vertical lines of the table.

[0036] Among them, the line detection and filtering transforms the edge image from pixel space to parameter space through Hough transform, and detects all possible line segments. Based on the detection results, a preset table line feature library is used, which includes angle range (such as horizontal / vertical lines within ±5), length threshold (such as lines exceeding 10% of the image width), and line width constraint (such as thin lines of 1-3 pixels). Through feature matching and filtering, non-table lines such as signature curves and decorative borders in contracts in the document image to be identified can be excluded, thereby improving the recognition accuracy.

[0037] Furthermore, cluster analysis groups based on the spatial relationship of straight lines, constructs table borders, and uses the DBSCAN density clustering algorithm, with the spacing between lines (e.g., less than 5 pixels) and angular deviation (e.g., less than 2°) as clustering conditions, to group horizontal and vertical lines belonging to the same table into one category; for example, nested tables in financial statements can be parsed layer by layer through hierarchical clustering, first identifying the outer borders, then segmenting the internal row and column lines, and finally generating a complete table topology.

[0038] Specifically, the closure score is used to quantify the integrity of potential table regions and is evaluated from three dimensions: first, line closure, which is the percentage of complete straight lines at the boundary of the region; second, region symmetry, which is the uniformity of row and column spacing; and third, content density, which is determined by connecting component analysis to see if the region contains regularly arranged cell content (such as numbers or short text). After comprehensive scoring, regions with a closure score of 0.8 or higher (out of 1) are judged as highly reliable table candidates.

[0039] Among them, region screening and non-maximum suppression ensure the accuracy of the results through dual filtering. Low-quality regions are eliminated according to a preset threshold (such as a closure score ≥ 0.7), and non-maximum suppression is applied to overlapping regions. That is, the score of the overlapping table is compared with the intersection-union ratio (IoU), and regions with higher scores and IoU exceeding the threshold (such as 0.5) are retained to eliminate duplicate detection caused by line breaks.

[0040] like Figure 3 As shown in the embodiment of the present invention, the step of performing horizontal and vertical projections on the target table area to obtain the target table layout includes: The target table region is binarized to obtain a binary table image; The binary table image is projected horizontally to generate a horizontal projection histogram, and the row dividing lines of the target table region are determined based on the horizontal projection histogram. The binary table image is vertically projected to generate a vertical projection histogram, and the column dividing lines of the target table region are determined based on the vertical projection histogram. An initial table grid structure is generated based on the row divider and the column divider, and cross-row and cross-column cells in the initial table grid structure are merged to obtain the target table layout.

[0041] In detail, binarization, as a preliminary step in projection analysis, aims to convert color or grayscale table images into black and white binary images to highlight the contrast between table lines and content. An adaptive thresholding algorithm is used to dynamically adjust the segmentation threshold based on local pixel density. For scanned documents with uneven lighting (such as the crease area of ​​medical bills), the algorithm divides the image into several sub-blocks and calculates the optimal threshold for each sub-block to ensure the separation effect between table lines (usually black) and background (white).

[0042] The horizontal projection analysis locates the row dividing lines of the table by statistically analyzing the black and white distribution of pixels in each row. In practice, the algorithm scans the binary image row by row, counts the number of black pixels (table lines or content) in each row, and generates a horizontal projection histogram. The trough regions in the histogram correspond to the blank intervals between table rows, while the peaks may contain table lines or dense content. Noise (such as local peaks generated by text strokes) is filtered out by dynamic thresholding, and troughs with a continuous length exceeding 30% of the row height are retained as row segmentation candidates.

[0043] For example, changes in row height caused by merging cells in financial statements can be smoothed by using a sliding window mean filter to smooth the histogram, ensuring that the dividing lines accurately capture the true row boundaries.

[0044] Furthermore, the vertical projection analysis is similar to the horizontal direction. A vertical projection histogram is generated by counting the number of black and white pixels in each column to locate column dividing lines. For complex tables (such as medical test reports with multi-level headers), the algorithm adopts a hierarchical projection strategy, that is, first detects the main column dividing lines in the global range, and then performs secondary projection on each main column area to identify nested sub-column dividing lines.

[0045] Specifically, after generating the initial table grid based on row and column dividing lines, the grid structure construction and cell merging process needs to handle merged cells that span rows / columns. The content areas crossed by the dividing lines are identified through connected component analysis. If the same content block (such as the "Total" cell) is surrounded by multiple dividing lines, its minimum bounding rectangle is calculated, and all dividing lines covering the rectangle are traced back in reverse and marked as "need to be merged".

[0046] For example, in a healthcare setting, taking the digitization of paper medical records in hospitals as an example, hospitals receive a large number of paper medical records daily, containing patient basic information, symptom descriptions, examination results, and other content presented in tabular form. First, the target table area of ​​the scanned paper medical record is binarized, converting the color or grayscale image into a binary table image containing only black and white, making the table lines and text more distinct. Next, a horizontal projection is performed to generate a horizontal projection histogram. The troughs in the histogram correspond to the row spacing of the table, allowing for precise determination of the row dividing lines of the target table area. Similarly, a vertical projection histogram is generated to determine the column dividing lines. After generating an initial table grid structure based on the row and column dividing lines, since the medical record table may contain cells that span multiple rows, such as "Past Medical History," it is necessary to merge the cross-row and cross-column cells in the initial grid structure to obtain a complete and accurate target table layout. Subsequently, based on this layout, medical record information can be automatically extracted and entered into the hospital information system, improving the efficiency of medical record management.

[0047] In this embodiment of the invention, the computer's ability to parse document tables is significantly improved. The visual detection stage uses edge enhancement and feature clustering technology, which can accurately locate table regions in complex backgrounds. Through adaptive binarization and dynamic threshold projection, table line extraction can be adapted to different lighting conditions, thereby improving the accuracy of layout parsing.

[0048] S3. Extract the target table data of each table cell in the target table layout, and construct the mapping relationship between the table cell and the target table data.

[0049] In this embodiment of the invention, intelligent conversion from document images to structured data is realized. Through precise cell positioning, region cropping, and text detection technologies, the content information of each table cell is accurately extracted, and a mapping relationship between table cells and data is established, ensuring the accuracy of data extraction. This effectively solves the problem of data and structure being disconnected in traditional table recognition, and significantly improves the automation level and data availability of document digitization.

[0050] In this embodiment of the invention, extracting the target table data of each table cell in the target table layout includes: The target table layout is positioned by cell location to obtain multiple table cells, and the cell boundary coordinates of the multiple table cells are identified. Based on the cell boundary coordinates and the target table layout, the document image to be identified is cropped to obtain the corresponding cell image block; Text region detection is performed on each of the cell image blocks to obtain a valid text region including text content; The effective text area is subjected to optical character recognition processing to obtain initial table data; The initial table data is post-processed to obtain the target table data.

[0051] In detail, cell positioning and boundary recognition are the foundation of data extraction, aiming to accurately determine the spatial range of each table cell. Based on the row and column dividing line information of the target table layout, geometric topology analysis technology is used to generate a complete cell coordinate matrix by scanning the intersection of all row and column dividing lines. Then, the coordinates of the four vertices of each cell are redundantly checked, and abnormal coordinates caused by broken or merged table lines (such as cells with overlapping coordinates or deviating from the grid by more than 10%) are removed. Finally, the minimum bounding rectangle boundary coordinates are marked for each valid cell.

[0052] Specifically, the region cropping and image block generation process spatially segments the document image to be recognized based on the cell boundary coordinates. A bilinear interpolation algorithm is used to resample the cropped region at the pixel level to ensure that even if the cells are tilted (such as table distortion caused by document scanning tilt), the generated image blocks still maintain the orthogonality of the text direction. At the same time, for small cells (such as columns with a width of less than 10 pixels), dynamic magnification processing (the magnification factor is automatically adjusted according to the minimum font size) is used to enhance the readability of the text.

[0053] Furthermore, the 8-connected region labeling algorithm is used to identify all connected pixel blocks, filter out non-text regions such as table lines and background noise, and calculate the aspect ratio, duty cycle and other features of each connected block to select candidate regions that conform to the text shape. Finally, the baseline position of the text line is determined by the projection analysis method to further refine the text region boundary and avoid recognition errors caused by font differences.

[0054] Among them, optical character recognition adopts a deep learning-driven hybrid recognition engine, combining the feature extraction capabilities of convolutional neural networks (CNN) with the sequence modeling advantages of recurrent neural networks (RNN) to decode characters in text region images; for multiple types of content such as Chinese, English, numbers, and symbols, the system automatically switches the corresponding language model and strengthens contextual association through attention mechanisms (such as the distinction between "20%" and "20"); data post-processing improves data quality through semantic verification and format standardization, performs logical verification on the recognition results (such as date format and numerical range), and automatically corrects common errors (such as full-width / half-width symbol conversion and case consistency).

[0055] In this embodiment of the invention, constructing the mapping relationship between the table unit and the target table data includes: Each of the table cells is assigned an identifier to obtain an identifier for each table cell. Extract the data items, corresponding content features, and location information from the target table data; Based on the identifiers of each table cell, the content features, and the location information, the table cells are matched and associated with the corresponding target table data to obtain the matching results; Based on the matching results, a bidirectional mapping table is constructed between each table cell identifier and the corresponding data item; The mapping relationship between the table cell and the target table data is determined based on the bidirectional mapping relationship table.

[0056] In detail, a unique numerical label is generated for each cell, and a coordinate code is generated according to the row and column structure of the table. The cells are numbered horizontally from left to right by column as C1, C2, etc., and vertically from top to bottom by row as R1, R2, etc. The final cell identifier is "row number + column number" (e.g., R3C2 represents the cell in the 3rd row and 2nd column).

[0057] For merged cells, the range of original cells they cover is determined by the minimum bounding rectangle algorithm, and the merging direction is marked (e.g., horizontal merging is marked as "H-R2C1-3", indicating horizontal merging of the 2nd row and the 1st to 3rd columns).

[0058] Furthermore, natural language processing technology is first used to identify data types (such as dates, numbers, text, etc.) and extract content features, including keywords (such as table header labels such as "total" and "aggregate"), semantic tags (such as identifying "hemoglobin" as a test indicator through medical knowledge graph) and format features (such as currency symbols "¥" and percentage symbols "%"); at the same time, the relative position of data items in the table is recorded (such as being located in the 2nd row and 4th column), forming a "content-feature-position" triplet information database.

[0059] Specifically, preliminary filtering is performed based on the location information of data items (such as row number and column number) and cell identifiers. Then, the robustness of matching is enhanced by content feature verification, such as comparing whether the keywords of data items are consistent with the semantics of the column header where the cell is located (e.g., the data in the "Age" column should all be numerical and in the range of 0-120).

[0060] In detail, the bidirectional mapping table is constructed using cell identifiers as indexes to establish bidirectional links between "identifier → data item" and "data item → identifier". It adopts a key-value pair storage structure, where the key is the cell identifier and the value is a composite object containing data content, data type, and semantic tags. At the same time, it records the identifier to which each data item belongs. It also supports fast querying and dynamic updates. When the table structure or data content changes, only the associated key-value pairs need to be adjusted to maintain mapping consistency. Data can be located by cell, or the cell position can be retrieved by data characteristics (such as finding all cells containing the "error" tag) to obtain the relevant mapping relationship.

[0061] For example, during the upgrade of a medical information management system, it is necessary to migrate medical record table data from the old system to the new system and establish a reasonable mapping relationship to ensure accurate data correspondence. The medical record tables in the old system contain multiple table units such as basic patient information, diagnostic records, and treatment plans. First, a unique identifier is assigned to each table unit. Data items are extracted from the target table data in the new system, such as patient name, age, gender, as well as the name of the diagnosed disease, diagnosis time, and specific drugs and dosages in the treatment plan. At the same time, the content characteristics corresponding to these data items are obtained, such as the text type of the name, the numerical type of the age, and their position information in the table, such as which row and column they are in.

[0062] Based on table cell identifiers, content features, and location information, table cells are matched and associated with corresponding target table data. For example, by identifying the content features and location relevance of table cells with data items such as patient names and ages in the new system, matching results are obtained. Then, a two-way mapping relationship table is constructed based on the matching results to clarify the correspondence between data items such as patient names and ages. Finally, the mapping relationship between table cells and target table data is determined based on the two-way mapping relationship table. This can accurately fill the old system's medical record table data into the corresponding positions in the new system, ensuring the integrity and accuracy of medical information, facilitating doctors' access to and analysis of patient conditions, and improving the quality of medical services.

[0063] In this embodiment of the invention, the automation level of computer processing of spreadsheet documents is significantly improved by using refined data extraction and intelligent mapping construction technology. In the data extraction stage, cell positioning and multi-level text detection technology are used to accurately identify tiny text in low-resolution or complex layout tables. In the mapping construction stage, the automatic parsing of complex structures such as cross-row merged cells and diagonal headers is achieved through a two-way association mechanism of identifier encoding and content features, thereby improving the efficiency of mapping relationship construction.

[0064] S4. Generate a corresponding structured spreadsheet based on the target table layout, and fill the target table data into the structured spreadsheet according to the mapping relationship.

[0065] In this embodiment of the invention, a structured spreadsheet is generated by parsing the table layout, and the categorized and sorted table data is accurately filled into the corresponding cells according to the mapping relationship, thereby realizing the automatic conversion of document tables into spreadsheets.

[0066] For example, in a healthcare setting, when hospitals organize patient examination report data, the original examination forms have diverse layouts, with different examination items distributed in complex forms. First, the target examination form layout is analyzed to accurately identify the table's row and column structure, such as which rows correspond to different major examination categories (e.g., blood routine, urine routine, etc.) and which columns correspond to specific indicators (e.g., red blood cell count, white blood cell count, etc.). Cell merging relationships are also determined; for example, some comprehensive evaluation areas may have multiple merged cells. Next, based on the analyzed row and column structure and cell merging relationships, a structured spreadsheet is generated, providing a standardized data storage framework. Then, according to pre-established mapping relationships, the various indicators in the patient's examination data are classified and sorted, grouping data belonging to the blood routine category and arranging them sequentially to form a data filling queue. Finally, using the coordinates of each cell in the structured spreadsheet, the data in the data filling queue is accurately filled into the corresponding positions, completing the structured organization of the examination report data, facilitating quick review and analysis by doctors.

[0067] In this embodiment of the invention, generating a corresponding structured spreadsheet based on the target table layout and filling the structured spreadsheet with the target table data according to the mapping relationship includes: The target table layout is parsed to obtain the row and column structure and cell merging relationships; Generate a corresponding structured spreadsheet based on the row and column structure and the cell merging relationship; The target table data is classified and sorted according to the mapping relationship to obtain a data filling queue; Using the cell coordinates in the structured spreadsheet, the data filling queue is sequentially filled into the structured spreadsheet.

[0068] In detail, the layout parsing uses layered scanning and topology analysis technology to accurately restore the row and column structure and merging relationship of the table. It performs horizontal and vertical dividing line detection on the target table layout, identifies the boundaries of all independent cells through connected component analysis, and then uses a depth-first search algorithm to traverse the adjacency relationship between cells to construct the row and column topology graph of the table. For merged cells, it generates a merging relationship description (such as "3 rows and 2 columns merged horizontally") by detecting the number and direction (horizontal / vertical) of the original cells they cover.

[0069] The structured spreadsheet generation dynamically creates an editable spreadsheet framework based on the parsing results. It determines the total number of rows and columns of the table according to the row and column structure and assigns unique electronic coordinates to each cell. For merged cells, it creates a merged area within the specified coordinate range by calling the merge function of the spreadsheet API and retains the original cell references for data filling. The generated spreadsheet supports all mainstream formats (such as XLSX and CSV) and is compatible with the display rules of different software.

[0070] Specifically, the data classification and sorting constructs the logical order of data filling based on the mapping relationship. The mapping relationship table is traversed to extract the target cell identifier (such as R2C3) corresponding to each data item. According to the row and column coordinate system of the spreadsheet, the identifier is converted into electronic coordinates. Finally, the data items are sorted in the order of "row first, then column" to form a linear filling queue from A1 to the last row and column.

[0071] For data in merged cells across rows, the fill position is determined based on the starting coordinates of the merged area (e.g., the starting column for horizontal merging), and subsequent coordinates are marked as placeholders to avoid duplicate filling.

[0072] Furthermore, precise data filling achieves efficient writing through coordinate mapping and exception handling mechanisms. It traverses the data filling queue and writes the content of each data item into the corresponding electronic cell. For data types (such as date, number, text), it automatically calls the spreadsheet's formatting functions and checks whether the data length exceeds the cell width. If it does, it automatically adjusts the column width or enables automatic line wrapping.

[0073] For example, in a fintech scenario, taking a bank's processing of customer loan application forms as an example, the loan application forms submitted by customers vary in format and contain various aspects such as basic customer information, loan information, and financial status. After parsing the layout of the target form, the rows and columns of each part of the information can be clearly divided, as well as some special cell merging situations, such as customer contact information being displayed in merged cells. After generating a structured spreadsheet based on the parsing results, the customer loan data is classified and sorted according to the mapping relationship, and customer basic information, loan amount, repayment period, etc. are classified separately to form a data filling queue. Then, using electronic cell coordinates, the data is accurately filled into the structured spreadsheet, which facilitates the bank system's subsequent automated review and risk assessment of loan applications, improving business processing efficiency and accuracy.

[0074] In this embodiment of the invention, layout parsing and intelligent fill technology significantly improve the efficiency and accuracy of computer-automated processing of table documents. It accurately parses the row and column structure and merging relationships of complex tables, and is compatible with special layouts such as cross-row and cross-column, diagonal headers, etc., improving parsing accuracy. Subsequently, it dynamically generates a structured spreadsheet with the same logic as the original table, supports multiple output formats such as Excel and CSV, and intelligently sorts the data through mapping relationships to construct a fill queue that conforms to the spreadsheet coordinate system, achieving millisecond-level accurate matching between data and cells, thereby improving the accuracy and efficiency of table data generation.

[0075] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0076] like Figure 4 The diagram shown is a functional block diagram of a table generation device based on image data provided in an embodiment of the present invention.

[0077] This disclosure provides a table generation device based on image data, which corresponds one-to-one with the table generation method based on image data described in the above embodiments. For example... Figure 4 As shown, this image data-based table generation device 100 can be installed in an electronic device. Depending on its functions, the image data-based table generation device 100 includes an image enhancement module 101, a table layout recognition module 102, a mapping relationship generation module 103, and a structured table construction module 104. Detailed descriptions of each functional module are as follows: Image enhancement module 101 is used to obtain data migration information from the source database, perform multi-dimensional information analysis on the data migration information, and obtain data migration scenario and data service category; The table layout recognition module 102 is used to generate a set of data migration tasks according to the data migration scenario and the data service category, and to perform balanced task decomposition on the set of data migration tasks to obtain multiple data migration sub-tasks. The mapping relationship generation module 103 is used to obtain the data to be migrated from multiple data migration subtasks, perform data augmentation processing on the data to be migrated, and obtain the target data to be migrated. The structure table construction module 104 is used to obtain the target database and migrate the target data to be migrated to the target database in parallel according to the database identifier of the target database.

[0078] In one embodiment, when the image enhancement module 101 performs image enhancement processing on the initial document image to obtain the document image to be recognized, it is used to: The initial document image is converted to grayscale to obtain a grayscale document image; The grayscale document image is subjected to noise suppression processing to obtain a denoised document image; The denoised document image is subjected to illumination equalization processing to obtain an equalized document image, and the equalized document image is subjected to edge enhancement processing to obtain an enhanced document image. The enhanced document image is then subjected to image tilt correction to obtain the document image to be identified.

[0079] In one embodiment, when the table layout recognition module 102 performs visual table detection on the document image to be recognized and obtains the target table region in the document image to be recognized, it is used to: Edge detection is performed on the document image to be identified to obtain the line structure of the document image to be identified; The line structure is subjected to line detection, and the detected lines are filtered according to the preset table line features to obtain candidate lines that meet the table line features; Cluster analysis is performed on the candidate lines to obtain a table frame; Based on the table outline, potential table regions are determined, and connected component analysis is performed on the potential table regions to obtain the closure score of the potential table regions. The potential table regions are filtered according to the preset table scoring threshold and the closure score to obtain candidate table regions; The candidate table region is subjected to nonmaximum suppression processing to obtain the target table region.

[0080] In one embodiment, when the table layout recognition module 102 performs horizontal and vertical projection on the target table area to obtain the target table layout, it is used to: The target table region is binarized to obtain a binary table image; The binary table image is projected horizontally to generate a horizontal projection histogram, and the row dividing lines of the target table region are determined based on the horizontal projection histogram. The binary table image is vertically projected to generate a vertical projection histogram, and the column dividing lines of the target table region are determined based on the vertical projection histogram. An initial table grid structure is generated based on the row divider and the column divider, and cross-row and cross-column cells in the initial table grid structure are merged to obtain the target table layout.

[0081] In one embodiment, when the mapping relationship generation module 103 extracts the target table data of each table cell in the target table layout, it is used to: The target table layout is positioned by cell location to obtain multiple table cells, and the cell boundary coordinates of the multiple table cells are identified. Based on the cell boundary coordinates and the target table layout, the document image to be identified is cropped to obtain the corresponding cell image block; Text region detection is performed on each of the cell image blocks to obtain a valid text region including text content; The effective text area is subjected to optical character recognition processing to obtain initial table data; The initial table data is post-processed to obtain the target table data.

[0082] In one embodiment, the mapping relationship generation module 103, when performing the construction of the mapping relationship between the table unit and the target table data, is used to: Each of the table cells is assigned an identifier to obtain an identifier for each table cell. Extract the data items, corresponding content features, and location information from the target table data; Based on the identifiers of each table cell, the content features, and the location information, the table cells are matched and associated with the corresponding target table data to obtain the matching results; Based on the matching results, a bidirectional mapping table is constructed between each table cell identifier and the corresponding data item; The mapping relationship between the table cell and the target table data is determined based on the bidirectional mapping relationship table.

[0083] In one embodiment, when the structured table construction module 104 generates a corresponding structured spreadsheet based on the target table layout and fills the target table data into the structured spreadsheet according to the mapping relationship, it is used to: The target table layout is parsed to obtain the row and column structure and cell merging relationships; Generate a corresponding structured spreadsheet based on the row and column structure and the cell merging relationship; The target table data is classified and sorted according to the mapping relationship to obtain a data filling queue; Using the cell coordinates in the structured spreadsheet, the data filling queue is sequentially filled into the structured spreadsheet.

[0084] In this invention, the specific limitations of the table generation device based on image data can be found in the above-described limitations of the table generation method based on image data, and will not be repeated here. Each module in the aforementioned table generation device based on image data can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0085] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements the functions or steps of a table generation method based on image data on the server side.

[0086] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 6 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When executed by the processor, the computer program implements client-side functions or steps of a table generation method based on image data.

[0087] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps: An initial document image is acquired, and image enhancement processing is performed on the initial document image to obtain the document image to be identified; Visual table detection is performed on the document image to be identified to obtain the target table region in the document image to be identified, and the target table region is horizontally and vertically projected to obtain the target table layout. Extract the target table data of each table cell in the target table layout, and construct the mapping relationship between the table cell and the target table data; A corresponding structured spreadsheet is generated based on the target table layout, and the target table data is filled into the structured spreadsheet according to the mapping relationship.

[0088] In the several embodiments provided by this invention, it should be understood that the disclosed devices and apparatuses can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.

[0089] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.

[0090] Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within the invention. No appended diagram markings in the claims should be construed as limiting the scope of the claims.

[0091] In some embodiments of this example, a computer-readable storage medium is provided, on which a computer program is stored, characterized in that the computer program, when executed by a processor, implements the steps of the method described in the above embodiments.

[0092] The readable storage medium of the present invention stores a computer program, which, when executed by a processor of an electronic device, can perform the following: An initial document image is acquired, and image enhancement processing is performed on the initial document image to obtain the document image to be identified; Visual table detection is performed on the document image to be identified to obtain the target table region in the document image to be identified, and the target table region is horizontally and vertically projected to obtain the target table layout. Extract the target table data of each table cell in the target table layout, and construct the mapping relationship between the table cell and the target table data; A corresponding structured spreadsheet is generated based on the target table layout, and the target table data is filled into the structured spreadsheet according to the mapping relationship.

[0093] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.

[0094] Computer-readable storage media may also store at least one computer-executable program / instruction, such as computer-readable instructions. Computer-readable storage media include, but are not limited to, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Computer-readable storage media may include, for example, read-only memory (ROM), hard disk, flash memory, etc. For example, a non-transitory computer-readable storage medium may be connected to a computing device such as a computer, and then, when the computing device executes the computer-readable instructions stored on the computer-readable storage medium, the various methods described above can be performed.

[0095] In addition, the computer device may include (but is not limited to) a data bus, an input / output (I / O) bus, a display, and input / output devices (e.g., keyboard, mouse, speakers, etc.).

[0096] In one embodiment, the at least one computer-executable instruction may also be compiled into or comprise a software product / computer program product, wherein one or more computer-executable instructions are executed by a processor to perform the steps of the various functions and / or methods in the embodiments described herein.

[0097] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Furthermore, any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory.

[0098] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0099] In the embodiments provided in this disclosure, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0100] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

[0101] It should be noted that if any software tools or components not belonging to our company appear in the embodiments of this application, they are merely for illustrative purposes and do not represent actual use.

Claims

1. A method for generating tables based on image data, characterized in that, The method includes: An initial document image is acquired, and image enhancement processing is performed on the initial document image to obtain the document image to be identified; Visual table detection is performed on the document image to be identified to obtain the target table region in the document image to be identified, and the target table region is horizontally and vertically projected to obtain the target table layout. Extract the target table data of each table cell in the target table layout, and construct the mapping relationship between the table cell and the target table data; A corresponding structured spreadsheet is generated based on the target table layout, and the target table data is filled into the structured spreadsheet according to the mapping relationship.

2. The table generation method based on image data as described in claim 1, characterized in that, The step of performing visual table detection on the document image to be identified, to obtain the target table region in the document image to be identified, includes: Edge detection is performed on the document image to be identified to obtain the line structure of the document image to be identified; The line structure is subjected to line detection, and the detected lines are filtered according to the preset table line features to obtain candidate lines that meet the table line features; Cluster analysis is performed on the candidate lines to obtain a table frame; Based on the table outline, potential table regions are determined, and connected component analysis is performed on the potential table regions to obtain the closure score of the potential table regions. The potential table regions are filtered according to the preset table scoring threshold and the closure score to obtain candidate table regions; The candidate table region is subjected to nonmaximum suppression processing to obtain the target table region.

3. The table generation method based on image data as described in claim 1, characterized in that, The step of performing horizontal and vertical projections on the target table area to obtain the target table layout includes: The target table region is binarized to obtain a binary table image; The binary table image is projected horizontally to generate a horizontal projection histogram, and the row dividing lines of the target table region are determined based on the horizontal projection histogram. The binary table image is vertically projected to generate a vertical projection histogram, and the column dividing lines of the target table region are determined based on the vertical projection histogram. An initial table grid structure is generated based on the row divider and the column divider, and cross-row and cross-column cells in the initial table grid structure are merged to obtain the target table layout.

4. The table generation method based on image data as described in claim 1, characterized in that, The step of extracting target table data from each table cell in the target table layout includes: The target table layout is positioned by cell location to obtain multiple table cells, and the cell boundary coordinates of the multiple table cells are identified. Based on the cell boundary coordinates and the target table layout, the document image to be identified is cropped to obtain the corresponding cell image block; Text region detection is performed on each of the cell image blocks to obtain a valid text region including text content; The effective text area is subjected to optical character recognition processing to obtain initial table data; The initial table data is post-processed to obtain the target table data.

5. The table generation method based on image data as described in claim 1, characterized in that, The process of constructing the mapping relationship between the table unit and the target table data includes: Each of the table cells is assigned an identifier to obtain an identifier for each table cell. Extract the data items, corresponding content features, and location information from the target table data; Based on the identifiers of each table cell, the content features, and the location information, the table cells are matched and associated with the corresponding target table data to obtain the matching results; Based on the matching results, a bidirectional mapping table is constructed between each table cell identifier and the corresponding data item; The mapping relationship between the table cell and the target table data is determined based on the bidirectional mapping relationship table.

6. The table generation method based on image data as described in claim 1, characterized in that, The step of generating a corresponding structured spreadsheet based on the target table layout and filling the structured spreadsheet with the target table data according to the mapping relationship includes: The target table layout is parsed to obtain the row and column structure and cell merging relationships; Generate a corresponding structured spreadsheet based on the row and column structure and the cell merging relationship; The target table data is classified and sorted according to the mapping relationship to obtain a data filling queue; Using the cell coordinates in the structured spreadsheet, the data filling queue is sequentially filled into the structured spreadsheet.

7. The table generation method based on image data as described in claim 1, characterized in that, The step of performing image enhancement processing on the initial document image to obtain the document image to be identified includes: The initial document image is converted to grayscale to obtain a grayscale document image; The grayscale document image is subjected to noise suppression processing to obtain a denoised document image; The denoised document image is subjected to illumination equalization processing to obtain an equalized document image, and the equalized document image is subjected to edge enhancement processing to obtain an enhanced document image. The enhanced document image is then subjected to image tilt correction to obtain the document image to be identified.

8. A table generation device based on image data, characterized in that, The device includes: The image enhancement module is used to acquire an initial document image and perform image enhancement processing on the initial document image to obtain a document image to be recognized. The table layout recognition module is used to perform visual table detection on the document image to be recognized, obtain the target table region in the document image to be recognized, and perform horizontal and vertical projection on the target table region to obtain the target table layout. The mapping relationship generation module is used to extract the target table data of each table cell in the target table layout and construct the mapping relationship between the table cell and the target table data; The structured table construction module is used to generate a corresponding structured spreadsheet based on the target table layout, and to fill the target table data into the structured spreadsheet according to the mapping relationship.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor to enable the at least one processor to perform the table generation method based on image data as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the table generation method based on image data as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Vehicle test domain knowledge graph construction method and system based on global semantic driving

    CN121835854A