Wireless table structure identification method, device, equipment, storage medium and program product

By extracting content outlines, removing noise, clustering and projecting from wireless table images, the noise interference and merged cell problems in wireless table structure recognition are solved, efficient and accurate table structure recognition is achieved, and resource consumption is reduced.

CN120260062BActive Publication Date: 2025-10-14CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510750917.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-06
Publication Date
2025-10-14
Estimated Expiration
2045-06-06

AI Technical Summary

Technical Problem

Existing wireless table structure recognition methods have problems such as large noise interference, low recognition efficiency and difficulty in processing merged cells. In particular, deep learning methods require a large amount of data annotation and resources, while traditional methods are susceptible to noise interference and have limited application scenarios.

Method used

By extracting the content outline from the target table image, performing noise removal processing, determining the cell blocks based on center point clustering, and determining the row and column coordinate information through horizontal and vertical projection, the table structure is finally determined. A simple algorithm is used to reduce noise interference and accurately obtain the table area.

Benefits of technology

It improves the accuracy of wireless table structure recognition, reduces resource consumption, can effectively handle the situation of merged cells, and recognizes wireless table structures concisely and efficiently.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120260062B_ABST
    Figure CN120260062B_ABST
Patent Text Reader

Abstract

The application relates to a wireless table structure recognition method and device, equipment, a storage medium and a program product, and relates to the technical field of image recognition. At least one content contour is extracted from a target table image; noise removal processing is performed on each content contour to obtain at least one content region; clustering processing is performed based on the center points of each content region to determine a plurality of cell blocks; horizontal projection is performed on the plurality of cell blocks, and row coordinate information is determined according to the horizontal projection result; vertical projection is performed on the plurality of cell blocks, and column coordinate information is determined according to the vertical projection result; and the table structure is determined according to the row coordinate information and the column coordinate information. The method can reduce noise interference and improve the accuracy of wireless table structure recognition. The plurality of content regions in a cell are subjected to clustering processing, the table cell region can be accurately obtained, deep learning algorithms are not required, resource consumption is low, and the wireless table structure can be simply and effectively recognized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image recognition, in particular to a wireless table structure recognition method and device, computer equipment, computer readable storage medium and computer program product. BACKGROUND

[0002] Document images exist in various fields as a data format, and there is a large amount of data information in the form of tables in some images. According to whether the image has a table line, the table can be classified into a wired table and a wireless table. Extracting data information of the table from the image requires accurate recognition of the table structure. At present, the wired table technology is relatively mature, while the wireless table still has the problem of low structure recognition efficiency. The recognition accuracy of the wireless table structure has an important influence on the information extraction of the document image.

[0003] At present, the methods applied to the recognition of the wireless table structure mainly include the following categories:

[0004] 1. Using a deep learning method to recognize the table structure, such as using a model to learn the visual features, semantic features and layout features of the table image, and constructing a table graph with text as the vertex and the vertex with edge relationship through multi-modal fusion features. This method needs to collect a large amount of data and perform data labeling, and requires certain GPU (Graphics Processing Unit) resources for inference.

[0005] 2. Using a large model to perform sentence segmentation and discrimination on the text in the table, and then generating the table according to the sentence segmentation result. This method uses a large model and consumes a lot of resources.

[0006] 3. Using some traditional methods, such as using row and column projection, and taking the wave trough as the position of the table cell division line. This method is easily disturbed by noise and cannot handle the case of merged cells.

[0007] In summary, most of the existing wireless table structure recognition methods use deep learning methods, which need to be labeled and have complex methods. The existing methods using traditional methods for table structure recognition are too simple and cannot handle noise interference and merged cells, and the application scenarios are extremely limited. SUMMARY

[0008] Therefore, it is necessary to provide a wireless table structure recognition method, device, computer equipment, computer readable storage medium and computer program product to reduce noise interference and improve the accuracy of wireless table structure recognition.

[0009] In a first aspect, the present application provides a wireless table structure recognition method, comprising:

[0010] extracting at least one content contour from the target table image;

[0011] performing noise removal processing on each content contour to obtain at least one content region;

[0012] performing clustering processing based on a center point of each content region to determine a plurality of cell blocks;

[0013] performing horizontal projection on the plurality of cell blocks to determine row coordinate information according to a horizontal projection result;

