Table identification method and equipment
Through text projection and state machine recognition of the starting position of table rows, the problems of table recognition consistency and real-time performance are solved, and accurate recognition and real-time return of multiple style tables are achieved, reducing the training cost and time of neural networks.
Patent Information
- Application Number
- CN202310493421.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-04
- Publication Date
- 2024-11-05
AI Technical Summary
The prior art has the problem of identification consistency in table recognition, especially in complex scenarios, which are inaccurate in recognition and cannot recognize and return table structures in real time. The training of neural networks requires pre-constructing of data sets, which increases training time and cost.
Automatically identify the starting position of the table row and column through text projection and state machine, generate binarized images, accumulate pixel values to obtain row projection and column projection, and use state machine scanning to determine the starting and end positions of rows and columns to improve the accuracy of table recognition Sex and real-time.
It realizes accurate identification of various styles of table structures, reduces the training time and labeling cost of neural networks, and can identify table structures in real time to meet users' usage needs.
Smart Images

Figure CN118898852A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image recognition technology, and in particular to a table recognition method and device. Background Art
[0002] With the development of computer technology, the use of electronic documents is becoming more and more popular. Users often convert paper documents into electronic documents by scanning, taking photos, etc., and save them. Later, when other users use electronic documents, they can convert the original non-editable electronic documents into editable documents through image processing, optical character recognition (OCR) and other technologies to meet their usage needs. Summary of the invention
[0003] However, when electronic documents include tables, due to the diversity of table structures, there are still many problems in the consistency of table recognition. For example, the coverage of scenes is not complete. For example, the recognition of some real scenes, especially complex scenes, is inaccurate. For example, for some scenes, it is not necessary to pre-build data sets suitable for these scenes to train neural networks, which can save neural network training time and training set annotation costs. For example, it is impossible to recognize and return table structures in real time.
[0004] In order to solve the above technical problems, the present application provides a table recognition method and electronic device. The technical solution provided by the present application automatically recognizes the starting position and ending position of table rows and columns through text projection and state machine, thereby improving the accuracy of table recognition.
[0005] In order to achieve the above technical objectives, this application provides the following technical solutions:
[0006] In a first aspect, a table recognition method is provided, which is applied to a first device. The method includes: obtaining a text row area corresponding to a table area in an image. Based on the text row area, a binary image is generated. The pixel values of the pixel points of a single row in the binary image are accumulated to obtain a row projection corresponding to the binary image; and the pixel values of the pixel points of a single column in the binary image are accumulated to obtain a column projection corresponding to the binary image. The row projection and the column projection are scanned by a state machine to determine the starting position and the ending position of the row and the starting position and the ending position of the column. The table position is determined according to the starting position and the ending position of the row and the starting position and the ending position of the column.
[0007] In this way, the electronic device recognizes the table structure based on text projection and the state machine, so that the table recognition method has high robustness and avoids interference from interference factors.
[0008] Moreover, compared with table structure recognition based on neural networks, the table recognition method provided in the embodiments of the present application can be applied to more table recognition scenarios, such as wireless table structure recognition scenarios of various styles, without having to pre-build data sets suitable for these scenarios to train neural networks, thereby saving neural network training time and training set annotation costs.
[0009] In addition, the table recognition method provided in the embodiment of the present application can recognize and return the table structure in real time, and meet the user's usage needs with a higher processing speed.
[0010] According to the first aspect, generating a binary image based on a text line region includes: scaling the text line region according to a preset condition, and generating a binary image based on the scaled text line region.
[0011] In this way, based on the standardized text height, the difficulty of setting the counting threshold in the above state transition conditions and direction process is reduced.
[0012] Exemplarily, the preset condition is used to indicate a preset interval preset in the electronic device for scaling the text line area. Generally, the preset interval is smaller than the text line height. In the process of scaling the text line area, it is equivalent to downsampling the image, reducing the number of sampling points in the image recognition process. In the subsequent table recognition process, the algorithm processing steps and time can be effectively reduced, and the table recognition speed can be improved.
[0013] According to the first aspect, or any implementation of the first aspect above, generating a binary image based on a text line region includes: correcting the tilt angle of the text line region. Generating a binary image based on the text line region after the tilt angle is corrected.
[0014] In some scenarios, the table in the original image may be tilted due to shooting angles and other issues. Then, after determining the text row area in the original image, the electronic device can first correct the tilt angle of the text row area, and then determine the corresponding table structure based on the text row area after the tilt angle correction. In this way, the recognition of tilted tables is achieved, expanding the applicable table recognition scenarios.
[0015] According to the first aspect, or any implementation of the first aspect above, the state machine includes a ready state and an activated state, the ready state is used to indicate scanning a new column or row, and the activated state is used to indicate that a certain column or row is being scanned; the ready state or the activated state includes two transfer directions, namely maintaining the current state or transferring to the next state.
[0016] According to the first aspect, or any implementation of the first aspect, the ready state or the activated state includes multiple sub-states.
[0017] Optionally, the transition direction of the ready state or the active state is to maintain the current state, for example, to transition from the current sub-state to the next sub-state.
[0018] According to the first aspect, or any implementation method of the first aspect above, the row projection and the column projection are scanned by a state machine to determine the starting position and the ending position of the row and the starting position and the ending position of the column, including: determining the transfer direction or transfer condition of the ready state or the activated state through one or more of the counting threshold, the counting situation, the signal value, the buffer value, and the fluctuation threshold, the counting situation is used to indicate the number of sub-states transferred within the ready state or the activated state, and the number is less than or equal to the counting threshold, and the buffer is used to convert the input signal.
[0019] The counting threshold may be determined according to the character width, for example, the counting threshold may be half a character width, a character width, or the like.
[0020] Optionally, a single state machine scans the row projection and the column projection to determine the starting position and the ending position of the row and the starting position and the ending position of the column. The input conversion method of the ready state is to determine the transition condition and direction of the ready state by judging the relationship between the signal and the sum of the minimum value of the buffer and the fluctuation threshold, as well as the counting situation. The input conversion method of the activation state is to determine the transition condition and direction of the activation state by judging the size of the difference between the signal and the maximum value of the buffer and the fluctuation threshold, as well as the counting situation.
[0021] Optionally, the forward state machine scans the row projection and the column projection to determine the starting position of the row and the starting position of the column. Among them, the input conversion method of the ready state is to determine the transfer condition and direction of the ready state by judging the relationship between the signal and the sum of the minimum value of the buffer and the fluctuation threshold, as well as the counting situation. The forward state machine does not need to determine the end position of the column, so the activation state does not need to convert the input, and determines to switch to the end state or the next substate of the activation state based on whether it is in the last substate of the activation state. The input conversion method of the end state is to determine the transfer condition and direction of the end state by judging the size of the difference between the signal and the maximum value of the buffer and the fluctuation threshold, as well as the counting situation.
[0022] Optionally, the reverse state machine scans the row projection and the column projection to determine the end position of the row and the end position of the column. The input conversion method of the ready state is to determine the transition condition and direction of the ready state by judging the relationship between the signal and the sum of the buffer minimum value and the fluctuation threshold, as well as the counting situation. Since the reverse state machine only detects one end position each time it scans, the algorithm stops once the reverse state machine enters the active state, so there is no transition in the active state.
[0023] According to the first aspect, or any implementation of the first aspect above, the row projection and the column projection are scanned by a state machine to determine the starting position and the ending position of the row and the starting position and the ending position of the column, including: scanning the column projection along the horizontal direction by the state machine, during the scanning process, determining the starting position and the ending position of each column according to the state transition of the state machine, wherein the position corresponding to the transition of the state machine from the ready state to the active state is determined to be the starting position of the nth column, and the ending position of the nth column is the position corresponding to the transition of the state machine from the active state to the ready state closest to the starting position of the nth column, and n is a positive integer. Scanning the row projection along the vertical direction by the state machine, during the scanning process, determining the starting position and the ending position of each row according to the state transition of the state machine, wherein the position corresponding to the transition of the state machine from the ready state to the active state is determined to be the starting position of the mth row, and the ending position of the mth row is the position corresponding to the transition of the state machine from the active state to the ready state closest to the starting position of the mth row, and m is a positive integer.
[0024] For example, the device scans the column projection in the horizontal direction through the state machine, and determines that the state machine is transferred from the ready state to the active state, that is, the state machine is transferred from the state of preparing to scan a new column to the state of scanning a column, and the corresponding position is the starting position of the nth column. Then, the state machine continues to scan the current nth column, and the state machine is still in the active state. After that, the state machine is transferred from the active state to the ready state (the position of this state transfer is the position closest to the starting position of the nth column, that is, the position is determined by continuous scanning), that is, the state machine is transferred from the state of scanning a column to the state of scanning the next new column, and the corresponding position is the end position of the nth column. After that, the state machine is transferred from the current ready state to the active state, that is, the state machine is transferred from the state of preparing to scan the next new column to the state of scanning a new column, and the corresponding position is the starting position of the n+1th column. That is, the state machine continuously scans the column projection in one direction in the horizontal direction (such as from left to right or from right to left), and the transfer process of the above-mentioned ready state and active state is repeated, so that the starting position and the end position of multiple columns in the table can be determined respectively.
[0025] For another example, the device scans the row projection in the vertical direction through the state machine, and determines that the state machine is transferred from the ready state to the active state, that is, the state machine is transferred from the state of preparing to scan a new row to the state of scanning a row, and the corresponding position is the starting position of the mth row. Then, the state machine continues to scan the current mth row, and the state machine is still in the active state. Then, the state machine is transferred from the active state to the ready state (the position of this state transfer is the position closest to the starting position of the mth row, that is, the position is determined by continuous scanning), that is, the state machine is transferred from the state of scanning a row to the state of scanning the next new row, and the corresponding position is the end position of the mth row. Then, the state machine is transferred from the current ready state to the active state, that is, the state machine is transferred from the state of preparing to scan the next new row to the state of scanning a new row, and the corresponding position is the starting position of the m+1th row. That is, the state machine continuously scans the row projection in one direction in the vertical direction (such as from top to bottom or from bottom to top), and the transfer process of the above-mentioned ready state and active state is repeated, and the starting position and end position of multiple rows in the table can be determined respectively.
[0026] According to the first aspect, or any implementation of the first aspect above, the state machine includes a forward state machine and a reverse state machine, the forward state machine includes a ready state, an active state, and an end state, and the reverse state machine includes a ready state and an active state. The end state is used to indicate that the scanning of the previous row or column has been ended in advance, and it is not ready to scan the next row or column.
[0027] According to the first aspect, or any implementation of the first aspect above, the row projection and the column projection are scanned by a state machine to determine the starting position and the ending position of the row and the starting position and the ending position of the column, including: scanning the column projection along the horizontal direction by a forward state machine, during the scanning process, determining the starting position of each column according to the state transition of the forward state machine, wherein the position corresponding to the transition of the forward state machine from the ready state to the active state is determined to be the starting position of the nth column, and then the forward state machine is transferred from the active state to the end state and then to the ready state, and it is determined to be ready to scan the n+1th column, where n is a positive integer. Scanning the column projection along the horizontal direction by a reverse state machine in a direction opposite to the scanning direction of the forward state machine, during the scanning process, determining the ending position of the nth column corresponding to the starting position of the nth column according to the state transition of the reverse state machine, wherein the scanning starts from the starting position of the n+1th column as the starting point to determine the position corresponding to the transition of the reverse state machine from the ready state to the active state is the ending position of the nth column.
[0028] For example, the device scans the column projection in the horizontal direction through the forward state machine, and determines that the forward state machine is transferred from the ready state to the active state, that is, the forward state machine is transferred from the state of preparing to scan a new column to the state of scanning a column, and the corresponding position is the starting position of the nth column. Then, the current nth column is continued to be scanned through the forward state machine, and the forward state machine is transferred from the active state to the end state, that is, the forward state machine is transferred from the state of scanning the nth column to the state of having finished scanning the nth column in advance and not ready to scan the n+1th column. After that, the forward state machine continues to scan, and the forward state machine is transferred from the end state to the active state, that is, the forward state machine is transferred from the state of not yet ready to scan the n+1th column to the state of scanning the n+1th column, and the corresponding position is the starting position of the n+1th column. That is, the forward state machine continuously scans the column projection in one direction in the horizontal direction (such as from left to right or from right to left), and the transfer process of the above-mentioned ready state, active state, and end state is cycled, and the starting positions of multiple columns in the table can be determined respectively.
[0029] After determining the starting positions of multiple columns, the device can scan the column projections in the horizontal direction in the opposite direction to the scanning direction of the forward state machine through the reverse state machine to determine the end positions corresponding to the starting positions of these determined columns. For example, take the scanning direction of the forward state machine as from left to right and the scanning direction of the reverse state machine as from right to left. In the process of determining the end position of the nth column, the device first obtains the starting position of the nth column, determines the first starting position to the right of the starting position of the nth column, that is, determines the starting position of the n+1th column, and starts scanning to the left with the starting position of the n+1th column as the starting point. Determine that the reverse state machine is transferred from the ready state to the active state, that is, the reverse state machine is transferred from the state of preparing to scan a new column to the state of scanning a column, then the corresponding position is the end position of the nth column. After the reverse state machine switches to the active state, the device ends the scanning of the reverse state machine. That is, the reverse state machine scans the column projection multiple times in the horizontal direction opposite to the scanning direction of the forward state machine, taking the starting position of the column that has been determined by the forward state machine as the starting point, and loops the above-mentioned transition process from the ready state to the active state, thereby determining the end positions of multiple columns in the table respectively.
[0030] According to the first aspect, or any implementation of the first aspect above, the row projection and the column projection are scanned by a state machine to determine the starting position and the ending position of the row and the starting position and the ending position of the column, including: scanning the row projection along the vertical direction by a forward state machine, during the scanning process, determining the starting position of each row according to the state transition of the forward state machine, wherein the position corresponding to the transition of the forward state machine from the ready state to the active state is determined to be the starting position of the mth row, and then the forward state machine is transferred from the active state to the end state and then to the ready state, and it is determined to be ready to scan the m+1th row, where m is a positive integer. Scanning the row projection along the vertical direction by a reverse state machine in a direction opposite to the scanning direction of the forward state machine, during the scanning process, determining the ending position of the mth row corresponding to the starting position of the mth row according to the state transition of the reverse state machine, wherein the scanning starts from the starting position of the m+1th row as the starting point to determine the position corresponding to the transition of the reverse state machine from the ready state to the active state is the ending position of the mth row.
[0031] For example, the device scans the row projection in the vertical direction through the forward state machine, and determines that the forward state machine is transferred from the ready state to the active state, that is, the forward state machine is transferred from the state of preparing to scan a new row to the state of scanning a row, and the corresponding position is the starting position of the mth row. Then, the forward state machine continues to scan the current mth row, and the forward state machine is transferred from the active state to the end state, that is, the forward state machine is transferred from the state of scanning the mth row to the state of having finished scanning the mth row in advance and not ready to scan the m+1th row. Then, the forward state machine continues to scan, and the forward state machine is transferred from the end state to the active state, that is, the forward state machine is transferred from the state of not being ready to scan the m+1th row to the state of scanning the m+1th row, and the corresponding position is the starting position of the m+1th row. That is, the forward state machine continuously scans the row projection in one direction in the vertical direction (such as from top to bottom or from bottom to top), and the transfer process of the above-mentioned ready state, active state, and end state is cycled, and the starting positions of multiple rows in the table can be determined respectively.
[0032] After determining the starting positions of multiple rows, the device can scan the row projections in the vertical direction in the direction opposite to the scanning direction of the forward state machine through the reverse state machine to determine the end positions corresponding to the starting positions of these determined rows. For example, take the scanning direction of the forward state machine as from top to bottom and the scanning direction of the reverse state machine as from bottom to top. In the process of determining the end position of the mth row, the device first obtains the starting position of the mth row, determines the first starting position below the starting position of the mth row, that is, determines the starting position of the m+1th row, and starts scanning upward with the starting position of the m+1th row as the starting point. Determine that the reverse state machine is transferred from the ready state to the active state, that is, the reverse state machine is transferred from the state of preparing to scan a new row to the state of scanning a row, then the corresponding position is the end position of the mth row. After the reverse state machine switches to the active state, the device ends the scanning of the reverse state machine. That is, the reverse state machine scans the row projection multiple times in the vertical direction opposite to the scanning direction of the forward state machine, taking the starting position of the row that has been determined by the forward state machine as the starting point, and cycles the above-mentioned transition process from the ready state to the active state, thereby determining the end positions of multiple rows in the table respectively.
[0033] Optionally, since the forward state machine does not need to detect the end position of the column or row, the activation state of the forward state machine ends early, and the end state of the forward state machine is actually a special state separated from the activation state of a single state machine.
[0034] In this way, when the forward state machine only detects the starting position, the counting threshold can be set more flexibly, so as to enter and exit each state more quickly, improve the sensitivity of detection, and facilitate the processing of narrow blank spaces or rows and columns with less text changes.
[0035] According to the first aspect, or any implementation of the first aspect above, determining the table position according to the starting position and ending position of the row and the starting position and ending position of the column includes: determining the row separation position and the column separation position according to the starting position and ending position of the row and the starting position and ending position of the column, respectively. Determining the coordinates of the cells included in the table according to the row separation position and the column separation position.
[0036] According to the first aspect, or any implementation of the first aspect above, a binary image is generated based on the text line area, including: setting the pixel value within the text line area to 1, and setting the pixel value of the area outside the text line area to 0.
[0037] In this way, after the original image is converted into a binary image, the row projection and the column projection are determined based on the binary image, so that the image with a colored background can be better processed.
[0038] In addition, interference factors such as the background in the original image, text outside the table, shooting angle, lighting, etc. will affect the recognition of the table structure. Determining the row and column projections based on the binary image rather than determining the projection based on the original pixel value can effectively eliminate the above interference factors and improve the robustness of table structure recognition.
[0039] According to the first aspect, or any implementation of the first aspect above, the starting position and the ending position of the row and the starting position and the ending position of the column are determined by scanning the row projection and the column projection by a state machine, including: normalizing the row projection and the column projection respectively. The starting position and the ending position of the row and the starting position and the ending position of the column are determined by scanning the normalized row projection and the column projection by a state machine.
[0040] In this way, the electronic device scans the row projection and column projection based on the state machine to determine the starting and ending positions of the rows and columns respectively, and can eliminate some noise interference caused by factors such as text detection errors and image shooting angles.
[0041] In addition, in the process of determining the starting and ending positions of rows and columns, the row projection and column projection are normalized so that the projection threshold is a fluctuating threshold rather than a fixed threshold. This can effectively eliminate the influence of cross-cell text (such as merged cells), so that the scanning method of the state machine can be applicable to recognition scenarios of various table structures.
[0042] In a second aspect, an electronic device is provided. The electronic device includes: a processor and a memory, the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, and when the processor reads the computer instructions from the memory, the electronic device executes: obtaining a text row area corresponding to a table area in an image. Based on the text row area, a binary image is generated. The pixel values of the pixel points of a single row in the binary image are accumulated to obtain a row projection corresponding to the binary image; and the pixel values of the pixel points of a single column in the binary image are accumulated to obtain a column projection corresponding to the binary image. The row projection and the column projection are scanned by a state machine to determine the starting position and the ending position of the row and the starting position and the ending position of the column. The table position is determined according to the starting position and the ending position of the row and the starting position and the ending position of the column.
[0043] According to the second aspect, generating a binary image based on a text line region includes: scaling the text line region according to a preset condition, and generating a binary image based on the scaled text line region.
[0044] According to the second aspect, or any implementation of the second aspect above, generating a binary image based on the text line region includes: correcting the tilt angle of the text line region. Generating a binary image based on the text line region after the tilt angle is corrected.
[0045] According to the second aspect, or any implementation of the second aspect above, the state machine includes a ready state and an activated state, the ready state is used to indicate scanning a new column or row, and the activated state is used to indicate that a certain column or row is being scanned; the ready state or the activated state includes two transfer directions, namely maintaining the current state or transferring to the next state.
[0046] According to the second aspect, or any implementation of the second aspect, the ready state or the activated state includes multiple sub-states.
[0047] According to the second aspect, or any implementation method of the second aspect above, the row projection and the column projection are scanned by a state machine to determine the starting position and the ending position of the row and the starting position and the ending position of the column, including: determining the transfer direction or transfer condition of the ready state or the activated state through one or more of the counting threshold, the counting situation, the signal value, the buffer value, and the fluctuation threshold, the counting situation is used to indicate the number of sub-states transferred within the ready state or the activated state, and the number is less than or equal to the counting threshold, and the buffer is used to convert the input signal.
[0048] According to the second aspect, or any implementation of the second aspect above, the row projection and the column projection are scanned by a state machine to determine the starting position and the ending position of the row and the starting position and the ending position of the column, including: scanning the column projection along the horizontal direction by the state machine, during the scanning process, determining the starting position and the ending position of each column according to the state transition of the state machine, wherein the position corresponding to the transition of the state machine from the ready state to the active state is determined to be the starting position of the nth column, and the ending position of the nth column is the position corresponding to the transition of the state machine from the active state to the ready state closest to the starting position of the nth column, and n is a positive integer. Scanning the row projection along the vertical direction by the state machine, during the scanning process, determining the starting position and the ending position of each row according to the state transition of the state machine, wherein the position corresponding to the transition of the state machine from the ready state to the active state is determined to be the starting position of the mth row, and the ending position of the mth row is the position corresponding to the transition of the state machine from the active state to the ready state closest to the starting position of the mth row, and m is a positive integer.
[0049] According to the second aspect, or any implementation of the second aspect, the state machine includes a forward state machine and a reverse state machine, the forward state machine includes a ready state, an active state, and an end state, and the reverse state machine includes a ready state and an active state. The end state is used to indicate that the scanning of the previous row or column has been ended in advance, and it is not ready to scan the next row or column.
[0050] According to the second aspect, or any implementation of the second aspect above, the row projection and the column projection are scanned by a state machine to determine the starting position and the ending position of the row and the starting position and the ending position of the column, including: scanning the column projection along the horizontal direction by a forward state machine, during the scanning process, determining the starting position of each column according to the state transition of the forward state machine, wherein the position corresponding to the transition of the forward state machine from the ready state to the active state is determined to be the starting position of the nth column, and then the forward state machine is transferred from the active state to the end state and then to the ready state, and it is determined to be ready to scan the n+1th column, where n is a positive integer. Scanning the column projection along the horizontal direction by a reverse state machine in a direction opposite to the scanning direction of the forward state machine, during the scanning process, determining the ending position of the nth column corresponding to the starting position of the nth column according to the state transition of the reverse state machine, wherein the scanning starts from the starting position of the n+1th column as the starting point to determine the position corresponding to the transition of the reverse state machine from the ready state to the active state is the ending position of the nth column.
[0051] According to the second aspect, or any implementation of the second aspect above, the row projection and the column projection are scanned by a state machine to determine the starting position and the ending position of the row and the starting position and the ending position of the column, including: scanning the row projection along the vertical direction by a forward state machine, during the scanning process, determining the starting position of each row according to the state transition of the forward state machine, wherein the position corresponding to the transition of the forward state machine from the ready state to the active state is determined to be the starting position of the mth row, and then the forward state machine is transferred from the active state to the end state and then to the ready state, and it is determined to be ready to scan the m+1th row, where m is a positive integer. Scanning the row projection along the vertical direction in a direction opposite to the scanning direction of the forward state machine by a reverse state machine, during the scanning process, determining the ending position of the mth row corresponding to the starting position of the mth row according to the state transition of the reverse state machine, wherein the scanning starts from the starting position of the m+1th row as the starting point to determine the position corresponding to the transition of the reverse state machine from the ready state to the active state is the ending position of the mth row.
[0052] According to the second aspect, or any implementation of the second aspect above, determining the table position according to the starting position and ending position of the row and the starting position and ending position of the column includes: determining the row separation position and the column separation position according to the starting position and ending position of the row and the starting position and ending position of the column, respectively. Determining the coordinates of the cells included in the table according to the row separation position and the column separation position.
[0053] According to the second aspect, or any implementation of the second aspect above, a binary image is generated based on the text line area, including: setting the pixel value within the text line area to 1, and setting the pixel value of the area outside the text line area to 0.
[0054] According to the second aspect, or any implementation of the second aspect above, the starting position and the ending position of the row and the starting position and the ending position of the column are determined by scanning the row projection and the column projection by a state machine, including: normalizing the row projection and the column projection respectively. The normalized row projection and the column projection are scanned by the state machine to determine the starting position and the ending position of the row and the starting position and the ending position of the column.
[0055] The technical effects corresponding to the second aspect and any implementation method of the second aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any implementation method of the first aspect, and will not be repeated here.
[0056] In a third aspect, a server is provided. The server includes: a processor and a memory, the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, when the processor reads the computer instructions from the memory, the server executes the table recognition method as described in the first aspect and any possible implementation thereof.
[0057] The technical effects corresponding to the third aspect and any one of the implementation methods of the third aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any one of the implementation methods of the first aspect, and will not be repeated here.
[0058] In a fourth aspect, an electronic device is provided. The electronic device has the function of implementing the table recognition method described in the first aspect and any possible implementation thereof. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
[0059] The technical effects corresponding to the fourth aspect and any one of the implementation methods of the fourth aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any one of the implementation methods of the first aspect, and will not be repeated here.
[0060] In a fifth aspect, a server is provided. The server has the function of implementing the table recognition method described in the first aspect and any possible implementation thereof. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
[0061] The technical effects corresponding to the fifth aspect and any one of the implementation methods of the fifth aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any one of the implementation methods of the first aspect, and will not be repeated here.
[0062] In a sixth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program (also referred to as an instruction or code), and when the computer program is executed by a first device, the first device executes the method of the first aspect or any one of the implementations of the first aspect. Optionally, the first device is an electronic device or a server.
[0063] The technical effects corresponding to the sixth aspect and any one of the implementation methods of the sixth aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any one of the implementation methods of the first aspect, and will not be repeated here.
[0064] In a seventh aspect, a computer program product is provided. When the computer program product is run on a first device, the first device executes the method of the first aspect or any one of the implementations of the first aspect. Optionally, the first device is an electronic device or a server.
[0065] The technical effects corresponding to the seventh aspect and any one of the implementation methods of the seventh aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any one of the implementation methods of the first aspect, and will not be repeated here.
[0066] In an eighth aspect, a circuit system is provided, wherein the circuit system includes a processing circuit, and the processing circuit is configured to execute the method of the first aspect or any one of the implementations of the first aspect.
[0067] The technical effects corresponding to the eighth aspect and any one of the implementation methods of the eighth aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any one of the implementation methods of the first aspect, and will not be repeated here.
[0068] In a ninth aspect, a chip system is provided. The chip system includes at least one processor and at least one interface circuit, wherein the at least one interface circuit is used to perform a transceiver function and send an instruction to the at least one processor, and when the at least one processor executes the instruction, the at least one processor executes the method of the first aspect or any one of the implementations of the first aspect.
[0069] The technical effects corresponding to the ninth aspect and any one of the implementation methods of the ninth aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any one of the implementation methods of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] Figure 1 Identify scenario diagrams for the provided tables;
[0071] Figure 2 Schematic diagram of the neural network structure provided;
[0072] Figure 3 A schematic diagram of the position relationship of the blank areas provided;
[0073] Figure 4 A schematic diagram of the hardware structure of the device provided in the embodiment of the present application;
[0074] Figure 5 Schematic diagram of the process of the table recognition method provided in the embodiment of the present application Figure 1 ;
[0075] Figure 6 A schematic diagram of the starting position and ending position of a column or row provided in an embodiment of the present application;
[0076] Figure 7 A schematic diagram of the state machine state transition provided in the embodiment of the present application;
[0077] Figure 8 A schematic diagram of the internal sub-state transition of the state machine provided in the embodiment of the present application;
[0078] Fig. 9 A schematic diagram of the forward state machine state transition provided in an embodiment of the present application;
[0079] Fig.10 A schematic diagram of the reverse state machine state transition provided in an embodiment of the present application;
[0080] Fig.11 A diagram showing the recognition effect of the starting position and the ending position of a row of a table provided in an embodiment of the present application;
[0081] Fig.12 Schematic diagram of the process of the table recognition method provided in the embodiment of the present application Figure 2 ;
[0082] Fig.13 Schematic diagram of the process of the table recognition method provided in the embodiment of the present application Figure 3 ;
[0083] Fig.14 A schematic diagram of the first device structure provided in an embodiment of the present application. DETAILED DESCRIPTION
[0084] The technical solutions in the embodiments of the present application are described below in conjunction with the accompanying drawings in the embodiments of the present application. Wherein, in the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to include expressions such as "one or more", unless there is a clear indication to the contrary in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one or more (including two).
[0085] References to "one embodiment" or "some embodiments" etc. described in this specification mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways. The term "connection" includes direct connection and indirect connection, unless otherwise specified. "First" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.
[0086] In the embodiments of the present application, the words "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.
[0087] In some scenarios, with the popularization of electronic documents, users generally convert paper documents into electronic documents by scanning, taking photos, etc., and save them. Later, when using electronic documents, users can convert the original non-editable electronic documents into editable documents through image processing, OCR and other technologies to meet their usage needs.
[0088] For example, Figure 1 As shown in (a), the electronic device obtains a non-editable document (such as an image), wherein the image includes a table. The electronic device detects the table in the original image through image recognition technology; Figure 1 As shown in (b), the area where the table is located in the original image is determined. Afterwards, the electronic device performs text detection on the area where the table is located, such as Figure 1 As shown in (c) in the figure, the text line area in the area where the table is located in the original image is determined. Figure 1 As shown in (d), based on the text row area in the table, the table structure is identified. After that, after determining the table structure, the electronic device can match the identified text position with the table position to generate an editable document.
[0089] Among them, different table structure recognition methods may be required for table images of different styles. For example, different table structure recognition methods are usually used for wired (framed) tables and wireless (framed) tables. For example, for wired (framed) tables, the table line detection method of image semantic segmentation can be used to complete the recognition of the table structure. However, for scenes with wireless (framed) tables or tables with missing lines (frames), since the dividing lines of the cells are not clear, there are still many problems in the consistency of table structure recognition.
[0090] In some examples, a table structure recognition method using a neural network is used to recognize the table structure. Figure 2 As shown, this type of neural network usually has an "encoder-decoder" structure, in which the encoder can obtain the visual features of the image after receiving the input image and send the visual features to the decoder. Afterwards, the decoder can output the table structure one by one in an auto-regressive manner based on the received visual features, thereby realizing the recognition of the table structure included in the electronic device. Similarly, the text in the cell is recognized by the neural network, and then the text can be matched with the recognized table.
[0091] Among them, this type of neural network including the "encoder-decoder" structure usually requires a large amount of manually annotated table data for training before use, and the collection and annotation of the table structure is very difficult. Depending on the complexity of the table, the annotation time for a single table may be between several minutes and tens of minutes, so the cost of building a table structure recognition data set for training neural networks is very high. The currently open source data sets cannot cover all the table structures in real scenes very well. If the input image recognized by the neural network includes a table structure that has not been covered in the data set, or the table structure is relatively complex, it will cause serious errors in the output table structure. In addition, the reasoning process of the neural network to recognize the table structure requires more computing resources, and its reasoning time is often proportional to the number of cells included in the image, resulting in reduced efficiency in table structure recognition.
[0092] In other examples, the table structure is determined by identifying blank areas within the area where the table is located. Figure 3 An example of vertical overlap (i.e., at least partial horizontal alignment) between blank area A and blank area B is shown in (a). Figure 3An example of horizontal overlap (i.e., at least partial vertical alignment) between blank areas A and B shown in (b). After detecting the blank areas in the image, the blank areas with mutual vertical overlap are grouped. Among them, if and only if two blank areas overlap vertically, the two blank areas are connected, and the connected blank areas form a group. The top border of the topmost blank area in each group is defined as the top border of the table candidate. Similarly, the bottom border of the bottommost blank area is defined as the bottom border of the table candidate. Afterwards, a dynamic threshold is used to filter the height of the blank areas, and blank areas with insufficient height are discarded. For the remaining blank areas, the text distributed between the blank areas is collected, and column separators are added to the right boundary of the text. Similarly, a row separator is added to each column separator. The text located between the separators is assigned to the cells.
[0093] However, in the above scheme, there are cases where the detection frames of blank areas and content areas are inaccurate. A small number of misdetected blank areas or content areas may result in the appearance of extra rows or columns. Inaccurate detection frames may also result in errors in the judgment of the vertical overlap between blank areas, thereby causing errors in the recognition of table structures. In addition, in the scenario of converting electronic documents by taking photos, the image of the electronic document may rotate or shift, causing the detection frames of blank areas or content areas to rotate or shift. At this time, the error rate of judging vertically overlapping blank areas will increase significantly.
[0094] In some other examples, the table structure is identified by projection thresholds. For example, the image is converted into a grayscale image, and the pixel values of the grayscale image are accumulated in the vertical and horizontal directions to obtain row projections and column projections. Afterwards, the row projections and column projections are scanned respectively, and according to the size of the projection values, the intervals with projection values less than the threshold are identified as troughs, otherwise they are identified as peaks. For the peak and trough areas, a second scan is performed, and the threshold at this time is set to the average value of the projection values in the interval to obtain new peaks and troughs. Row separations and column separations are added at the troughs obtained by the second scan, thereby completing the identification of the table structure.
[0095] However, in the above scheme, the grayscale image pixels are directly projected, which cannot process images with color backgrounds well. In addition, the fixed projection threshold may lead to misrecognition, such as recognizing rows or columns with fewer characters as troughs, recognizing projection noise as non-existent rows or columns, etc. In addition, the problems of rotation and displacement that may exist in the image cannot be well overcome, which will still lead to an increase in the recognition error rate.
[0096] Based on this, an embodiment of the present application provides a table recognition method, which automatically recognizes the row and column separation of a table through text projection and a state machine, thereby improving the accuracy of table structure recognition.
[0097] Optionally, the table recognition method provided in the embodiment of the present application can be applied to the device 100. For example, the device 100 can be a terminal device such as a computer, a mobile phone, a computer, a tablet computer, a laptop computer, an augmented reality (AR) / virtual reality (VR) device, a mixed reality (MR) device, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a wearable device, an artificial intelligence (AI) device, etc. The operating system installed in the above device 100 includes but is not limited to Or other operating systems. This application does not limit the specific type of the above device 100 and the installed operating system.
[0098] Optionally, the device 100 may also be a device or server with computing functions such as a cloud server or a network server. The server may be a single server, a server cluster consisting of multiple servers, or a cloud computing service center.
[0099] Optionally, the table recognition method provided in the embodiment of the present application is mainly used in scenarios where table structures are extracted and restored in document electronic programs, such as converting non-editable documents in the original format of images, PDFs, etc. into editable documents. Optionally, the table recognition method provided in the embodiment of the present application can also be applied to other programs that rely on table recognition or document recognition, such as automatic financial report analysis programs, etc.
[0100] For example, Figure 4 As shown, the device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0101] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the device 100. In other embodiments of the present application, the device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0102] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.
[0103] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0104] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0105] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0106] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor, charger, flash, camera 193, etc. through different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor through the I2C interface, so that the processor 110 communicates with the touch sensor through the I2C bus interface to realize the touch function of the device 100.
[0107] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the device 100.
[0108] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the device 100, and can also be used to transmit data between the device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other first electronic devices, such as AR devices, etc.
[0109] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the device 100. In other embodiments of the present application, the device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0110] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the device 100. While the charging management module 140 is charging the battery 142, it may also power the first electronic device through the power management module 141.
[0111] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0112] The wireless communication function of the device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0113] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0114] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied on the device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0115] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device, or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0116] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0117] In some embodiments, the antenna 1 of the device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. GNSS may include the global positioning system (GPS), the global navigation satellite system (GLONASS), the Beidou navigation satellite system (BDS), the quasi-zenith satellite system (QZSS) and / or the satellite based augmentation system (SBAS).
[0118] The device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0119] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be manufactured using a liquid crystal display (LCD), such as an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Mini-led, Micro-led, Micro-oled, quantum dot light emitting diodes (QLED), etc. In some embodiments, the device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0120] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0121] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0122] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the device 100 by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor.
[0123] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110. The device 100 can use the audio module 170, such as music playback, recording, etc. The audio module 170 can include a speaker, a receiver, a microphone, a headphone interface, and an application processor to implement audio functions.
[0124] The sensor module 180 may include a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.
[0125] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The device 100 may receive key input and generate key signal input related to user settings and function control of the device 100.
[0126] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback.
[0127] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0128] The SIM card interface 195 is used to connect a SIM card. The device 100 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
[0129] The following embodiment takes the device 100 as an electronic device and the non-editable electronic document as an image format document as an example to introduce in detail the table recognition method provided in the embodiment of the present application.
[0130] In some embodiments, the user can obtain images including tables by scanning, taking photos, etc., and these images are, for example, images in RGB format or any image format. In some examples, the electronic device determines to convert these images in non-editable formats into documents in editable formats in response to user operations. During the conversion process, the electronic device needs to identify the tables included in the images, such as determining the table structure, matching the text in the table with the corresponding cells, etc.
[0131] For example, Figure 5 A flowchart of a table recognition method provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, the method includes the following process.
[0132] S501: The electronic device obtains a text row area corresponding to a table area in an original image.
[0133] The original image is a non-editable electronic document, and the user needs to convert the original image into an editable electronic document, so the electronic device needs to recognize the table included therein.
[0134] In some embodiments, the electronic device processes the original image in a preset manner to determine the table area and text row area included in the original image. Afterwards, the electronic device matches the table area with the text row area to determine the text row area in the table area, that is, to determine the text row area corresponding to the table. Alternatively, the electronic device first determines the table area included in the original image, and then the electronic device determines the text row area included in the table area.
[0135] In the following steps, the electronic device scans the projection value of the binary image corresponding to the text row area in the table area through the state machine to determine the table structure. The text row area in the following text is used to indicate the text row area in the table area, which will not be described in detail below.
[0136] Optionally, the preset method includes, for example, processing the original image by an image recognition algorithm, a neural network, etc. For example, the electronic device determines the table area by an algorithm such as YOLO (You Only Look Once). The electronic device determines the text line area by an algorithm such as DBNet (Differentiable Binarization Networks).
[0137] For example, the electronic device obtains Figure 1 The original image shown in (a) is then subjected to a table detection by the electronic device; Figure 1 As shown in (b), the position of the table in the original image is determined. Afterwards, the electronic device performs text detection on the original image, such as Figure 1 As shown in (c), the position of the text line in the original image is determined, that is, the text line area in the area where the table in the original image is located is determined.
[0138] Optionally, in the above process, the electronic device may also perform text recognition on the original image, such as Figure 1 As shown in (c), the content of the text line in the original image is determined. The electronic device can recognize the content of the text line in the original image through OCR technology. For example, the electronic device recognizes the content of the text line through CRNN-CTC (Convolutional Recurrent Neural Networks with Connectionist Temporal Classification) algorithm.
[0139] S502: The electronic device generates a binary image corresponding to the original image based on the text line area.
[0140] In some embodiments, after determining the text line area, the electronic device can use a binarization algorithm to set the pixel value of the text line area to 1 and the pixel value of other areas outside the text line area to 0, thereby generating a binary image corresponding to the original image.
[0141] S503: The electronic device determines a row projection and a column projection based on the binarized image.
[0142] In some embodiments, after converting the original image into a binary image, the electronic device accumulates the pixel values of the pixel points in the i-th row of the binary image to the row projection of the i-th row to obtain a set of one-dimensional signals, and accumulates the pixel values of the pixel points in the j-th column of the binary image to the column projection of the j-th column to obtain another set of one-dimensional signals, where i and j are positive integers.
[0143] Optionally, after acquiring the two groups of one-dimensional signals, in order to eliminate the adverse effects caused by the singular sample data, the electronic device normalizes the two groups of one-dimensional signals to determine the row projection and column projection for subsequent identification of the table structure. For example, the electronic device divides the two groups of one-dimensional signals by the corresponding maximum values of the signals respectively, so as to normalize the value ranges of the two groups of one-dimensional signals to the interval [0,1].
[0144] In this way, after the original image is converted into a binary image, the row projection and the column projection are determined based on the binary image, so that the image with a colored background can be better processed.
[0145] In addition, interference factors such as the background in the original image, text outside the table, shooting angle, lighting, etc. will affect the recognition of the table structure. Determining the row and column projections based on the binary image rather than determining the projection based on the original pixel value can effectively eliminate the above interference factors and improve the robustness of table structure recognition.
[0146] S504: The electronic device scans the row projection and the column projection through the state machine to determine the starting position and the ending position of the row and the column respectively.
[0147] In some embodiments, after determining the row projection and the column projection, the electronic device scans the row projection and the column projection respectively through a state machine to determine the starting position and the ending position of the row and the column.
[0148] For example, Figure 6 The partial table area shown, where each column or row includes a starting position and an ending position. Then, after the electronic device determines the starting position and the ending position of the column or row through the state machine, it can determine the separation position (such as the median position) between the two as the corresponding two cell boundaries based on the ending position of the previous column (such as the nth column) or row (such as the mth row) and the starting position of the current column (such as the n+1th column) or row (such as the m+1th row), thereby realizing the recognition of the table structure. The process of the electronic device determining the starting position and the ending position of the row and column by scanning the row projection and the column projection through the state machine is described in detail as follows.
[0149] Optionally, the state machine is, for example, a finite-state automaton (FSA). Figure 7 As shown in FIG. 1 , the state machine includes two states, such as the preparation state (Pre) and the activation state (Active). The preparation state indicates that a new column (or row) is ready to be scanned, and the activation state indicates that a certain column (or row) is being scanned. Each state has two possible transfer directions, which are to maintain the current state or transfer to the next state.
[0150] Optionally, the state machine can be subdivided into a group of sub-states according to the count when looping in each state, and transfer to the next sub-state when the count is increased by one, and return to the first sub-state when the count is reset to zero. Figure 8 The schematic diagram of the sub-state cycle within the ready state is shown. For the ready state and the activated state, the electronic device can be preset with corresponding counting thresholds respectively. After the count reaches the counting threshold, it can be determined that the state machine has transferred to the last sub-state in the current corresponding state, and it is necessary to switch to another state, the count of the other state is reset, and the state machine is restarted in the first sub-state of the current state. For example, the electronic device determines that the state machine has transferred to the last sub-state of the ready state, and it is necessary to switch the state machine to the activated state.
[0151] Optionally, in addition to maintaining the state of the state machine, the electronic device also needs to maintain a buffer for converting input signals. If the state machine is transferred from the ready state to the active state, the buffer needs to be updated.
[0152] In some examples, when the electronic device starts scanning, the state machine is in a ready state (count cnt=0), and the buffer buf=*0+. Each time an input signal v is processed i , based on the output signal, the state change of the state machine is determined. The electronic device is preset with a signal fluctuation threshold t, a counting threshold n1 corresponding to the ready state, and a counting threshold n2 corresponding to the activated state. Among them, the counting threshold can be determined according to the character width, for example, the counting threshold is the width of half a character, the width of a character, etc.
[0153] Optionally, the electronic device may first scan the column projection through the state machine to determine the starting position and the ending position of the column, and then scan the row projection through the state machine to determine the starting position and the ending position of the row; or, the electronic device may first scan the row projection through the state machine to determine the starting position and the ending position of the row, and then scan the column projection through the state machine to determine the starting position and the ending position of the column; or, the electronic device may also scan the column projection and the column projection at the same time through the state machine to determine the starting position and the ending position of the row and the column, respectively. This embodiment of the present application is not limited to this.
[0154] The following takes the example of an electronic device scanning a column projection through a state machine to determine the starting position and the ending position of a column as an example, and the process of determining the starting position and the ending position is described in detail.
[0155] Optionally, the input conversion method of the ready state is to determine the transfer condition and direction of the ready state by judging the relationship between the signal and the sum of the buffer minimum value and the fluctuation threshold, as well as the counting situation. For example, the signal is greater than or equal to the buffer minimum value plus the fluctuation threshold (v i ≥min(buf)+t) i =1, otherwise c i =0, the corresponding feasible transfer condition and direction are as follows:
[0156] a) If the signal is greater than or equal to the buffer minimum plus the fluctuation threshold, and the current state is in the last substate of the ready state, the count is cleared and the state machine can transfer to the active state to reset and update the buffer. For example, if c i =1, cnt = n1, then state = Active, cnt = 0, buf = *v i +.
[0157] b) If the signal is greater than or equal to the buffer minimum plus the fluctuation threshold, and there is no last sub-state in the ready state, then increment the count, transfer the state machine to the next sub-state of the ready state, and update the buffer. For example, if c i = 1, cnt < n1, then cnt = cnt + 1, buf = buf ∪ *v i +.
[0158] c) If the signal is less than the buffer minimum plus the fluctuation threshold, then clear the count, transfer the state machine to the first sub-state of the ready state, and update the buffer. For example, if c i = 0, then cnt = 0, buf = buf ∪ *v i +.
[0159] Optionally, the input transition method for the active state is to determine the transition conditions and directions of the active state by judging the magnitude relationship between the signal and the difference between the buffer maximum and the fluctuation threshold, as well as the count situation. For example, when the signal is less than or equal to the buffer maximum minus the fluctuation threshold (v i ≤ max(buf) - t), c i = 1, otherwise c i = 0. A feasible set of transition conditions and directions is as follows:
[0160] a) If the signal is less than or equal to the buffer maximum minus the fluctuation threshold, and the current state is the last sub-state of the active state, then clear the count, the state machine can transfer to the ready state, reset and update the buffer. For example, if c i = 1, cnt = n2, then state = Pre, cnt = 0, buf = *v i +.
[0161] b) If the signal is less than or equal to the buffer maximum minus the fluctuation threshold, and there is no last sub-state of the active state, then increment the count, the state machine can transfer to the next sub-state of the active state, and update the buffer. For example, if c i = 1, cnt < n2, then cnt = cnt + 1, buf = buf ∪ *v i +.
[0162] c) If the signal is greater than the buffer maximum minus the fluctuation threshold, then clear the count, the state machine can transfer to the first sub-state of the active state, and update the buffer. For example, if c i = 0, then cnt = 0, buf = buf ∪ *v i +.
[0163] Based on the transition conditions and directions of the ready state and the activated state in the above example, the electronic device scans a set of one-dimensional signals in the horizontal direction of the binary image from left to right, thereby realizing the detection of the starting position and the ending position of the column based on the state machine. It should be understood that the electronic device can also scan a set of one-dimensional signals in the horizontal direction of the binary image from right to left, thereby realizing the detection of the starting position and the ending position of the column based on the state machine.
[0164] For example, the electronic device scans the column projection in the horizontal direction through the state machine, and determines that the state machine is transferred from the ready state to the active state, that is, the state machine is transferred from the state of preparing to scan a new column to the state of scanning a column. Figure 6 As shown, the corresponding position is the starting position of the nth column. Then the state machine continues to scan the current nth column, and the state machine is still in the active state. Then, the state machine changes from the active state to the ready state, that is, the state machine changes from the state of scanning a certain column to the state of scanning the next new column. Then, Figure 6 As shown, the corresponding position is the end position of the nth column. Then the state machine changes from the current ready state to the active state, that is, the state machine changes from the state of preparing to scan the next new column to the state of scanning a new column. Figure 6 As shown, the corresponding position is the starting position of the n+1th column. That is, the state machine continuously scans the column projection in one direction in the horizontal direction (such as from left to right or from right to left), and cycles the transition process of the above-mentioned ready state and active state, and can respectively determine the starting position and the ending position of multiple columns in the table. Where n is a positive integer.
[0165] Similarly, the electronic device scans a set of one-dimensional signals in the vertical direction in the binary image from top to bottom (or from bottom to top), thereby realizing the starting position and ending position of the row based on the state machine detection. The specific method can refer to the transfer conditions and directions in the scanning column projection process of the above example, which will not be repeated here.
[0166] For example, the electronic device scans the line projection along the vertical direction through the state machine, and determines that the state machine is transferred from the ready state to the active state, that is, the state machine is transferred from the state of preparing to scan a new line to the state of scanning a line. Figure 6 As shown in the figure, the corresponding position is the starting position of the mth row. Then the state machine continues to scan the current mth row, and the state machine is still in the active state. Then, the state machine changes from the active state to the ready state, that is, the state machine changes from the state of scanning a row to the state of scanning the next new row. Figure 6As shown, the corresponding position is the end position of the mth row. Then the state machine changes from the current ready state to the active state, that is, the state machine changes from the state of preparing to scan the next new row to the state of scanning a new row. Figure 6 As shown, the corresponding position is the starting position of the m+1th row. That is, the state machine continuously scans the row projection in one direction in the vertical direction (such as from top to bottom or from bottom to top), and cycles the transition process of the above-mentioned preparation state and activation state, and can respectively determine the starting position and the end position of multiple rows in the table. Wherein, m is a positive integer.
[0167] In this way, the electronic device scans the row projection and column projection based on the state machine to determine the starting and ending positions of the rows and columns respectively, and can eliminate some noise interference caused by factors such as text detection errors and image shooting angles.
[0168] In addition, in the process of determining the starting and ending positions of rows and columns, the row projection and column projection are normalized so that the projection threshold is a fluctuating threshold rather than a fixed threshold. This can effectively eliminate the influence of cross-cell text (such as merged cells), so that the scanning method of the state machine can be applicable to recognition scenarios of various table structures.
[0169] S505: The electronic device determines the table position according to the starting position and the ending position of the row and the column.
[0170] In some embodiments, after determining the starting position and ending position of the row and column, the electronic device can determine the separation position of the row and column. After that, the electronic device can determine the coordinates of the cell according to the separation position of the row and column. After all the coordinates of the cells in the table are determined, the electronic device can complete the determination of the table position. Optionally, the electronic device can set the upper left corner endpoint position of the original image to the coordinate origin position.
[0171] For example, the electronic device determines the end position of the previous line and the start position of the next line, and then uses the median of these two positions as the separation position of the two lines.
[0172] For another example, the electronic device determines the end position of the previous column and the start position of the next column, and then uses the median of these two positions as the separation position of the two columns.
[0173] In some embodiments, after determining the table position, the electronic device may further match the table position with the recognized text position to generate a final original image recognition result. Figure 5 As shown, after step S505, the following step S506 may also be included.
[0174] S506: The electronic device generates an original image recognition result according to the text position and the table position.
[0175] In some embodiments, in the above step S501, the electronic device can recognize the text in the original image through OCR technology, so as to determine the text position (such as corresponding to the text line coordinates). Then, after determining the table position (such as corresponding to the cell coordinates), the electronic device can match the text position with the table position, such as filling the text line content into the corresponding cell, and then the electronic device can generate the recognition result of the original image, such as outputting an editable document.
[0176] Optionally, in the process of matching the text position and the table position, the electronic device may determine whether the text position and the table position match according to the center point or area overlap ratio corresponding to the text position and the table position.
[0177] For example, Figure 1 As shown in (d), the electronic device recognizes the table structure, confirms the text position and the table position, matches the text position and the table position, and then fills the text line content into the corresponding cell.
[0178] Optionally, after matching the table position with the text position in the table, the electronic device may further match the table position with the text position outside the table to generate a final original image recognition result.
[0179] In this way, the electronic device recognizes the table structure based on text projection and the state machine, so that the table recognition method has high robustness and avoids interference from interference factors.
[0180] Moreover, compared with table structure recognition based on neural networks, the table recognition method provided in the embodiments of the present application can be applied to more table recognition scenarios, such as wireless table structure recognition scenarios of various styles, without having to pre-build data sets suitable for these scenarios to train neural networks, which can save neural network training time and training set annotation costs.
[0181] In addition, the table recognition method provided in the embodiment of the present application can recognize and return the table structure in real time, and meet the user's usage needs with a higher processing speed.
[0182] In the above embodiment, in the above step S504, the electronic device determines the corresponding starting position and ending position based on the single state machine scanning row projection or column projection. In some examples, the electronic device may also decouple the detection of the starting position and the ending position, and determine the starting position or the ending position respectively through the forward state machine and the reverse state machine, thereby reducing the complexity of state transfer.
[0183] In some embodiments, the electronic device detects the starting position through a forward state machine and detects the ending position through a reverse state machine.
[0184] For example, still taking the example of an electronic device scanning a set of one-dimensional signals in the horizontal direction of a binary image and realizing the start position and end position of the column based on the state machine detection, the process of the electronic device determining the start position and end position through the forward-reverse state machine is introduced in detail.
[0185] In some examples, after acquiring the column projection, the electronic device scans a set of one-dimensional signals in the horizontal direction of the binary image from left to right, and determines the starting position of the column based on the forward state machine detection, but does not detect the ending position of the column. It should be understood that the embodiment of the present application takes the forward direction from left to right and the reverse direction from right to left as an example to illustrate the projection scanning process of the forward-reverse state machine. The electronic device may also be in the reverse direction from left to right and in the forward direction from right to left, and the embodiment of the present application is not limited to this.
[0186] Alternatively, if Fig. 9 As shown, the forward state machine includes three states, such as the preparation state (Pre), the activation state (Active) and the end state (Post). Among them, the preparation state indicates that a new column is ready to be scanned, and the activation state indicates that a certain column is being scanned. Optionally, since the forward state machine does not need to detect the end position of the column, the activation state of the forward state machine ends in advance, and the end state of the forward state machine actually belongs to a special state separated from the activation state of the single state machine in the above embodiment. Then the end state can indicate that the scan of the previous column has ended in advance, and it is not ready to scan the next column. There are two possible transfer directions for each state, namely, maintaining the current state or transferring to the next state.
[0187] Optionally, the input conversion method of the ready state is to determine the transfer condition and direction of the ready state by judging the relationship between the signal and the sum of the buffer minimum value and the fluctuation threshold, as well as the counting situation (the counting threshold corresponding to the ready state is n1). For example, the signal is greater than or equal to the buffer minimum value plus the fluctuation threshold (v i ≥min(buf)+t) i =1, otherwise c i =0, the corresponding feasible transfer condition and direction are as follows:
[0188] a) If the signal is greater than or equal to the buffer minimum plus the fluctuation threshold, and the current state is in the last substate of the ready state, the count is cleared and the forward state machine can transfer to the active state to reset and update the buffer. For example, if c i =1, cnt = n1, then state = Active, cnt = 0, buf = *v i +.
[0189] b) If the signal is greater than or equal to the buffer minimum value plus the fluctuation threshold and there is no last sub - state in the ready state, then increment the count, transfer the forward state machine to the next sub - state of the ready state, and update the buffer. For example, if c i = 1, cnt < n1, then cnt = cnt + 1, buf = buf ∪ *v i +.
[0190] c) If the signal is less than the buffer minimum value plus the fluctuation threshold, then clear the count, transfer the forward state machine to the first sub - state of the ready state, and update the buffer. For example, if c i = 0, then cnt = 0, buf = buf ∪ *v i +.
[0191] Optionally, if the forward state machine does not have to determine the termination position of the column, then the activation state does not need to transform the input. Then a feasible transfer condition and method are as follows. Among them, the count threshold corresponding to the activation state of the forward state machine preset in the current electronic device is n3.
[0192] a) If it is currently in the last sub - state of the activation state, then clear the count, transfer the forward state machine to the end state, and update the buffer. For example, if cnt = n3, then state = Post, cnt = 0, buf = buf ∪ *v i +.
[0193] b) If it is not in the last sub - state of the activation state, then increment the count, transfer the forward state machine to the next sub - state of the activation state, and update the buffer. For example, if cnt < n3, then cnt = cnt + 1, buf = buf ∪ *v i +.
[0194] Optionally, since the activation state of the forward state machine ends prematurely, the end state of the forward state machine actually belongs to a special state separated from the activation state of the single state machine in the above - mentioned embodiment. Then the transfer conditions and directions of the end state are the same as those of the activation state of the above - mentioned single state machine.
[0195] For example, the input transformation method of the end state is to determine the transfer conditions and directions of the end state by judging the size of the signal compared with the difference between the buffer maximum value and the fluctuation threshold, as well as the count situation (the count threshold corresponding to the end state is n2). For example, when the signal is less than or equal to the buffer maximum value minus the fluctuation threshold (v i ≤ max(buf)-t), c i = 1, otherwise c i = 0. A feasible transfer condition and direction are as follows:
[0196] a) If the signal is less than or equal to the buffer maximum minus the fluctuation threshold and the current state is the last sub - state of the end state, then clear the count, the forward state machine can transition to the ready state, reset and update the buffer. For example, if c i = 1, cnt = n2, then state = Pre, cut = 0, buf = *v i +.
[0197] b) If the signal is less than or equal to the buffer maximum minus the fluctuation threshold and it is not in the last sub - state of the end state, then increment the count, the forward state machine can transition to the next sub - state of the end state, and update the buffer. For example, if c i = 1, cnt < n2, then cnt = cnt + 1, buf = buf ∪ *v i +.
[0198] c) If the signal is greater than the buffer maximum minus the fluctuation threshold, then clear the count, the forward state machine can transition to the first sub - state of the end state, and update the buffer. For example, if c i = 0, then cnt = 0, buf = buf ∪ *v i +.
[0199] In this way, through the above - mentioned method, the electronic device determines the starting position of the column based on the left - to - right scanning of the column projection by the forward state machine.
[0200] In this way, when the forward state machine only detects the starting position, the counting threshold can be set more flexibly, so as to enter and exit each state more quickly, improve the sensitivity of detection, and facilitate the processing of relatively narrow blank intervals or rows and columns with less text change.
[0201] In some examples, the electronic device scans a set of one - dimensional signals in the horizontal direction of the binarized image from right to left, and determines the termination position of the column based on the detection of the reverse state machine, but does not detect the starting position of the column.
[0202] Optionally, during the process of scanning the column projection based on the reverse state machine, the electronic device selects the first starting position on the right side of the already determined starting position 1 by the forward state machine (selects the right - most position if it does not exist) as the starting point for scanning, scans the one - dimensional signal in the horizontal direction to the left, and determines the termination position between the two starting positions, and this termination position matches the starting position 1. Then it can be seen that the reverse state machine needs to perform multiple right - to - left (reverse) scans of the one - dimensional signal in the horizontal direction to determine the termination position of the column.
[0203] Optionally, if the reverse state machine scans from the scanning starting point to the starting position to be matched (such as the starting position 1 determined based on the forward state machine) and still fails to determine the termination position between the two starting positions, then this reverse scan can be ended (i.e., not ended prematurely), and the ready state can be forcibly converted to the active state. Optionally, in this case, the electronic device can determine the termination position corresponding to the starting position to be matched as coinciding with this starting position.
[0204] Optionally, as Fig.10 shown, the reverse state machine includes two states, such as the ready state (Pre) and the active state (Active). Among them, the ready state indicates preparing to scan a new column, and the active state indicates scanning a certain column.
[0205] Optionally, since the reverse state machine only detects one termination position each time it scans and stops the algorithm once it enters the active state, there is no transition for the active state.
[0206] Optionally, the input transition method for the ready state is to determine the transition conditions and directions of the ready state by judging the relationship between the signal and the sum of the buffer minimum value and the fluctuation threshold, as well as the counting situation (the counting threshold corresponding to the ready state is n1). For example, when the signal is greater than or equal to the buffer minimum value plus the fluctuation threshold (v i ≥min(buf)+t), then c i =1, and a feasible set of transition conditions and directions is as follows:
[0207] a) If the signal is greater than or equal to the buffer minimum value plus the fluctuation threshold and the reverse state machine is currently in the last sub-state of the ready state, then the reverse state machine can transition to the active state and the scan ends. For example, if c i =1, cnt=n1, then state=Active.
[0208] b) If the signal is greater than or equal to the buffer minimum value plus the fluctuation threshold and is not in the last sub-state of the ready state, then the count is incremented, the reverse state machine can transition to the next sub-state of the ready state, and the buffer is updated. For example, if c i =1, cnt<n1, then cnt=cnt+1, buf=buf∪*v i +.
[0209] c) If the signal is less than the buffer minimum value plus the fluctuation threshold, then the count is cleared, the reverse state machine can transition to the first sub-state of the ready state, and the buffer is updated. For example, if c i =0, then cnt=0, buf=buf∪*v i +.
[0210] In this way, through the above method, the electronic device determines the end position of the column based on the scanning column projection from right to left by the reverse state machine.
[0211] Optionally, the electronic device may first scan the column projection from right to left through the forward state machine to determine the end position of the column. Afterwards, based on the determined end position of the column, the reverse state machine is scanned multiple times to determine the start position corresponding to each end position. The embodiment of the present application does not limit the scanning order of the column projection of the forward state machine and the reverse state.
[0212] For example, the electronic device scans the column projection along the horizontal direction through the forward state machine, and determines that the forward state machine is transferred from the ready state to the active state, that is, the forward state machine is transferred from the state of preparing to scan a new column to the state of scanning a column. Figure 6 As shown, the corresponding position is the starting position of the nth column. Afterwards, the forward state machine continues to scan the current nth column, and the forward state machine transfers from the active state to the end state, that is, the forward state machine transfers from the state of scanning the nth column to the state of having ended the scanning of the nth column in advance and not yet ready to scan the n+1th column. Afterwards, the forward state machine continues to scan, and the forward state machine transfers from the end state to the active state, that is, the forward state machine transfers from the state of not yet ready to scan the n+1th column to the state of scanning the n+1th column. Then, as Figure 6 As shown, the corresponding position is the starting position of the n+1th column. That is, the forward state machine continuously scans the column projection in one direction in the horizontal direction (such as from left to right or from right to left), and cycles through the transition process of the above-mentioned ready state, activation state, and end state, and can respectively determine the starting positions of multiple columns in the table.
[0213] After determining the starting positions of multiple columns, the electronic device can use the reverse state machine to scan the column projections in the horizontal direction in the opposite direction to the scanning direction of the forward state machine to determine the end positions corresponding to the starting positions of these determined columns. For example, the scanning direction of the forward state machine is from left to right, and the scanning direction of the reverse state machine is from right to left. Figure 6 As shown, in the process of determining the end position of the nth column, the electronic device first obtains the starting position of the nth column, determines the first starting position to the right of the starting position of the nth column, that is, determines the starting position of the n+1th column, and starts scanning to the left with the starting position of the n+1th column as the starting point. Determine that the reverse state machine is transferred from the ready state to the active state, that is, the reverse state machine is transferred from the state of preparing to scan a new column to the state of scanning a column, then Figure 6As shown, the corresponding position is the end position of the nth column. After the reverse state machine switches to the active state, the device ends the scanning of the reverse state machine. That is, the reverse state machine moves in the horizontal direction in the opposite direction to the scanning direction of the forward state machine, starting from the start position of the column that has been determined by the forward state machine, and by scanning the column projection multiple times, the above-mentioned transition process from the ready state to the active state is cycled, and the end positions of multiple columns in the table can be determined respectively.
[0214] Similarly, the electronic device scans a set of one-dimensional signals in the vertical direction of the binary image through the forward-reverse state machine, thereby realizing the detection of the starting position and the ending position of the row based on the state machine. The specific method can refer to the specific implementation method in the process of scanning the column projection in the above example, which will not be repeated here. Similarly, the embodiment of the present application does not limit the scanning order of the forward state machine and the reverse state for the row projection.
[0215] Optionally, the electronic device determines the starting position of the line by scanning the line from top to bottom through the forward state machine, and determines the ending position of the line by scanning the line from bottom to top through the reverse state machine. It should be understood that the embodiment of the present application takes the forward direction from top to bottom and the reverse direction from bottom to top as an example to illustrate the projection scanning process of the forward-reverse state machine. The electronic device may also be in the reverse direction from top to bottom and in the forward direction from bottom to top, and the embodiment of the present application does not limit this.
[0216] For example, the electronic device scans the line projection along the vertical direction through the forward state machine, and determines that the forward state machine is transferred from the ready state to the active state, that is, the forward state machine is transferred from the state of preparing to scan a new line to the state of scanning a line. Figure 6 As shown, the corresponding position is the starting position of the mth row. Afterwards, the forward state machine continues to scan the current mth row, and the forward state machine transfers from the active state to the end state, that is, the forward state machine transfers from the state of scanning the mth row to the state of having ended the scan of the mth row in advance and not yet ready to scan the m+1th row. Afterwards, the forward state machine continues to scan, and the forward state machine transfers from the end state to the active state, that is, the forward state machine transfers from the state of not yet ready to scan the m+1th row to the state of scanning the m+1th row. Then, as Figure 6 As shown, the corresponding position is the starting position of the m+1th row. That is, the forward state machine continuously scans the row projection in one direction in the vertical direction (such as from top to bottom or from bottom to top), and cycles through the transition process of the above-mentioned preparation state, activation state, and end state, and can respectively determine the starting positions of multiple rows in the table.
[0217] After determining the starting positions of multiple rows, the electronic device can use the reverse state machine to scan the row projections in the vertical direction in the direction opposite to the scanning direction of the forward state machine to determine the end positions corresponding to the starting positions of these determined rows. For example, the scanning direction of the forward state machine is from top to bottom, and the scanning direction of the reverse state machine is from bottom to top. Figure 6 As shown in the figure, in the process of determining the end position of the mth row, the electronic device first obtains the starting position of the mth row, determines the first starting position below the starting position of the mth row, that is, determines the starting position of the m+1th row, and starts scanning upward with the starting position of the m+1th row as the starting point. Determine that the reverse state machine is transferred from the ready state to the active state, that is, the reverse state machine is transferred from the state of preparing to scan a new row to the state of scanning a row, then Figure 6 As shown, the corresponding position is the end position of the mth row. After the reverse state machine switches to the active state, the device ends the scanning of the reverse state machine. That is, the reverse state machine moves in the vertical direction in the opposite direction to the scanning direction of the forward state machine, starting from the start position of the row determined by the forward state machine, and through multiple scanning row projections, the above-mentioned transition process from the ready state to the active state is cycled, and the end positions of multiple rows in the table can be determined respectively.
[0218] For example, Fig.11 This is a recognition effect diagram of the starting position and the ending position of a row of a table provided in an embodiment of the present application. Fig.11 As shown, the pixel height of the image is 600 (corresponding to the horizontal coordinate), and the row projection value is normalized to between [0, 1] (corresponding to the vertical coordinate).
[0219] In some examples, the electronic device may detect the starting position and the ending position of a row through a single state machine.
[0220] In other examples, the electronic device may detect the starting position of the line through the forward state machine, such as determining the starting position 101 and the starting position 102. Afterwards, the electronic device may detect the ending position of the line through the reverse state machine. For example, in the process of scanning the line projection based on the reverse state machine, the electronic device selects the first starting position 102 on the right side of the starting position 101 determined by the forward state machine as the starting point of the scan, scans the projection value of the line projection vertically to the left, and determines the ending position 103 between the two starting positions.
[0221] Optionally, if the electronic device fails to determine the end position 103, the reverse scan can be stopped, and the reverse state machine can be forced to switch from the ready state to the active state. Optionally, in this case, the electronic device can also determine that the reference numeral 101 is used to indicate the start position and the end position of the corresponding row.
[0222] In some scenarios, after determining the text line area in the original image, the electronic device may first scale the text line area, scale the text height to a preset range, and then determine the corresponding table structure based on the scaled text line area. In this way, based on the standardized text height, the difficulty of setting the counting threshold in the above state transition conditions and direction process is reduced.
[0223] For example, Fig.12 A flowchart of another table recognition method provided in an embodiment of the present application is shown below. Fig.12 As shown, the above step S502 may include step S1201 and step S1202.
[0224] S1201: The electronic device scales the text line area according to preset conditions.
[0225] The preset condition is used to indicate a preset interval preset in the electronic device for scaling the text line area.
[0226] In some embodiments, the electronic device may determine the short side height of the text line detection frame in the process of acquiring the text line area in the original image, and the text line height may be estimated based on the short side height. Afterwards, the electronic device scales the text line height to the preset interval according to the preset interval. Then, correspondingly, after the text line height is scaled, the text line area is scaled.
[0227] In some embodiments, the electronic device can identify the text in the original image through OCR technology and determine the text position (such as corresponding to the text line coordinates). Then, when scaling the text line height, the electronic device can synchronously adjust the text line coordinates and correct the corresponding text position.
[0228] S1202: The electronic device generates a binary image corresponding to the original image based on the scaled text line area.
[0229] In some embodiments, after acquiring the scaled text line area, the electronic device can use a binarization algorithm to set the pixel value of the scaled text line area to 1 and set the pixel values of other areas outside the scaled text line area to 0, thereby generating a binary image corresponding to the original image.
[0230] Afterwards, the electronic device may perform the above steps S503 to S505 again, and determine the position of the table based on the binary image corresponding to the scaled text line area. Fig.12 As shown, the above step S506 can be implemented as step S1203.
[0231] S1203: After scaling the text position and the table position, an original image recognition result is generated.
[0232] In some embodiments, after determining the position of the table (such as corresponding to the cell coordinates), the electronic device may reversely scale the cell coordinates and the text row coordinates based on the scaling ratio determined in the above step S1201 to match the size of the original image. For example, in steps S1201 and S1202, the electronic device reduces the text row area and the text row coordinates and generates a corresponding binary image to determine the position of the table. Then, in step S1203, the electronic device enlarges the determined cell coordinates and text row coordinates to match the size of the original image. In addition, the electronic device may match the cell coordinates and the text row coordinates to generate the original image recognition result.
[0233] For example, if the preset interval is generally smaller than the text line height, then in the process of scaling the text line area, it is equivalent to downsampling the image, reducing the number of sampling points in the image recognition process. In the subsequent table recognition process, the algorithm processing steps and time can be effectively reduced, and the table recognition speed can be improved.
[0234] In some scenarios, the table in the original image may be tilted due to shooting angles and other issues. Then, after determining the text row area in the original image, the electronic device can first correct the tilt angle of the text row area, and then determine the corresponding table structure based on the text row area after the tilt angle correction. In this way, the recognition of tilted tables is achieved, expanding the applicable table recognition scenarios.
[0235] For example, Fig.13 A flowchart of another table recognition method provided in an embodiment of the present application is shown below. Fig.13 As shown, the above step S502 may include step S1301 and step S1302.
[0236] S1301. The electronic device corrects the tilt angle of the text line area.
[0237] In some embodiments, the electronic device may determine whether the text line region has a tilt problem during the process of acquiring the text line region in the original image. Optionally, the electronic device may determine the border of the original image as a horizontal direction and a vertical direction, and then the electronic device may determine whether the text line region has a tilt problem based on the determined horizontal direction and vertical direction.
[0238] When the electronic device determines that the text line region has a tilt problem, the electronic device may determine a minimum rotation rectangle or a center line including the text line region. Then, the electronic device may estimate the tilt angle of the text line region based on the minimum rotation rectangle or the center line. Then, the electronic device corrects the text line region by rotating it according to the tilt angle.
[0239] Optionally, the electronic device may determine the minimum rotated rectangle of the text line area based on algorithms such as cv2.minAreaRect, and determine the tilt angle of the text line area based on the minimum rotated rectangle and the border of the original image.
[0240] Optionally, after identifying the text line area, the electronic device may determine the center line by connecting the center points of the two short sides of the text line area. Furthermore, the electronic device may determine the weighted average of all text lines according to the long side of the text line area, and based on the center line and the weighted average, the electronic device may determine the tilt angle of the text line area.
[0241] In some embodiments, the electronic device can identify the text in the original image through OCR technology and determine the text position (such as corresponding to the text line coordinates). Based on the above method, the electronic device can also determine the tilt angle corresponding to the text position and correct the text position by rotation.
[0242] S1302: The electronic device generates a binary image corresponding to the original image based on the text line area after the tilt angle is corrected.
[0243] In some embodiments, after obtaining the text line area after correcting the tilt angle, the electronic device can use a binarization algorithm to set the pixel value of the text line area after correcting the tilt angle to 1, and set the pixel values of other areas outside the text line area after correcting the tilt angle to 0, thereby generating a binary image corresponding to the original image.
[0244] Afterwards, the electronic device may perform the above steps S503 to S505 again, and determine the position of the table based on the binary image corresponding to the text line area after the tilt angle is corrected. Fig.13 As shown, the above step S506 can be implemented as step S1303.
[0245] S1303: After performing tilt processing on the text position and the table position, an original image recognition result is generated.
[0246] In some embodiments, after determining the table position (such as corresponding to the cell coordinates), the electronic device may reversely rotate the cell coordinates and the text row coordinates based on the tilt angle determined in the above step S1201 to match the angle of the original image. Furthermore, the electronic device may match the cell coordinates and the text row coordinates to generate the original image recognition result.
[0247] In this way, the tilted table can be processed by rotating the text line detection frame (ie, rotating the text line area).
[0248] Optionally, after executing the above step S501 to determine the text line area, the electronic device may first scale the text line area and then perform tilt angle correction on the text line area, or first perform tilt angle correction on the text line area and then scale the text line area, that is, the embodiment of the present application does not limit the execution order between step S1201-step S1202 and step S1301-step S1302. Correspondingly, the embodiment of the present application also does not limit the execution order of step S1203 and step S1303. In addition, in this process, if the electronic device determines that the text line area is already within the preset interval, it is not necessary to scale the text line area; if the electronic device determines that the text line area does not need to be corrected for the tilt angle, it is not necessary to correct the tilt angle of the text line area.
[0249] Combination of the above Figure 5-Figure 13 The table recognition method provided in the embodiment of the present application is described in detail. Fig.14 The device provided in the embodiments of the present application is described in detail.
[0250] In one possible design, Fig.14 This is a schematic diagram of the structure of the first device provided in the embodiment of the present application. Fig.14 As shown, the first device 1400 may include: a processing unit 1401. The first device 1400 may be used to implement the functions of the electronic device involved in the above method embodiments.
[0251] Optionally, the processing unit 1401 is configured to support the first device 1400 to execute Figure 5 S501-S506 in; and / or, supporting the first device 1400 to execute Fig.12 S1201, S1202 and S1203 in; and / or, supporting the first device 1400 to execute Fig.13 S1301, S1302 and S1303 in.
[0252] Alternatively, if Fig.14 As shown, the first device 1400 may further include a transceiver unit 1402, which is used to support the first device 1400 to perform a receiving operation or a sending operation. The transceiver unit may include a receiving unit and a sending unit, which may be implemented by a transceiver or a transceiver-related circuit component, and may be a transceiver or a transceiver module.
[0253] Alternatively, if Fig.14 As shown, the first device 1400 may further include a display unit, which is used to support the first device 1400 to display interface content, such as displaying an original image, displaying an original image recognition result after table recognition, and the like.
[0254] Optionally, the operations and / or functions of each unit in the first device 1400 are respectively for implementing the corresponding processes of the table recognition method described in the above method embodiment. All relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional unit, and will not be repeated here for the sake of brevity.
[0255] Optionally, Fig.14 The first device 1400 shown may also include a storage unit ( Fig.14 (not shown), the storage unit stores a program or instruction. When the processing unit 1401 executes the program or instruction, Fig.14 The first device 1400 shown can execute the table recognition method described in the above method embodiment.
[0256] Fig.14 The technical effects of the first device 1400 shown can refer to the technical effects of the table recognition method described in the above method embodiment, and will not be repeated here.
[0257] In addition to being in the form of the first device 1400, the technical solution provided in the present application may also be a functional unit or chip in the first device, or a device used in conjunction with the first device.
[0258] An embodiment of the present application also provides a chip system, including: a processor, the processor is coupled to a memory, the memory is used to store programs or instructions, when the program or instructions are executed by the processor, the chip system implements the method in any of the above method embodiments.
[0259] Optionally, the processor in the chip system may be one or more. The processor may be implemented by hardware or by software. When implemented by hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented by software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.
[0260] Optionally, the memory in the chip system may also be one or more. The memory may be integrated with the processor or may be separately arranged with the processor, which is not limited in the embodiments of the present application. Exemplarily, the memory may be a non-transient processor, such as a read-only memory ROM, which may be integrated with the processor on the same chip or may be arranged on different chips respectively. The embodiments of the present application do not specifically limit the type of memory and the arrangement of the memory and the processor.
[0261] Exemplarily, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.
[0262] It should be understood that each step in the above method embodiment can be completed by an integrated logic circuit of hardware in a processor or by instructions in the form of software. The method steps disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.
[0263] The embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is run on a computer, the computer executes the above-mentioned related steps to implement the table recognition method in the above-mentioned embodiment.
[0264] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the above-mentioned related steps to implement the table recognition method in the above-mentioned embodiment.
[0265] In addition, an embodiment of the present application further provides a device. The device may be a component or a module, and the device may include one or more processors and a memory connected to each other. The memory is used to store a computer program. When the computer program is executed by one or more processors, the device performs the table recognition method in the above-mentioned method embodiments.
[0266] Among them, the device, computer-readable storage medium, computer program product or chip provided in the embodiments of the present application are used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0267] The steps of the method or algorithm described in conjunction with the disclosure of the embodiments of the present application can be implemented in hardware or by executing software instructions by a processor. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC).
[0268] Through the description of the above implementation methods, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed; that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0269] In the several embodiments provided in the present application, it should be understood that the disclosed method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation; for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of modules or units, which can be electrical, mechanical or other forms.
[0270] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0271] Computer-readable storage media include, but are not limited to, any of the following: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and other media that can store program codes.
[0272] It should be noted that any part or all of any features of any embodiment in the present application can be freely combined, and the combined technical solutions are also within the scope of the present application.
[0273] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A table recognition method, characterized in that: Applied to a first device, the method includes: Get the text row area corresponding to the table area in the image; Based on the text line area, generating a binary image; Accumulating the pixel values of the pixel points in a single row in the binary image to obtain a row projection corresponding to the binary image; and accumulating the pixel values of the pixel points in a single column in the binary image to obtain a column projection corresponding to the binary image; Scanning the row projection and the column projection by a state machine to determine the starting position and the ending position of the row and the starting position and the ending position of the column; The table position is determined according to the starting position and the ending position of the row and the starting position and the ending position of the column.
2. The method according to claim 1, characterized in that The step of generating a binary image based on the text line region includes: According to preset conditions, scaling the text line area; The binary image is generated based on the scaled text line area.
3. The method according to claim 1 or 2, characterized in that: The step of generating a binary image based on the text line region includes: Correcting the tilt angle of the text line area; The binary image is generated based on the text line region after the tilt angle is corrected.
4. The method according to any one of claims 1 to 3, characterized in that The state machine includes a ready state and an activated state, wherein the ready state is used to indicate scanning a new column or row, and the activated state is used to indicate scanning a certain column or row; the ready state or the activated state includes two transfer directions, namely maintaining the current state or transferring to the next state.
5. The method according to claim 4, characterized in that The ready state or the active state includes a plurality of sub-states.
6. The method according to claim 5, characterized in that Scanning the row projection and the column projection by a state machine to determine the starting position and the ending position of the row and the starting position and the ending position of the column includes: The transfer direction or transfer condition of the ready state or the activated state is determined by one or more of the counting threshold, counting situation, signal value, buffer value, and fluctuation threshold. The counting situation is used to indicate the number of sub-states transferred within the ready state or the activated state, and the number is less than or equal to the counting threshold. The buffer is used to convert the input signal.
7. The method according to any one of claims 4 to 6, characterized in that: Scanning the row projection and the column projection by a state machine to determine the starting position and the ending position of the row and the starting position and the ending position of the column includes: Scanning the column projections in the horizontal direction by the state machine, during the scanning process, determining the starting position and the ending position of each column according to the state transition of the state machine, wherein the position corresponding to the transition of the state machine from the ready state to the active state is determined to be the starting position of the nth column, and the ending position of the nth column is the position corresponding to the transition of the state machine from the active state to the ready state that is closest to the starting position of the nth column, and n is a positive integer; The row projections are scanned in a vertical direction by the state machine. During the scanning process, the starting position and the ending position of each row are determined according to the state transition of the state machine, wherein the position corresponding to the transition of the state machine from the ready state to the activated state is determined to be the starting position of the mth row, and the ending position of the mth row is the position corresponding to the transition of the state machine from the activated state to the ready state that is closest to the starting position of the mth row, and m is a positive integer.
8. The method according to any one of claims 4 to 6, characterized in that: The state machine includes a forward state machine and a reverse state machine, the forward state machine includes the ready state, the activated state and the end state, and the reverse state machine includes the ready state and the activated state; wherein the end state is used to indicate that the scanning of the previous row or column has been ended in advance and it is not yet ready to scan the next row or column.
9. The method according to claim 8, characterized in that Scanning the row projection and the column projection by a state machine to determine the starting position and the ending position of the row and the starting position and the ending position of the column includes: Scanning the column projections in the horizontal direction by the forward state machine, during the scanning process, determining the starting position of each column according to the state transition of the forward state machine, wherein determining the position corresponding to the transition of the forward state machine from the ready state to the active state is the starting position of the nth column, and then the forward state machine is transferred from the active state to the end state and then to the ready state, and determining to be ready to scan the n+1th column, where n is a positive integer; The reverse state machine scans the column projection along the horizontal direction in a direction opposite to the scanning direction of the forward state machine. During the scanning process, the end position of the nth column corresponding to the starting position of the nth column is determined according to the state transition of the reverse state machine, wherein the scanning is started with the starting position of the n+1th column as the starting point to determine that the position corresponding to the transition of the reverse state machine from the ready state to the activated state is the end position of the nth column.
10. The method according to claim 8, characterized in that Scanning the row projection and the column projection by a state machine to determine the starting position and the ending position of the row and the starting position and the ending position of the column includes: Scanning the row projections along the vertical direction by the forward state machine, during the scanning process, determining the starting position of each row according to the state transition of the forward state machine, wherein determining that the position corresponding to the transition of the forward state machine from the ready state to the active state is the starting position of the mth row, and then the forward state machine transitions from the active state to the end state and then to the ready state, determining to be ready to scan the m+1th row, where m is a positive integer; The reverse state machine scans the row projection along a vertical direction in a direction opposite to the scanning direction of the forward state machine. During the scanning process, the end position of the mth row corresponding to the starting position of the mth row is determined according to the state transition of the reverse state machine, wherein the scanning is started with the starting position of the m+1th row as the starting point to determine that the position corresponding to the transition of the reverse state machine from the ready state to the activated state is the end position of the mth row.
11. The method according to any one of claims 1 to 10, characterized in that The determining the table position according to the starting position and the ending position of the row and the starting position and the ending position of the column comprises: Determine the row separation position and the column separation position according to the starting position and the ending position of the row and the starting position and the ending position of the column respectively; The coordinates of cells included in the table are determined according to the separation positions of the rows and the separation positions of the columns.
12. The method according to any one of claims 1 to 11, characterized in that The step of generating a binary image based on the text line region includes: The pixel values within the text line area are set to 1, and the pixel values outside the text line area are set to 0.
13. The method according to any one of claims 1 to 12, characterized in that Scanning the row projection and the column projection by a state machine to determine the starting position and the ending position of the row and the starting position and the ending position of the column includes: Normalizing the row projection and the column projection respectively; The normalized row projection and column projection are scanned by the state machine to determine the starting position and the ending position of the row and the starting position and the ending position of the column.
14. An electronic device, characterized in that: include: A processor and a memory, wherein the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, and when the processor reads the computer instructions from the memory, the electronic device executes the method as described in any one of claims 1-13.
15. A server, characterized in that: include: A processor and a memory, wherein the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, and when the processor reads the computer instructions from the memory, the server executes the method according to any one of claims 1 to 13.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises a computer program, and when the computer program is executed on an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 13.
17. A computer program product, characterized in that When the computer program product is executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 13.
Citation Information
Cited By
Document image tilt correction method and device, computer equipment, readable storage medium and program product
CN119723591A
