A method, device, computer equipment and storage medium for identifying seal information

By automatically identifying the seal position and field type, combined with text recognition technology, the problem of high cost and low efficiency of manual entry of seal information is solved, and efficient and accurate seal information entry is achieved.

CN113269102BActive Publication Date: 2024-08-23CHINA POST INFORMATION TECH (BEIJING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110591916.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-28
Publication Date
2024-08-23
Estimated Expiration
2041-05-28

AI Technical Summary

Technical Problem

In the existing technology, manual input of seal information is costly, efficient and accurate, and it is difficult to effectively deal with problems such as background clutter, seal tilt, uneven printing, and edge defects.

Method used

By obtaining the seal position information in the document picture, intercept the seal picture, and obtain the field position information and type in the seal picture, use the text recognition model to identify the field information, obtain the seal position information, field type and text information, and realize automatic recognition. and entry.

Benefits of technology

It improves the efficiency and accuracy of seal information entry, reduces the cost of manual entry, and enables efficient identification of various seal shapes and types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113269102B
    Figure CN113269102B
Patent Text Reader

Abstract

The present invention discloses a seal information recognition method, device, computer equipment and storage medium. The method comprises: obtaining a document image and the position information of a seal in the document image, and obtaining a seal image according to the position information of the seal; obtaining the position information of a field in the seal image, and obtaining a field image and a field type according to the position information of the field; performing text recognition on the field image, obtaining text information, and using the position information of the seal, the field type of the field in the seal and the text information as seal information. By using the technical solution of the present invention, automatic seal information recognition can be realized, thereby improving the efficiency and accuracy of seal information entry.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to image processing technology, and in particular to a seal information recognition method, device, computer equipment and storage medium. Background Art

[0002] With the rapid and stable economic development, the substantial growth of living and consumption levels, and the sharp increase in various types of bill business data with seals, the traditional information entry method has brought great challenges. Especially when entering seal information, there are usually problems such as messy background, seal tilt, uneven printing color, edge defects, etc., and there are many shapes and types of seals, which puts great pressure on the entry of seal information.

[0003] In the prior art, seal information is usually entered manually, but this manual entry method is costly and has low efficiency and accuracy. Summary of the invention

[0004] The embodiment of the present invention provides a seal information recognition method, device, computer equipment and storage medium to realize automatic seal information recognition, thereby improving the efficiency and accuracy of seal information entry.

[0005] In a first aspect, an embodiment of the present invention provides a seal information recognition method, the method comprising:

[0006] Obtaining a document image and location information of a seal in the document image, and obtaining a seal image according to the location information of the seal;

[0007] Get the location information of the field in the seal image, and get the field image and field type according to the location information of the field;

[0008] Perform text recognition on the field image to obtain text information, and use the seal position information, the field type of the field in the seal, and the text information as the seal information.

[0009] In a second aspect, an embodiment of the present invention further provides a seal information recognition device, the device comprising:

[0010] A seal image acquisition module is used to acquire a document image and the position information of the seal in the document image, and acquire the seal image according to the position information of the seal;

[0011] The field type acquisition module is used to obtain the position information of the field in the seal image, and obtain the field image and field type according to the field position information;

[0012] The text information recognition module is used to perform text recognition on the field image, obtain text information, and use the position information of the seal, the field type of the field in the seal, and the text information as the seal information.

[0013] In a third aspect, an embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a seal information recognition method as described in any one of the embodiments of the present invention is implemented.

[0014] In a fourth aspect, an embodiment of the present invention further provides a storage medium comprising computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are used to execute a seal information recognition method as described in any one of the embodiments of the present invention.

[0015] The embodiment of the present invention intercepts a seal image according to the position information of the seal in the document image, intercepts a field image according to the position information of the field in the seal image, determines the field type according to the field position information, performs text recognition on the field image to obtain text information, and uses the seal position information, field type and text information as seal information. The problem of high cost, low efficiency and low accuracy of manual input in the prior art is solved, and automatic recognition of seal information is realized, thereby improving the efficiency and accuracy of seal information input. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 is a flow chart of a seal information recognition method in Embodiment 1 of the present invention;

[0017] Figure 2 is a flow chart of a seal information recognition method in Embodiment 2 of the present invention;

[0018] Figure 3 It is a structural schematic diagram of a seal information recognition device in Embodiment 3 of the present invention;

[0019] Figure 4 It is a structural diagram of a computer device in Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0020] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0021] Embodiment 1

