A wireless form detection method and system
By judging the page image of the document page, using the change of brightness value and the calculation of coordinate center point to identify the wireless table, the problem of poor wireless table detection in the prior art is solved, and high accuracy and efficient wireless table detection is achieved .
Patent Information
- Application Number
- CN202411815467.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-12-11
AI Technical Summary
Existing deep learning technologies are not effective in wireless table detection, making it difficult to accurately identify document table content and fields in wireless tables.
By judging the page image of the document page, the existence of the wireless table is determined by using the change of brightness value and the calculation of the coordinate center point. The specific steps include horizontal and vertical division, judgment of the change of brightness value of the judgment point, and calculation of the coordinate center point.
It improves the accuracy and processing speed of wireless table detection, avoids the need for large-scale model training, and can accurately identify the existence and scope of wireless tables.
Smart Images

Figure CN119274197B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a wireless form detection method and system. Background Art
[0002] With the development of deep learning technology, table detection technology has been widely used in qualification review and contract review. The review process often involves a lot of work on reviewing the content of qualification certificates and contract documents, and these certificates and contracts are usually covered with tables of different styles. The positioning of the table can identify the subsequent content, including field recognition, etc.
[0003] In recent years, deep learning has made significant progress in the fields of image processing and natural language processing, and has also promoted the development of wired table detection technology. Deep learning-based methods usually use models such as convolutional neural networks (CNNs) to learn the complex features of tables through a large amount of training data, and can accurately detect tables in documents of various layouts and formats. For example, some studies have proposed end-to-end deep learning models that can perform table detection and structure recognition at the same time, thereby improving the practicality and accuracy of table detection.
[0004] Existing deep learning detection technology can detect wired forms well. However, the detection effect on wireless forms is average. Wireless forms are diverse in form and have many layout changes, so it is difficult to have strong rules. Although deep learning can learn its characteristics, with a large number of wireless forms that cannot be located, document table content recognition and field extraction of wireless forms have become a big problem. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a wireless form detection method and system to eliminate or improve one or more defects in the prior art.
[0006] One aspect of the present invention provides a wireless table detection method, the method comprising the steps of:
[0007] Obtain a document page to be detected, and construct the document page into a page image;
[0008] The page image is judged by at least one judgment criterion:
[0009] The determination criteria include a first determination criterion, and the determination steps of the first determination criterion include:
[0010] The page image is evenly divided into a plurality of longitudinal regions by a transverse dividing line, each longitudinal region is evenly divided into a plurality of transverse regions by a longitudinal dividing line, and the intersection of the transverse dividing line and the longitudinal dividing line is used as a determination point;
[0011] Sequentially selecting a first preset number of pixel points along the longitudinal direction at the position where the determination point is located, and comparing the variation range of the brightness values of the first preset number of pixel points selected with a preset variation range to determine whether the determination point is an empty point;
[0012] Calculate the coordinate center point of the height based on the position of the empty point at the same height, and determine whether the number of coordinate center points at the same height is greater than 1. If so, the first determination criterion is met;
[0013] If the page image meets all the determination criteria, it is determined that a wireless table exists on the document page corresponding to the page image.
[0014] The above scheme is adopted. This scheme is based on the characteristics that the wireless table includes multiple columns of data, and there are gaps of content-free areas between the multiple columns of data. First, a large number of judgment points are evenly determined, and multiple pixel points are selected vertically at the position of each judgment point. The change in the brightness value of the area is used to determine whether the vertical area is a content-free area. The corresponding judgment point is determined as an empty point, and the coordinate center point is calculated based on the continuous empty points in the horizontal direction. One coordinate center point corresponds to a content-free area gap. The above method is used to determine whether a row has multiple content-free area gaps, and whether the page image has a wireless table. On the one hand, the judgment accuracy is guaranteed, and on the other hand, large-scale model training is not required, thereby improving the processing speed.
[0015] In some embodiments of the present invention, in the step of calculating the coordinate center point of the height based on the positions of the empty points at the same height, adjacent empty points at the same height are divided into a coordinate group, and the coordinate center point of each coordinate group is calculated.
[0016] In some embodiments of the present invention, the coordinate center point of the height is calculated based on the position of the empty point at the same height, and it is determined whether the number of coordinate center points at the same height is greater than 1. If so, it meets the first judgment standard. For each longitudinal area, it is determined whether the first judgment standard is met in the longitudinal area.
[0017] In some embodiments of the present invention, in the step of determining whether the longitudinal region meets the first determination criteria, if the longitudinal region meets the first determination criteria, the longitudinal region is marked, and it is determined whether the longitudinal region adjacent to the longitudinal region meets the first determination criteria; if the longitudinal region adjacent to the longitudinal region also meets the first determination criteria, the two longitudinal regions are merged to obtain a merged region, and it is further determined whether the longitudinal region adjacent to the merged region meets the first determination criteria; if so, they are further merged to update the merged region.
[0018] In some embodiments of the present invention, in the step of comparing the variation range of the luminance values of the first preset number of selected pixel points with the preset variation interval to determine whether the determination point is an empty point, if the variation range of the luminance values of the first preset number of selected pixel points is less than or equal to the preset variation interval, the corresponding determination point is determined to be an empty point.
[0019] In some embodiments of the present invention, the step of performing at least one determination criterion on the page image further includes pre-determination of the page image, and determining the content start column through the pre-determination of the page image. The step of pre-determination of the page image includes:
[0020] Starting from the pixel at any corner position of the page image, the determination is performed pixel by pixel from the pixel at one corner of the page image to the pixel at another corner in the longitudinal direction;
[0021] The brightness difference between two adjacent pixels is determined. If the brightness difference is greater than a preset brightness difference threshold, it is determined that the preset image pre-determination standard is met, and the column where the position is located is used as the content start column.
[0022] In some embodiments of the present invention, in the step of starting from pixels at any corner position of the page image and performing pixel-by-pixel determination from pixels at one corner of the page image to pixels at another corner in the longitudinal direction, after completing the determination of the brightness value of one column, another adjacent column is determined.
[0023] In some embodiments of the present invention, the determination criteria further include a second determination criteria, and the determination steps of the second determination criteria include:
[0024] Obtaining the content start column determined by the page image pre-determination step, and performing horizontal determination from the position of the content start column toward a direction away from the determination area determined by the page image pre-determination;
[0025] In the horizontal determination process, the brightness difference between two adjacent pixels is determined. If the brightness difference is greater than a preset brightness difference threshold, the column where the pixel is located is used as the starting column of the first determination area.
[0026] Extending a second preset number of pixels in a horizontal determination direction based on the starting column of the first determination area, and taking the column position where the pixels are located as the ending column of the first determination area;
[0027] The end column of the first determination area is used as the start column of the second determination area, and a third preset number of pixels are extended in the horizontal determination direction based on the start column of the second determination area, and the column position where the pixels are located is used as the end column of the second determination area:
[0028] The difference between the average values of the brightness values of the first determination area and the second determination area is calculated respectively, and the difference is compared with a preset change threshold to determine whether it meets the second determination standard.
[0029] In some embodiments of the present invention, the determination criteria further include a third determination criteria, and the determination steps of the third determination criteria include:
[0030] Obtaining the content start column determined by the page image pre-determination step, and performing horizontal determination from the position of the content start column toward a direction away from the determination area determined by the page image pre-determination;
[0031] In the horizontal determination process, the brightness difference between two adjacent pixels in each row is determined. If the brightness difference is greater than a preset brightness difference threshold, the position of the pixel is taken as the changed pixel position.
[0032] It is determined whether the horizontal range of the changed pixel positions of a plurality of adjacent rows is smaller than a horizontal determination threshold, and whether the third determination criterion is met.
[0033] The second aspect of the present invention also provides a wireless form detection system, which includes a computer device, the computer device includes a processor and a memory, the memory stores computer instructions, the processor is used to execute the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the system implements the steps implemented by the method described above.
[0034] The third aspect of the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps implemented by the aforementioned wireless form detection method are implemented.
[0035] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention can be specifically pointed out and obtained in the specification and the accompanying drawings.
[0036] Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of this application, and do not constitute a limitation of the present invention.
[0038] Figure 1 This is a schematic diagram of the first implementation of the wireless table detection method of this scheme;
[0039] Figure 2 This is a schematic diagram of a second implementation of the wireless table detection method of this scheme;
[0040] Figure 3 This is a schematic diagram of a third implementation of the wireless form detection method of this scheme;
[0041] Figure 4 This is a page diagram of a wireless table;
[0042] Figure 5 A schematic diagram of a directory page. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0044] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.
[0045] like Figure 1 As shown, the present invention proposes a wireless table detection method, the steps of which include:
[0046] Step S100, obtaining a document page to be detected, and constructing the document page into a page image;
[0047] In some embodiments of the present invention, in the step of constructing the document page into a page image, the pixel value of the page image is converted into an HSV value, and the HSV value includes three parameters: hue, saturation, and value.
[0048] Step S200, performing at least one determination criterion on the page image;
[0049] The determination criteria include a first determination criterion, and the determination steps of the first determination criterion include:
[0050] Step S311, dividing the page image into a plurality of longitudinal regions by a transverse dividing line, dividing each longitudinal region into a plurality of transverse regions by a longitudinal dividing line, and taking the intersection of the transverse dividing line and the longitudinal dividing line as a determination point;
[0051] In some embodiments of the present invention, the number of the longitudinal regions is 3 and the number of the transverse regions is 30.
[0052] Step S312, sequentially selecting a first preset number of pixel points along the longitudinal direction at the position where the decision point is located, and comparing the variation range of the brightness values of the first preset number of pixel points selected with a preset variation range to determine whether the decision point is an empty point;
[0053] In a specific implementation process, in the step of sequentially selecting a first preset number of pixel points along the longitudinal direction at the position where the decision point is located, the first preset number of pixel points are sequentially selected upward or downward along the longitudinal direction from the decision point,
[0054] In some implementations of the present invention, the page image is placed in a pre-constructed plane rectangular coordinate system, and a first preset number of pixel points are selected in a direction in which the vertical coordinate increases or decreases.
[0055] In the specific implementation process, in the image HSV value, brightness is a key parameter used to describe the brightness of the color. The following is a detailed introduction to brightness:
[0056] Lightness refers to the brightness or brightness of a color, which reflects the intensity of light in the color. In the HSV color space, lightness is an independent dimension that together with hue and saturation constitutes a complete description of the color.
[0057] The value range of lightness is usually between 0 and 1, which can also be expressed as 0% to 100%. When the lightness is 0, the color is black; when the lightness is at its maximum value, the color is white. In the HSV color space, the change of lightness can be independent of hue and saturation, making color adjustment more flexible.
[0058] The effects of lightness on color include:
[0059] Brightness of color: Brightness directly determines the brightness of the color. Colors with high brightness appear brighter, while colors with low brightness appear darker.
[0060] Visual effect of color: Changes in brightness will affect the visual effect of color;
[0061] Color readability: In image processing, the adjustment of brightness is also related to the readability of color. Appropriate brightness can improve the clarity of text or graphics, making them easier to recognize.
[0062] In image processing software, brightness is a commonly used adjustment parameter. By adjusting the brightness, the brightness and contrast of the image can be changed, thereby improving the visual effect of the image.
[0063] In summary, this solution uses brightness value as the standard for image processing, which can better distinguish between areas with content and areas without content in the table, and improve the recognition accuracy of wireless tables.
[0064] Step S313, calculating the coordinate center point of the height based on the positions of the empty points at the same height, and determining whether the number of the coordinate center points at the same height is greater than 1, if so, the first determination criterion is met;
[0065] In some embodiments of the present invention, in the step of calculating the coordinate center point of the height based on the position of the empty point at the same height, the average value of the coordinates is calculated based on the positions of multiple coordinate empty points, and the position corresponding to the average value of the coordinates is used as the position of the coordinate center point.
[0066] Step S400: If the page image meets all the determination criteria, it is determined that a wireless table exists in the document page corresponding to the page image.
[0067] The above scheme is adopted. This scheme is based on the characteristics that the wireless table includes multiple columns of data, and there are gaps of content-free areas between the multiple columns of data. First, a large number of judgment points are evenly determined, and multiple pixel points are selected vertically at the position of each judgment point. The change in the brightness value of the area is used to determine whether the vertical area is a content-free area. The corresponding judgment point is determined as an empty point, and the coordinate center point is calculated based on the continuous empty points in the horizontal direction. One coordinate center point corresponds to a content-free area gap. The above method is used to determine whether a row has multiple content-free area gaps, and whether the page image has a wireless table. On the one hand, the judgment accuracy is guaranteed, and on the other hand, large-scale model training is not required, thereby improving the processing speed.
[0068] In some embodiments of the present invention, in the step of calculating the coordinate center point of the height based on the positions of the empty points at the same height, adjacent empty points at the same height are divided into a coordinate group, and the coordinate center point of each coordinate group is calculated.
[0069] Adopting the above scheme, this scheme divides the adjacent empty points at the same height into a coordinate group, and one coordinate group corresponds to one horizontal gap. Based on the characteristic that the wireless table has regular horizontal gaps, this scheme improves the judgment accuracy of the wireless table by corresponding one coordinate center point to one horizontal gap.
[0070] In some embodiments of the present invention, the coordinate center point of the height is calculated based on the position of the empty point at the same height, and it is determined whether the number of coordinate center points at the same height is greater than 1. If so, it meets the first judgment standard. For each longitudinal area, it is determined whether the first judgment standard is met in the longitudinal area.
[0071] like Figure 4 and 5As shown, using the above scheme, if the number of coordinate center points at the same height is greater than 1, it is determined that there are multiple horizontal gaps. This scheme can be distinguished from the characteristics of a directory, etc. that only has one horizontal gap. The wireless table has multiple horizontal gaps, which improves the determination accuracy of the wireless table.
[0072] In some embodiments of the present invention, in the step of determining whether the longitudinal region meets the first determination criteria, if the longitudinal region meets the first determination criteria, the longitudinal region is marked, and it is determined whether the longitudinal region adjacent to the longitudinal region meets the first determination criteria; if the longitudinal region adjacent to the longitudinal region also meets the first determination criteria, the two longitudinal regions are merged to obtain a merged region, and it is further determined whether the longitudinal region adjacent to the merged region meets the first determination criteria; if so, they are further merged to update the merged region.
[0073] Using the above scheme, for the vertical area that meets the first judgment standard, it means that there is a wireless table in the area. This scheme merges the adjacent areas with wireless tables to ensure the integrity of the original table. When the table is extracted later, the wireless table range can be accurately extracted.
[0074] In some embodiments of the present invention, in the step of comparing the variation range of the luminance values of the first preset number of selected pixel points with the preset variation interval to determine whether the determination point is an empty point, if the variation range of the luminance values of the first preset number of selected pixel points is less than or equal to the preset variation interval, the corresponding determination point is determined to be an empty point.
[0075] Using the above scheme, if the range of variation of the brightness values of the first preset number of pixels selected is less than or equal to the preset variation interval, it is determined that there is no brightness value change caused by the absence of text at that position, ensuring that there is no text in the horizontal gap and the accuracy of wireless table determination.
[0076] like Figure 2 As shown, in some embodiments of the present invention, before the step of determining the page image by at least one determination criterion, the step further includes pre-determination of the page image, and the content start column is determined by pre-determination of the page image. The step of pre-determination of the page image includes:
[0077] Step S201, starting from the pixel at any corner position of the page image, the determination is performed pixel by pixel from the pixel at one corner of the page image to the pixel at another corner in the longitudinal direction;
[0078] In some embodiments of the present invention, the page image is placed in a preconstructed plane rectangular coordinate system, and the page image is placed in the fourth quadrant. In the step of performing pixel-by-pixel judgment from the pixels of one corner of the page image to the pixels of another corner in the longitudinal direction, pixel-by-pixel judgment is performed starting from the point with the largest horizontal and vertical coordinates in the page image to the other side in the direction of decreasing vertical coordinates.
[0079] Step S202, determining the brightness difference between two adjacent pixels, if the brightness difference is greater than a preset brightness difference threshold, it is determined that the preset image pre-determination standard is met, and the column where the position is located is used as the content start column.
[0080] In some embodiments of the present invention, in another step of determining pixel by pixel starting from a point with the largest horizontal and vertical coordinates in the page image in a direction of decreasing vertical coordinates, two adjacent pixel points in the vertical direction are determined one by one.
[0081] In some embodiments of the present invention, in the step of starting from pixels at any corner position of the page image and performing pixel-by-pixel determination from pixels at one corner of the page image to pixels at another corner in the longitudinal direction, after completing the determination of the brightness value of one column, another adjacent column is determined.
[0082] In some embodiments of the present invention, if the image pre-determination standard is preset, multiple determination standards are performed.
[0083] By adopting the above scheme, this scheme determines whether there is content on the current page through page image pre-determination. If it meets the standard of page image pre-determination, it means that the page is not empty. Further determination can be made to efficiently screen empty pages.
[0084] like Figure 3 As shown, in some embodiments of the present invention, the determination criterion further includes a second determination criterion, and the determination steps of the second determination criterion include:
[0085] Step S321, obtaining the content start column determined by the page image pre-determination step, and performing horizontal determination from the position of the content start column to a direction away from the determination area of the page image pre-determination;
[0086] In a specific implementation process, in the step of performing horizontal determination in a direction from the position of the content start column to a direction away from the determination area pre-determined by the page image, horizontal determination is performed in a direction in which the horizontal coordinate decreases.
[0087] Step S322, during the horizontal determination process, determine the brightness difference between two adjacent pixels, and if the brightness difference is greater than a preset brightness difference threshold, use the column where the pixel is located as the starting column of the first determination area;
[0088] In a specific implementation process, in the process of horizontal determination, in the process of determining the brightness difference between two adjacent pixels, determination is performed row by row to determine the brightness difference between two adjacent pixels in the horizontal coordinate.
[0089] In a specific implementation process, when determining each row one by one, after the determination of one row is completed, another adjacent row is determined in the direction of decreasing vertical coordinates.
[0090] In the specific implementation process, if the brightness difference is greater than the preset brightness difference threshold, in the step of taking the column where the pixel is located as the starting column of the first determination area, the column of the row with the brightness difference threshold determined for the first time is taken as the starting column of the first determination area.
[0091] Step S323, extending a second preset number of pixels in a horizontal determination direction based on the starting column of the first determination area, and taking the column position where the pixel is located as the ending column of the first determination area;
[0092] Step S324, taking the end column of the first determination area as the start column of the second determination area, extending a third preset number of pixels in the horizontal determination direction based on the start column of the second determination area, and the column position where the pixel is located is taken as the end column of the second determination area:
[0093] Step S325, respectively calculating the difference between the average values of the brightness values of the first determination area and the second determination area, and comparing the difference with a preset change threshold to determine whether it meets the second determination criterion.
[0094] In the specific implementation process, although brightness cannot directly reflect whether there is content, for example, the area without content may be darker, but in the same page, the difference in brightness can often reflect whether there is content. In this solution, when comparing the difference with the preset change threshold to determine whether it meets the second judgment standard, if the difference is greater than the preset change threshold, it means that there is a significant difference in content coverage between the two areas, thereby ensuring the judgment accuracy of the wireless table.
[0095] Using the above scheme, since the vertical column data in the wireless table are often gathered in a vertical range, and the two sides of the vertical column data are usually content-free areas, in the judgment of this scheme, based on the above characteristics of the wireless table, the difference between the average values of the brightness values of the first judgment area and the second judgment area corresponds to the judgment of the vertical column data and the content-free area, thereby ensuring the judgment accuracy of the wireless table.
[0096] like Figure 3 As shown, in some embodiments of the present invention, the determination criteria further include a third determination criteria, and the determination steps of the third determination criteria include:
[0097] Step S331, obtaining the content start column determined by the page image pre-determination step, and performing horizontal determination from the position of the content start column to a direction away from the determination area of the page image pre-determination;
[0098] Step S332, during the horizontal determination process, for each row, the brightness difference between two adjacent pixels is determined, and if the brightness difference is greater than a preset brightness difference threshold, the position of the pixel is taken as the changed pixel position;
[0099] Step S333, determining whether the horizontal range of the changed pixel positions of a plurality of adjacent rows is smaller than a horizontal determination threshold, and determining whether the third determination criterion is met.
[0100] In the specific implementation process, since in actual wireless tables, the coverage range of the vertical column data is often a rectangular coverage area, and the horizontal boundaries of the vertical column data are relatively neat, this scheme is based on the above characteristics of the above wireless table to determine whether the horizontal range of the changed pixel positions of multiple adjacent rows is less than the horizontal determination threshold, and to determine whether the boundaries of the range where the data exists are neat, corresponding to the above characteristics of the wireless table, to ensure the determination accuracy of the wireless table.
[0101] An embodiment of the present invention also provides a wireless form detection system, which includes a computer device, wherein the computer device includes a processor and a memory, wherein the memory stores computer instructions, and the processor is used to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the system implements the steps implemented by the method described above.
[0102] The embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps implemented by the wireless table detection method described above are implemented. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.
[0103] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.
[0104] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.
[0105] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or replace features of other embodiments.
[0106] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A wireless table detection method, characterized in that: The steps of the method include: Obtain a document page to be detected, and construct the document page into a page image; The page image is judged by at least one judgment criterion: The determination criteria include a first determination criterion, and the determination steps of the first determination criterion include: The page image is evenly divided into a plurality of longitudinal regions by a transverse dividing line, each longitudinal region is evenly divided into a plurality of transverse regions by a longitudinal dividing line, and the intersection of the transverse dividing line and the longitudinal dividing line is used as a determination point; Sequentially selecting a first preset number of pixel points along the longitudinal direction at the position where the determination point is located, and comparing the variation range of the brightness values of the first preset number of pixel points selected with a preset variation range to determine whether the determination point is an empty point; Calculate the coordinate center point of the height based on the positions of the empty points at the same height, divide the adjacent empty points at the same height into a coordinate group, and calculate the coordinate center point of each coordinate group, and determine whether the number of coordinate center points at the same height is greater than 1. If so, the first determination criterion is met; If the page image meets all the determination criteria, it is determined that a wireless table exists on the document page corresponding to the page image.
2. The wireless table detection method according to claim 1, characterized in that: In the step of calculating the coordinate center point of the height based on the position of the empty point at the same height, determining whether the number of coordinate center points at the same height is greater than 1, and if so, meeting the first judgment criterion, for each longitudinal area, determining whether the first judgment criterion is met in the longitudinal area.
3. The wireless table detection method according to claim 2, characterized in that: In the step of determining whether the longitudinal area meets the first determination criteria, if the longitudinal area meets the first determination criteria, the longitudinal area is marked, and it is determined whether the longitudinal area adjacent to the longitudinal area meets the first determination criteria; if the longitudinal area adjacent to the longitudinal area also meets the first determination criteria, the two longitudinal areas are merged to obtain a merged area, and it is further determined whether the longitudinal area adjacent to the merged area meets the first determination criteria; if so, they are further merged to update the merged area.
4. The wireless table detection method according to any one of claims 1 to 3, characterized in that: In the step of comparing the variation range of the luminance values of the first preset number of selected pixel points with the preset variation interval to determine whether the determination point is an empty point, if the variation range of the luminance values of the first preset number of selected pixel points is less than or equal to the preset variation interval, the corresponding determination point is determined to be an empty point.
5. The wireless table detection method according to claim 1, characterized in that: Before the step of determining the page image by at least one determination criterion, the step further includes pre-determination of the page image, and determining the content start column through the pre-determination of the page image. The step of pre-determination of the page image includes: Starting from the pixel at any corner position of the page image, the determination is performed pixel by pixel from the pixel at one corner of the page image to the pixel at another corner in the longitudinal direction; The brightness difference between two adjacent pixels is determined. If the brightness difference is greater than a preset brightness difference threshold, it is determined that the preset image pre-determination standard is met, and the column where the position is located is used as the content start column.
6. The wireless table detection method according to claim 5, characterized in that: In the step of starting from the pixels at any corner position of the page image and performing pixel-by-pixel judgment from the pixels at one corner of the page image to the pixels at another corner in the longitudinal direction, when the judgment of the brightness value of one column is completed, another adjacent column is judged.
7. The wireless table detection method according to claim 5, characterized in that: The determination criteria also include a second determination criteria, and the determination steps of the second determination criteria include: Obtaining the content start column determined by the page image pre-determination step, and performing horizontal determination from the position of the content start column toward a direction away from the determination area determined by the page image pre-determination; In the horizontal determination process, the brightness difference between two adjacent pixels is determined. If the brightness difference is greater than a preset brightness difference threshold, the column where the pixel is located is used as the starting column of the first determination area. Extending a second preset number of pixels in a horizontal determination direction based on the starting column of the first determination area, and taking the column position where the pixels are located as the ending column of the first determination area; The end column of the first determination area is used as the start column of the second determination area, and a third preset number of pixels are extended in the horizontal determination direction based on the start column of the second determination area, and the column position where the pixels are located is used as the end column of the second determination area: The difference between the average values of the brightness values of the first determination area and the second determination area is calculated respectively, and the difference is compared with a preset change threshold to determine whether it meets the second determination standard.
8. The wireless table detection method according to claim 5, characterized in that: The determination criteria also include a third determination criterion, and the determination steps of the third determination criterion include: Obtaining the content start column determined by the page image pre-determination step, and performing horizontal determination from the position of the content start column toward a direction away from the determination area determined by the page image pre-determination; In the horizontal determination process, the brightness difference between two adjacent pixels in each row is determined. If the brightness difference is greater than a preset brightness difference threshold, the position of the pixel is taken as the changed pixel position. It is determined whether the horizontal range of the changed pixel positions of a plurality of adjacent rows is smaller than a horizontal determination threshold, and whether the third determination criterion is met.
9. A wireless table detection system, characterized in that: The system includes a computer device, which includes a processor and a memory, wherein the memory stores computer instructions, and the processor is used to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the system implements the steps implemented by the method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Identification technology for wireless table
CN113642380A
Frameless line table accurate identification method based on positioning algorithm
CN116129454A