CN113343797A - Information extraction method and device, terminal equipment and computer readable storage medium - Google Patents

Information extraction method and device, terminal equipment and computer readable storage medium Download PDF

Info

Publication number
CN113343797A
CN113343797A CN202110570167.1A CN202110570167A CN113343797A CN 113343797 A CN113343797 A CN 113343797A CN 202110570167 A CN202110570167 A CN 202110570167A CN 113343797 A CN113343797 A CN 113343797A
Authority
CN
China
Prior art keywords
grid
target
image
information
grids
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110570167.1A
Other languages
Chinese (zh)
Inventor
陈乐清
刘东煜
曾增烽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN202110570167.1A priority Critical patent/CN113343797A/en
Publication of CN113343797A publication Critical patent/CN113343797A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Image Analysis (AREA)

Abstract

The application is applicable to the technical field of image processing, and provides an information extraction method, an information extraction device, terminal equipment and a computer-readable storage medium, wherein the information extraction method comprises the following steps: acquiring mark information in an image to be processed, wherein the mark information is an image element determined according to a preset mark rule; dividing the image to be processed into a plurality of grids according to a preset division rule; and extracting target information which has a preset position relation with the mark information in the image to be processed according to the relative position between the grids. By the method, the data processing amount can be greatly reduced, and the information extraction efficiency is effectively improved.

Description