[0014] performing vertical projection on the plurality of cell blocks to determine column coordinate information according to a vertical projection result;

[0015] determining a table structure according to the row coordinate information and the column coordinate information.

[0016] In one of the embodiments, the noise removal processing includes at least one of a fine noise removal processing and a connected line noise removal processing; the connected line noise removal processing includes the following steps:

[0017] splitting the content contour into a plurality of rectangular regions;

[0018] filtering the rectangular regions with a width less than a set width threshold to obtain a plurality of target rectangular regions;

[0019] merging the plurality of target rectangular regions into at least one image region;

[0020] determining a minimum circumscribed rectangle of each image region to obtain at least one content region.

[0021] In one of the embodiments, splitting the content contour into a plurality of rectangular regions includes:

[0022] detecting, for each content contour, corner points on each edge of the content contour;

[0023] determining a horizontal coordinate set and a vertical coordinate set based on coordinate information of the corner points;

[0024] constructing a reference rectangle according to any two adjacent horizontal coordinates in the horizontal coordinate set and any two adjacent vertical coordinates in the vertical coordinate set;

[0025] filtering the reference rectangle with a rectangular center point not in the content contour to obtain a plurality of rectangular regions.

[0026] In one of the embodiments, the fine noise removal processing includes the following steps:

[0027] filtering the content contour with a contour area less than a first preset threshold or a contour size less than a second preset threshold to obtain at least one content region.

[0028] In one of the embodiments, before extracting the at least one content contour from the target table image, the method further comprises:

[0029] obtaining an initial table image;

[0030] preprocessing the initial table image to obtain a target table image.

[0031] In one of the embodiments, preprocessing the initial table image to obtain a target table image comprises:

[0032] setting pixel values of a boundary region of the initial table image to an average pixel value of the initial table image to obtain a first intermediate image;

[0033] performing binarization processing and open operation processing on the first intermediate image to obtain a second intermediate image;

[0034] performing horizontal projection on the second intermediate image to determine peak coordinate information;

[0035] performing foreground removal processing on a region corresponding to the peak coordinate information in the second intermediate image to obtain a target table image.

[0036] In a second aspect, the present application further provides a wireless table structure recognition device, comprising:

[0037] a contour extraction module configured to extract at least one content contour from a target table image;

[0038] a noise removal module configured to perform noise removal processing on each content contour to obtain at least one content region;

[0039] a clustering module configured to perform clustering processing based on a center point of each content region to determine a plurality of cell blocks;

[0040] a projection module configured to perform horizontal projection on the plurality of cell blocks to determine row coordinate information according to a horizontal projection result, and perform vertical projection on the plurality of cell blocks to determine column coordinate information according to a vertical projection result;

[0041] a determination module configured to determine a table structure according to the row coordinate information and the column coordinate information.

[0042] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements steps of the method of the first aspect when executing the computer program.

[0043] In a fourth aspect, the present application also provides a computer readable storage medium, having stored thereon a computer program, which, when executed by a processor, implements the steps of the method according to the first aspect.

[0044] In a fifth aspect, the present application also provides a computer program product, comprising a computer program which, when executed by a processor, implements the steps of the method according to the first aspect.

[0045] The wireless table structure recognition method, device, computer device, computer readable storage medium and computer program product described above extract at least one content contour from a target table image; perform noise removal processing on each content contour to obtain at least one content region; perform clustering processing based on the center point of each content region to determine a plurality of cell blocks; perform horizontal projection on the plurality of cell blocks, and determine row coordinate information according to the horizontal projection result; perform vertical projection on the plurality of cell blocks, and determine column coordinate information according to the vertical projection result; and determine the table structure according to the row coordinate information and the column coordinate information. In this way, by means of noise removal processing, noise interference can be reduced, and the accuracy of wireless table structure recognition can be improved. By means of clustering processing on a plurality of content regions in a cell, the table cell region can be accurately obtained. By means of horizontal projection and vertical projection, the table structure can be determined, and the situation of a merged cell can be processed. Without using a deep learning algorithm, the wireless table structure can be recognized simply and effectively with less resource consumption. BRIEF DESCRIPTION OF DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the description of the embodiments of the present application or the related art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other related drawings can also be obtained without creative labor.

