A method and system for removing table lines in an image
Through the method of eliminating pixel points of stacking excessive lines, the problem of inaccurate recognition of table lines in the prior art is solved, and the stable identification and efficient data extraction of complex tables are realized, which is suitable for automated information processing in multiple fields.
Patent Information
- Application Number
- CN202311655450.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-05
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2043-12-05
AI Technical Summary
The existing table line recognition methods do not have the best effect on complex or distorted table line recognition, and when removing lines, it is easy to accidentally damage the text and numbers inside the table, making it difficult to accurately identify subtle lines, resulting in a decrease in recognition accuracy and inaccurate data extraction.
The method of eliminating pixel points of stacking excessive lines is adopted, by collecting images, performing two-dimensional interpolation compression, extracting neutral gray binarized images, counting light and dark distribution, judging bright color mode, performing threshold binarized preprocessing, and removing horizontal and vertical lines, and finally removing table lines.
It improves the accuracy of image recognition, can stably identify complex tables, convert them into editable table formats, improves data extraction accuracy and processing efficiency, and is suitable for automated information processing in multiple fields.
Smart Images

Figure CN117671709B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and particularly to a method and system for removing table lines in an image. Background Art
[0002] In the field of image processing, table recognition technology has always been a topic of great concern; with the continuous growth of digital information, automatic table recognition has become the key to improving data processing efficiency.
[0003] Currently, existing table recognition technologies generally have some serious defects and deficiencies when dealing with table lines in images. Firstly, since traditional table line recognition methods usually rely on rules and template matching, the recognition effect for complex or distorted table lines is not good, resulting in a significant decrease in recognition accuracy when dealing with non-standardized tables or handwritten tables; secondly, existing line removal methods may accidentally damage the text and numbers inside the table while removing the table lines, thus affecting the accuracy of final data extraction; in addition, the lines of some tables in images may be very fine, which makes it difficult for traditional methods to accurately recognize and leads to the problem of missed detection; therefore, it is necessary to design a method and system for removing table lines in an image. Summary of the Invention
[0004] The purpose of the present invention is to overcome the deficiencies of the prior art, and to better and effectively solve the problems that traditional table line recognition methods usually rely on rules and template matching, resulting in poor recognition effect for complex or distorted table lines, leading to a significant decrease in recognition accuracy when dealing with non-standardized tables or handwritten tables, and existing line removal methods may accidentally damage the text and numbers inside the table while removing the table lines, thus affecting the accuracy of final data extraction, and at the same time, the lines of some tables in images may be very fine, which makes it difficult for traditional methods to accurately recognize and leads to the problem of missed detection. The present invention provides a method and system for removing table lines in an image, which realizes the function of stably recognizing various complex tables, and can improve the accuracy of image recognition by using the method of eliminating overstacked line pixels, and can also convert the table content into a real editable table, and can eliminate the table lines in the image without considering the line thickness, improving the accuracy of table data extraction and processing efficiency.
[0005] In order to achieve the above purpose, the technical solution adopted by the present invention is as follows:
[0006] A method and system for removing table lines in an image, including the following steps,
[0007] Step (A), collecting an image containing table lines and performing sample processing;
[0008] Step (B): Perform two-dimensional interpolation on the image containing table lines for image compression to obtain the compressed image;
[0009] Step (C): Extract a neutral gray binary image from the compressed image;
[0010] Step (D): Statistically analyze the light and dark distribution of the neutral gray binary image and determine whether the neutral gray binary image belongs to the bright color mode;
[0011] Step (E): Perform threshold binary preprocessing on the neutral gray binary image based on the bright color mode to obtain the preprocessed image;
[0012] Step (F): Remove the horizontal lines from the table area in the preprocessed image to obtain the image after removing the horizontal lines;
[0013] Step (G): Remove the vertical lines from the table area in the preprocessed image to obtain the image after removing the vertical lines;
[0014] Step (H): Combine the image after removing the horizontal lines and the image after removing the vertical lines to obtain the image after removing the table lines and output it.
[0015] The aforementioned method for removing table lines in an image, Step (A): Collect an image containing table lines and perform sample processing. The specific steps are as follows.
[0016] Step (A1): Collect an image containing table lines. The standard for the image containing table lines is divided into two cases: the image background is dark and the image background is bright. The specific steps are as follows.
[0017] Step (A11): When the image background is dark and max(R, G, B) ≤ T, the gray value of the image in the entire table area gradually changes in the range [0, T], and the colors of the text and table lines meet min(R, G, B) ≥ 255 - T, where T represents the threshold.
[0018] Step (A12): When the image background is bright and min(R, G, B) ≥ 255 - T, the gray value of the image in the entire table area gradually changes in the range [0, T], and the colors of the text and table lines meet max(R, G, B) ≤ T.
[0019] Step (A2): Perform sample processing on the image containing table lines. The sample processing is specifically to process the image with a dark background, and f(A) = 255 - A, where A represents the image.
[0020] The aforementioned method for removing table lines in an image, Step (B): Perform two-dimensional interpolation on the image containing table lines for image compression to obtain the compressed image, as specifically shown in formula (1).
[0021] A ′ (x ′ , y ′ ) = (1 - α)(1 - β)A(x, y) + α(1 - β)A(x + 1, y)
[0022] + (1 - α)βA(x, y + 1) + αβA(x + 1, y + 1)(1)
[0023] where A ′ (x ′ , y ′ ) represents the gray value of the compressed image, and A(x, y) represents the gray value of the original image. (x ′ , y ′ ) represents the coordinates of the compressed image, (x, y) represents the coordinates of the original image, and α and β are the offsets of x ′ and y ′ relative to the integer coordinates x and y.
[0024] For the aforementioned method for removing table lines in an image, in step (C), a neutral gray binary image is extracted from the compressed image, as specifically shown in formula (2),
[0025]
[0026] where B(x, y) represents the neutral gray binary image.
[0027] For the aforementioned method for removing table lines in an image, in step (D), the light and dark distribution of the neutral gray binary image is statistically analyzed, and it is determined whether the neutral gray binary image belongs to the bright color mode. The specific steps are as follows,[[]]
[0028] In step (D1), the light and dark distribution of the neutral gray binary image is statistically analyzed, as specifically shown in formula (3),
[0029]
[0030] where W represents the image width, H represents the image height; N0 represents the proportion of the dark area among all the pixel points of the image, and N1 represents the proportion of the bright area among all the pixel points of the image;
[0031] In step (D2), it is determined whether the neutral gray binary image belongs to the bright color mode. The criterion for determining whether the neutral gray binary image belongs to the bright color mode is specifically as follows,
[0032] If N0 > N1, it is the dark color mode; if N1 > N0, it is the bright color mode;
[0033] If only N0 is calculated, use conditional judgment to determine whether it belongs to the bright color mode; if only N1 is calculated, use The condition determines whether it belongs to the bright color mode.
[0034] For the method for removing table lines in an image described above, in step (E), perform threshold binarization preprocessing on the neutral gray binarized image based on the bright color mode to obtain a preprocessed image, as specifically shown in formula (4).
[0035]
[0036] For the method for removing table lines in an image described above, in step (F), remove the horizontal lines from the table area in the preprocessed image to obtain an image after removing the horizontal lines, as specifically shown in formula (5).
[0037]
[0038] f(B) = [f(B,1); f(B,2); …; f(B,H)] (5)
[0039] Wherein, represents the ray length threshold, f(B,x) represents a row vector, and f(B) represents the image after removing the horizontal lines.
[0040] For the method for removing table lines in an image described above, in step (G), remove the vertical lines from the table area in the preprocessed image to obtain an image after removing the vertical lines, as specifically shown in formula (6).
[0041]
[0042] g(B) = [g(B,1), g(B,2), …, g(B,W)] (6)
[0043] Wherein, g(B,y) represents a column vector, and g(B) represents the image after removing the vertical lines.
[0044] For the method for removing table lines in an image described above, in step (H), combine the image after removing the horizontal lines and the image after removing the vertical lines to obtain an image after removing the table lines and output it. The specific steps are as follows.
[0045] In step (H1), the relationship between the image f(B) after removing the horizontal lines and the image g(B) after removing the vertical lines is as shown in formula (7).
[0046] [f(B,1); f(B,2); …; f(B,H)] = [g(B T ,1), g(B T ,2), …, g(B T ,W)] T ,
[0047] [g(B, 1), g(B, 2), …, g(B, W)] = [f(B T , 1); f(B T , 2); …; f(B T , H)] T (7);
[0048] Step (H2), combine the image after removing horizontal lines and the image after removing vertical lines, specifically as shown in formula (8),
[0049] B cleartableline = f(B) ∨ [f(B T )] T = g(B) ∨ [g(B T )] T = g(f(B)) = f(g(B)) (8)
[0050] where ∨ represents the bitwise OR operator, and B cleartableline represents the image with table lines removed.
[0051] An image table line removal system includes an image acquisition module, an image compression module, an image extraction module, an image statistical judgment module, an image preprocessing module, an image horizontal line removal module, an image vertical line removal module, and an image output module. The image acquisition module is used to acquire an image containing table lines and perform sample processing; the image compression module is used to compress the image containing table lines using two-dimensional interpolation and obtain the compressed image; the image extraction module is used to extract a neutral gray binary image from the compressed image; the image statistical judgment module is used to statistically analyze the light and dark distribution of the neutral gray binary image and judge whether the neutral gray binary image belongs to the bright color mode; the image preprocessing module is used to perform threshold binary preprocessing on the neutral gray binary image based on the bright color mode and obtain the preprocessed image; the image horizontal line removal module is used to remove horizontal lines from the table area in the preprocessed image and obtain the image after removing horizontal lines; the image vertical line removal module is used to remove vertical lines from the table area in the preprocessed image and obtain the image after removing vertical lines; the image output module is used to combine the image after removing horizontal lines and the image after removing vertical lines, obtain the image after removing table lines, and output it.
[0052] The beneficial effects of the present invention are:
[0053] (1) The present invention adopts a method for eliminating stacked excessive line pixels, effectively improving the accuracy of image recognition; this improvement in accuracy is of great significance for automated scenarios of retrieving a large amount of text information with irregular layouts based on optical character detection. For example, automated retrieval of a large amount of high-precision form information such as product information of medical devices and dosage instructions of prescription drugs; in addition, it is of great significance for fields such as aerospace equipment, materials science, and financial information analysis, and can also solve the problem of converting photocopied books into editable documents.
[0054] (2) The present invention can directly convert the table content into a real editable table. Whether it is in the word document format, markdown format or pdf format, after the content is extracted, the syntax of the format can be spliced to be converted into an editable table. A large amount of form information can be directly converted into an excel table; on this premise, it can also automatically translate the form information and assemble it into an editable document format in another language, solving the problem that in the re-editing of current photocopied books, since most of the form information cannot be converted into editable documents, only the form area image blocks can be cut and typeset in the document in the form of pictures.
[0055] (3) The present invention can eliminate the table lines in the image without considering the line thickness, providing a more fluent and intuitive experience for users, and enabling users to complete tasks more quickly and accurately during use. In information verification, the present invention effectively controls the cost, not only provides better performance, but also provides more considerable benefits while reducing costs; the present invention enables the annotation work related to form images to be automatically completed, and high-precision information retrieval and automated processing in fields such as medical, finance, and aerospace are crucial for the smooth progress of business, and the present invention has a relatively wide application prospect.
[0056] (4) The present invention can perform internal automated processing on privacy information that is not convenient to disclose and does not require a large number of workers, which is crucial for protecting the privacy and security of data in many industries. The present invention is not only a current solution but also has long-term value. For example, in online course learning, assuming that the lecture notes of the instructor cannot be obtained and there is no lecture note document, and the content in the lecture notes is presented in the form of text and tables in the PPT, the present invention can extract and process the information from the video frames and organize it into editable lecture notes, which is convenient for students to generate note templates. For long videos, it is not necessary for the video producer to manually divide the time intervals to which the content topics belong. The accurate content topics can be automatically determined according to frame analysis. In this way, a more accurate division can be formed, and when students watch the recorded video for review, they can find the segments of their weak points faster for online learning. The present invention has development prospects in application scenarios of continuous massive image and table information. The present invention can stably identify various complex tables and improve the extraction accuracy and processing efficiency of table data. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 is the overall flowchart of the present invention;
[0058] Figure 2 is the schematic diagram of the sample image of the present invention;
[0059] Figure 3 is the schematic diagram after removing the table lines of the sample image of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0060] The present invention will be further described below in conjunction with the accompanying drawings of the specification.
[0061] As Figure 1 shown, a method and system for removing table lines in an image according to the present invention include the following steps.
[0062] As Figure 2 shown, step (A), collect an image containing table lines and perform sample processing. The specific steps are as follows.
[0063] Step (A1), collect an image containing table lines. The standards for images containing table lines are divided into images with a dark background and images with a bright background. The specific steps are as follows.
[0064] Step (A11), the image has a dark background and max(R, G, B) ≤ T. The gray value of the image in the entire table area gradually changes in the range of [0, T], and the colors of the text and table lines meet min(R, G, B) ≥ 255 - T, where T represents the threshold.
[0065] Step (A12): The image background is bright and min(R, G, B) ≥ 255 - T. The grayscale values of the image gradually change within a small range in the interval [0, T] throughout the table area, and the colors of the text and table lines satisfy max(R, G, B) ≤ T.
[0066] Step (A2): Sample processing is performed on the image containing table lines. Specifically, the image with a dark background is processed, and f(A) = 255 - A, where A represents the image.
[0067] Step (B): The image containing table lines is compressed using two-dimensional interpolation to obtain the compressed image, as specifically shown in formula (1):
[0068] A ′ (x ′ ,y ′ ) = (1 - α)(1 - β)A(x, y) + α(1 - β)A(x + 1, y)
[0069] + (1 - α)βA(x, y + 1) + αβA(x + 1, y + 1) (1)
[0070] where A ′ (x ′ ,y ′ ) represents the grayscale value of the compressed image, and A(x, y) represents the grayscale value of the original image. (x ′ ,y ′ ) represents the coordinates of the compressed image, (x, y) represents the coordinates of the original image, and α and β are the offsets of x ′ and y ′ relative to the integer coordinates x and y.
[0071] Step (C): The neutral gray binary image is extracted from the compressed image, as specifically shown in formula (2):
[0072]
[0073] where B(x, y) represents the neutral gray binary image.
[0074] Step (D): The light and dark distribution of the neutral gray binary image is statistically analyzed, and it is determined whether the neutral gray binary image belongs to the bright color mode. The specific steps are as follows:
[0075] Step (D1): The light and dark distribution of the neutral gray binary image is statistically analyzed, as specifically shown in formula (3):
[0076]
[0077] Where, W represents the image width, and H represents the image height; N0 represents the proportion of the dark area among all the pixels of the image, and N1 represents the proportion of the bright area among all the pixels of the image;
[0078] Step (D2), determine whether the neutral gray binary image belongs to the bright color mode. The criterion for determining whether the neutral gray binary image belongs to the bright color mode is as follows:
[0079] If N0 > N1, it is the dark color mode; if N1 > N0, it is the bright color mode;
[0080] If only N0 is calculated, then use the condition to determine whether it belongs to the bright color mode; if only N1 is calculated, then use the condition to determine whether it belongs to the bright color mode.
[0081] Step (E), perform threshold binary preprocessing on the neutral gray binary image based on the bright color mode to obtain a preprocessed image, as specifically shown in formula (4):
[0082]
[0083] Step (F), remove the horizontal lines from the table area in the preprocessed image to obtain an image after removing the horizontal lines, as specifically shown in formula (5):
[0084]
[0085] f(B) = [f(B,1); f(B,2); …; f(B,H)] (5)
[0086] Where, represents the ray length threshold, f(B,x) represents a row vector, and f(B) represents the image after removing the horizontal lines.
[0087] Step (G), remove the vertical lines from the table area in the preprocessed image to obtain an image after removing the vertical lines, as specifically shown in formula (6):
[0088]
[0089] g(B) = [g(B,1), g(B,2), …, g(B,W)] (6)
[0090] Where, g(B,y) represents a column vector, and g(B) represents the image after removing the vertical lines.
[0091] As Figure 3 shown, Step (H), combine the image after removing the horizontal lines and the image after removing the vertical lines to obtain an image after removing the table lines and output it. The specific steps are as follows:
[0092] In step (H1), the relationship between the image f(B) after removing horizontal lines and the image g(B) after removing vertical lines is shown in Equation (7):
[0093] [f(B, 1); f(B, 2);...; f(B, H)] = [g(B T , 1), g(B T , 2),..., g(B T , W)] T ,
[0094] [g(B, 1), g(B, 2),..., g(B, W)] = [f(B T , 1); f(B T , 2);...; f(B T , H)] T (7);
[0095] In step (H2), the image after removing horizontal lines and the image after removing vertical lines are combined, as specifically shown in Equation (8):
[0096] B cleartableline = f(B) ∨ [f(B T )] T = g(B) ∨ [g(B T )] T = g(f(B)) = f(g(B)) (8)
[0097] where ∨ represents the bitwise OR operator, and B cleartableline represents the image with table lines removed.
[0098] An image table line removal system includes an image acquisition module, an image compression module, an image extraction module, an image statistical judgment module, an image preprocessing module, a horizontal line removal module for the image, a vertical line removal module for the image, and an image output module. The image acquisition module is used to acquire an image containing table lines and perform sample processing; the image compression module is used to compress the image containing table lines by two-dimensional interpolation and obtain the compressed image; the image extraction module is used to extract a neutral gray binary image from the compressed image; the image statistical judgment module is used to statistically analyze the light and dark distribution of the neutral gray binary image and judge whether the neutral gray binary image belongs to the bright color mode; the image preprocessing module is used to perform threshold binary preprocessing on the neutral gray binary image based on the bright color mode and obtain the preprocessed image; the horizontal line removal module for the image is used to remove the horizontal lines from the table area in the preprocessed image and obtain the image after removing the horizontal lines; the vertical line removal module for the image is used to remove the vertical lines from the table area in the preprocessed image and obtain the image after removing the vertical lines; the image output module is used to combine the image after removing the horizontal lines and the image after removing the vertical lines, obtain the image after removing the table lines and output it.
[0099] In summary, for the image table line removal method and system of the present invention, first, an image containing table lines is acquired and sample processing is performed. Then, the image containing table lines is compressed by two-dimensional interpolation to obtain the compressed image. Next, a neutral gray binary image is extracted from the compressed image. Subsequently, the light and dark distribution of the neutral gray binary image is statistically analyzed and it is judged whether the neutral gray binary image belongs to the bright color mode. Then, threshold binary preprocessing is performed on the neutral gray binary image based on the bright color mode to obtain the preprocessed image. Then, the horizontal lines are removed from the table area in the preprocessed image to obtain the image after removing the horizontal lines. Next, the vertical lines are removed from the table area in the preprocessed image to obtain the image after removing the vertical lines. Finally, the image after removing the horizontal lines and the image after removing the vertical lines are combined to obtain the image after removing the table lines and output it. The present invention realizes the function of stably recognizing various complex tables, and the method of eliminating the stacked excessive line pixel points can improve the accuracy of image recognition. It can also convert the table content into a real editable table, and can eliminate the table lines in the image without considering the line thickness, improving the extraction accuracy and processing efficiency of the table data.
[0100] The basic principles, main features and advantages of the present invention have been shown and described above. Those skilled in the art should understand that the present invention is not limited by the above embodiments. What is described in the above embodiments and the specification only illustrates the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention will have various changes and improvements, and all these changes and improvements fall within the scope of the present invention claimed. The scope of protection claimed by the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for removing table lines in an image, characterized in that: including the following steps, Step (A), collecting an image containing table lines and performing sample processing; Step (B), performing image compression on the image containing table lines using two-dimensional interpolation to obtain a compressed image; Step (C), extracting a neutral gray binary image from the compressed image; Step (D), statistically analyzing the light and dark distribution of the neutral gray binary image and determining whether the neutral gray binary image belongs to the bright color mode; Step (E), performing threshold binary preprocessing on the neutral gray binary image based on the bright color mode to obtain a preprocessed image, specifically as shown in formula (4); Step (F), removing horizontal lines from the table area in the preprocessed image to obtain an image after removing horizontal lines, specifically as shown in formula (5); f(B) = [f(B,1); f(B,2); …; f(B,H)] (5) Among them, represents the ray length threshold, f(B, x) represents a row vector, and f(B) represents the image after removing the horizontal lines; Step (G), removing vertical lines from the table area in the preprocessed image to obtain an image after removing vertical lines, specifically as shown in formula (6); g(B) = [g(B,1), g(B,2), …, g(B,W)] (6) wherein, g(B,y) represents a column vector, and g(B) represents the image after removing vertical lines; Step (H), combining the image after removing horizontal lines and the image after removing vertical lines to obtain an image after removing table lines and outputting it. The specific steps are as follows: Step (H1), the relationship between the image f(B) after removing horizontal lines and the image g(B) after removing vertical lines is as shown in formula (7); [f(B, 1); f(B, 2); …; f(B, H)] = [g(B T , 1), g(B T , 2), …, g(B T , W)] T , [g(B, 1), g(B, 2), …, g(B, W)] = [f(B T , 1); f(B T , 2); …; f(B T , H)] T (7); Step (H2), combining the image after removing horizontal lines and the image after removing vertical lines, specifically as shown in formula (8); B cleartableline = f(B) ∨ [f(B T )] T = g(B) ∨ [g(B T )] T = g(f(B)) = f(g(B)) (8) where V represents the bitwise OR operator, and B cleartableline represents the image with the table lines removed.
2. The method for removing table lines in an image according to claim 1, wherein: Step (A), collecting an image containing table lines and performing sample processing. The specific steps are as follows: Step (A1), collecting an image containing table lines. The standard of the image containing table lines is divided into two types: the image background is dark and the image background is bright. The specific steps are as follows: Step (A11), when the image background is dark and max(R,G,B) ≤ T, the gray value of the image in the entire table area gradually changes in the range of [0,T], and the colors of the text and table lines meet min(R,G,B) ≥ 255 - T, where T represents the threshold; Step (A12), when the image background is bright and min(R,G,B) ≥ 255 - T, the gray value of the image in the entire table area gradually changes in the range of [0,T], and the colors of the text and table lines meet max(R,G,B) ≤ T; Step (A2), performing sample processing on the image containing table lines. The sample processing is specifically performed on the image with a dark background, and f(A) = 255 - A, where A represents the image; 3. A method for removing table lines in an image according to claim 2, characterized in that: Step (B), performing image compression on the image containing table lines using two-dimensional interpolation to obtain a compressed image, specifically as shown in formula (1); A ′ (x ′ ,y ′ ) = (1 - α)(1 - β)A(x, y)+α(1 - β)A(x + 1, y) +(1 - α)βA(x,y + 1)+αβA(x + 1,y + 1) (1) Among them, A ′ (x ′ , y ′ ) represents the gray value of the compressed image, A(x, y) represents the gray value of the original image, (x ′ , y ′ ) represents the coordinates of the compressed image, (x, y) represents the coordinates of the original image, and α and β are the offsets of x ′ and y ′ relative to the integer coordinates x and y.
4. A method for removing table lines in an image according to claim 3, characterized in that: Step (C), extracting a neutral gray binary image from the compressed image, specifically as shown in formula (2); wherein, B(x,y) represents the neutral gray binary image.
5. A method for removing table lines in an image according to claim 4, characterized in that: Step (D), statistically analyze the light and dark distribution of the neutral gray binary image, and determine whether the neutral gray binary image belongs to the bright color mode. The specific steps are as follows: Step (D1), statistically analyze the light and dark distribution of the neutral gray binary image, as specifically shown in formula (3): where W represents the image width, H represents the image height; N0 represents the proportion of the dark area among all the pixel points of the image, and N1 represents the proportion of the bright area among all the pixel points of the image; Step (D2), determine whether the neutral gray binary image belongs to the bright color mode. The criterion for determining whether the neutral gray binary image belongs to the bright color mode is as follows: If N0 > N1, it is the dark color mode; if N1 > N0, it is the bright color mode; If only N0 is calculated, then use the condition to determine whether it belongs to the bright color mode; if only N1 is calculated, then use the condition to determine whether it belongs to the bright color mode.
6. An image table line removal system, wherein the table line removal process of the system is based on the table line removal method according to any one of claims 1-5, characterized in that: It includes an image acquisition module, an image compression module, an image extraction module, an image statistical judgment module, an image preprocessing module, an image horizontal line removal module, an image vertical line removal module, and an image output module. The image acquisition module is used to acquire an image containing table lines and perform sample processing; The image compression module is used to compress the image containing table lines by two-dimensional interpolation and obtain the compressed image; The image extraction module is used to extract the neutral gray binary image from the compressed image; The image statistical judgment module is used to statistically analyze the light and dark distribution of the neutral gray binary image and determine whether the neutral gray binary image belongs to the bright color mode; The image preprocessing module is used to perform threshold binary preprocessing on the neutral gray binary image based on the bright color mode and obtain the preprocessed image; The image horizontal line removal module is used to remove the horizontal lines from the table area in the preprocessed image and obtain the image after removing the horizontal lines; The image vertical line removal module is used to remove the vertical lines from the table area in the preprocessed image and obtain the image after removing the vertical lines; The image output module is used to combine the image after removing the horizontal lines and the image after removing the vertical lines, obtain the image after removing the table lines, and output it.
Citation Information
Patent Citations
Form recognition method, recognition system and computer device
CN109086714A
Image processing apparatus, image processing method, and non-transitory recording medium storing program for causing computer to execute image processing method
US20180211106A1