Information extraction method and device, terminal equipment and computer readable storage medium
Technical Field
The present application belongs to the field of image processing technologies, and in particular, to an information extraction method, an information extraction device, a terminal device, and a computer-readable storage medium.
Background
With the advent of paperless times, more and more data in life is stored in the form of images, such as electronic invoices, electronic insurance policies and the like. When the target information needs to be acquired, a common method is to perform image processing on the document image. For example: if the name of the insured life in the electronic insurance policy needs to be acquired, characters corresponding to the name of the insured life need to be extracted from the image of the electronic insurance policy.
In the prior art, when information is extracted from an image, each character in the image is generally required to be traversed to search out target information. The method has large data processing amount and low information extraction efficiency.
Disclosure of Invention
The embodiment of the application provides an information extraction method, an information extraction device, terminal equipment and a computer readable storage medium, and the information extraction efficiency can be effectively improved.
In a first aspect, an embodiment of the present application provides an information extraction method, including:
acquiring mark information in an image to be processed, wherein the mark information is an image element determined according to a preset mark rule;
dividing the image to be processed into a plurality of grids according to a preset division rule;
and extracting target information which has a preset position relation with the mark information in the image to be processed according to the relative position between the grids.
In the embodiment of the application, the image to be processed is divided into a plurality of grids, relative position relations are implied among the divided grids, and the position relations among all image elements in the image to be processed can be established through the relative positions among the grids; thus, after the mark information in the image to be processed is determined, the target information related to the position of the mark information can be quickly found according to the position relation between the image elements. By the method, when the information in the image is extracted, each character in the image does not need to be traversed, and only the position of the target information to be extracted is determined according to the divided grids, so that the data processing amount is greatly reduced, and the information extraction efficiency is effectively improved.
In a possible implementation manner of the first aspect, the extracting, according to the relative position between the grids, target information in the image to be processed, which has a preset positional relationship with the marker information, includes:
determining a first target grid to which the mark information belongs from the grids;
determining a second target grid which has the preset position relation with the first target grid in the grids according to the relative position between the grids;
and extracting the target information belonging to the second target grid in the image to be processed.
In a possible implementation manner of the first aspect, the determining a first target mesh to which the label information belongs from the multiple meshes includes:
determining a target boundary grid in the grids, wherein the target boundary grid is a grid to which boundary pixel points of the marking information belong;
and determining the first target grid according to the target boundary grid.
In a possible implementation manner of the first aspect, the determining a target boundary mesh of the multiple meshes includes:
acquiring the image resolution of the image to be processed;
determining the grid resolution according to the image resolution and the preset division rule;
acquiring image coordinates of boundary pixel points of the marking information in the image to be processed;
and determining the target boundary grid according to the image coordinates and the grid resolution.
In a possible implementation manner of the first aspect, the determining the first target mesh according to the target boundary mesh includes:
determining a target grid area surrounded by the target boundary grids;
determining a mesh contained within the target mesh region as the first target mesh.
In a possible implementation manner of the first aspect, the determining a target grid area surrounded by the target boundary grid includes:
determining a first grid column number, a second grid column number, a first grid line number and a second grid line number, wherein the first grid column number is the column number of the grid with the rightmost position in the horizontal direction in the target boundary grid in the multiple grids, the second grid column number is the column number of the grid with the leftmost position in the horizontal direction in the target boundary grid in the multiple grids, the first grid line number is the line number of the grid with the uppermost position in the vertical direction in the target boundary grid in the multiple grids, and the second grid line number is the line number of the grid with the lowermost position in the vertical direction in the target boundary grid in the multiple grids;
and determining the target grid area according to the first grid column number, the second grid column number, the first grid line number and the second grid line number.
In a possible implementation manner of the first aspect, the determining, according to the relative position between the grids, a second target grid of the multiple grids, which has the preset positional relationship with the first target grid, includes:
identifying image elements included in each of the plurality of meshes in the image to be processed;
correcting the first target grid according to image elements contained in the grids to obtain the corrected first target grid;
and determining the second target grid which has the preset position relation with the corrected first target grid in the grids.
In a possible implementation manner of the first aspect, after extracting target information having a preset positional relationship with the marker information in the image to be processed according to the relative position between the grids, the method further includes:
determining a third target grid to which the target information belongs in the image to be processed;
comparing the second target grid with the third target grid;
if the comparison result is consistent, the extracted target information is correct;
and if the comparison result is inconsistent, re-extracting the target information according to the second target grid and the third target grid.
In a second aspect, an embodiment of the present application provides an information extraction apparatus, including:
the system comprises a mark acquisition unit, a marking unit and a processing unit, wherein the mark acquisition unit is used for acquiring mark information in an image to be processed, and the mark information is an image element determined according to a preset mark rule;
the grid dividing unit is used for dividing the image to be processed into a plurality of grids according to a preset dividing rule;
and the information extraction unit is used for extracting target information which has a preset position relation with the mark information in the image to be processed according to the relative position between the grids.
In a third aspect, an embodiment of the present application provides a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor, when executing the computer program, implements the information extraction method according to any one of the first aspects.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, and the embodiment of the present application provides a computer-readable storage medium, where a computer program is stored, where the computer program is executed by a processor to implement the information extraction method according to any one of the first aspects.
In a fifth aspect, an embodiment of the present application provides a computer program product, which, when run on a terminal device, causes the terminal device to execute the information extraction method according to any one of the above first aspects.
It is understood that the beneficial effects of the second aspect to the fifth aspect can be referred to the related description of the first aspect, and are not described herein again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flowchart of an information extraction method provided in an embodiment of the present application;
FIG. 2 is a schematic diagram of an image to be processed according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of meshing provided by an embodiment of the present application;
fig. 4 is a block diagram of an information extraction device provided in an embodiment of the present application;
fig. 5 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when.. or" upon "or" in response to a determination "or" in response to a detection ".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise.
Referring to fig. 1, which is a schematic flow chart of an information extraction method provided in an embodiment of the present application, by way of example and not limitation, the method may include the following steps:
s101, acquiring mark information in the image to be processed.
The marking information is an image element determined according to a preset marking rule.
The image elements can be characters, images, figures or symbols, and the contents presented in the image to be processed can be used as elements.
Optionally, the preset marking rule may be: and determining the preset information in the identified image to be processed as the mark information. The preset information is image elements in a preset image to be processed.
In practical applications, before information extraction, image recognition processing is usually performed on an image to be processed, that is, image elements such as characters or characters in the image to be processed are recognized. Exemplarily, refer to fig. 2, which is a schematic diagram of an image to be processed provided in an embodiment of the present application. If the preset information is a rectangular frame (i.e., a graph), the mark information is the graph of the rectangular frame surrounding "zhang san" in fig. 2. If the preset information is the 'insured name' (namely characters), the mark information is the characters of 'insured name'.
And S102, dividing the image to be processed into a plurality of grids according to a preset division rule.
The position of each grid is determined by a preset division rule. The division may be equidistant or non-equidistant. For ease of calculation, preferably, equidistant partitioning is used. This is convenient when determining each grid position. The more the number of divided meshes is, the more accurately the position of the image element to be subsequently determined is, but the more the data processing amount is, and there may be a case where one image element occupies a plurality of meshes. Therefore, the preset division rule needs to be set according to actual conditions.
For example, refer to fig. 3, which is a schematic diagram of grid division provided in the embodiment of the present application. As shown in fig. 3, the image to be processed is an electronic policy, the top left vertex of the electronic policy is determined as the origin of coordinates, the vertically downward direction (i.e., the upward direction) from the origin of coordinates is determined as the y-axis forward direction, and the horizontally rightward direction (i.e., the widthwise rightward direction) from the origin of coordinates is determined as the x-axis forward direction. Then, n lines are divided along the x-axis and the y-axis, respectively, to obtain (n +1) (n +1) grids. As shown in fig. 3, when n is 9, the electronic policy is divided into 10 × 10 grids.
In practical applications, when an image to be processed is stored in a computer, the computer can generally only perceive character information and coordinate information of image elements, but cannot perceive the position relationship between the image elements. In the embodiment of the application, the image elements are added into each grid by dividing the grid, so that the position relationship among the image elements in the image to be processed can be increased through the distance relationship among the grids.
S103, extracting target information which has a preset position relation with the mark information in the image to be processed according to the relative position between the grids.
As described in S102, after the image to be processed is divided into a plurality of grids, a relative positional relationship exists between the grids. For example, the position of a grid in the image to be processed, and the positions of grids adjacent to the grid (e.g., up, down, left, and right). The relative position between the grids is utilized to establish the position relationship between the image elements in the image to be processed. Thus, after the mark information in the image to be processed is determined, the target information related to the position of the mark information can be quickly found according to the position relation between the image elements.
In one embodiment, S103 may include the steps of:
s31, a first target mesh to which the marker information belongs is determined from the plurality of meshes.
S32, according to the relative position between the grids, determining a second target grid which has the preset position relation with the first target grid in the grids.
And S33, extracting the target information belonging to the second target grid in the image to be processed.
Wherein, the first target grid may include at least one grid. As shown in fig. 3, when the label information is a rectangular frame surrounding "zhang san", the first target grid is a grid in row 2 and column 3, and at this time, the first target grid includes one grid. When the marking information is the characters of 'insured name', the first target grid is the grid of the 1 st line of the 2 nd line and the 2 nd line of the 2 nd line, and the first target grid comprises 2 grids.
In an embodiment, in the step S31, the method for determining the first target mesh to which the label information belongs from the multiple meshes may include:
determining coordinates of boundary pixel points of the marking information in the image to be processed to obtain boundary coordinates of the marking information; determining an image area occupied by the marking information in the image to be processed according to the boundary coordinates of the marking information; determining the position of each grid in the image to be processed according to the grid division rule and the resolution of the image to be processed; and determining grids contained in the image area according to the position of each grid in the image to be processed to obtain a first target grid.
Generally, the resolution (the number of horizontal pixels × the number of vertical pixels) of the image to be processed is known, and therefore, after the meshes are divided, the resolution of each mesh and the position of each mesh in the image to be processed can be determined according to the preset division rule of the meshes and the resolution of the image to be processed.
The position of the mesh may be determined by the four vertices of the mesh. For example: the resolution of the image to be processed shown in fig. 3 is 1000 × 800, which is equally divided into 10 × 10 meshes, each of which has a resolution of 100 × 80(1000 ÷ 10 ═ 100, 800 ÷ 10 ═ 80), and the 4 vertices of the 1 st row and 1 st column meshes are (0,0), (0,100), (80,0), and (80,100), respectively. By analogy, the position of each grid can be determined.
The first target grid is determined from the perspective of the image coordinates, and may also be determined from the perspective of the grid. Specifically, in another embodiment, the method for determining the first target grid may include:
determining a target boundary grid in the grids, wherein the target boundary grid is a grid to which boundary pixel points of the marking information belong; a first target mesh is determined from the target boundary mesh.
The target boundary grid may include a grid to which each boundary pixel point on the marking information belongs; for example, there are 10 boundary pixels on the label information, and then the grids to which the 10 boundary pixels belong are the target boundary grids. The target boundary grid can also comprise grids to which boundary pixel points on the sampled and obtained marking information belong; for example, the marking information has 10 boundary pixels, 5 boundary pixels are sampled from the 10 boundary pixels, and the grid to which the sampled 5 boundary pixels belong is determined as the target boundary grid.
For example, if the shape of the mark information is a regular polygon (such as a rectangle, a diamond, etc.), it is preferable that the mesh to which the vertex of the image element belongs be determined as the target boundary mesh. If the mark information is several characters of 'insured name' as described in the example of fig. 3, the grids to which the border pixel points on the left side of the 'insured' character belong and the grids to which the pixel points on the right side of the 'name' character belong are determined as target border grids.
Optionally, one implementation manner of determining the target boundary mesh in the multiple meshes may be:
acquiring the image resolution of an image to be processed; determining the grid resolution according to the image resolution and a preset division rule; acquiring image coordinates of boundary pixel points of the marking information in the image to be processed; and determining a target boundary grid according to the image coordinates and the grid resolution.
Exemplarily, assuming that the resolution of the image to be processed is 3000 × 1500 (the number of horizontal pixels is 3000, the number of vertical pixels is 1500), the image to be processed includes 10 × 10 grids, the preset partition rule is an equidistant partition, and the image coordinates of the boundary pixel points on the marking information are (347,310); with the above method, the resolution of each grid is 300 × 150 (3000/10-300, 1500/10-150), i.e., the number of pixels contained in each grid in the horizontal direction is 300, and the number of pixels contained in the vertical direction is 150; then, determining the target boundary grid as:
Figure BDA0003082307910000091
i.e., a grid of row 3 and column 2. Wherein the content of the first and second substances,
Figure BDA0003082307910000092
indicating a rounding down operation. Of course, the rounding-up operation may also be used, and is not limited herein.
If all boundary pixel points on the marking information belong to the same target boundary grid, the marking information is completely positioned in one grid, and then the target boundary grid is the first target grid to which the marking information belongs. However, in practical application, because the mesh division rules are different, different boundary pixel points on the mark information may belong to different meshes, which indicates that there are multiple meshes to which the mark information belongs, and at this time, all first target meshes to which the mark information belongs need to be determined according to the target boundary meshes. The details are as follows.
Optionally, after determining the target boundary mesh in the multiple meshes, one implementation manner of determining the first target mesh according to the target boundary mesh is as follows:
determining a target grid area surrounded by target boundary grids; the grid contained within the target grid area is determined as the first target grid.
The target mesh region may be a mesh region including a target boundary mesh; the mesh region may be a mesh region surrounded by the target boundary mesh, excluding the target boundary mesh.
Further, one implementation manner of determining the target grid area surrounded by the target boundary grid is as follows:
and determining a first grid column number, a second grid column number, a first grid line number and a second grid line number, and determining a target grid area according to the first grid column number, the second grid column number, the first grid line number and the second grid line number.
The first grid column number is the column number of the grid with the rightmost position in the horizontal direction in the target boundary grid in the grids, the second grid column number is the column number of the grid with the leftmost position in the horizontal direction in the target boundary grid in the grids, the first grid row number is the row number of the grid with the topmost position in the vertical direction in the target boundary grid in the grids, and the second grid row number is the row number of the grid with the bottommost position in the vertical direction in the target boundary grid in the grids.
Illustratively, taking the marking information as a rectangular frame as an example, coordinates of 4 vertices of the rectangular frame in the image to be processed are (619,722), (619,761), (759,761) and (759,722), respectively, where (759,722) belongs to [13,7] (representing a grid of row 13 and column 7), (619,722) belongs to [13,8], (759,761) belongs to [16,7], (619,761) belongs to [16,8], that is, the target boundary grid of the marking information is [13,7], [13,8], [16,7] and [16,8 ]. In the 4 target boundary grids, the number of columns to which the grid at the rightmost position in the horizontal direction belongs in the grids is 8, the number of columns to which the grid at the leftmost position belongs in the grids is 7, the number of rows to which the grid at the uppermost position in the vertical direction belongs in the grids is 13, and the number of rows to which the grid at the lowermost position belongs in the grids is 16; therefore, it can be determined that the first target mesh to which the marker information belongs is [13,8], [14,8], [15,8], [16,8], [13,7], [14,7], [15,7] and [16,7 ].
In practical applications, the information extraction is aimed at obtaining target information related to the position of the mark information. In the prior art, each image element in the image to be processed is required to be traversed to search out the target information related to the position of the mark information. The method has the advantages of large data processing amount and low processing efficiency. In order to solve the above problem, in the embodiment of the present application, a position relationship between the mark information and the target information may be established through a grid, and then a position of a second target grid to which the target information belongs is determined through a first target grid to which the mark information belongs, which is equivalent to determining a position of the target information in the image to be processed, so that traversing of each image element is avoided, and processing efficiency is effectively improved. The specific method is as follows.
In one embodiment, a second target grid having a preset positional relationship with the first target grid among the plurality of grids is determined according to the relative position between the grids.
The preset position relationship in the embodiment of the present application refers to a relationship mapped according to position parameter information of a divided grid. The preset position relationship may be a position occupied by the first target grid; at this time, the second target grid having a preset positional relationship with the first target grid is the first target grid, that is, the first target grid and the second target grid coincide. For example: as shown in fig. 3, when the mark information is a rectangular frame, the grid corresponding to the position occupied by the grid to which the rectangular frame belongs (i.e., the first target grid) is determined as the second target grid. The preset positional relationship may also be a position adjacent to the first target mesh; at this time, the second target mesh having the predetermined positional relationship with the first target mesh is a mesh adjacent to the first target mesh (e.g., a mesh on the right/left side of the first target mesh, etc.). For example, as shown in fig. 3, when the label information is several words such as "insured name", it is common to obtain the text content after the several words, and therefore, at least one grid on the right side of the first target grid to which the several words belong may be determined as the second target grid.
After the first target mesh is acquired according to the step of S31, the second target mesh having a preset positional relationship with the first target mesh may be directly determined. In order to more accurately determine the corresponding relationship between the image elements and the mesh in the image to be processed, in an embodiment, the first target mesh may be modified, and then the second target mesh may be determined according to the modified first target mesh. The details are as follows.
S32, determining a second target grid having the preset position relationship with the first target grid in the multiple grids, may include the steps of:
identifying image elements contained in a plurality of grids in an image to be processed; correcting the first target grid according to image elements contained in the grids to obtain a corrected first target grid; and determining a second target grid which has a preset position relation with the corrected first target grid in the grids.
Step S31 is equivalent to determining the grid to which the image element belongs, and the above steps are equivalent to determining the image element contained in the grid, that is, to reversely traverse and find the image element contained in each grid, and in this way, the first target grid obtained by correction can be effectively avoided, so that the problem that the first target grid is inaccurate due to calculation errors can be effectively avoided, and the accuracy of extracting the text can be further improved.
Optionally, the modification method may be: determining grids containing marking information according to image elements contained in the grids respectively, and obtaining a fourth target grid; if the fourth target grid comprises all the first target grids, keeping the original first target grids; if the first target grid contains all the fourth target grids, determining the fourth target grids as the modified first target grids; and if the intersection exists between the first target grid and the fourth target grid, determining the intersection between the first target grid and the fourth target grid as the modified first target grid.
For example, assume that each of the plurality of meshes contains image elements of: the grids [1,1] contain picture elements a, the grids [1,2] contain picture elements a, the grids [2,1] contain picture elements b, and the grids [2,2] contain picture elements c. Assuming that the label information is a, the fourth target grids are [1,1] and [1,2 ].
If it is determined from S31 that the first target grids to which a belongs are [1,1] and [1,2], that is, the fourth target grid includes all the first target grids, the modified first target grids are still [1,1] and [1,2 ].
If the first target grids to which a belongs are determined to be [1,1], [1,2] and [2,1] according to S31, that is, all the fourth target grids are included in the first target grid, the modified first target grids are the fourth target grids [1,1] and [1,2 ].
If the first target grid to which the a belongs is determined to be [1,1] according to the step S102, that is, the first target grid and the fourth target grid have an intersection, the modified first target grid is the intersection [1,1] of the first target grid and the fourth target grid.
Several examples of step S33 (extracting object information belonging to the second object mesh in the image to be processed) are described below.
Taking the marking information as a rectangular frame as an example, the elements in the rectangular frame are target information to be extracted. In this case, the first target mesh to which the rectangular frame belongs may be obtained according to the method in S31, and this first target mesh may be determined as the second target mesh, and the target information in the second target mesh (which is equivalent to the extraction of the image element in the mesh to which the rectangular frame belongs) may be extracted.
Taking the words of which the label information is the name of the insured life as an example, the information extraction aims to acquire the word "zhang san" corresponding to the name of the insured life, namely the words of which the target information is the word "zhang san". In this case, the first target network described in the letters "name of insured" can be obtained according to the method in S31. Since the name is usually behind the title, at least one grid to the right of the first target grid can be determined as the second target grid, and then the target information in the second target grid is advanced, i.e. "zhang san" can be extracted.
Sometimes only the positional relationship of the first target grid and the second target grid can be determined, but the number of the second target grids cannot be determined. In the above example, only "zhang san" can be determined to the right of the "insured name", that is, the right of the first target grid is the second target grid, but it cannot be determined that several grids to the right of the first target grid are determined as the second target grid, which easily results in more or less contents of the second target elements being extracted.
In order to solve the above problem and improve the accuracy of information extraction, in an embodiment, after S103, the extracted information may be further confirmed to improve the accuracy of information extraction. Specifically, after S103, the information extraction method may further include the steps of:
determining a third target grid to which target information in the image to be processed belongs; comparing the second target grid with the third target grid; if the comparison result is consistent, the extracted target information is correct; and if the comparison result is inconsistent, re-extracting the target information according to the second target grid and the third target grid.
The method for calculating the third target grid to which the target information belongs is the same as the method for calculating the first target grid to which the tag information belongs in S31, and specific reference may be made to the description in S31, which is not described herein again.
By using the method, the extracted target information is equivalently checked, and the accuracy of information extraction is further improved.
In the embodiment of the application, the image to be processed is divided into a plurality of grids, relative position relations are implied among the divided grids, and the position relations among all image elements in the image to be processed can be established through the relative positions among the grids; thus, after the mark information in the image to be processed is determined, the target information related to the position of the mark information can be quickly found according to the position relation between the image elements. By the method, when the information in the image is extracted, each character in the image does not need to be traversed, and only the position of the target information to be extracted is determined according to the divided grids, so that the data processing amount is greatly reduced, and the information extraction efficiency is effectively improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 4 is a block diagram of an information extraction device provided in an embodiment of the present application, which corresponds to the information extraction method described in the above embodiment, and only the relevant parts of the embodiment of the present application are shown for convenience of description.
Referring to fig. 4, the apparatus includes:
a mark obtaining unit 41, configured to obtain mark information in an image to be processed, where the mark information is an image element determined according to a preset mark rule;
the grid dividing unit 42 is used for dividing the image to be processed into a plurality of grids according to a preset dividing rule;
an information extracting unit 43, configured to extract, according to the relative position between the grids, target information in the image to be processed, which has a preset positional relationship with the marker information.
Optionally, the information extracting unit 43 includes:
and the first grid determining module is used for determining a first target grid to which the mark information belongs from the plurality of grids.
A second grid determining module, configured to determine a second target grid of the multiple grids that has the preset positional relationship with the first target grid.
And the information extraction module is used for extracting the target information belonging to the second target grid in the image to be processed.
Optionally, the first grid determining module is further configured to:
determining a target boundary grid in the grids, wherein the target boundary grid is a grid to which boundary pixel points of the marking information belong; and determining the first target grid according to the target boundary grid.
Optionally, the first grid determining module is further configured to:
acquiring the image resolution of the image to be processed; determining the grid resolution according to the image resolution and the preset division rule; acquiring image coordinates of boundary pixel points of the marking information in the image to be processed; and determining the target boundary grid according to the image coordinates and the grid resolution.
Optionally, the first grid determining module is further configured to:
determining a target grid area surrounded by the target boundary grids; determining a mesh contained within the target mesh region as the first target mesh.
Optionally, the first grid determining module is further configured to:
determining a first grid column number, a second grid column number, a first grid line number and a second grid line number, wherein the first grid column number is the column number of the grid with the rightmost position in the horizontal direction in the target boundary grid in the multiple grids, the second grid column number is the column number of the grid with the leftmost position in the horizontal direction in the target boundary grid in the multiple grids, the first grid line number is the line number of the grid with the uppermost position in the vertical direction in the target boundary grid in the multiple grids, and the second grid line number is the line number of the grid with the lowermost position in the vertical direction in the target boundary grid in the multiple grids; and determining the target grid area according to the first grid column number, the second grid column number, the first grid line number and the second grid line number.
Optionally, the second grid determining module is further configured to:
identifying image elements included in each of the plurality of meshes in the image to be processed; correcting the first target grid according to image elements contained in the grids to obtain the corrected first target grid; and determining a second target grid which has a preset position relation with the corrected first target grid in the grids.
Optionally, the apparatus 4 further comprises:
a comparison unit 44, configured to determine a third target grid to which the target information in the image to be processed belongs after extracting, according to the relative position between the grids, target information in the image to be processed, which has a preset positional relationship with the marker information; comparing the second target grid with the third target grid; if the comparison result is consistent, the extracted target information is correct; and if the comparison result is inconsistent, re-extracting the target information according to the second target grid and the third target grid.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
The information extraction device shown in fig. 4 may be a software unit, a hardware unit, or a combination of software and hardware unit built in the existing terminal device, may be integrated into the terminal device as a separate pendant, or may exist as a separate terminal device.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Fig. 5 is a schematic structural diagram of a terminal device according to an embodiment of the present application. As shown in fig. 5, the terminal device 5 of this embodiment includes: at least one processor 50 (only one is shown in fig. 5), a memory 51, and a computer program 52 stored in the memory 51 and operable on the at least one processor 50, wherein the processor 50 implements the steps of any of the various information extraction method embodiments described above when executing the computer program 52.
The terminal device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The terminal device may include, but is not limited to, a processor, a memory. Those skilled in the art will appreciate that fig. 5 is only an example of the terminal device 5, and does not constitute a limitation to the terminal device 5, and may include more or less components than those shown, or combine some components, or different components, such as an input-output device, a network access device, and the like.
The Processor 50 may be a Central Processing Unit (CPU), and the Processor 50 may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 51 may in some embodiments be an internal storage unit of the terminal device 5, such as a hard disk or a memory of the terminal device 5. The memory 51 may also be an external storage device of the terminal device 5 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 5. Further, the memory 51 may also include both an internal storage unit and an external storage device of the terminal device 5. The memory 51 is used for storing an operating system, an application program, a Boot Loader (Boot Loader), data, and other programs, such as program codes of the computer programs. The memory 51 may also be used to temporarily store data that has been output or is to be output.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the above-mentioned method embodiments.
The embodiments of the present application provide a computer program product, which when running on a terminal device, enables the terminal device to implement the steps in the above method embodiments when executed.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to an apparatus/terminal device, recording medium, computer Memory, Read-Only Memory (ROM), Random-Access Memory (RAM), electrical carrier wave signals, telecommunications signals, and software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. An information extraction method, comprising:
acquiring mark information in an image to be processed, wherein the mark information is an image element determined according to a preset mark rule;
dividing the image to be processed into a plurality of grids according to a preset division rule;
and extracting target information which has a preset position relation with the mark information in the image to be processed according to the relative position between the grids.
2. The information extraction method according to claim 1, wherein the extracting, from the relative positions between the meshes, target information having a preset positional relationship with the marker information in the image to be processed, includes:
determining a first target grid to which the mark information belongs from the grids;
determining a second target grid which has the preset position relation with the first target grid in the grids according to the relative position between the grids;
and extracting the target information belonging to the second target grid in the image to be processed.
3. The information extraction method according to claim 2, wherein the determining a first target mesh to which the label information belongs from the plurality of meshes includes:
determining a target boundary grid in the grids, wherein the target boundary grid is a grid to which boundary pixel points of the marking information belong;
and determining the first target grid according to the target boundary grid.
4. The information extraction method of claim 3, wherein the determining a target boundary mesh of the plurality of meshes comprises:
acquiring the image resolution of the image to be processed;
determining the grid resolution according to the image resolution and the preset division rule;
acquiring image coordinates of boundary pixel points of the marking information in the image to be processed;
and determining the target boundary grid according to the image coordinates and the grid resolution.
5. The information extraction method of claim 3, wherein said determining the first target mesh from the target boundary mesh comprises:
determining a target grid area surrounded by the target boundary grids;
determining a mesh contained within the target mesh region as the first target mesh.
6. The information extraction method of claim 5, wherein the determining a target grid area surrounded by the target boundary grid comprises:
determining a first grid column number, a second grid column number, a first grid line number and a second grid line number, wherein the first grid column number is the column number of the grid with the rightmost position in the horizontal direction in the target boundary grid in the multiple grids, the second grid column number is the column number of the grid with the leftmost position in the horizontal direction in the target boundary grid in the multiple grids, the first grid line number is the line number of the grid with the uppermost position in the vertical direction in the target boundary grid in the multiple grids, and the second grid line number is the line number of the grid with the lowermost position in the vertical direction in the target boundary grid in the multiple grids;
and determining the target grid area according to the first grid column number, the second grid column number, the first grid line number and the second grid line number.
7. The information extraction method according to claim 5, wherein the determining, based on the relative position between the grids, a second target grid having the preset positional relationship with the first target grid among the multiple grids comprises:
identifying image elements included in each of the plurality of meshes in the image to be processed;
correcting the first target grid according to image elements contained in the grids to obtain the corrected first target grid;
and determining the second target grid which has the preset position relation with the corrected first target grid in the grids.
8. The information extraction method according to any one of claims 1 to 7, wherein after extracting target information having a preset positional relationship with the marker information in the image to be processed in accordance with the relative position between the meshes, the method further comprises:
determining a third target grid to which the target information belongs in the image to be processed;
comparing the second target grid with the third target grid;
if the comparison result is consistent, the extracted target information is correct;
and if the comparison result is inconsistent, re-extracting the target information according to the second target grid and the third target grid.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 8 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 8.
CN202110570167.1A 2021-05-25 2021-05-25 Information extraction method and device, terminal equipment and computer readable storage medium Pending CN113343797A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110570167.1A CN113343797A (en) 2021-05-25 2021-05-25 Information extraction method and device, terminal equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110570167.1A CN113343797A (en) 2021-05-25 2021-05-25 Information extraction method and device, terminal equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN113343797A true CN113343797A (en) 2021-09-03