[0047] Figure 1 A flowchart of a wireless table structure recognition method in an embodiment;

[0048] Figure 2 A schematic diagram of an image processing process in an embodiment;

[0049] Figure 3 A flowchart of a wireless table structure recognition method in another embodiment;

[0050] Figure 4 A schematic diagram of an image processing result in an embodiment;

[0051] Figure 5 A block diagram of a wireless table structure recognition device in an embodiment;

[0052] Figure 6 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0054] In an exemplary embodiment, Figure 1 As shown, a wireless table structure recognition method is provided. This embodiment uses the method applied to a computer device as an example for illustration. It is understandable that the method can also be applied to a server, and can also be applied to a system including a computer device and a server, and is implemented through the interaction between the computer device and the server. The method includes:

[0055] Step 102: extract at least one content outline from the target table image.

[0056] Here, an outer contour detection algorithm is used to detect each outer contour in the target table image to obtain at least one content contour. The outer contour detection algorithm is, for example, the Canny edge detection algorithm, which is not limited in this embodiment.

[0057] Step 104: Perform noise removal on each content outline to obtain at least one content region.

[0058] The noise removal process includes at least one of fine noise removal and adhesion line noise removal. Optionally, each content outline is subjected to morphological processing, including dilation, erosion, opening and closing operations, to remove noise from each content outline.

[0059] Step 106 : performing clustering processing based on the center point of each content area to determine a plurality of cell blocks.

[0060] The center point of each content area is extracted, and the contour centers are clustered. The contour centers within the same cell are clustered together. Based on the clustering structure, the content areas in the same cluster are merged to obtain multiple cell blocks, each of which includes at least one content area. Optionally, the DBSCAN (Density-Based Spatial Clustering of Applications with Noise) self-clustering algorithm is used for clustering. Other clustering algorithms can also be used in specific implementations, and this embodiment does not limit this.

[0061] Step 108, performing horizontal projection on the plurality of cell blocks, and determining row coordinate information according to the horizontal projection result.

[0062] In the horizontal projection, the coordinates of each cell block are projected, the text contour projections in the same row position are contained by the largest text block in the row, and the zero-pixel jump points in the horizontal projection can be considered as the row division lines of the table. The coordinate information corresponding to the row division lines is determined as the row coordinate information. Starting from the image boundary, the zero-pixel jump points are used as the starting coordinates of the next adjacent cell.

[0063] Step 110, performing vertical projection on the plurality of cell blocks, and determining column coordinate information according to the vertical projection result.

[0064] In the vertical projection, the coordinates of each cell block are projected, and the zero-pixel jump points in the vertical projection can be considered as the column division lines of the table. The coordinate information corresponding to the column division lines is determined as the column coordinate information. Starting from the image boundary, the zero-pixel jump points are used as the starting coordinates of the next adjacent cell.

[0065] Step 112, determining the table structure according to the row coordinate information and the column coordinate information.

[0066] In this way, the coordinate information corresponding to the zero-pixel jump points and the boundary points can be combined to determine the table structure.

[0067] In the above wireless table structure recognition method, at least one content contour is extracted from a target table image; noise removal processing is performed on each content contour to obtain at least one content region; clustering processing is performed based on the center points of each content region to determine a plurality of cell blocks; horizontal projection is performed on the plurality of cell blocks, and row coordinate information is determined according to the horizontal projection result; vertical projection is performed on the plurality of cell blocks, and column coordinate information is determined according to the vertical projection result; and the table structure is determined according to the row coordinate information and the column coordinate information. Through the above method, noise removal processing can reduce noise interference and improve the accuracy of wireless table structure recognition. Clustering processing is performed on the plurality of content regions in a cell to accurately obtain the table cell region. The table structure is determined by horizontal projection and vertical projection, which can handle the case of merged cells. Without using a deep learning algorithm, the method consumes less resources and can effectively and simply recognize the wireless table structure.

[0068] In an example embodiment, the noise removal processing includes at least one of a fine noise removal processing and a sticking line noise removal processing; the sticking line noise removal processing includes the following steps: splitting the content contour into a plurality of rectangular regions; filtering the rectangular regions with a width less than a preset width threshold to obtain a plurality of target rectangular regions; merging the plurality of target rectangular regions into at least one image region; determining a minimum circumscribed rectangle of each image region to obtain at least one content region.