[0022] Figure 1It is a flow chart of a seal information recognition method provided in the first embodiment of the present invention. This embodiment is applicable to the situation of automatically recognizing seal information in a document. The method can be executed by a seal information recognition device, which can be implemented by software and / or hardware and is generally integrated in a computer device and used in conjunction with a photographing device.

[0023] like Figure 1 As shown, the technical solution of the embodiment of the present invention specifically includes the following steps:

[0024] S110, obtaining a document image and location information of a seal in the document image, and obtaining a seal image according to the location information of the seal.

[0025] The document image is an image obtained by scanning, photographing, etc. the document, which may be a bill, a file, etc. The document image includes a seal. Since the shape of the seal may be different, the position information of the seal may be the pixel coordinates of the center point of the seal or the center point of the smallest circumscribed circle of the seal in the document image, or the pixel coordinates of the vertices of the seal or the vertices of the smallest circumscribed rectangle of the seal in the document image, which is not limited in this embodiment.

[0026] The seal image is generated by cropping the document image according to the position information of the seal. The document image is cropped to generate the seal image. On the one hand, the document may contain multiple seals, and the seal information can be identified separately after cropping. On the other hand, it can improve the accuracy of subsequent field recognition.

[0027] In the embodiment of the present invention, seal position information is identified in a document image, and the document image is cropped to obtain a seal image.

[0028] S120, obtaining the position information of the field in the seal image, and obtaining the field image and the field type according to the position information of the field.

[0029] In the embodiment of the present invention, the field may include Chinese, English, pinyin, numbers and other forms, which are not limited in the present embodiment. The field image is a picture generated after the seal image is cropped, the seal image is subjected to field recognition, the position information of the field is obtained, and the seal image is cropped according to the position information of the field to obtain the field image.

[0030] The field type can be company name, number, time, etc. This embodiment does not limit this. The field type is determined based on the position information of the field. For example, the relative position of the field in the seal image can be determined based on the position information of the field, and the field type can be determined based on the relative position of the field.

[0031] S130, performing text recognition on the field image to obtain text information, and using the position information of the seal, the field type of the field in the seal, and the text information as the seal information.

[0032] After obtaining a seal image from a document image and a field image from the seal image, the field image is subjected to text information recognition to determine the text information corresponding to the field image. For example, when the field type is determined to be a number according to the field image, the field image is subjected to text recognition to determine the text information to be "AB1234". After obtaining the above information, the position information of the seal in the document image, the field type and text information corresponding to the field in the seal are used as seal information, and the seal information can be entered, thereby realizing automatic recognition and entry of seal information in the document.

[0033] The technical solution of this embodiment intercepts the seal image according to the position information of the seal in the document image, intercepts the field image according to the position information of the field in the seal image, determines the field type according to the field position information, performs text recognition on the field image to obtain text information, and uses the seal position information, field type and text information as seal information. The problem of high cost, low efficiency and accuracy of manual input in the prior art is solved, and automatic recognition of seal information is realized, thereby improving the efficiency and accuracy of seal information input.

[0034] Embodiment 2

[0035] Figure 2 It is a flow chart of a seal information recognition method provided in the second embodiment of the present invention. Based on the above embodiments, the embodiment of the present invention further specifies the process of obtaining seal position information, the process of obtaining field position information, the process of obtaining text information, and the process of judging field type, and adds the step of entering seal information.

[0036] Correspondingly, such as Figure 2 As shown, the technical solution of the embodiment of the present invention specifically includes the following steps:

[0037] S210, obtaining a document image.

[0038] S220: Obtaining the position information of the seal in the document image through a seal detection model.

[0039] Wherein, the seal detection model is obtained by training a neural network model according to a text detection algorithm.

[0040] In the embodiment of the present invention, a pre-trained seal detection model is used to perform seal recognition on a document image, and a document image with seal position information annotated is output. The seal detection model is trained based on a text detection algorithm, and the text detection algorithm may be a DB (Differentiable binarization) algorithm, but this embodiment does not limit this.

