CN114299509A - Method, device, equipment and medium for acquiring information - Google Patents

Method, device, equipment and medium for acquiring information Download PDF

Info

Publication number
CN114299509A
CN114299509A CN202111636198.9A CN202111636198A CN114299509A CN 114299509 A CN114299509 A CN 114299509A CN 202111636198 A CN202111636198 A CN 202111636198A CN 114299509 A CN114299509 A CN 114299509A
Authority
CN
China
Prior art keywords
image
target
character
recognized
information
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
CN202111636198.9A
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.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co 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 Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202111636198.9A priority Critical patent/CN114299509A/en
Publication of CN114299509A publication Critical patent/CN114299509A/en
Pending legal-status Critical Current

Links

Images

Abstract

The embodiment of the specification discloses a method, a device, equipment and a medium for acquiring information. The scheme comprises the following steps: acquiring an image to be identified; identifying target characters which accord with preset character image characteristics in the image to be identified; the preset character image features are features contained in character images in the template image; determining a target conversion matrix based on the coordinates of the target character; adjusting the image to be recognized based on the target conversion matrix to obtain an adjusted image to be recognized; and acquiring target information from the adjusted target area of the image to be recognized.

Description

Method, device, equipment and medium for acquiring information
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for acquiring information.
Background
With the development of technology, people are more and more popularized by taking pictures and uploading cards and certificates to transact business. For example, when identity information is recorded, the identity card may be scanned to identify identity information such as a name and an identity card number; for example, when financial information is recorded, a credit card or a deposit card may be scanned to identify information such as an account number and an account bank.
In the prior art, when card information is identified, the card information is generally identified by using the pixel characteristics of a card image, and the image is easily influenced by factors such as brightness, angle, noise, color and the like, so that the card identification accuracy in the prior art is low, and a deep learning model with high accuracy is often low in reasoning efficiency due to high calculation complexity.
Therefore, how to better identify the card information is a technical problem to be solved urgently.
Disclosure of Invention
The embodiment of the specification provides a method, a device, equipment and a medium for acquiring information, so as to solve the problem of low identification accuracy rate of the existing card information identification method.
In order to solve the above technical problem, the embodiments of the present specification are implemented as follows:
an embodiment of the present specification provides a method for acquiring information, including:
acquiring an image to be identified;
identifying target characters which accord with preset character image characteristics in the image to be identified; the preset character image features are features contained in character images in the template image;
determining a target conversion matrix based on the coordinates of the target character;
adjusting the image to be recognized based on the target conversion matrix to obtain an adjusted image to be recognized;
and acquiring target information from the adjusted target area of the image to be recognized.
An apparatus for acquiring information provided by an embodiment of the present specification includes:
the image acquisition module is used for acquiring an image to be identified;
the character image recognition module is used for recognizing target characters which accord with preset character image characteristics in the image to be recognized; the preset character image features are features contained in character images in the template image;
the matrix determination module is used for determining a target conversion matrix based on the coordinates of the target character;
the image adjusting module is used for adjusting the image to be recognized based on the target conversion matrix to obtain an adjusted image to be recognized;
and the information identification module is used for acquiring target information from the target area of the adjusted image to be identified.
An apparatus for acquiring information provided in an embodiment of the present specification includes:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
acquiring an image to be identified;
identifying target characters which accord with preset character image characteristics in the image to be identified; the preset character image features are features contained in character images in the template image;
determining a target conversion matrix based on the coordinates of the target character;
adjusting the image to be recognized based on the target conversion matrix to obtain an adjusted image to be recognized;
and acquiring target information from the adjusted target area of the image to be recognized.
Embodiments of the present specification provide a computer readable medium having stored thereon computer readable instructions executable by a processor to implement a method of obtaining information.
One embodiment of the present description achieves the following advantageous effects:
in the embodiment of the description, a target conversion matrix for adjusting the image to be recognized is determined according to the coordinates of the target character by recognizing the target character in the image to be recognized, so as to obtain the adjusted image to be recognized, and target information is acquired from a target area of the adjusted image to be recognized. The image can be adjusted based on the character features in the image, so that the image can be more accurately matched, and the accuracy of information acquisition is further improved.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without any creative effort.
Fig. 1 is a schematic application scenario diagram of a method for acquiring information according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a method for acquiring information according to an embodiment of the present disclosure;
FIG. 3 is a diagram illustrating character association matching according to an embodiment of the present disclosure;
FIG. 4 is a schematic illustration of a template image provided in an example of the present specification;
FIG. 5 is a swim lane diagram of a method for obtaining information provided by an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an apparatus for acquiring information according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an apparatus for acquiring information according to an embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of one or more embodiments of the present disclosure more apparent, the technical solutions of one or more embodiments of the present disclosure will be described in detail and completely with reference to the specific embodiments of the present disclosure and the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present specification, and not all embodiments. All other embodiments that can be derived by a person skilled in the art from the embodiments given herein without making any creative effort fall within the scope of protection of one or more embodiments of the present specification.
The technical solutions provided by the embodiments of the present description are described in detail below with reference to the accompanying drawings.
In the prior art, when card information is identified, the card information is generally identified by using pixel Features of a card image, wherein SIFT (Scale-invariant feature transform) Features, Speeded Up Robust Features (SURF) Features, FAST (corner detection algorithm) Features, ORB (Oriented FAST and corner BRIEF) Features, and the like are generally used for image registration, and these image registration methods have poor robustness, low accuracy, and slow speed, and affect the identification efficiency and accuracy of an image.
In order to solve the defects in the prior art, the scheme provides the following embodiments:
fig. 1 is a schematic application scenario diagram of a method for acquiring information according to an embodiment of the present disclosure. As shown in fig. 1, the scheme may include an image to be recognized 1, a server 2, and an adjusted image to be recognized 3, where the server 2 may obtain the image to be recognized 1, recognize target characters in the image based on an image character recognition technology, determine a target conversion matrix for adjusting the image to be recognized according to the recognized target characters and a template image generated in advance, adjust the image to be recognized to obtain the adjusted image to be recognized 3, and obtain required target information from a target area of the adjusted image to be recognized 3.
Next, a method for acquiring information provided by an embodiment of the specification will be specifically described with reference to the accompanying drawings:
fig. 2 is a flowchart illustrating a method for acquiring information according to an embodiment of the present disclosure. From the viewpoint of a program, the execution subject of the flow may be a program installed in an application server or an application client.
As shown in fig. 2, the process may include the following steps:
step 202: and acquiring an image to be identified.
In the embodiment of the specification, the image to be recognized may be an image acquired or uploaded by a terminal, and the terminal may be a mobile phone, a computer, an intelligent watch, a car machine, or the like. The server can acquire the image to be identified collected or uploaded by the terminal.
Step 204: identifying target characters which accord with preset character image characteristics in the image to be identified; the preset character image features are features contained in character images in the template image.
In the embodiments of the present specification, the target Character in the image may be recognized based on an image Character Recognition technology, such as an OCR (Optical Character Recognition) technology. The target character may be text information such as a character and a symbol included in the image. The template image may be an image stored in the server in advance, and may be used as an adjustment reference for the image to be recognized. In practical applications, the template image may be provided by a user or determined by the server according to preset conditions.
The preset character image features may include characters' fonts, colors, sizes, text information, and the like. The character image may be an image in which the recognized character corresponds in the template image or the image to be recognized. In the embodiment of the present specification, image registration may be performed based on a target character, an image to be recognized may be adjusted, and the target character may include characters that can be recognized from both the image to be recognized and the template image.
Step 206: and determining a target conversion matrix based on the coordinates of the target character.
In practical application, when text information in an image is recognized, position information of the image corresponding to each character in the text information in the image to be recognized can be recognized, and the position information of the character can be represented in a coordinate mode.
Step 208: and adjusting the image to be recognized based on the target conversion matrix to obtain the adjusted image to be recognized.
In the embodiment of the specification, a target conversion matrix can be determined according to the coordinates of the target characters, the image to be recognized is adjusted, and the angle and the size of the adjusted image to be recognized are the same as those of the template image. In practical applications, when the deviation between the angle and the size of the adjusted image to be recognized and the template image is small or within an acceptable range, the angle and the size of the adjusted image to be recognized and the template image are the same.
Step 210: and acquiring target information from the adjusted target area of the image to be recognized.
In the embodiment of the description, a target conversion matrix for adjusting the image to be recognized is determined according to the coordinates of the target character by recognizing the target character in the image to be recognized, so as to obtain the adjusted image to be recognized, and target information is acquired from a target area of the adjusted image to be recognized. The image can be adjusted based on the character features in the image, and the character features are more accurate and have better robustness compared with the pixel features, so that the image matching can be more accurately performed, and the accuracy of information acquisition is improved.
In addition, in the embodiment of the specification, registration adjustment can be performed on the image to be recognized based on the template image, a large number of samples are not required to train the model for image registration, and the cost can be reduced.
It should be understood that the order of some steps in the method described in one or more embodiments of the present disclosure may be interchanged according to actual needs, or some steps may be omitted or deleted.
Based on the method of fig. 2, the present specification also provides some specific embodiments of the method, which are described below.
In practical application, certificate information may need to be provided when business transaction is performed, in this specification, information of a certificate may be extracted, and specifically, an image to be recognized may include a card image to be recognized. Such as identification cards, marriage cards, business licenses, overseas identification cards (english), marriage cards, house property cards, immotile property cards, admission tickets, and the like.
In the embodiment of the present specification, the template image may be a card image of the same type as the image to be identified, and information identification is performed based on the template images of the same type. For example, the image to be recognized is a national identification card, and the template image may also be a template image obtained from the national identification card. Specifically, before the step 204 identifies the target character in the image to be identified, which meets the preset character image characteristics, the method may further include:
determining a template image corresponding to the image to be identified; the template image is consistent with the category of the image to be identified.
In practical application, when the image to be recognized is recognized, a user can select the category of the image to be recognized, and the server can also determine the category according to the self-determination and determine the template image according to the category of the image to be recognized.
For example, when a user transacts a service using a terminal, the service requires the user to provide identification card information and then license information. Assuming that the user is required to provide the identity card information when the step A is carried out, the user can shoot or scan the identity card through the terminal, the server obtains an identity card image provided by the user, determines an identity card template image for registering the identity card image, and extracts the information in the identity card provided by the user according to the template image. Similarly, assuming that the user is required to provide the license information when the process goes to step B, the user may also take or scan the license through the terminal, the server obtains the license image provided by the user, determines a license template image for registering the license image, and extracts the information in the license provided by the user according to the template image. In practical application, the user may also select the category of the image to be recognized by himself, for example, in step a, the user may select the certificate to be recognized as the identification card first, then shoot or scan the identification card, and provide the identification card image to the server, so that the server recognizes and extracts the information.
In the embodiment of the present specification, association matching may be performed on the template image and the same characters included in the image to be recognized, and a target character is determined from the associated and matched characters. The identifying of the target character in the image to be identified, which conforms to the preset character image characteristics, may specifically include:
identifying a second character which is the same as text information corresponding to a first character from the image to be identified based on character features of the first character contained in the template image;
determining at least some of the second characters as the target characters.
In practical application, the first characters included in the template image may be determined based on an image character recognition technology such as OCR, wherein the first characters may be character information included in cards of the same type, and may represent fixed information in cards of the same type. The target character in the embodiment of the present specification may be a character included in both the template image and the image to be recognized.
Fig. 3 is a schematic diagram of character association matching provided in an embodiment of the present specification. As shown in fig. 3, it is assumed that the image to be recognized 32 is a certain identification card image, and the template image 31 is a template image of the same category corresponding to the image to be recognized, where the template image and the image to be recognized may be subjected to character recognition, the template image 31 and the same character in the image to be recognized 32 may be matched, and an association relationship between the same characters is established, that is, an association relationship between a first character and a second character is established. For example, the "last name" in the template image 31 corresponds to the "last name" in the image to be recognized 32, and can be regarded as a matching pair; the "live" in the template image 31 corresponds to the "live" in the image to be recognized 32, and can be regarded as a matching pair. In practical application, all or part of the same characters in the template image and the image to be recognized can be matched, and are not listed here.
In practical applications, when a character in an image is recognized by using an image character recognition technology, coordinates of the recognized character in the image may also be obtained, in an embodiment of the present specification, a target transformation matrix may be obtained based on the coordinates of the character, specifically, in the embodiment of the present specification, the determining the target transformation matrix based on the coordinates of the target character specifically includes:
acquiring a first coordinate of the target character in the template image;
acquiring a second coordinate of the target character in the image to be recognized;
and obtaining the target conversion matrix based on the first coordinate and the second coordinate.
In this embodiment of the present specification, a target transformation matrix may be obtained according to a formula X — M × U, where X denotes a first coordinate of a target character in a template image, M denotes the target transformation matrix, and U denotes a second coordinate of the target character in an image to be recognized.
For a two-dimensional planar image, this can be expressed specifically as
Figure BDA0003442387860000061
Wherein the first coordinate X is (X, y), the second coordinate U is (U, v), and the target transformation matrix M is
Figure BDA0003442387860000062
Considering that in practical application, there may be an image to be recognized or a template image itself containing the same characters, for example, a name of a person contains a "raw" word, and an identification card image of the person contains two identical "raw" words, one "raw" word in "raw" and one "raw" word in the name, so that when character matching is performed, there may be a case where the "raw" word in "raw" is matched with the "raw" word in the name, and if the target conversion matrix is calculated by using the pair of matched characters, it may be inaccurate, and may also affect the recognition of target information. In order to improve the accuracy of the target transformation matrix and improve the accuracy of information identification, in this embodiment of the present specification, the obtaining the target transformation matrix based on the first coordinate and the second coordinate specifically includes:
obtaining a pending transformation matrix based on the first coordinate and the second coordinate;
adjusting the image to be identified based on the to-be-determined conversion matrix to obtain an image to be determined and adjusted;
acquiring a preset number of third characters in the image to be determined and adjusted;
acquiring a fourth character which is in the same text information as the third character and corresponds to the template image;
and judging whether the conversion matrix to be determined is the target conversion matrix or not based on the distance between the coordinate of the third character in the image to be determined and adjusted and the coordinate of the fourth character in the template image.
In the embodiment of the present specification, the accuracy of the conversion matrix obtained according to the first coordinate and the second coordinate may be verified according to the coordinate distance between the third character and the fourth character, and then, the correct conversion matrix may be used to perform image adjustment, so as to further accurately obtain the target information.
As an implementation manner, in this embodiment of the present description, the determining whether the pending transformation matrix is the target transformation matrix may specifically include:
calculating the coordinate distance between each third character and the corresponding fourth character;
counting the number of characters of a third character of which the coordinate distance is smaller than or equal to a preset distance;
and if the number of the characters is greater than or equal to the number of preset characters, determining the to-be-determined conversion matrix as the target conversion matrix.
In practical application, the third character and the fourth character may be characters having a matching relationship, a coordinate distance between the characters may be calculated according to coordinate information of the third character and the fourth character, and the smaller the coordinate distance between the third character and the corresponding fourth character is, the more accurate the obtained to-be-determined conversion matrix is. In the embodiment of the present specification, a preset number of characters may be selected for verification calculation, and when the number of characters whose corresponding coordinate distance is less than or equal to the preset distance is larger, it can be said that the more accurate the to-be-determined conversion matrix is.
In order to further improve the accuracy of the verification, in this embodiment of the present specification, the third character may be a character other than the target character in the image to be determined and adjusted.
In practical application, the number of characters for verifying the matrix to be converted can be set according to requirements, and the characters can be all characters with matching relation or partial characters; the preset distance and the preset number of characters can also be set according to actual requirements, and are not specifically limited herein. For example, the number of the preset characters may be a specific numerical value, or may be a ratio of a preset number corresponding to the third character, for example, when the number of the characters of the third character whose coordinate distance is less than or equal to the preset distance is greater than or equal to half of the total number of the third characters, it may be determined that the to-be-determined conversion matrix is determined as the target conversion matrix.
In the embodiment of the present specification, the number of the target characters may be determined according to the calculation requirement of the conversion matrix, for example, when the template image and the image to be recognized are two-dimensional images, the number of the target characters should be greater than or equal to 4.
In this embodiment of the present specification, if the number of the third characters whose coordinate distances obtained by statistics are smaller than or equal to the preset distance is smaller than the preset number of characters, it may be determined that the accuracy of the to-be-determined conversion matrix is not sufficient, and the to-be-determined conversion matrix cannot be used as the target conversion matrix. If the pending conversion matrix cannot be used as the target conversion matrix, the characters used for calculating the target conversion matrix can be reselected, and calculation and verification are performed by using the reselected characters, and the process can be the same as the above process, and is not described again here.
As an implementation manner, in this embodiment, the template image may also be adjusted, and the target conversion matrix is determined by the distance between the adjusted target image and the character in the image to be recognized. Specifically, the obtaining the target transformation matrix based on the first coordinate and the second coordinate may specifically include:
obtaining a pending transformation matrix based on the first coordinate and the second coordinate;
adjusting the template image based on the undetermined transformation matrix to obtain an adjusted template image;
acquiring a preset number of third characters in the image to be recognized;
acquiring a fourth character with the same text information corresponding to the third character in the adjusted template image;
and judging whether the conversion matrix to be determined is the target conversion matrix or not based on the distance between the coordinate of the third character in the image to be recognized and the coordinate of the fourth character in the adjusted template image.
In practical application, the target characters at least comprise characters with the minimum number of characters required for calculating the pending conversion matrix. Wherein, when judging whether the pending conversion matrix is the target conversion matrix, a plurality of groups of target characters can be selected, each group of target characters comprises the characters with the minimum number of characters required for calculating the pending conversion matrix, a plurality of pending conversion matrices can be obtained, then aiming at each pending conversion matrix, the characters which can accord with the pending conversion matrix in the image to be recognized or the template image are calculated, namely, all characters or other characters except the target characters in the image to be recognized are used as third characters, or all characters which have matching corresponding relations with the template image or other characters except the target characters in the image to be recognized are used as third characters, the coordinate distance between each third character and the corresponding fourth character is calculated for each pending conversion matrix, the number of the characters with the coordinate distance smaller than or equal to the preset distance is counted, the pending conversion matrix with the largest number of characters can be determined as the target conversion matrix.
In this embodiment, the mismatching points between the template image and the image to be recognized may be filtered according to a random sample consensus (random sample consensus) algorithm, and then the target transformation matrix is calculated by using the character coordinates with correct matching relationship.
In practical application, the recognition accuracy of image recognition technologies such as OCR can reach 99%, the conversion matrix verification mode can be used for dealing with 50% of wrong matching points, the matching accuracy between the template image and the image to be recognized in the embodiment of the specification can be more than 97% through verification, and the accuracy of image information recognition can be effectively improved.
The template images in the embodiments of the present specification may be images containing character information generally contained in images of the same category, so that the template images can identify different images to be identified of the same category. Determining a target character from characters contained in a template image, wherein the target character is a specific character in the image to be recognized; the specific characters may be characters included in different images to be recognized in the same category.
In practical applications, the template image may be understood as a template corresponding to an image to be recognized, and may contain some specific information at a specific position. For example, the template image used for identifying the identification card image may be an image including information such as "name", "sex", "birth", "national identification number", and the like.
In this example, a template image may be created in advance, position information of target information to be acquired may be determined from the template image, and then the target information in the image to be recognized may be determined from the position information. Specifically, in the embodiment of the present specification, the acquiring target information from the target area of the adjusted image to be recognized specifically may include:
determining a target field corresponding to the target information;
determining an information display area corresponding to the target field in the template image according to a preset area corresponding relation; the information display area is used for displaying the description information of the target field; the preset area corresponding relation comprises a target field and position information of an information display area corresponding to the target field;
determining target coordinates of the display area;
determining a region corresponding to the target coordinate in the adjusted image to be recognized as the target region;
identifying target information corresponding to the target field from an area corresponding to the target coordinate in the adjusted image to be identified; and the target information is information used for describing the target field in the adjusted image to be recognized.
In practical application, the target field can be determined according to the information acquisition requirement so as to extract the required information from the image to be identified. For example, when a user transacts a certain business, the user needs to provide information such as a name and an identification card number on an identification card, and the target field may be a "name", "a citizen identification number" in an identification card image. The specific target field may be set according to actual requirements, and is not specifically limited herein.
In the embodiment of the description, the image to be recognized can be adjusted according to the target transformation matrix, and the size and the angle of the adjusted image to be recognized are the same as those of the template image. In practical application, affine transformation, equidistant transformation, similarity transformation, projection transformation and the like can be performed on the image to be recognized based on characters in the image, and the image to be recognized can be registered to the template image.
The template image in the embodiment of the present specification may be an image with clear handwriting and a correct position provided by a user, and a corresponding relationship between a target field and an information display area in the template image may be established based on an operation of the user, so as to obtain information in an image to be recognized according to the corresponding relationship. In practical application, the template image and the card corresponding to the image to be recognized may be the same card or different cards in the same category. For example, the image to be recognized may be an image of a third identity card, and the template image may be an image of a fourth identity card or an image of a third identity card.
Before acquiring the image to be recognized, the embodiments of this specification may further include:
acquiring the template image;
determining a target character in the template image based on a first operation of a user on the template image;
determining an information display area corresponding to the target character in the template image based on a second operation of the user on the template image; the information display area is used for displaying the description information of the target character;
and obtaining the corresponding relation of the preset area according to the corresponding relation of the target character and the information display area.
In this example, the first operation and the second operation may be selection operations performed by a user, for example, in a terminal page on which a template image is displayed, operations such as checking, selecting, and pressing on the page may be performed, and a target character in the template image may be determined and marked through the first operation, where an area where the target character is located may be marked as a first specified color, for example, as red; through the second operation, the description information corresponding to the target character can be determined, and the information display area in which the description information can be displayed is marked, wherein the area in which the target character is located can be marked with a second specified color, for example, blue. The user may be the user who provides the image to be recognized, or may be a staff member of the system or application.
Fig. 4 is a schematic diagram of a template image provided in an example of the present specification. As shown in fig. 4, the target character 41 in the template image may be determined based on a first operation of the user, and the area where the target character 41 is marked is a first preset color; and determining an information display area 42 corresponding to the target character 41 in the template image based on the second operation of the user, wherein the information display area is marked to be in a second preset color. The target characters in the template image may be fixed information contained in images of the same category, such as "name", "gender", "ethnicity", "birth", "year", etc. marked by solid line frames as shown in fig. 4, and the area inside the solid line frame may be marked as a first preset color; the description information of the field corresponding to the target character in the template image may be variable information contained in the category image, such as "liquad", "men", "han", "1988" marked with a dashed box shown in fig. 4, and the region inside the dashed box may be marked with a second preset color.
In practical application, when the user performs the second operation, a character segment filling interface may be further displayed, the user may input a character segment corresponding to the information display area and formed by the target character in the character segment filling interface, and the server may acquire the character segment corresponding to the information display area, establish a corresponding relationship between the character segment including the target character and the information display area, and obtain a preset area corresponding relationship. Wherein the information display area may be represented by coordinates of a location where the area is located. In the embodiment of the present specification, the correspondence between the character segment and the information display area may be recorded in a key-value pair manner. The position information of the information display area may be expressed in the form of vertex coordinates, and when the information display area is rectangular, the information display area may be expressed in coordinates including at least a pair of diagonal vertices.
In this embodiment of the present disclosure, a mask operation may be performed on the marked template image to obtain an image including a target character, and then the target character and a coordinate corresponding to the target character are obtained according to an image character recognition technology, so that a conversion matrix for adjusting the image to be recognized is obtained by using the target character and the coordinate of the target character.
In the embodiment of the specification, the image to be recognized can be adjusted based on the template image, information in the image to be recognized is obtained, a large number of samples are not required for training, and compared with the method for deep learning which requires a large number of samples for training, the method provided in the embodiment of the specification can obtain the information in the image to be recognized only by using one card image with high quality as the template.
In addition, in practical applications, if the image to be recognized is an unusual card image, such as a qualified certificate of a licensed veterinarian, a printing license, etc., the application program used by the user may not have a process or program for extracting the card information, and the application program needs to be upgraded or the card information needs to be submitted in other ways, which also brings inconvenience to the user. In the embodiment of the specification, the template image for identifying the image to be identified can be established through the template image provided by the user, and then the information extraction of the image to be identified can be completed under the condition that the code is not modified or the application program is not updated, so that the user can self-define the identification template according to the actual requirement and complete the extraction of the image information, and the method is high in practicability and wide in application.
To more clearly illustrate the method for obtaining information provided in the embodiments of the present specification, fig. 5 is a swim lane diagram of a method for obtaining information provided in the embodiments of the present specification. As shown in fig. 5, the method may include an image acquisition stage, an image adjustment stage, and an information acquisition stage, and specifically may include:
step 502: acquiring an image to be identified;
step 504: determining a template image corresponding to an image to be identified;
step 506: acquiring target characters contained in an image to be recognized and a template image;
step 508: determining a target conversion matrix based on the coordinates of the target characters in the image to be recognized and the coordinates of the target characters in the template image;
step 510: adjusting the image to be recognized based on the target conversion matrix to obtain an adjusted image to be recognized;
step 512: determining an information display area corresponding to a target field corresponding to the information to be extracted in the template image according to the corresponding relation of the preset area;
step 514: determining coordinate information of the information display area;
step 516: determining a target display area corresponding to the coordinate information in the adjusted image to be recognized;
step 518: and acquiring target information from the target display area in the adjusted image to be recognized.
Based on the same idea, the embodiment of the present specification further provides a device corresponding to the above method. Fig. 6 is a schematic structural diagram of an apparatus for acquiring information according to an embodiment of the present disclosure. As shown in fig. 6, the apparatus may include:
an image obtaining module 602, configured to obtain an image to be identified;
the character recognition module 604 is configured to recognize a target character in the image to be recognized, where the target character corresponds to a preset character image feature; the preset character image features are features contained in character images in the template image;
a matrix determination module 606, configured to determine a target transformation matrix based on the coordinates of the target character;
an image adjusting module 608, configured to adjust the image to be recognized based on the target transformation matrix, so as to obtain an adjusted image to be recognized;
and an information identification module 610, configured to obtain target information from the target area of the adjusted image to be identified.
Based on the same idea, the embodiment of the present specification further provides a device corresponding to the above method.
Fig. 7 is a schematic structural diagram of an apparatus for acquiring information according to an embodiment of the present disclosure. As shown in fig. 7, the apparatus 700 may include:
at least one processor 710; and the number of the first and second groups,
a memory 730 communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory 730 stores instructions 720 executable by the at least one processor 710 to enable the at least one processor 710 to:
acquiring an image to be identified;
identifying target characters which accord with preset character image characteristics in the image to be identified; the preset character image features are features contained in character images in the template image;
determining a target conversion matrix based on the coordinates of the target character;
adjusting the image to be recognized based on the target conversion matrix to obtain an adjusted image to be recognized;
and acquiring target information from the adjusted target area of the image to be recognized.
Based on the same idea, the embodiment of the present specification further provides a computer-readable medium corresponding to the above method. The computer readable medium has stored thereon computer readable instructions executable by a processor to implement the above-described method of obtaining information.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus shown in fig. 7, since it is substantially similar to the method embodiment, the description is simple, and the relevant points can be referred to the partial description of the method embodiment.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital character system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate a dedicated integrated circuit chip. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, AtmelAT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium which can be used to store information which can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (14)