[0069] Some scanned document images may have noise straight lines that stick together the texts of different cells, causing the texts of different cells to be in the same contour, which greatly affects the accuracy of table structure recognition. For example, there are straight lines on many wireless table boundaries that connect the texts of different cells, causing incorrect recognition of table structure.

[0070] The content contour disturbed by the noise straight line appears as an irregular long contour convex hull. The long contour convex hulls are split into a plurality of rectangular regions. The preset width threshold is a parameter set in advance, which can be the minimum width of the text used. The plurality of rectangular regions are filtered by the preset width threshold, and the rectangular regions with a width less than the preset width threshold are filtered out, so as to remove the disturbance of the sticking straight line. The overlapping regions in the plurality of target rectangular regions after filtering are merged to obtain at least one image region, and the minimum circumscribed rectangle of each image region is determined to obtain the corresponding content region.

[0071] In an example embodiment, splitting the content contour into a plurality of rectangular regions includes: detecting, for each content contour, the corner points on each edge of the content contour; determining a horizontal coordinate set and a vertical coordinate set based on the coordinate information of the corner points; constructing a reference rectangle according to any two adjacent horizontal coordinates in the horizontal coordinate set and any two adjacent vertical coordinates in the vertical coordinate set; and filtering the reference rectangle whose center point is not in the content contour to obtain a plurality of rectangular regions.

[0072] In the method, detecting the corner points on each edge of the content contour can include the following steps: for each long contour convex hull, traversing each edge on the convex hull to determine the point set corresponding to each edge. The very close points are merged. The minimum circumscribed rectangle containing the point set of each edge on the convex hull boundary is obtained. All corner points of these circumscribed rectangles are collected.

[0073] According to the horizontal and vertical coordinates of the corner points, the repeated values are removed, and the new reference rectangles are formed between adjacent values in ascending order. The reference rectangles whose center points are not in the original content contour are filtered out, and a plurality of rectangular regions are obtained. The plurality of rectangular regions include the cell text box of the original content contour and the interference line region. For the plurality of rectangular regions, the cell text block region is obtained by filtering again based on the minimum width of the text, and the interference of the adhered straight line is removed. Figure 2 , Figure 2 In (1), the text of multiple cells is adhered together due to the interference of the upper straight line, forming an entire contour (refer to the contour 1 of (2)), which affects the recognition accuracy of the table structure. In (2), the corner points on each edge of the content contour are detected, a plurality of reference rectangles are split and filtered out, and the content region shown in (3) is obtained by merging the remaining rectangular regions and determining the minimum circumscribed rectangle. At this time, the interference of the adhered straight line is removed. Figure 2 Figure 2 (2), the corner points on each edge of the content contour are detected, a plurality of reference rectangles are split and filtered out, and the content region shown in (3) is obtained by merging the remaining rectangular regions and determining the minimum circumscribed rectangle. At this time, the interference of the adhered straight line is removed. Figure 2

[0074] In an exemplary embodiment, the fine noise removal process includes the following steps: filtering the content contour whose contour area is less than a first preset threshold or whose contour size is less than a second preset threshold, to obtain at least one content region.

[0075] In an exemplary embodiment, the fine noise removal process includes the following steps: filtering the content contour whose contour area is less than a first preset threshold or whose contour size is less than a second preset threshold, to obtain at least one content region.

[0076] In an exemplary embodiment, the fine noise removal process includes the following steps: filtering the content contour whose contour area is less than a first preset threshold or whose contour size is less than a second preset threshold, to obtain at least one content region.

[0077] In an exemplary embodiment, before step 102, the method further includes: obtaining an initial table image; and pre-processing the initial table image to obtain the target table image.

[0078] ​​Among them, the preprocessing of the initial table image can include grayscale, noise reduction, binarization, contrast enhancement, size adjustment, etc. By preprocessing the initial table image, this embodiment can enhance the table structure features in the image and improve the accuracy of table structure recognition.

[0079] In an exemplary embodiment, the initial table image is preprocessed to obtain a target table image, including: setting the pixel values ​​of the boundary area of ​​the initial table image to the average pixel values ​​of the initial table image to obtain a first intermediate image; performing binarization and opening operation on the first intermediate image to obtain a second intermediate image; performing horizontal projection on the second intermediate image to determine peak coordinate information; and performing foreground clearing processing on the area corresponding to the peak coordinate information in the second intermediate image to obtain a target table image.