[0041] The training samples of the seal detection model include sample images after enhanced change processing, and the sample images include seals; the enhanced change processing includes at least one of the following: rotation, background color mixing setting and Gaussian noise processing; the training samples of the seal detection model include multiple types of sample images, and each type of sample image corresponds to a different seal type.

[0042] Before training the seal detection model, some or all of the sample images in the training samples are enhanced and changed. This setting can enhance the generalization ability of the model and improve the accuracy of the model in detecting seals. At the same time, selecting sample images corresponding to multiple seal types can make the trained seal detection model applicable to all types of seals.

[0043] Exemplarily, the rotation may be to rotate the sample image clockwise or counterclockwise by 0-30 degrees. The background color mixing setting may be to mix the background color of the sample image in the RGB (Red Green Blue) color space, but this embodiment does not limit the color mixing algorithm used. Gaussian noise is a type of noise whose probability density function obeys Gaussian distribution (i.e., normal distribution). Gaussian noise processing refers to adding Gaussian noise to the sample image.

[0044] S230: Obtain a seal image according to the position information of the seal.

[0045] The document image is cropped according to the position information of the seal to obtain the seal image.

[0046] S240. Obtaining the location information of the fields in the seal image through the field detection model.

[0047] The field detection model is obtained by training a neural network model according to a text detection algorithm.

[0048] In an embodiment of the present invention, a pre-trained field detection model is used to perform field recognition on a seal image, and a seal image with marked field position information is output. The field detection model is trained based on a text detection algorithm. For example, the text detection algorithm may also be a DB algorithm, but this embodiment does not limit this.

[0049] S250: Obtain a field image according to the location information of the field.

[0050] The seal image is cropped according to the position information of the field to obtain the field image.

[0051] S260: Determine the relative position of the field and the seal according to the position information of the field and the position information of the seal.

[0052] Exemplarily, the size of the seal can be determined according to the size of the seal image. When the distance from the field to the center of the seal is less than a preset distance according to the location information of the field and the location information of the seal, it can be determined that the field is located at the center of the seal. When the distance from the field to the edge of the seal is less than a preset distance according to the location information of the field and the location information of the seal, it can be determined that the field is located at the edge of the seal. The preset distance can be determined according to the size of the seal.

[0053] S270: Determine the field type according to the relative position and the mapping relationship between the relative position and the field type.

[0054] In an embodiment of the present invention, a mapping relationship between relative positions and field types is pre-stored. For example, a field located at the center of the seal can be mapped with a numbered field type, and a field located at the edge of the seal can be mapped with a company name, but this embodiment does not limit this.

[0055] Optionally, different mapping relationships may be set for different seal types, and the seal type may be determined according to a seal detection model.

[0056] In the embodiment of the present invention, the field type is determined according to the relative position of the field and the seal, which improves the speed of seal information recognition and the efficiency of seal information input.

[0057] S280. Obtain text information corresponding to the field image through a text recognition model.

[0058] Among them, the text recognition model is obtained by training the machine learning model according to the convolutional recurrent neural network algorithm.

[0059] The text recognition model is trained using the CRNN (Convolutional Recurrent Neural Network) algorithm based on multiple sample images annotated with text information.

[0060] S290: Use the position information of the seal, the field type of the field in the seal, and the text information as the seal information.

[0061] S2100, inputting the seal information according to a preset data format.

[0062] In the embodiment of the present invention, after obtaining the position information of the seal in the document image, the field type of the field and the text information, the seal information is entered according to a preset data format. Exemplarily, the seal information can be entered in XML format, but this embodiment does not limit this.

[0063] Embodiment 3

[0064] Figure 3 Schematic diagram of the structure of a seal information recognition device in Embodiment 3 of the present invention. Figure 3 As shown, the device includes: a seal image acquisition module 310, a field type acquisition module 320 and a text information recognition module 330. Among them:

[0065] The seal image acquisition module 310 is used to acquire the document image and the position information of the seal in the document image, and acquire the seal image according to the position information of the seal;

[0066] The field type acquisition module 320 is used to acquire the position information of the field in the seal image, and acquire the field image and the field type according to the position information of the field;

