Information identification method and device, and storage medium
By dividing and expanding the grid edges in the curved image, the problem of information recognition failure caused by paper curvature is solved, and the success rate of information recognition is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHENGDU TD TECH LTD
- Filing Date
- 2021-09-10
- Publication Date
- 2026-06-02
AI Technical Summary
In existing technologies, the bending of the paper edges causes the grid edge lines to cut information during grid division, reducing the success rate of information recognition.
By acquiring a curved surface image, the first grid is divided according to the original number of grids, and its correction coordinate information is determined. The edges of the first grid are extended outward by a preset length to form a second grid to avoid cutting.
The area of the information recognition region has been increased, avoiding the cutting of information by the grid edge lines and improving the success rate of information recognition.
Smart Images

Figure CN115797940B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information processing technology, and in particular to an information identification method, apparatus and storage medium. Background Technology
[0002] Information recognition can include image information recognition, text information recognition, and audio information recognition. Image information recognition and text information recognition can both perform batch recognition of images and text to determine the information contained within them. For example, text information recognition can typically be achieved by taking a picture of the information carrier using a device with image capture capabilities, such as a mobile phone, to create an image containing the text. The information contained in the image can then be identified and determined.
[0003] Currently, to improve the efficiency of information recognition, information can be placed on paper. For example, images or text can be placed on paper by pasting or printing, and then an image acquisition device can be used to photograph the paper containing the information, obtaining an image of the paper containing the information. By dividing the image into a grid, multiple grids are obtained, each containing one piece of information. Recognizing the information within each grid allows us to obtain all the information in the image.
[0004] However, when using the grid method for information recognition, the edges of the paper may be curved and deformed, causing the edge lines of the grid to be located at the position of the information in the paper. In other words, the grid lines may cut through the information in the paper, making the information within the grid incomplete and thus unable to be recognized, thereby reducing the success rate of information recognition. Summary of the Invention
[0005] This application provides an information recognition method, device, and storage medium that can identify information contained in an image, effectively improving the success rate of information recognition.
[0006] In a first aspect, embodiments of this application provide an information identification method, the information identification method comprising:
[0007] Obtain a surface image to be processed. The surface image includes multiple original grids. The surface image is obtained by bending a rectangular image. The curved edges of the surface image correspond to the first edge of the rectangular image.
[0008] Based on the number of original grids, the surface image is divided to obtain multiple first grids.
[0009] For each first grid, the correction coordinate information of the first grid is determined, and based on the correction coordinate information of the first grid, the edge of the first grid is extended outward by a preset length to obtain the second grid.
[0010] The information within the second grid is identified.
[0011] In one possible implementation, determining the correction coordinate information of the first grid includes:
[0012] The length of the second side perpendicular to the first side in the first grid is determined based on the lengths of the multiple first line segments perpendicular to the first side within the first grid.
[0013] The correction coordinate information of the first grid is determined based on the length of the second side.
[0014] In one possible implementation, determining the length of a second side perpendicular to the first side in the first grid based on the lengths of multiple first line segments perpendicular to the first side within the first grid includes:
[0015] Within the first grid, multiple first line segments are drawn along a direction perpendicular to the first edge, and the length of each of the multiple first line segments is obtained.
[0016] Based on the length of each first line segment, the average value of the plurality of first line segments is determined, and the average value is determined as the length of the second side.
[0017] In one possible implementation, determining the correction coordinate information of the first grid based on the length of the second side includes:
[0018] Determine the coordinate information of the four vertices of the surface image.
[0019] Based on the coordinate information and the length of the second side, the correction coordinate information of the first grid is determined.
[0020] In one possible implementation, the surface image includes parallel edges.
[0021] Determining the correction coordinate information of the first grid based on the coordinate information and the length of the second side includes:
[0022] Determine the length of the third side in the first grid that is perpendicular to the parallel side.
[0023] Based on the coordinate information, the length of the second side, and the length of the third side, the correction coordinate information of the first grid is determined.
[0024] In one possible implementation, determining the length of the third side in the first grid that is perpendicular to the parallel side includes:
[0025] Within the first grid, multiple second line segments are drawn along a direction perpendicular to the parallel edge, and the length of each of the multiple second line segments is obtained.
[0026] Based on the length of each second line segment, the average value of the plurality of second line segments is determined, and the average value is determined as the length of the third side.
[0027] In one possible implementation, the step of extending the edge of the first grid outward by a preset length based on the correction coordinate information of the first grid to obtain a second grid includes:
[0028] The correction edge of the first grid is determined based on the correction coordinate information of the first grid.
[0029] The corrected edge is extended outward by a preset length to obtain the extended edge.
[0030] The second grid is determined based on the expanded edges.
[0031] Secondly, embodiments of this application provide an information identification device, the information identification device comprising:
[0032] The acquisition module is used to acquire a surface image to be processed. The surface image includes multiple original grids. The surface image is obtained by bending a rectangular image. The curved edges of the surface image correspond to the first edge of the rectangular image.
[0033] The processing module is used to divide the surface image into multiple first grids based on the number of original grids.
[0034] The processing module is also used to determine the correction coordinate information of each first grid, and to extend the edge of the first grid outward by a preset length according to the correction coordinate information of the first grid to obtain a second grid.
[0035] The identification module is used to identify information within the second grid.
[0036] In one possible implementation, the processing module is specifically used to determine the length of a second side perpendicular to the first side in the first grid based on the lengths of multiple first line segments perpendicular to the first side within the first grid; and to determine the correction coordinate information of the first grid based on the length of the second side.
[0037] In one possible implementation, the processing module is specifically configured to draw multiple first line segments within the first grid along a direction perpendicular to the first side, and obtain the length of each of the multiple first line segments; determine the average value of the multiple first line segments based on the length of each first line segment, and determine the average value as the length of the second side.
[0038] In one possible implementation, the processing module is specifically used to determine the coordinate information of the four vertices of the surface image; and to determine the correction coordinate information of the first grid based on the coordinate information and the length of the second side.
[0039] In one possible implementation, the surface image includes parallel edges; the processing module is specifically used to determine the length of a third edge in the first grid that is perpendicular to the parallel edges; and to determine the correction coordinate information of the first grid based on the coordinate information, the length of the second edge, and the length of the third edge.
[0040] In one possible implementation, the processing module is specifically configured to draw multiple second line segments within the first grid along a direction perpendicular to the parallel edge, and obtain the length of each of the multiple second line segments; determine the average value of the multiple second line segments based on the length of each second line segment, and determine the average value as the length of the third edge.
[0041] In one possible implementation, the processing module is specifically configured to determine the correction edge of the first grid based on the correction coordinate information of the first grid; extend the correction edge outward by a preset length to obtain an extended edge; and determine the second grid based on the extended edge.
[0042] Thirdly, embodiments of this application also provide an information identification device, which may include a memory and a processor; wherein,
[0043] The memory is used to store computer programs.
[0044] The processor is configured to read the computer program stored in the memory and execute the information recognition method described in any possible implementation of the first aspect according to the computer program in the memory.
[0045] Fourthly, embodiments of this application also provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the information recognition method described in any possible implementation of the first aspect.
[0046] Fifthly, embodiments of this application also provide a computer program product, including a computer program that, when executed by a processor, implements the information identification method described in any possible implementation of the first aspect.
[0047] Therefore, this application provides an information recognition method, apparatus, and storage medium. It acquires a curved image to be processed, the curved image including multiple original grids. The curved image is obtained by bending a rectangular image, and the curved edges of the curved image correspond to the first edges of the rectangular image. Based on the number of original grids, the curved image is divided into multiple first grids. For each first grid, the correction coordinate information of the first grid is determined, and based on the correction coordinate information of the first grid, the edge of the first grid is extended outward by a preset length to obtain a second grid. Information within the second grid is then recognized. The technical solution provided by this application divides the curved image obtained by bending a rectangular image into first grids based on the number of original grids, and extends the edge of the first grid outward by a preset length to obtain a second grid with a larger area than the first grid. This increases the area of the information recognition region and avoids the edge lines of the second grid cutting off the information within the second grid, thereby effectively improving the success rate of information recognition. Attached Figure Description
[0048] Figure 1 This is a schematic diagram illustrating an application scenario for information recognition provided in an embodiment of this application;
[0049] Figure 2 This is a schematic diagram of a mesh generation method in the prior art;
[0050] Figure 3 A flowchart illustrating an information identification method provided in an embodiment of this application;
[0051] Figure 4 A schematic diagram of a rectangular image and a curved surface image provided in the embodiments of this application;
[0052] Figure 5 This is a schematic diagram of a first mesh obtained after meshing processing, provided in an embodiment of this application;
[0053] Figure 6 A schematic diagram for drawing a first line segment provided in an embodiment of this application;
[0054] Figure 7 A schematic diagram of a second grid obtained by extending a preset length, provided in an embodiment of this application;
[0055] Figure 8 This is a schematic diagram of the structure of an information identification device provided in an embodiment of this application;
[0056] Figure 9 This is a schematic diagram of another information identification device provided in an embodiment of this application.
[0057] The accompanying drawings have illustrated specific embodiments of this disclosure, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concepts of this disclosure to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0058] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0059] In the embodiments of this application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone, where A and B can be singular or plural. In the textual description of this application, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0060] The technical solutions provided in this application can be applied to information recognition scenarios, such as batch recognition of QR codes. See also... Figure 1 As shown, Figure 1 The image shown depicts images containing QR codes pasted onto a grid of paper, with one image containing a QR code pasted into each grid cell. Figure 1 The dashed rectangular boxes within each grid cell indicate that the area is in the center of the grid, making it easier for users to paste QR code images. Additionally, Figure 1 The letters A, B, C, D, E, F, G, H, and J in the grid represent the column identifiers. Figure 1 It can be seen that the horizontal edge of the paper with the QR code image pasted on it is bent.
[0061] Furthermore, on Figure 1 The grid is divided into 6 rows and 10 columns to identify the QR code image pasted in each grid. Specifically, it can be based on... Figure 1 The image is divided into 60 grids, specifying the number and size of the grid cells. (See also...) Figure 2 As shown, Figure 2This is a schematic diagram of a method for dividing a grid in the prior art. Figure 2 The dashed lines in the image represent the grid lines of each mesh obtained after the meshing process. According to... Figure 2 The dashed lines in the diagram are used to create a grid, resulting in 60 grids. QR code recognition is then performed on each of these 60 grids to obtain the QR code information contained within the image of each grid. Grids without a pasted QR code image cannot have their QR code information recognized; for example, Figure 2 If no QR code image is pasted at position D1, the QR code information cannot be recognized. However, if a QR code image is pasted on a grid, the QR code information can be recognized. For example, the QR code information in the grid at position F1 is recognized as SN=BT2049014601Y. As an example, after recognizing the QR code information, it can be correlated with the grid coordinates, thus corresponding to the location of the QR code image on the paper.
[0062] However, according to Figure 2 As shown, because the parallel edges of the paper on which the QR code image is pasted are curved, the edge lines of the grid obtained after gridding may lie inside the original grid lines of the paper. For example... Figure 2 The edge line of the grid in the 6th row passes through the interior of the original grid in the paper. This means that when the grid is cut according to the grid obtained by the division process, it may cut into the image in the original grid in the paper, making the QR code information in the image incomplete and unable to be recognized, thus reducing the success rate of information recognition.
[0063] To address the issue of low information recognition success rates caused by the curvature of paper edges, and considering that the low success rate is also due to the cutting of information by the grid edge lines obtained from the grid division process, the edge lines of the grid obtained from the grid division process can be widened outward by a preset length. This increases the area of the grid for information recognition, ensuring that the grid edge lines do not cut the information and that the information within each grid can be recognized, thereby effectively improving the information recognition success rate.
[0064] The information identification method provided in this application will now be described in detail through specific embodiments. It is understood that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0065] Figure 3 This is a flowchart illustrating an information recognition method provided in an embodiment of this application. The information recognition method can be executed by software and / or hardware devices. For example, the hardware device can be an information recognition device, which can be a terminal or a processing chip within a terminal. For an example, please refer to [link to example]. Figure 2As shown, the information identification method may include:
[0066] S301. Obtain the surface image to be processed.
[0067] The curved image includes multiple original grids. The curved image is obtained by bending a rectangular image, and the curved edges of the curved image correspond to the first edges of the rectangular image. For example, the image corresponding to a rectangular piece of paper containing multiple original grids is a rectangular image, while the image corresponding to the bent paper is a curved image. Figure 1 The image shown is a curved surface image. The correspondence between the curved edge of the curved surface image and the first edge of the rectangular image means that the curved edge of the curved surface image is an edge of the rectangular image. This edge can be either a horizontal or vertical edge of the rectangular image; specifically, it is determined by the curved edge of the rectangular image. This application embodiment does not impose any limitation on this. For example, if both the horizontal and vertical edges of the rectangular image are curved, then the curved edges of the curved surface image correspond to both the horizontal and vertical edges of the rectangular image. The specific correspondence can be determined based on the relationship between the curved surface image and the rectangular image; this application embodiment does not impose any limitation on this.
[0068] It is understandable that the original grid is the grid containing the information, and each original grid contains one piece of information. For example, the above... Figure 1 As shown, the grid drawn on the paper is the original grid, and each original grid contains a QR code. The size and number of original grids can be determined according to the amount and size of information, and this application embodiment does not impose any limitations on this.
[0069] For example, Figure 4 As shown, Figure 4 These are schematic diagrams of rectangular and curved surface images provided in embodiments of this application. Figure 4 In this context, the horizontal side of the rectangular image is the first side, while the horizontal side of the curved surface image obtained by bending the rectangular image is the curved side; that is, the curved side of the curved surface image corresponds to the first side of the rectangular image. This application's embodiment only uses... Figure 4 The examples provided are for illustration only, but do not represent that the embodiments of this application are limited to this.
[0070] S302. Divide the surface image into multiple first grids based on the number of original grids.
[0071] For example, when dividing a surface image into multiple first grids based on the original number of grids, the number of grids in each row and column can be determined based on the original number of grids, and the coordinates of the four vertices of the surface image can be determined. Based on the coordinates of the four vertices and the number of grids in each row and column, the surface image is divided in the horizontal and vertical directions to obtain the first grids. Specifically, the above... Figure 2 The grid defined by the dashed lines can be the first grid.
[0072] For example, if the original grid has 30 grids, with 6 grids in each row and 5 grids in each column, the surface image can be divided into 6 equal parts horizontally between two adjacent coordinate points on the left and right sides, and into 5 equal parts horizontally between two adjacent coordinate points on the top and bottom sides in the vertical direction. The resulting grid is the first grid.
[0073] S303. For each first grid, determine the correction coordinate information of the first grid, and based on the correction coordinate information of the first grid, extend the edge of the first grid outward by a preset length to obtain the second grid.
[0074] When determining the correction coordinate information of each first grid, the length of the second side perpendicular to the first side in the first grid can be determined based on the length of the multiple first line segments perpendicular to the first side in the first grid; and the correction coordinate information of the first grid can be determined based on the length of the second side.
[0075] In this embodiment, the length of the second side is determined based on the length of multiple first line segments perpendicular to the first side within the first grid, making the determined length of the second side more accurate. This makes the correction coordinate information of the first grid determined based on the length of the second side more accurate, effectively improving the accuracy of the determined correction coordinates.
[0076] For example, when determining the length of a second side perpendicular to the first side in the first grid based on the lengths of multiple first line segments perpendicular to the first side within the first grid, multiple first line segments can be drawn along a direction perpendicular to the first side within the first grid, and the length of each of the multiple first line segments can be obtained; based on the length of each first line segment, the average value of the multiple first line segments can be determined, and this average value can be used as the length of the second side. It is understood that the number of first line segments drawn is related to the size of the original grid. If the size of the original grid is large, more first line segments can be drawn, and vice versa. This embodiment does not specifically limit this. Furthermore, the straight-line distance between any two first line segments drawn is equal. Additionally, if the first side is horizontal, then the side perpendicular to the first side is vertical; if the first side is vertical, then the side perpendicular to the first side is horizontal.
[0077] For example, assuming the first side is horizontal, for each first grid cell, draw multiple first line segments perpendicular to the horizontal side. These first line segments divide the horizontal side of the first grid cell into multiple equal parts. Obtain the length of each line segment, and take the quotient between the sum of the lengths of all first line segments and the number of first line segments as the average value of the first line segments. This average value is then used to determine the length of the second side.
[0078] In this embodiment of the application, the length of the second side is determined more accurately by calculating the average value of multiple first line segments and using the average value as the length of the second side.
[0079] Furthermore, when determining the correction coordinate information of the first grid based on the length of the second side, the coordinate information of the four vertices of the surface image can be determined; the correction coordinate information of the first grid can be determined based on the coordinate information and the length of the second side.
[0080] For example, when determining the corrected coordinate information of the first grid based on the coordinate information and the length of the second side, the distance between vertices at the same position in each first grid is the length of the second side. For instance, if the second side is a horizontal side, the distance between the vertices at the top left corner of two adjacent first grids is the length of the second side; if the second side is a vertical side, the distance between the vertices at the top left corner of two adjacent first grids is the length of the second side.
[0081] Furthermore, based on the position of the first grid, the distances between the four vertices of the first grid and the four vertices of the corresponding surface image are determined. The corresponding distances are added or subtracted from the coordinates of the four vertices of the surface image to obtain the coordinate information of the four vertices of the first grid, i.e., the corrected coordinate information of the first grid.
[0082] In this embodiment of the application, the correction coordinate information of the first grid can be accurately determined based on the coordinate information and the length of the second side, making the second grid determined based on the correction coordinate information more accurate.
[0083] For example, the surface image may include parallel edges; then, when determining the corrected coordinate information of the first grid based on the coordinate information and the length of the second edge, the length of the third edge perpendicular to the parallel edge in the first grid is determined; the corrected coordinate information of the first grid is determined based on the coordinate information, the length of the second edge, and the length of the third edge.
[0084] It is understandable that the lengths of the second and third sides are the lengths of the horizontal and vertical edge lines of the first grid, respectively. If the first grid is a rectangle, the lengths of the second and third sides are not equal. If the first grid is a square, the lengths of the second and third sides are equal.
[0085] When determining the correction coordinate information of the first grid based on the lengths of the second and third sides, please refer to... Figure 5 As shown, Figure 5 This is a schematic diagram of the first mesh obtained after meshing processing, as provided in an embodiment of this application. Figure 5In this method, each first grid obtained after meshing is labeled, with A1 representing the first grid in the first row and first column, and A2 representing the first grid in the first row and second column. Assuming the coordinates of the lower left vertex of the surface image are (0, 0), and that each first grid is a square grid with a side length of 1, then the coordinates of the lower right corner of the first grid B1 are (1, 0), the upper right corner is (1, 1), and the upper left corner is (0, 1). Based on this method, the coordinate information of each first grid, i.e., the correction coordinate information, can be determined.
[0086] In this embodiment, the corrected coordinate information of the first grid is determined based on the coordinate information, the length of the second side, and the length of the third side. Since the length of the second side and the length of the third side are the average lengths of multiple first line segments and the average lengths of multiple second line segments, respectively, the determined corrected coordinate information of the first grid is more accurate.
[0087] For example, when determining the length of the third side perpendicular to the parallel edge in the first grid, multiple second line segments can be drawn in the first grid along the direction perpendicular to the parallel edge, and the length of each of the multiple second line segments can be obtained; based on the length of each second line segment, the average value of the multiple second line segments can be determined, and the average value can be determined as the length of the third side.
[0088] It is understood that the method for determining the length of the third side is similar to the method for determining the length of the second side described above, and will not be repeated here in the embodiments of this application.
[0089] In this embodiment of the application, by drawing multiple second line segments perpendicular to the parallel side, and determining the average length of the multiple second line segments as the length of the third side, the determined length of the third side is made more accurate.
[0090] For example, when expanding the edge of the first grid outward by a preset length based on the correction coordinate information of the first grid to obtain the second grid, the correction edge of the first grid can be determined based on the correction coordinate information of the first grid; the correction edge can be expanded outward by a preset length to obtain the expanded edge; and the second grid can be determined based on the expanded edge.
[0091] It is understood that the preset length can be determined based on the distance between multiple first line segments and second line segments drawn on the first grid. Specifically, the straight-line distance between any two first line segments drawn along a direction perpendicular to the first edge can be determined as the preset width for outward expansion. The preset width can be the straight-line distance between any two first line segments, or it can be a multiple of the straight-line distance. This embodiment of the application does not limit the specific multiple. The straight-line distance between any two second line segments drawn along a direction perpendicular to the parallel edge can be determined as the preset height for outward expansion. The preset height can be the straight-line distance between any two second line segments, or it can be a multiple of the straight-line distance. This embodiment of the application does not limit the specific multiple.
[0092] For example, when extending the correction edge outward by a preset length, the horizontal correction edge can be extended only horizontally, or the vertical correction edge can be extended vertically, or both horizontal and vertical correction edges can be extended horizontally and vertically simultaneously. The specific extension can be determined based on the position of the curved edge of the curved image, and this application does not limit this.
[0093] It is understood that if the curved edge of the surface image is a horizontal edge, then only the vertical correction edge can be extended vertically by a preset length, or both the horizontal correction edge and the vertical correction edge can be extended horizontally and vertically simultaneously by a preset length. This application embodiment does not impose any limitations on this. Similarly, if the curved edge of the surface image is a vertical edge, then only the horizontal correction edge can be extended horizontally by a preset length, or both the horizontal correction edge and the vertical correction edge can be extended horizontally and vertically simultaneously by a preset length. This application embodiment does not impose any limitations on this. Furthermore, if the curved edge of the surface image has both horizontal and vertical edges, then both the horizontal correction edge and the vertical correction edge can be extended horizontally and vertically simultaneously by a preset length. This application embodiment does not impose any limitations on this.
[0094] In this embodiment, by extending the correction edge of the first grid outward by a preset length, an extended edge is obtained and a second grid is determined. Therefore, the area of the second grid is larger than the area of the first grid, so that the edge of the second grid, i.e. the extended edge, will not cut into the information within the second grid, so that the information within the second grid can be identified, thereby improving the success rate of information recognition.
[0095] S304. Identify the information within the second grid.
[0096] For example, when identifying information within the second grid, different identification methods can be selected based on the type of information within the second grid. For instance, if the information within the second grid is a QR code or barcode, QR code recognition or barcode recognition can be used to obtain the corresponding information; if the information within the second grid is text, text recognition can be used to obtain the corresponding information. This application does not impose any limitations on this aspect.
[0097] Therefore, the information recognition method provided in this application embodiment acquires a surface image to be processed, which includes multiple original grids. The surface image is obtained by bending a rectangular image, and the curved edges of the surface image correspond to the first edges of the rectangular image. Based on the number of original grids, the surface image is divided into multiple first grids. For each first grid, the correction coordinate information of the first grid is determined, and based on the correction coordinate information of the first grid, the edge of the first grid is extended outward by a preset length to obtain a second grid. The information within the second grid is then recognized. Since the second grid is obtained by extending the edges of the divided first grids outward by a preset length, the area of the second grid is larger than the area of the first grid, increasing the area of the information recognition region. This ensures that the edge lines of the second grid do not cut off the information within that grid, enabling the recognition of information within all original grids in the surface image, thereby effectively improving the success rate of information recognition.
[0098] For example, after identifying the information in the second grid, the identified information can be mapped to its location in the original grid to facilitate better management and storage of the information.
[0099] To facilitate understanding of the information recognition method provided in the embodiments of this application, the technical solution provided in the embodiments of this application will be described in detail below, taking the batch recognition of QR code information as an example.
[0100] Assuming the first grid obtained after meshing is as follows: Figure 2 As shown by the dashed grid, and the curved edges of the surface image are horizontal, that is to say, Figure 2 The horizontal edge in the diagram is the first edge. For an example, multiple first line segments drawn perpendicular to the first edge can be found in [reference needed]. Figure 6 As shown, Figure 6This is a schematic diagram illustrating the drawing of a first line segment according to an embodiment of this application. The grid of column I is divided, with the horizontal edge of the first grid in column I divided into eight equal parts. The total height of the first grid in column I can be obtained based on the average length of the drawn first line segments, thus determining the height of each first grid in column I. Furthermore, the straight-line distance between any two first line segments can be determined. Using the same method, multiple second line segments are drawn horizontally, allowing the determination of the width of the first grid in each row, the straight-line distance between any two second line segments, and the straight-line distance between any two second line segments.
[0101] Furthermore, when determining the second grid by extending the correction edge of the first grid outward by a preset length, the horizontal correction edge can be extended horizontally by a preset length and the vertical correction edge can be extended vertically by a preset length at the same time. The preset lengths of the horizontal correction edge extension and the vertical correction edge extension can be equal or unequal.
[0102] For example, Figure 7 As shown, Figure 7 This is a schematic diagram of a second grid obtained by extending a preset length, as provided in an embodiment of this application. According to... Figure 7 As shown, after extending the correction edge of the first grid outward by a preset length, the resulting second grid is as follows. Figure 7 As shown in the solid-line box in the image, according to Figure 7 It can be seen that the edge line of the first grid may cut off the information within the grid, while the edge line of the extended second grid will not cut off the information within the grid, so that the QR code information within the grid always remains intact and can be recognized.
[0103] In summary, the technical method provided in this application can perform batch recognition of information. During the recognition process, information recognition will not fail due to paper bending, thus effectively improving the success rate of information recognition.
[0104] Figure 8 This is a schematic diagram of the structure of an information identification device 80 provided in an embodiment of this application. For example, please refer to [link to example]. Figure 8 As shown, the information identification device 80 may include:
[0105] The acquisition module 801 is used to acquire the surface image to be processed. The surface image includes multiple original grids. The surface image is obtained by bending a rectangular image. The curved edges of the surface image correspond to the first edge of the rectangular image.
[0106] The processing module 802 is used to divide the surface image into multiple first grids based on the number of original grids.
[0107] The processing module 802 is also used to determine the correction coordinate information of each first grid, and to extend the edge of the first grid outward by a preset length according to the correction coordinate information of the first grid to obtain the second grid.
[0108] The identification module 803 is used to identify information within the second grid.
[0109] Optionally, the processing module 802 is specifically used to determine the length of the second side perpendicular to the first side in the first grid based on the length of multiple first line segments perpendicular to the first side in the first grid; and to determine the correction coordinate information of the first grid based on the length of the second side.
[0110] Optionally, the processing module 802 is specifically used to draw multiple first line segments in the first grid along a direction perpendicular to the first side, and obtain the length of each of the multiple first line segments; based on the length of each first line segment, determine the average value of the multiple first line segments, and determine the average value as the length of the second side.
[0111] Optionally, the processing module 802 is specifically used to determine the coordinate information of the four vertices of the surface image; and to determine the correction coordinate information of the first grid based on the coordinate information and the length of the second side.
[0112] Optionally, the surface image includes parallel edges; the processing module 802 is specifically used to determine the length of the third edge perpendicular to the parallel edge in the first grid; and to determine the correction coordinate information of the first grid based on the coordinate information, the length of the second edge, and the length of the third edge.
[0113] Optionally, the processing module 802 is specifically used to draw multiple second line segments in the first grid along a direction perpendicular to the parallel edge, and obtain the length of each of the multiple second line segments; based on the length of each second line segment, determine the average value of the multiple second line segments, and determine the average value as the length of the third side.
[0114] Optionally, the processing module 802 is specifically used to determine the correction edge of the first grid based on the correction coordinate information of the first grid; extend the correction edge outward by a preset length to obtain the extended edge; and determine the second grid based on the extended edge.
[0115] The information identification device provided in this application embodiment can execute the technical solution of the information identification method in any of the above embodiments. Its implementation principle and beneficial effects are similar to those of the information identification method. Please refer to the implementation principle and beneficial effects of the information identification method. It will not be repeated here.
[0116] Figure 9 For an example, please refer to the structural schematic diagram of another information recognition device 90 provided in the embodiments of this application. Figure 9 As shown, the information recognition device 90 may include a processor 901 and a memory 902; wherein,
[0117] The memory 902 is used to store computer programs.
[0118] The processor 901 is used to read the computer program stored in the memory 902 and execute the technical solution of the information recognition method in any of the above embodiments according to the computer program in the memory 902.
[0119] Optionally, the memory 902 can be either independent or integrated with the processor 901. When the memory 902 is a device independent of the processor 901, the information identification device 90 may further include a bus for connecting the memory 902 and the processor 901.
[0120] Optionally, this embodiment further includes a communication interface, which can be connected to the processor 901 via a bus. The processor 901 can control the communication interface to realize the receiving and sending functions of the information identification device 90 described above.
[0121] The information identification device 90 shown in this application embodiment can execute the technical solution of the information identification method in any of the above embodiments. Its implementation principle and beneficial effects are similar to those of the information identification method. Please refer to the implementation principle and beneficial effects of the information identification method. It will not be repeated here.
[0122] This application also provides a computer-readable storage medium storing computer-executable instructions. When a processor executes the computer-executable instructions, it implements the technical solution of the information recognition method in any of the above embodiments. The implementation principle and beneficial effects are similar to those of the information recognition method, and can be found in the implementation principle and beneficial effects of the information recognition method. They will not be repeated here.
[0123] This application also provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the technical solution of the information recognition method in any of the above embodiments. Its implementation principle and beneficial effects are similar to those of the information recognition method. Please refer to the implementation principle and beneficial effects of the information recognition method. It will not be repeated here.
[0124] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0125] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or in a combination of hardware and software functional units.
[0126] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application.
[0127] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0128] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk or optical disc, etc.
[0129] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0130] The aforementioned computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium accessible to general-purpose or special-purpose computers.
[0131] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. An information identification method, characterized in that, The method for batch recognition of QR codes includes: Obtain a surface image to be processed, the surface image including multiple original grids, the surface image being obtained by bending a rectangular image, and the curved edges of the surface image corresponding to the first edge of the rectangular image; Based on the number of original grids, the surface image is divided to obtain multiple first grids; For each first grid, multiple first line segments are drawn within the first grid along a direction perpendicular to the first side, and the length of each first line segment is obtained; the length of the second side is determined based on the length of each of the multiple first line segments; the coordinate information of the four vertices of the surface image is determined, and the correction coordinate information of the first grid is determined based on the coordinate information of the four vertices and the length of the second side; Based on the correction coordinate information of the first grid, the edge of the first grid is extended outward by a preset length to obtain the second grid; Identify the information within the second grid; The preset length is determined based on the distance between multiple first and second line segments drawn on the first grid, including: The straight-line distance between any two first line segments drawn along a direction perpendicular to the first side is determined as the preset width for outward expansion. The preset width is a multiple of the straight-line distance between any two first line segments. The straight-line distance between any two second line segments drawn along a direction perpendicular to the parallel edge is determined as the preset height for outward expansion. The preset height is a multiple of the straight-line distance between any two second line segments.
2. The method according to claim 1, characterized in that, The step of determining the length of the second side based on the lengths of the plurality of first line segments includes: Based on the length of each first line segment, the average value of the plurality of first line segments is determined, and the average value is determined as the length of the second side.
3. The method according to claim 1, characterized in that, The curved surface image includes parallel edges; The step of determining the correction coordinate information of the first grid based on the coordinate information of the four vertices and the length of the second side includes: Determine the length of the third side in the first grid that is perpendicular to the parallel side; Based on the coordinate information, the length of the second side, and the length of the third side, the correction coordinate information of the first grid is determined.
4. The method according to claim 3, characterized in that, Determining the length of the third side perpendicular to the parallel side in the first grid includes: Within the first grid, multiple second line segments are drawn along a direction perpendicular to the parallel edge, and the length of each of the multiple second line segments is obtained; Based on the length of each second line segment, the average value of the plurality of second line segments is determined, and the average value is determined as the length of the third side.
5. The method according to claim 3, characterized in that, The step of extending the edge of the first grid outward by a preset length based on the correction coordinate information of the first grid to obtain the second grid includes: Based on the correction coordinate information of the first grid, determine the correction edge of the first grid; The corrected edge is extended outward by a preset length to obtain the extended edge; The second grid is determined based on the expanded edges.
6. An information identification device, characterized in that, The device for batch recognition of QR codes includes: The acquisition module is used to acquire a surface image to be processed. The surface image includes multiple original grids. The surface image is obtained by bending a rectangular image. The curved edges of the surface image correspond to the first edge of the rectangular image. The processing module is used to divide the surface image according to the number of the original grids to obtain multiple first grids; The processing module is further configured to: determine the correction coordinate information of each first grid; extend the edge of the first grid outward by a preset length according to the correction coordinate information of the first grid to obtain a second grid; draw multiple first line segments within each first grid along a direction perpendicular to the first side, and obtain the length of each first line segment; determine the length of the second side according to the length of each of the multiple first line segments; determine the coordinate information of the four vertices of the surface image, and determine the correction coordinate information of the first grid according to the coordinate information of the four vertices and the length of the second side; The identification module is used to identify information within the second grid. The processing module is also used for: The straight-line distance between any two first line segments drawn along a direction perpendicular to the first side is determined as the preset width for outward expansion. The preset width is a multiple of the straight-line distance between any two first line segments. The straight-line distance between any two second line segments drawn along a direction perpendicular to the parallel edge is determined as the preset height for outward expansion. The preset height is a multiple of the straight-line distance between any two second line segments.
7. An information identification device, characterized in that, Includes memory and processor; among which, The memory is used to store computer programs; The processor is configured to read the computer program stored in the memory and execute the information recognition method according to any one of claims 1-5 based on the computer program in the memory.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by the processor, implement the information recognition method according to any one of claims 1-5.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements an information recognition method as described in any one of claims 1-5.