[0080] For the initial table image, an object detection model can be used to detect the table's location on the image and obtain an image of the ROI (region of interest) where the table resides. The average pixel value of the initial table image is obtained and assigned to a certain area along the image boundary (this area is related to the fill threshold, which can be set to 5 pixels) to generate a first intermediate image. This prevents text within the table image from being at the image boundary or having a large color difference between the table image and the background, which would result in a large boundary outline being recognized and affecting subsequent positioning. The first intermediate image is binarized and subjected to an open morphological operation to allow text within the same cell to be glued together. The kernel parameter for the open operation is set to 15*15. This threshold can also be adaptively set by obtaining the distance between adjacent text rows. Because some wireless tables have a horizontal line at the top, the morphological operation may cause glue to the text within the table. In this embodiment, after horizontally projecting the image, a small peak appears in the projected image. This peak corresponds to the location of the horizontal line. In the binary image, the area corresponding to the peak coordinates is cleared to remove the black line at that location. Specifically, the pixel value 255 is assigned to the area corresponding to the peak coordinates on the image. Assuming the horizontal line has a pixel width of no more than 5, the maximum peak width is set to 5, and the width of the area corresponding to the peak coordinates is 5 pixels.

[0081] In an optional implementation, referring to Figure 3 The wireless table structure recognition method includes the following steps: binarization and image opening morphological operations on the image; removing horizontal thin lines; segmenting the convex hull of the long contour to remove the interference of the adhesion line; performing self-clustering based on the contour center point and merging the clustered contours; determining the cell boundary through horizontal and vertical projection; combining cells and outputting the table structure. The method provided by the embodiment of the present application is used forFigure 2 The recognition results of the wireless table structure are as follows Figure 4 The method provided in this embodiment is also applicable to the recognition of light-colored line table structures.

[0082] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0083] Based on the same inventive concept, embodiments of the present application also provide a wireless table structure recognition device for implementing the wireless table structure recognition method described above. The solution provided by this device is similar to the solution described in the method described above. Therefore, the specific limitations of one or more embodiments of the wireless table structure recognition device provided below can be found in the limitations of the wireless table structure recognition method described above and will not be repeated here.

[0084] In an exemplary embodiment, Figure 5 As shown, a wireless table structure recognition device is provided, comprising:

[0085] The outline extraction module 502 is configured to extract at least one content outline from the target table image.

[0086] The noise removal module 504 is configured to perform noise removal processing on each content outline to obtain at least one content region.

[0087] The clustering module 506 is configured to perform clustering processing based on the center point of each content area to determine a plurality of cell blocks.

[0088] The projection module 508 is configured to perform horizontal projection on the multiple cell blocks and determine row coordinate information according to the horizontal projection result; and perform vertical projection on the multiple cell blocks and determine column coordinate information according to the vertical projection result.

[0089] The determination module 510 is configured to determine a table structure according to the row coordinate information and the column coordinate information.

[0090] The wireless table structure recognition device extracts at least one content contour from the target table image; performs noise removal processing on each content contour to obtain at least one content region; performs clustering processing based on the center point of each content region to determine a plurality of cell blocks; performs horizontal projection on the plurality of cell blocks, and determines row coordinate information according to the horizontal projection result; performs vertical projection on the plurality of cell blocks, and determines column coordinate information according to the vertical projection result; and determines the table structure according to the row coordinate information and the column coordinate information. In this way, the noise removal processing can reduce noise interference and improve the accuracy of wireless table structure recognition. The clustering processing on the plurality of content regions in the cell can accurately obtain the table cell region. The horizontal projection and the vertical projection can determine the table structure, and can process the case of a merged cell. Without using a deep learning algorithm, the wireless table structure can be recognized simply and effectively with less resource consumption.

[0091] In an example embodiment, the noise removal module 504 is further configured to split the content contour into a plurality of rectangular regions; filter the rectangular regions with a width less than a set width threshold to obtain a plurality of target rectangular regions; merge the plurality of target rectangular regions into at least one image region; and determine a minimum circumscribed rectangle of each image region to obtain at least one content region.