[0067] The text information recognition module 330 is used to perform text recognition on the field image, obtain text information, and use the position information of the seal, the field type of the field in the seal, and the text information as the seal information.

[0068] The technical solution of this embodiment intercepts the seal image according to the position information of the seal in the document image, intercepts the field image according to the position information of the field in the seal image, determines the field type according to the field position information, performs text recognition on the field image to obtain text information, and uses the seal position information, field type and text information as seal information. The problem of high cost, low efficiency and accuracy of manual input in the prior art is solved, and automatic recognition of seal information is realized, thereby improving the efficiency and accuracy of seal information input.

[0069] Based on the above embodiment, the seal image acquisition module 310 includes:

[0070] A seal position information detection unit, used to obtain the position information of the seal in the document image through a seal detection model;

[0071] Wherein, the seal detection model is obtained by training a neural network model according to a text detection algorithm.

[0072] On the basis of the above embodiment, the training samples of the seal detection model include sample images after enhanced change processing, and the sample images include seals;

[0073] The enhanced change processing includes at least one of the following: rotation, background color mixing setting, and Gaussian noise processing;

[0074] The training samples of the seal detection model include multiple types of sample images, and each type of sample image corresponds to a different seal type.

[0075] Based on the above embodiment, the field type acquisition module 320 includes:

[0076] A field position information detection unit, used to obtain the position information of the field in the seal image through a field detection model;

[0077] The field detection model is obtained by training a neural network model according to a text detection algorithm.

[0078] Based on the above embodiment, the field type acquisition module 320 includes:

[0079] A relative position determination unit, used to determine the relative position of the field and the seal according to the position information of the field and the position information of the seal;

[0080] The field type determination unit is used to determine the field type according to the relative position and the mapping relationship between the relative position and the field type.

[0081] Based on the above embodiment, the text information recognition module 330 includes:

[0082] A text information acquisition unit, used to acquire text information corresponding to the field image through a text recognition model;

[0083] Among them, the text recognition model is obtained by training the machine learning model according to the convolutional recurrent neural network algorithm.

[0084] Based on the above embodiment, the device further includes:

[0085] The seal information input module is used to input the seal information according to a preset data format.

[0086] The seal information recognition device provided in the embodiment of the present invention can execute the seal information recognition method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0087] Embodiment 4

[0088] Figure 4 A schematic diagram of the structure of a computer device provided in Embodiment 4 of the present invention is shown in FIG. Figure 4As shown, the computer device includes a processor 70, a memory 71, an input device 72 and an output device 73; the number of processors 70 in the computer device can be one or more. Figure 4 A processor 70 is taken as an example; the processor 70, memory 71, input device 72 and output device 73 in the computer device can be connected by a bus or other means. Figure 4 The example of connecting through bus is taken in the following.

[0089] The memory 71 is a computer-readable storage medium that can be used to store software programs, computer executable programs and modules, such as the modules corresponding to the seal information recognition method in the embodiment of the present invention (for example, the seal image acquisition module 310, the field type acquisition module 320 and the text information recognition module 330 in the seal information recognition device). The processor 70 executes various functional applications and data processing of the computer device by running the software programs, instructions and modules stored in the memory 71, that is, realizing the above-mentioned seal information recognition method. The method includes:

[0090] Obtaining a document image and location information of a seal in the document image, and obtaining a seal image according to the location information of the seal;

[0091] Get the location information of the field in the seal image, and get the field image and field type according to the location information of the field;

[0092] Perform text recognition on the field image to obtain text information, and use the seal position information, the field type of the field in the seal, and the text information as the seal information.

[0093] The memory 71 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 71 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 71 may further include a memory remotely arranged relative to the processor 70, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0094] The input device 72 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the computer device. The output device 73 may include a display device such as a display screen.

[0095] Embodiment 5

[0096] Embodiment 5 of the present invention further provides a storage medium containing computer executable instructions, wherein the computer executable instructions are used to execute a seal information recognition method when executed by a computer processor, the method comprising:

[0097] Obtaining a document image and location information of a seal in the document image, and obtaining a seal image according to the location information of the seal;