1. A method of obtaining information, comprising:
acquiring an image to be identified;
identifying target characters which accord with preset character image characteristics in the image to be identified; the preset character image features are features contained in character images in the template image;
determining a target conversion matrix based on the coordinates of the target character;
adjusting the image to be recognized based on the target conversion matrix to obtain an adjusted image to be recognized;
and acquiring target information from the adjusted target area of the image to be recognized.
2. The method of claim 1, the image to be identified comprising a card image to be identified.
3. The method of claim 1, before identifying a target character in the image to be identified, which meets a preset character image characteristic, further comprising:
determining a template image corresponding to the image to be identified; the template image is consistent with the category of the image to be identified.
4. The method according to claim 1, wherein the identifying of the target character in the image to be identified, which conforms to the preset character image characteristics, specifically comprises:
identifying a second character which is the same as text information corresponding to a first character from the image to be identified based on character features of the first character contained in the template image;
determining at least some of the second characters as the target characters.
5. The method according to claim 1, wherein determining the target transformation matrix based on the coordinates of the target character comprises:
acquiring a first coordinate of the target character in the template image;
acquiring a second coordinate of the target character in the image to be recognized;
and obtaining the target conversion matrix based on the first coordinate and the second coordinate.
6. The method according to claim 5, wherein the obtaining the target transformation matrix based on the first coordinate and the second coordinate specifically includes:
obtaining a pending transformation matrix based on the first coordinate and the second coordinate;
adjusting the image to be identified based on the to-be-determined conversion matrix to obtain an image to be determined and adjusted;
acquiring a preset number of third characters in the image to be determined and adjusted;
acquiring a fourth character which is in the same text information as the third character and corresponds to the template image;
and judging whether the conversion matrix to be determined is the target conversion matrix or not based on the distance between the coordinate of the third character in the image to be determined and adjusted and the coordinate of the fourth character in the template image.
7. The method according to claim 6, wherein the determining whether the pending transformation matrix is the target transformation matrix specifically includes:
calculating the coordinate distance between each third character and the corresponding fourth character;
counting the number of characters of a third character of which the coordinate distance is smaller than or equal to a preset distance;
and if the number of the characters is greater than or equal to the number of preset characters, determining the to-be-determined conversion matrix as the target conversion matrix.
8. The method of claim 6, the third character being a character in the image to be adjusted other than the target character.
9. The method of claim 1, the target character being a particular character in the image to be recognized; the specific characters are characters contained in different images to be recognized in the same category.
10. The method according to claim 1, wherein the obtaining of the target information from the target area of the adjusted image to be recognized specifically includes:
determining a target field corresponding to the target information;
determining an information display area corresponding to the target field in the template image according to a preset area corresponding relation; the information display area is used for displaying the description information of the target field;
determining target coordinates of the display area;
determining a region corresponding to the target coordinate in the adjusted image to be recognized as the target region;
identifying target information corresponding to the target field from an area corresponding to the target coordinate in the adjusted image to be identified; and the target information is information used for describing the target field in the adjusted image to be recognized.
11. The method of claim 10, prior to acquiring the image to be identified, further comprising:
acquiring the template image;
determining a target character in the template image based on a first operation of a user on the template image;
determining an information display area corresponding to the target character in the template image based on a second operation of the user on the template image; the information display area is used for displaying the description information of the target character;
and obtaining the corresponding relation of the preset area according to the corresponding relation of the target character and the information display area.
12. An apparatus for obtaining information, comprising:
the image acquisition module is used for acquiring an image to be identified;
the character recognition module is used for recognizing target characters which accord with preset character image characteristics in the image to be recognized; the preset character image features are features contained in character images in the template image;
the matrix determination module is used for determining a target conversion matrix based on the coordinates of the target character;
the image adjusting module is used for adjusting the image to be recognized based on the target conversion matrix to obtain an adjusted image to be recognized;
and the information identification module is used for acquiring target information from the target area of the adjusted image to be identified.
13. An apparatus for obtaining information, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
acquiring an image to be identified;
identifying target characters which accord with preset character image characteristics in the image to be identified; the preset character image features are features contained in character images in the template image;
determining a target conversion matrix based on the coordinates of the target character;
adjusting the image to be recognized based on the target conversion matrix to obtain an adjusted image to be recognized;
and acquiring target information from the adjusted target area of the image to be recognized.
14. A computer readable medium having computer readable instructions stored thereon which are executable by a processor to implement the method of obtaining information of any one of claims 1 to 11.
CN202111636198.9A 2021-12-29 2021-12-29 Method, device, equipment and medium for acquiring information Pending CN114299509A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111636198.9A CN114299509A (en) 2021-12-29 2021-12-29 Method, device, equipment and medium for acquiring information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111636198.9A CN114299509A (en) 2021-12-29 2021-12-29 Method, device, equipment and medium for acquiring information