[0092] In an example embodiment, the noise removal module 504 is further configured to, for each content contour, detect corner points on each edge of the content contour; determine a set of horizontal coordinates and a set of vertical coordinates based on coordinate information of the corner points; construct a reference rectangle according to any two adjacent horizontal coordinates in the set of horizontal coordinates and any two adjacent vertical coordinates in the set of vertical coordinates; and filter the reference rectangle with a center point not in the content contour to obtain a plurality of rectangular regions.

[0093] In an example embodiment, the noise removal module 504 is further configured to filter the content contour with a contour area less than a first preset threshold or a contour size less than a second preset threshold to obtain at least one content region.

[0094] In an example embodiment, the wireless table structure recognition device further includes a preprocessing module configured to obtain an initial table image; and perform preprocessing on the initial table image to obtain a target table image.

[0095] In an exemplary embodiment, the preprocessing module is further configured to set pixel values of a boundary region of the initial table image to an average pixel value of the initial table image to obtain a first intermediate image; perform binaryzation processing and open operation processing on the first intermediate image to obtain a second intermediate image; perform horizontal projection on the second intermediate image to determine peak coordinate information; and perform foreground removal processing on a region corresponding to the peak coordinate information in the second intermediate image to obtain a target table image.

[0096] The modules in the wireless table structure recognition device described above can be implemented wholly or partially by software, hardware, and combinations thereof. The modules described above can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a memory in a computer device in software form, so as to be called and executed by a processor to perform operations corresponding to the modules.

[0097] In an exemplary embodiment, a computer device is provided, which can be a server, and an internal structure diagram thereof can be as shown in FIG. 8. Figure 6 The computer device includes a processor, a memory, an input / output interface (I / O), and a communication interface. The processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The database of the computer device is configured to store intermediate data in a processing process. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to communicate with terminals outside through a network connection. The computer program is executed by the processor to implement a wireless table structure recognition method.

[0098] Those skilled in the art can understand that Figure 6 The structure shown in FIG. 8 is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. Specifically, the computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0099] In one example embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program: extracting at least one content contour from a target table image; performing noise removal processing on each content contour to obtain at least one content region; performing clustering processing based on a center point of each content region to determine a plurality of cell blocks; performing horizontal projection on the plurality of cell blocks to determine row coordinate information according to a horizontal projection result; performing vertical projection on the plurality of cell blocks to determine column coordinate information according to a vertical projection result; and determining a table structure according to the row coordinate information and the column coordinate information.

[0100] In one embodiment, the processor further implements the following steps when executing the computer program: splitting the content contour into a plurality of rectangular regions; filtering the rectangular regions with a width less than a set width threshold to obtain a plurality of target rectangular regions; merging the plurality of target rectangular regions into at least one image region; and determining a minimum circumscribed rectangle of each image region to obtain at least one content region.

[0101] In one embodiment, the processor further implements the following steps when executing the computer program: for each content contour, detecting corner points on each edge of the content contour; determining a horizontal coordinate set and a vertical coordinate set based on coordinate information of the corner points; and constructing a reference rectangle according to any two adjacent horizontal coordinates in the horizontal coordinate set and any two adjacent vertical coordinates in the vertical coordinate set; and filtering the reference rectangle with a center point not in the content contour to obtain a plurality of rectangular regions.

[0102] In one embodiment, the processor further implements the following steps when executing the computer program: filtering the content contour with a contour area less than a first preset threshold or a contour size less than a second preset threshold to obtain at least one content region.

[0103] In one embodiment, the processor further implements the following steps when executing the computer program: obtaining an initial table image; and performing preprocessing on the initial table image to obtain a target table image.

[0104] In one embodiment, the processor further implements the following steps when executing the computer program: setting a pixel value of a boundary region of the initial table image to an average pixel value of the initial table image to obtain a first intermediate image; performing binarization processing and open operation processing on the first intermediate image to obtain a second intermediate image; performing horizontal projection on the second intermediate image to determine peak coordinate information; and performing foreground removal processing on a region corresponding to the peak coordinate information in the second intermediate image to obtain the target table image.