[0098] Get the location information of the field in the seal image, and get the field image and field type according to the location information of the field;

[0099] Perform text recognition on the field image to obtain text information, and use the seal position information, the field type of the field in the seal, and the text information as the seal information.

[0100] Of course, the computer executable instructions of a storage medium including computer executable instructions provided by an embodiment of the present invention are not limited to the operations of the method described above, but can also execute related operations in the seal information recognition method provided by any embodiment of the present invention.

[0101] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0102] It is worth noting that in the embodiment of the above-mentioned seal information recognition device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific name of each functional unit is only for the convenience of distinguishing each other, and is not used to limit the scope of protection of the present invention.

[0103] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A seal information recognition method, It is characterized in that include: Obtaining a document image and location information of a seal in the document image, and obtaining a seal image according to the location information of the seal; Get the location information of the field in the seal image, and get the field image and field type according to the location information of the field; Get the field type based on the field's location information, including: According to the position information of the field and the position information of the seal, the relative position of the field and the seal is determined, including: If it is determined according to the position information of the field and the position information of the seal that the distance from the field to the center point of the seal is less than the preset distance, the relative position of the field and the seal is determined to be the center position; If it is determined according to the position information of the field and the position information of the seal that the distance from the field to the edge of the seal is less than the preset distance, then the relative position of the field and the seal is determined to be the edge position; Determine the field type according to the relative position and the mapping relationship between the relative position and the field type; Among them, the mapping relationship between the relative position and the field type matches the seal type; Perform text recognition on the field image to obtain text information, and use the seal position information, the field type of the field in the seal, and the text information as the seal information.

2. The method according to claim 1, It is characterized in that Obtaining the location information of the seal in the document image includes: Obtaining the location information of the seal in the document image through the seal detection model; Wherein, the seal detection model is obtained by training a neural network model according to a text detection algorithm.

3. The method according to claim 2, It is characterized in that The training samples of the seal detection model include sample images after enhanced change processing, and the sample images include seals; The enhanced change processing includes at least one of the following: rotation, background color mixing setting, and Gaussian noise processing; The training samples of the seal detection model include multiple types of sample images, and each type of sample image corresponds to a different seal type.

4. The method according to claim 1, It is characterized in that The step of obtaining the location information of the fields in the seal image includes: Obtain the location information of the fields in the seal image through the field detection model; The field detection model is obtained by training a neural network model according to a text detection algorithm.

5. The method according to claim 1, It is characterized in that The step of performing text recognition on the field image to obtain text information includes: Obtain the text information corresponding to the field image through the text recognition model; Among them, the text recognition model is obtained by training the machine learning model according to the convolutional recurrent neural network algorithm.

6. The method according to claim 1, It is characterized in that After the seal position information, the text information of the field in the seal, and the field type are used as the seal information, it also includes: The seal information is input according to a preset data format.

7. A seal information recognition device, It is characterized in that include: A seal image acquisition module is used to acquire a document image and the position information of the seal in the document image, and acquire the seal image according to the position information of the seal; The field type acquisition module is used to obtain the position information of the field in the seal image, and obtain the field image and field type according to the field position information; Field type acquisition module, including: A relative position determination unit, used to determine the relative position of the field and the seal according to the position information of the field and the position information of the seal; The relative position determination unit is specifically used for: If it is determined according to the position information of the field and the position information of the seal that the distance from the field to the center point of the seal is less than the preset distance, the relative position of the field and the seal is determined to be the center position; If it is determined according to the position information of the field and the position information of the seal that the distance from the field to the edge of the seal is less than the preset distance, then the relative position of the field and the seal is determined to be the edge position; A field type determination unit, used to determine the field type according to the relative position and the mapping relationship between the relative position and the field type; Among them, the mapping relationship between the relative position and the field type matches the seal type; The text information recognition module is used to perform text recognition on the field image, obtain text information, and use the position information of the seal, the field type of the field in the seal, and the text information as the seal information.

8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the seal information recognition method as described in any one of claims 1 to 6 is implemented.

9. A storage medium containing computer executable instructions, It is characterized in that The computer executable instructions are used to execute the seal information recognition method as described in any one of claims 1 to 6 when executed by a computer processor.