Publications (1)

Publication Number Publication Date
CN114299509A true CN114299509A (en) 2022-04-08

Family

ID=80971179

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111636198.9A Pending CN114299509A (en) 2021-12-29 2021-12-29 Method, device, equipment and medium for acquiring information

Country Status (1)

Country Link
CN (1) CN114299509A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116343232A (en) * 2023-04-03 2023-06-27 内蒙古师范大学 Ancient book mathematical symbol recognition method based on pre-classification

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116343232A (en) * 2023-04-03 2023-06-27 内蒙古师范大学 Ancient book mathematical symbol recognition method based on pre-classification

Similar Documents

Publication Publication Date Title
US11361570B2 (en) Receipt identification method, apparatus, device and storage medium
CN111242124B (en) Certificate classification method, device and equipment
WO2018233055A1 (en) Method and apparatus for entering policy information, computer device and storage medium
US11367310B2 (en) Method and apparatus for identity verification, electronic device, computer program, and storage medium
CN112580707A (en) Image recognition method, device, equipment and storage medium
US11574492B2 (en) Efficient location and identification of documents in images
CN113490947A (en) Detection model training method and device, detection model using method and storage medium
CN112861842A (en) Case text recognition method based on OCR and electronic equipment
CN111507214A (en) Document identification method, device and equipment
CN112668580A (en) Text recognition method, text recognition device and terminal equipment
CN114299509A (en) Method, device, equipment and medium for acquiring information
CN110796145A (en) Multi-certificate segmentation association method based on intelligent decision and related equipment
CN112597940B (en) Certificate image recognition method and device and storage medium
CN111062262B (en) Invoice recognition method and invoice recognition device
CN111539424A (en) Image processing method, system, device and medium based on OCR
CN114220103B (en) Image recognition method, device, equipment and computer readable storage medium
CN115688166A (en) Information desensitization processing method and device, computer equipment and readable storage medium
CN115880702A (en) Data processing method, device, equipment, program product and storage medium
CN114445807A (en) Text region detection method and device
CN113128496B (en) Method, device and equipment for extracting structured data from image
CN114092684A (en) Text calibration method, device, equipment and storage medium
CN112287763A (en) Image processing method, apparatus, device and medium
CN111931557A (en) Specification identification method and device for bottled drink, terminal equipment and readable storage medium
Ou et al. ERCS: An efficient and robust card recognition system for camera-based image
CN112396057A (en) Character recognition method and device and electronic equipment

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