[0105] In one embodiment, a computer readable storage medium is provided, having stored thereon a computer program, the computer program being executed by a processor to implement the following steps: extracting at least one content contour from a target table image; performing noise removal processing on each content contour to obtain at least one content region; performing clustering processing based on a center point of each content region to determine a plurality of cell blocks; performing horizontal projection on the plurality of cell blocks to determine row coordinate information according to a horizontal projection result; performing vertical projection on the plurality of cell blocks to determine column coordinate information according to a vertical projection result; and determining a table structure according to the row coordinate information and the column coordinate information.

[0106] In one embodiment, the computer program is executed by the processor to further implement the following steps: splitting the content contour into a plurality of rectangular regions; filtering the rectangular regions with a width less than a set width threshold to obtain a plurality of target rectangular regions; merging the plurality of target rectangular regions into at least one image region; and determining a minimum circumscribed rectangle of each image region to obtain at least one content region.

[0107] In one embodiment, the computer program is executed by the processor to further implement the following steps: for each content contour, detecting corner points on each edge of the content contour; determining a horizontal coordinate set and a vertical coordinate set based on coordinate information of the corner points; and constructing a reference rectangle according to any two adjacent horizontal coordinates in the horizontal coordinate set and any two adjacent vertical coordinates in the vertical coordinate set; and filtering the reference rectangle with a center point not in the content contour to obtain a plurality of rectangular regions.

[0108] In one embodiment, the computer program is executed by the processor to further implement the following steps: filtering the content contour with a contour area less than a first preset threshold or a contour size less than a second preset threshold to obtain at least one content region.

[0109] In one embodiment, the computer program is executed by the processor to further implement the following steps: obtaining an initial table image; and performing preprocessing on the initial table image to obtain a target table image.

[0110] In one embodiment, the computer program is executed by the processor to further implement the following steps: setting a pixel value of a boundary region of the initial table image to an average pixel value of the initial table image to obtain a first intermediate image; performing binarization processing and open operation processing on the first intermediate image to obtain a second intermediate image; performing horizontal projection on the second intermediate image to determine peak coordinate information; and performing foreground removal processing on a region corresponding to the peak coordinate information in the second intermediate image to obtain the target table image.

[0111] In one embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the following steps: extracting at least one content contour from a target table image; performing noise removal processing on each content contour to obtain at least one content region; performing clustering processing based on a center point of each content region to determine a plurality of cell blocks; performing horizontal projection on the plurality of cell blocks to determine row coordinate information according to a horizontal projection result; performing vertical projection on the plurality of cell blocks to determine column coordinate information according to a vertical projection result; and determining a table structure according to the row coordinate information and the column coordinate information.

[0112] In one embodiment, the computer program, when executed by the processor, further implements the following steps: splitting the content contour into a plurality of rectangular regions; filtering the rectangular regions with a width less than a set width threshold to obtain a plurality of target rectangular regions; merging the plurality of target rectangular regions into at least one image region; and determining a minimum circumscribed rectangle of each image region to obtain at least one content region.

[0113] In one embodiment, the computer program, when executed by the processor, further implements the following steps: for each content contour, detecting corner points on each edge of the content contour; determining a horizontal coordinate set and a vertical coordinate set based on coordinate information of the corner points; and constructing a reference rectangle according to any two adjacent horizontal coordinates in the horizontal coordinate set and any two adjacent vertical coordinates in the vertical coordinate set; and filtering the reference rectangle whose center point is not in the content contour to obtain a plurality of rectangular regions.

[0114] In one embodiment, the computer program, when executed by the processor, further implements the following steps: filtering the content contour with a contour area less than a first preset threshold or a contour size less than a second preset threshold to obtain at least one content region.

[0115] In one embodiment, the computer program, when executed by the processor, further implements the following steps: obtaining an initial table image; and performing preprocessing on the initial table image to obtain a target table image.

[0116] In one embodiment, the computer program, when executed by the processor, further implements the following steps: setting a pixel value of a boundary region of the initial table image to an average pixel value of the initial table image to obtain a first intermediate image; performing binarization processing and opening operation processing on the first intermediate image to obtain a second intermediate image; performing horizontal projection on the second intermediate image to determine peak coordinate information; and performing foreground removal processing on a region corresponding to the peak coordinate information in the second intermediate image to obtain the target table image.

[0117] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.

[0118] It can be understood by those skilled in the art that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments of each method. In the embodiments provided in the present application, the memory, database or other medium mentioned can include at least one of non-volatile memory and volatile memory. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.