Family

ID=77471248

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110570167.1A Pending CN113343797A (en) 2021-05-25 2021-05-25 Information extraction method and device, terminal equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113343797A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113938667A (en) * 2021-10-25 2022-01-14 深圳普罗米修斯视觉技术有限公司 Video data transmission method and device based on video stream data and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113938667A (en) * 2021-10-25 2022-01-14 深圳普罗米修斯视觉技术有限公司 Video data transmission method and device based on video stream data and storage medium

Similar Documents

Publication Publication Date Title
CN108334879B (en) Region extraction method, system and terminal equipment
CN112699775A (en) Certificate identification method, device and equipment based on deep learning and storage medium
CN108717744B (en) Method and device for identifying seal serial number on financial document and terminal equipment
CN111428700B (en) Table identification method and device, electronic equipment and storage medium
CN113920117B (en) Panel defect area detection method and device, electronic equipment and storage medium
CN110853488B (en) POI (Point of interest) label display method, device and equipment
CN101727580A (en) Image processing apparatus, electronic medium, and image processing method
CN111310426A (en) Form format recovery method and device based on OCR and storage medium
CN106909869A (en) A kind of sampling grid partitioning method and device of matrix two-dimensional code
CN110867243B (en) Image annotation method, device, computer system and readable storage medium
CN111651971A (en) Form information transcription method, system, electronic equipment and storage medium
CN113343797A (en) Information extraction method and device, terminal equipment and computer readable storage medium
CN109656652B (en) Webpage chart drawing method, device, computer equipment and storage medium
EP4075381B1 (en) Image processing method and system
CN113706422B (en) Image correction method, device, equipment and medium based on key point acquisition
CN107943760B (en) Method and device for optimizing fonts of PDF document editing, terminal equipment and storage medium
CN111401365B (en) OCR image automatic generation method and device
CN114359929A (en) Method, device, terminal and storage medium for translating cartoon file in JPG format
CN113850208A (en) Picture information structuring method, device, equipment and medium
CN110263310B (en) Data graph generation method and device and computer readable storage medium
CN112580638A (en) Text detection method and device, storage medium and electronic equipment
CN111931794A (en) Sketch-based image matching method
CN108629238B (en) Method and device for identifying Chinese character mark
CN111429399A (en) Straight line detection method and device
CN112118478B (en) Text processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination