A method, system, device, and readable medium for table recognition
By using image preprocessing and OCR technology to recognize table information in the procurement system, the problem of time-consuming traditional manual data entry has been solved, achieving the effect of efficiently obtaining procurement information.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INSPUR GENERSOFT CO LTD
- Filing Date
- 2022-02-18
- Publication Date
- 2026-06-30
AI Technical Summary
In the electronic image of the procurement system, the traditional manual entry of form information is time-consuming, inefficient, and unable to obtain procurement information in a timely manner.
The system identifies cells in a table region through image preprocessing, table region extraction, edge detection, and line detection, and uses OCR technology to recognize the content within the cells, storing the results in a database.
It reduced the workload of form recognition and data entry, decreased human error, and achieved the goal of efficiently obtaining procurement information.
Smart Images

Figure CN115205876B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method, system, device, and readable medium for form recognition in a procurement system. Background Technology
[0002] In electronic images within procurement systems, tables contain a wealth of information, and traditional manual data entry is often extremely time-consuming and inefficient. When multiple procurement needs arise simultaneously, it's difficult to obtain information promptly and determine the procurement unit's specific requirements. Therefore, quickly retrieving information from tables within procurement systems to identify the procuring department is a key technical challenge that needs to be addressed in table recognition within electronic images of procurement systems. Summary of the Invention
[0003] In view of this, the purpose of this invention is to provide a method, system, device, and readable medium for table recognition. The proposed table recognition method extracts information from a table through a series of functions, including image preprocessing, table region extraction, and table region recognition. Finally, the extracted information is structured according to the specific procurement business scenario, and the table recognition results are stored in a database for easy reference and retrieval. This table recognition method reduces the tedious workload of recognizing and entering information, minimizes problems caused by human error, and efficiently completes the acquisition of procurement information.
[0004] Based on the above objectives, one embodiment of the present invention provides a method for table recognition, comprising the following steps: preprocessing an image to be recognized to obtain a first image; performing contour lookup on the first image to obtain a table region of the first image; performing edge detection and line detection on the table region to obtain table lines of the table region; performing erosion and dilation processing on the table lines to obtain the intersection points of the table lines; obtaining cells of the table region based on the table lines and the intersection points; recognizing the content in the cells, and storing the recognition results in a corresponding database.
[0005] In some embodiments, preprocessing the image to be identified includes grayscale conversion, binarization, and image enhancement.
[0006] In some embodiments, a method for table recognition, wherein the contour search of the first image further includes: obtaining a second region in the first image other than the table region; performing morphological processing on the second region to obtain a processed second region; recognizing the processed second region and storing the recognition result in a corresponding database, and outputting and displaying the recognition result as needed.
[0007] In some embodiments, a table recognition method further includes: in response to the need for table correction in the table area, calculating the slope of the table lines, converting the slope into an angle, and rotating the table area accordingly based on the angle to obtain a corrected table area.
[0008] In some embodiments, performing edge detection and line detection on the table area to obtain the table lines of the table area includes: performing edge detection and line detection on the table area in the horizontal and vertical directions respectively to obtain the abscissa of all vertical lines and the ordinate of all horizontal lines in the table area; and combining the abscissa of the vertical lines and the ordinate of the horizontal lines to obtain the table lines of the table area.
[0009] In some embodiments, recognizing the content in the cell includes: performing text recognition on the cell using ORC technology, and converting the recognition result of the cell into a corresponding list format according to the cell's format, and storing it in the corresponding database.
[0010] In some embodiments, recognizing the content in the cell includes: looping through the cell and performing morphological processing to obtain a cell containing the outline of the target image; marking and saving the outline of the target image in the cell; and converting the recognition result of the cell into a corresponding list format and storing it in the corresponding database.
[0011] In another aspect, this invention provides a table recognition system, comprising: a first module for preprocessing an image to be recognized to obtain a first image; a second module for performing contour lookup on the first image to obtain a table region of the first image; a third module for performing edge detection and line detection on the table region to obtain table lines of the table region; a fourth module for performing erosion and dilation processing on the table lines to obtain the intersection points of the table lines; a fifth module for obtaining cells of the table region based on the table lines and the intersection points; and a sixth module for recognizing the content in the cells and storing the recognition results in a corresponding database.
[0012] In another aspect of the present invention, a computer device is also provided, including at least one processor; and a memory storing computer instructions executable on the processor, the instructions, when executed by the processor, implementing the steps of any of the methods described above.
[0013] In another aspect of the present invention, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements any of the method steps described above.
[0014] The present invention has at least the following beneficial effects: The table recognition method provided by the present invention preprocesses the image to be recognized, extracts the table area, recognizes the table area, and designs a corresponding data structure according to the specific procurement business scenario, and stores the recognition result in the corresponding database for easy reading and reference by users. At the same time, this table recognition method reduces the workload of table recognition and table information entry, reduces the inconvenience caused by human error, and is conducive to efficiently obtaining procurement information, thereby ensuring timely follow-up of procurement information and avoiding information loss or human error. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art 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 embodiments can be obtained based on these drawings without creative effort.
[0016] Figure 1 A schematic diagram illustrating an embodiment of a table recognition method provided by the present invention;
[0017] Figure 2 A schematic diagram of the image to be recognized in an embodiment of a table recognition method provided by the present invention;
[0018] Figure 3 A schematic diagram of a grayscale image in an embodiment of a table recognition method provided by the present invention;
[0019] Figure 4 A schematic diagram of a binarized image in an embodiment of a table recognition method provided by the present invention;
[0020] Figure 5 This is a schematic diagram of an image after extracting a table region in an embodiment of a table recognition method provided by the present invention.
[0021] Figure 6 A schematic diagram showing the recognition of a graphic in a table area in an embodiment of a table recognition method provided by the present invention;
[0022] Figure 7 A schematic diagram of the characters to be recognized in a table area in an embodiment of a table recognition method provided by the present invention;
[0023] Figure 8 A schematic diagram showing the characters in a table area after recognition in an embodiment of a table recognition method provided by the present invention;
[0024] Figure 9 A schematic diagram of a QR code to be recognized in a table area in an embodiment of a table recognition method provided by the present invention;
[0025] Figure 10 A schematic diagram showing the recognition of a QR code in a table area in an embodiment of a table recognition method provided by the present invention;
[0026] Figure 11 This is a schematic diagram illustrating the integrated output of the recognition results of the image to be recognized in an embodiment of a table recognition method provided by the present invention;
[0027] Figure 12 A schematic diagram of the image to be recognized to be corrected in an embodiment of a table recognition method provided by the present invention;
[0028] Figure 13 A schematic diagram of the corrected image to be recognized in an embodiment of a table recognition method provided by the present invention;
[0029] Figure 14 A schematic diagram of the image to be recognized, to be enhanced, in an embodiment of a table recognition method provided by the present invention;
[0030] Figure 15 A schematic diagram of the image to be recognized after image enhancement processing in an embodiment of a table recognition method provided by the present invention;
[0031] Figure 16 A schematic diagram illustrating an embodiment of a table recognition system provided by the present invention;
[0032] Figure 17 A schematic diagram illustrating an embodiment of a computer device provided by the present invention;
[0033] Figure 18 This is a schematic diagram of an embodiment of a computer-readable storage medium provided by the present invention. Detailed Implementation
[0034] The following describes embodiments of the present invention. However, it should be understood that the disclosed embodiments are merely examples, and other embodiments may take various alternative forms.
[0035] Furthermore, it should be noted that all uses of the terms "first" and "second" in the embodiments of this invention are for the purpose of distinguishing two entities or parameters with the same name but different names. Therefore, "first" and "second" are merely for convenience of expression and should not be construed as limiting the embodiments of this invention. Subsequent embodiments will not elaborate on this further. The terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements may include not only those elements but also elements not expressly listed or inherent to those processes, methods, articles, or apparatuses.
[0036] One or more embodiments of this application will now be described with reference to the accompanying drawings.
[0037] Based on the above objectives, a first aspect of the embodiments of the present invention provides an embodiment of a table recognition method. Figure 1 The diagram shown is an embodiment of a table recognition method provided by the present invention. Figure 1 As shown, a table recognition method according to an embodiment of the present invention includes the following steps:
[0038] S1. Preprocess the image to be recognized to obtain the first image;
[0039] S2. Perform contour lookup on the first image to obtain the table area of the first image;
[0040] S3. Perform edge detection and line detection on the table area to obtain the table lines of the table area;
[0041] S4. Perform erosion and expansion processing on the table lines to obtain the intersection points of the table lines;
[0042] S5. Obtain the cells of the table area based on the table lines and their intersections; and
[0043] S6. Recognize the content in the cell and store the recognition result in the corresponding database.
[0044] In the procurement system, the table of the procurement image is recognized to obtain the required table information, and the recognition result is converted into a list format and stored in the corresponding database. The steps of the procurement image recognition method include:
[0045] 1. For example Figure 2 As shown, Figure 2 The image shown is the image to be identified, which includes a table area, a QR code area, and unwanted stains and creases.
[0046] 2. For example Figure 3 , 4As shown, the image to be recognized is processed by grayscale and binarization. During grayscale processing, the R, G, and B components of each pixel are processed to obtain a grayscale image. Then, the binarization algorithm is used to determine the optimal threshold. The grayscale values of pixels not greater than the threshold are changed to 0 (black), and the grayscale values of pixels greater than the threshold are changed to 255 (white).
[0047] Understandably, in practical applications, one can call the PIL package in Python and functions in OpenCV to read the image, then loop through the pixels in the pixel matrix corresponding to the image to be processed, use the cv2.convert function in OpenCV to change the grayscale values of the image to be processed, obtain the grayscale image, then calculate the optimal threshold for grayscale conversion, continue looping through the pixels in the pixel matrix corresponding to the grayscale image, change grayscale values less than or equal to the threshold to 0, and change grayscale values greater than the threshold to 255, and finally use the cv2.imwrite function in OpenCV to store the image. Figure 3 , 4 As shown, the image obtained after grayscale and binarization can reduce the impact of various traces caused by paper contamination and shadows generated during the scanning process on the subsequent recognition process.
[0048] 3. For example Figure 5The image is binarized and read using OpenCV's `imread` function. Edge and line detection are then performed on the binarized image to obtain the table lines for the table region. First, Canny edge detection is used; the `cv2.Canny` function in OpenCV has parameters of (image name, 30, 240). Then, the HOUGH line detection function `cv2.HoughLinesP()` is used to detect lines. The shortest line length `minLineLength` is set to 100, and the maximum line gap `maxLineGap` is set to 50. The parameters for the HOUGH line function call are set to `cv2.HoughLinesP(canny-recognized edge image, 1, np.pi / 180, 100, minLineLength, maxLineGap)` to find all vertical lines. However, HOUGH line detection can only detect one direction at a time, making it impossible to find all vertex coordinates based solely on vertical lines. Therefore, the average of the x-coordinates of multiple identified lines is taken for each line. The method for determining whether lines belong to the same line is as follows: using a loop, check if the difference in x-coordinates between two identified vertical lines is greater than 30. If it is less than 30, they are different sub-segments of the same line; if it is greater than 30, they are not on the same line. The average x-coordinate of each line is stored in the first array. Next, the image is rotated 90 degrees clockwise, and the Canny and HOUGH line detection processes are repeated, changing only the image name to the rotated image while keeping other parameters unchanged. The x-coordinates of all current vertical lines are found, which are equivalent to the y-coordinates of all previous horizontal lines. The results are stored in the second array. The elements of the two arrays are iterated and combined. Using OpenCV's line drawing function, the table lines of the table area are obtained. The table lines are then subjected to expansion processing to obtain their intersections, and the cells of the table area are derived based on the table lines and their intersections.
[0049] 4. Recognition of the image to be recognized can be performed on table areas and QR code areas. Recognition of table areas includes both character recognition and graphic recognition. Specifically:
[0050] (1) As Figure 6As shown, the graphic in the table area is identified, specifically the hand-drawn pentagram. The table area, extracted and split in the previous step, is iterated through repeatedly, with variable i starting from 0 and looping through all cells. Cells are cropped according to their vertex coordinates. Using morphological gradient descent, edge detection is performed on each cropped image. The Sobel operator is obtained using the `cv2.Sobel` function in OpenCV, and the gradient difference in the horizontal and vertical directions is calculated using the `cv2.convertScaleAbs` function in OpenCV. Erosion and dilation are then performed, and finally, `cv2.fin` is used to calculate the final result. The `dContours` function identifies the outline of a pentagram, calculates the proportion of the pentagram outline in the total area of the cell image, and if the proportion exceeds 20%, records the cell position with an appended parameter of 1; if the proportion does not exceed 20%, records the cell position with an appended parameter of 0. The previous image to be processed is retrieved again, and a circle is drawn using the set of four vertices as the center. If the original cell's appended parameter was 1, a circle is drawn using the `cv2.circle` function to mark it; if the original cell's appended parameter was 0, no appending is performed. The newly identified image is then saved locally using `cv2.imwrite`.
[0051] (2) Figure 7 , 8 As shown, characters in the table area are recognized. The cells in the table area, extracted and split in the previous step, are used for text recognition using OCR technology. The recognition results are then converted into a list format according to the format of each recognized cell and stored in a database based on the established data structure. In practical applications, it's understandable that the `tesseract` package can be imported into Python, and the relevant Chinese-Simplified character recognition library can be downloaded to use methods such as `image_to_string` to recognize characters in the table area.
[0052] (3) Figure 9 As shown in / 10, the QR code region of the image to be recognized is identified. Following the method in the previous step, the QR code region of the image to be recognized is extracted. Using the processing method in the PIL package: Extract Image Name = Original Image Name [Starting Horizontal Coordinate: Ending Horizontal Coordinate, Starting Vertical Coordinate: Ending Vertical Coordinate], the QR code region is cropped. Then, the methods in the Zxing and qrcode packages are used to recognize the content of the QR code region. The zxing.BarCodeReader function and decode are used, with the parameter being the extracted QR code image name. The result is then output, completing the recognition of the QR code region content.
[0053] 5. For example Figure 11As shown, the final recognition results of the image to be recognized are integrated and stored in the corresponding database. If necessary, the results can be exported to Excel.
[0054] In practical applications, the image to be recognized may not be horizontal or vertical; it may have an angle with the horizontal direction. Therefore, after grayscale and binarization processing, the image needs to be angle-corrected before recognition is performed. As shown in Figures 12 and 13, the correction steps include:
[0055] (1) Calculate the tilt slope. Find the coordinates of multiple points on a straight line using HOUGH line detection. Use the cv2.Canny() function with parameters set to (image name, 30, 240). Then use the cv2.HoughLinesP() function in OpenCV to complete the line detection with parameters set to: minimum line length minLineLength = 100, maximum line gap maxLineGap = 50. The parameters for calling the HOUGH line function are set to cv2.HoughLinesP(edge image after canny detection, 1, np.pi / 180, 100, minLineLength, maxLineGap). Enter the coordinates of the line segments identified on a straight line into an array and add a loop to judge whether the distance between two lines is greater than 30. After calculating the start and end point coordinates, calculate the midpoint of each segment. Then use the least squares method to process the midpoint coordinates. Assuming the equation of the line is y = ax + b, then use the least squares method to obtain a and b, where the calculated a is the image tilt slope.
[0056] (2) Rotate the image. Convert the calculated slope into an angle using the arctangent function, and then use a rotation program to rotate the image. The resulting image is the corrected image.
[0057] In practical applications, images processed by grayscale and binarization often suffer from blurred lines. Therefore, image enhancement processing is necessary before image recognition. The methods for image enhancement are selective; preferably, histogram equalization, a histogram processing method based on the cumulative distribution function, can be used. Figure 14 , 15 As shown, the image after image enhancement has corrected the problem of broken lines.
[0058] Based on the above objectives, a second aspect of the embodiments of the present invention provides a table recognition system. Figure 16The diagram shown is a schematic representation of an embodiment of a table recognition system provided by the present invention. Figure 16 As shown, an embodiment of a table recognition system of the present invention includes the following modules: a first module 011, which preprocesses the image to be recognized to obtain a first image; a second module 012, which performs contour lookup on the first image to obtain a table region of the first image; a third module 013, which performs edge detection and line detection on the table region to obtain table lines of the table region; a fourth module 014, which performs erosion and dilation processing on the table lines to obtain the intersection points of the table lines; a fifth module 015, which obtains cells of the table region based on the table lines and the intersection points; and a sixth module 016, which recognizes the content in the cells and stores the recognition results in the corresponding database.
[0059] Based on the above objectives, a third aspect of the embodiments of the present invention provides a computer device. Figure 17 The diagram shown is a schematic representation of an embodiment of a computer device provided by the present invention. Figure 17 As shown, an embodiment of a computer device provided by the present invention includes the following modules: at least one processor 021; and a memory 022, the memory 022 storing computer instructions 023 that can be executed on the processor 021, the computer instructions 023 implementing the steps of any of the above methods when executed by the processor 021.
[0060] The present invention also provides a computer-readable storage medium. Figure 18 The diagram shown is a schematic representation of an embodiment of a computer-readable storage medium provided by the present invention. Figure 18 As shown, computer-readable storage medium 031 stores a computer program 032 that, when executed by a processor, performs the methods described above.
[0061] Finally, it should be noted that 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 program for setting system parameters can be stored in a computer-readable storage medium. When executed, the program can include the processes of the embodiments of the above methods. The storage medium for the program can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc. The above computer program embodiments can achieve the same or similar effects as any of the corresponding foregoing method embodiments.
[0062] Furthermore, the method disclosed in the embodiments of the present invention can also be implemented as a computer program executed by a processor, which may be stored in a computer-readable storage medium. When the computer program is executed by the processor, it performs the functions defined in the method disclosed in the embodiments of the present invention.
[0063] Furthermore, the above-described method steps and system units can also be implemented using a controller and a computer-readable storage medium for storing a computer program that enables the controller to perform the functions of the above-described steps or units.
[0064] Those skilled in the art will also understand that the various exemplary logic blocks, modules, circuits, and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software, or a combination of both. To clearly illustrate this interchangeability between hardware and software, the functionality of various illustrative components, blocks, modules, circuits, and steps has been generally described. Whether this functionality is implemented as software or as hardware depends on the specific application and the design constraints imposed on the system as a whole. Those skilled in the art can implement the functionality in various ways for each specific application, but such implementation decisions should not be construed as departing from the scope of the embodiments disclosed herein.
[0065] In one or more exemplary designs, functionality may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functionality may be stored as one or more instructions or code on or transmitted via a computer-readable medium. Computer-readable media include computer storage media and communication media, including any medium that facilitates the transfer of a computer program from one location to another. Storage media may be any available medium accessible to a general-purpose or special-purpose computer. By way of example, and not limitation, computer-readable media may include RAM, ROM, EEPROM, CD-ROM or other optical disc storage devices, disk storage devices or other magnetic storage devices, or any other medium that may be used to carry or store the required program code in the form of instructions or data structures and is accessible to a general-purpose or special-purpose computer or a general-purpose or special-purpose processor. Furthermore, any connection may be appropriately referred to as computer-readable media. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DOL), or wireless technologies such as infrared, radio, and microwave, then the aforementioned coaxial cable, fiber optic cable, twisted pair, DOL, or wireless technologies such as infrared, radio, and microwave are all included in the definition of media. As used herein, disks and optical discs include compact discs (CDs), laser discs, optical discs, digital versatile discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs reproduce data optically using lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0066] The above are exemplary embodiments disclosed in this invention. However, it should be noted that various changes and modifications can be made without departing from the scope of the embodiments of this invention as defined by the claims. The functions, steps, and / or actions of the methods according to the disclosed embodiments described herein do not need to be performed in any particular order. Furthermore, although the elements disclosed in the embodiments of this invention may be described or claimed individually, they may be understood as multiple unless explicitly limited to a singular number.
[0067] It should be understood that, as used herein, the singular form “a” is intended to include the plural form as well, unless the context clearly supports an exception. It should also be understood that, as used herein, “and / or” refers to any and all possible combinations of one or more of the associated listed items.
[0068] The embodiment numbers disclosed in the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0069] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0070] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the invention (including the claims) is limited to these examples. Within the framework of the invention, technical features of the above embodiments or different embodiments can be combined, and many other variations of different aspects of the invention exist, which are not provided in the details for the sake of brevity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the invention should be included within the protection scope of the invention.
Claims
1. A method for table recognition, characterized in that, include: The image to be recognized is preprocessed to obtain the first image; Perform contour lookup on the first image to obtain the table area of the first image; Edge detection and line detection are performed on the table area to obtain the table lines of the table area; The table lines are subjected to erosion and expansion treatment to obtain the intersection points of the table lines; The cells of the table area are obtained based on the table lines and their intersections; The content in the cell is identified, and the identification result is stored in the corresponding database; The process of recognizing the content in the cell includes: The cells are iterated through and morphologically processed to obtain cells that include the outline of the target image; The outline of the target image is marked and saved in the cell; The recognition results of the cells are converted into a corresponding list and stored in the corresponding database; The process involves recognizing hand-drawn pentagrams in the table area: The table area is iterated through, with variable i starting from 0 and looping through all cells. Cells are cropped according to their vertex coordinates. Edge detection is performed on each cropped image, followed by erosion and dilation processing. Finally, the cv2.findContours function is used to identify the pentagram outline, calculating its proportion in the total area of the cell image. If the proportion exceeds 20%, the parameter for that cell position is appended with 1; otherwise, it is appended with 0. The previous image is then retrieved, and a circle is drawn using the set of four vertices as the center. If the original cell's appended parameter is 1, a circle is drawn using the cv2.circle function; otherwise, no appending is performed. The newly recognized image is then saved locally using cv2.imwrite.
2. The method according to claim 1, characterized in that, The preprocessing of the image to be recognized includes: grayscale conversion, binarization, and image enhancement of the image to be recognized.
3. The method according to claim 1, characterized in that, The contour search of the first image further includes: Obtain the second region in the first image, excluding the table region; The second region is subjected to morphological processing to obtain the processed second region; The processed second region is identified, and the identification results are stored in the corresponding database. The identification results are output and displayed as needed.
4. The method according to claim 1, characterized in that, Also includes: In response to the need for table correction in the table area, the slope of the table lines is calculated, and the slope is converted into an angle. The table area is then rotated accordingly based on the angle to obtain the corrected table area.
5. The method according to claim 1, characterized in that, The step of performing edge detection and line detection on the table region to obtain the table lines of the table region includes: Edge detection and line detection are performed on the table area in the horizontal and vertical directions respectively to obtain the horizontal coordinates of all vertical lines and the vertical coordinates of all horizontal lines in the table area. The horizontal coordinates of the vertical lines and the vertical coordinates of the horizontal lines are then combined to obtain the table lines of the table area.
6. The method according to claim 1, characterized in that, The process of recognizing the content in the cell includes: performing text recognition on the cell using ORC technology, and converting the recognition result of the cell into a corresponding list format according to the cell's format, and storing it in the corresponding database.
7. A system for table recognition, characterized in that, include: The first module preprocesses the image to be recognized to obtain the first image; The second module performs contour lookup on the first image to obtain a table area of the first image; The third module performs edge detection and line detection on the table area to obtain the table lines of the table area; The fourth module performs erosion and expansion processing on the table lines to obtain the intersection points of the table lines; The fifth module obtains the cells of the table area based on the table lines and their intersections; as well as The sixth module identifies the content in the cell and stores the identification results in the corresponding database; The sixth module is also used to: loop through the cells and perform morphological processing to obtain cells that include the outline of the target image; The outline of the target image is marked and saved in the cell; The recognition results of the cells are converted into a corresponding list and stored in the corresponding database; The sixth module is also used to identify hand-drawn pentagrams in the table area: The table area is iterated in a loop, with variable i, starting from 0 and looping through all cell numbers. Cells are cropped according to their vertex coordinates. Edge detection is performed on each cropped image, followed by erosion and dilation processing. Finally, the cv2.findContours function is used to identify the pentagram outline, calculating the proportion of the pentagram outline in the total area of the cell image. If the proportion exceeds 20%, the cell position is recorded with an appended parameter of 1; if the proportion does not exceed 20%, the cell position is recorded with an appended parameter of 0. The previous image to be processed is retrieved again, centered on the set of four vertices. If the original cell's appended parameter is 1, a circle is drawn using the cv2.circle function for marking; if the original cell's appended parameter is 0, no appending processing is performed. The newly identified image is saved locally using cv2.imwrite.
8. A computer device, characterized in that, include: At least one processor; as well as A memory storing computer instructions executable on the processor, which, when executed by the processor, implement the steps of the method according to any one of claims 1-6.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-6.