[0119] Any technical features in the above embodiments can be combined, and for the sake of brevity, not all possible combinations are described above, however, any combination of these technical features is deemed to be within the scope of the present application.

[0120] The above embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it should not be understood as a limitation on the patent scope of the present application. It should be pointed out that, for ordinary skilled persons in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A wireless table structure recognition method, characterized in that: The method comprises: extracting at least one content outline from the target table image; performing noise removal processing on each of the content contours to obtain at least one content area; Performing clustering processing based on the center point of each content area to determine a plurality of cell blocks; Performing horizontal projection on the plurality of cell blocks, and determining row coordinate information according to the horizontal projection result; Performing vertical projection on the plurality of cell blocks, and determining column coordinate information according to the vertical projection result; determining a table structure according to the row coordinate information and the column coordinate information; The noise removal process includes at least one of a fine noise removal process and a sticky line noise removal process; the sticky line noise removal process includes the following steps: For each content outline, detecting corner points on each edge of the content outline; Determine a set of horizontal coordinates and a set of vertical coordinates based on the coordinate information of the corner points; Constructing a reference rectangle according to any two adjacent horizontal coordinates in the horizontal coordinate set and any two adjacent vertical coordinates in the vertical coordinate set; Filtering reference rectangles whose center points are not within the content outline to obtain multiple rectangular areas; Filter the rectangular areas whose width is less than the set width threshold to obtain multiple target rectangular areas; Merging the multiple target rectangular areas into at least one image area; The minimum bounding rectangle of each image area is determined to obtain at least one content area.

2. The method according to claim 1, characterized in that The fine noise removal process includes the following steps: Content contours whose contour areas are smaller than a first preset threshold or whose contour sizes are smaller than a second preset threshold are filtered to obtain at least one content region.

3. The method according to claim 1 or 2, characterized in that Before extracting at least one content outline from the target table image, the method further includes: Get the initial table image; The initial table image is preprocessed to obtain a target table image.

4. The method according to claim 3, characterized in that The preprocessing of the initial table image to obtain a target table image includes: Setting the pixel value of the boundary area of ​​the initial table image to the average pixel value of the initial table image to obtain a first intermediate image; performing binarization and opening operation on the first intermediate image to obtain a second intermediate image; Performing horizontal projection on the second intermediate image to determine peak coordinate information; A foreground clearing process is performed on the area corresponding to the peak coordinate information in the second intermediate image to obtain a target table image.

5. A wireless table structure recognition device, characterized in that: The device comprises: a contour extraction module, configured to extract at least one content contour from the target table image; a noise removal module, configured to perform noise removal processing on each of the content contours to obtain at least one content area; A clustering module, configured to perform clustering processing based on the center point of each content area to determine a plurality of cell blocks; A projection module is configured to perform horizontal projection on the plurality of cell blocks and determine row coordinate information according to the horizontal projection result; and perform vertical projection on the plurality of cell blocks and determine column coordinate information according to the vertical projection result; a determination module, configured to determine a table structure according to the row coordinate information and the column coordinate information; Among them, the noise removal module is also used to detect the corner points on each edge of each content outline; determine the horizontal coordinate set and the vertical coordinate set based on the coordinate information of the corner points; construct a reference rectangle according to any two numerically adjacent horizontal coordinates in the horizontal coordinate set and any two numerically adjacent vertical coordinates in the vertical coordinate set; filter the reference rectangles whose center points are not in the content outline to obtain multiple rectangular areas; filter the rectangular areas whose width is less than the set width threshold to obtain multiple target rectangular areas; merge the multiple target rectangular areas into at least one image area; determine the minimum circumscribed rectangle of each of the image areas to obtain at least one content area.

6. The device according to claim 5, characterized in that The noise removal module is further configured to filter content contours whose contour area is smaller than a first preset threshold or whose contour size is smaller than a second preset threshold, to obtain at least one content region.

7. The device according to claim 5 or 6, characterized in that The wireless table structure recognition device further includes a preprocessing module, which is used to obtain an initial table image and preprocess the initial table image to obtain a target table image.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.

10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Table processing method and device

    CN110347994A

  • Hard-tipped pen calligraphy matts slice image extraction method, system and device

    CN113901936A