General seal detection system used in complex environment

By introducing data preprocessing and OCR identification modules into the seal detection system, combining seal object detection and environmental recognition, the accuracy problem of the existing system in detecting different seals and multiple scenarios is solved, and high-precision and fast seal detection are achieved , suitable for file verification in multiple scenarios.

CN119091462APending Publication Date: 2024-12-06COLORFUL GUIZHOU IMPRESSION NETWORK MEDIA CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411194232.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The existing seal detection system is poor when detecting seals of different shapes, sizes and colors, and the detection accuracy is affected when the quality of images or videos is poor, and the generalization is poor, and it cannot adapt to multiple scenarios. It requires a large amount of training data. and computing resources.

Method used

A general system for seal detection in complex environments is designed, including data input, data preprocessing, OCR recognition and seal detection. The pictures in PDF files are extracted through data preprocessing, and text information is extracted using the OCR recognition module, and combined with Seal target detection and environmental-based seal type recognition output image type, seal position and confidence value to achieve high-precision seal detection in different scenarios.

Benefits of technology

It realizes high-precision seal detection in different scenarios, quickly and accurately positioning the seal position, avoiding manual review errors, improves work efficiency and reduces error rates, and is suitable for review processes such as contract signing and bank account opening.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119091462A_ABST
    Figure CN119091462A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of seal detection, in particular to a seal detection universal system used in a complex environment, which comprises data input, data preprocessing, OCR identification, seal detection and data output, and is characterized in that the output end of the data input is electrically connected with the input end of the data preprocessing, the output end of the data preprocessing is electrically connected with the input end of the OCR identification, and the output end of the data preprocessing is electrically connected with the input end of the seal detection; the output end of the OCR is electrically connected with the input end of the seal detector, and the output end of the seal detector is electrically connected with the input end of the data output; according to the information output by the OCR recognition module and the target detection output information, text positioning is carried out, and finally the picture type, the seal position information and the confidence coefficient value can be obtained for reference of a user so as to verify the legality and validity of a file. Seal identification is carried out for different scenes, and seal detection can be carried out on documents in different scenes, so that high-precision detection service and seal position information are obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of seal detection, in particular to a universal seal detection system used in complex environments. Background Art

[0002] Seals are mainly used to sign, authenticate and approve documents, contracts, certificates, etc. to ensure the legitimacy and integrity of the documents. It can prevent documents from being tampered with and forged, and ensure the authenticity and credibility of the documents. In many occasions, such as contract signing, bank account opening, company registration, etc., seals are required to verify identity and authorization. Seal detection technology is mainly used to detect whether there are seals in images or videos, helping people to quickly and accurately detect and verify the legitimacy and validity of documents. A fast and efficient seal detection system is extremely important. It can automatically detect seals, avoid negligence and errors that may occur in manual review, improve work efficiency, reduce error rates, and enable efficient development of corporate business.

[0003] So far, there are many systems for seal detection, such as: seal detection system based on image processing, which preprocesses the seal image, such as grayscale, binarization, denoising, etc., and then uses morphology, edge detection and other technologies to extract the seal contour. Finally, by comparing the extracted contour with the pre-set standard contour, it is determined whether it is a valid seal. Seal detection system based on traditional deep learning: This method uses deep learning models such as convolutional neural network (CNN) to train seal images to achieve automatic seal detection. Although these methods can achieve seal detection to a certain extent, there are still many problems in the use process, such as: a. The detection effect may be different for seals of different shapes, sizes, and colors; b. For poor image or video quality, the detection accuracy will be affected; c. A large amount of training data and computing resources are required; d. The system has poor generalization and can only be applied in specific scenarios. The seal detection effect is not good after changing the scenario. Summary of the invention

[0004] The purpose of the present invention is to provide a general seal detection system for complex environments to solve the problem of detecting whether there is a seal and the seal type in a document according to different user requirements and returning detection information as proposed in the above background technology.

[0005] To achieve the above object, the present invention provides the following technical solutions: A general seal detection system for complex environments includes data input, data preprocessing, OCR recognition, seal detection and data output, wherein the output end of the data input is electrically connected to the input end of the data preprocessing, the output end of the data preprocessing is electrically connected to the input end of the OCR recognition, the output end of the OCR recognition is electrically connected to the input end of the seal detection, and the output end of the seal detection is electrically connected to the input end of the data output.

[0006] As a preferred solution of the present invention, the OCR recognition includes text positioning, text direction detection, text recognition and image classification.

[0007] As a preferred solution of the present invention, the input terminals of text positioning, text direction detection, text recognition and image classification are all electrically connected to the output terminal of OCR recognition.

[0008] As a preferred solution of the present invention, the seal detection includes seal target detection and seal type recognition based on environment.

[0009] As a preferred solution of the present invention, the input ends of the seal target detection and the seal type recognition based on the environment are both electrically connected to the output end of the seal detection.

[0010] As a preferred solution of the present invention, the data output includes picture type information, seal position information and confidence value respectively.

[0011] As a preferred solution of the present invention, the input ends of the picture type information, seal position information and confidence value are all electrically connected to the output end of the data output.

[0012] As a preferred solution of the present invention, the data preprocessing includes image detection and image processing respectively.

[0013] As a preferred solution of the present invention, the output ends of the image detection and image processing are both electrically connected to the input end of the data preprocessing.

[0014] As a preferred solution of the present invention, the text direction detection includes text distortion and text inclination, and the text recognition includes semantic analysis, n-character and pattern recognition and n-text database clustering classification.

[0015] Compared with the prior art, the present invention has the following beneficial effects: 1. In the present invention, the image extraction in the PDF file required by the user is mainly realized through data input, data preprocessing, OCR recognition, seal detection and data output, and the seal position and seal type in the image are detected. The intelligent extraction, seal detection and seal positioning of the image in the PDF document provide users with fast and accurate seal detection services, and help to efficiently locate the seal position. The data preprocessing module extracts the img image from the input PDF file and performs data enhancement processing on the image. The OCR recognition module extracts the text information in the image into a text format and classifies the image accordingly. The seal detection module performs seal target detection on the input image, and performs text positioning according to the information output by the OCR recognition module and the target detection output information. Finally, the image type, seal position information and confidence value can be obtained for user reference to verify the legitimacy and validity of the file. The text recognition mechanism constructed by this system performs text recognition and classification on the image to perform seal recognition for different scenes. This system performs seal detection on documents in different scenes to obtain high-precision detection services and seal position information.

[0016] 2. The present invention can be applied to seal detection in various scenarios with PDF files as input, such as contract signing, bank account opening, company registration, etc., where it is necessary to verify whether the document is valid and legal. This system is mainly used to detect whether there is a seal in the image of the PDF file, helping people to quickly and accurately detect and verify the legality and validity of the document. It can automatically detect seals, avoid negligence and errors that may occur in manual review, improve work efficiency, reduce error rate, and enable efficient development of corporate business. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a schematic diagram of the framework design of the present invention; Figure 2 It is a schematic diagram of the OCR recognition flow chart of the present invention.

[0018] In the figure: 1. Data input; 2. Data preprocessing; 201. Image detection; 202. Image processing; 3. OCR recognition; 301. Text positioning; 302. Text direction detection; 303. Text recognition; 304. Image classification; 4. Seal detection; 401. Seal target detection; 402. Environment-based seal type recognition; 5. Data input; 501. Image type information; 502. Seal location information; 503. Confidence value. DETAILED DESCRIPTION

[0019] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0020] For examples, see Figure 1-2 , the present invention provides a technical solution: A general seal detection system for complex environments comprises a data input 1, a data preprocessing 2, an OCR recognition 3, a seal detection 4 and a data output 5, wherein the output end of the data input 1 is electrically connected to the input end of the data preprocessing 2, the output end of the data preprocessing 2 is electrically connected to the input end of the OCR recognition 3, the output end of the OCR recognition 3 is electrically connected to the input end of the seal detection 4, the output end of the seal detection 4 is electrically connected to the input end of the data output 5, the OCR recognition 3 comprises a text positioning 301, a text direction detection 302, a text recognition 303 and a picture classification 304, the input ends of the text positioning 301, the text direction detection 302, the text recognition 303 and the picture classification 304 are all electrically connected to the output end of the OCR recognition 3, the seal detection 4 comprises a seal target detection 401 and an environment-based seal type recognition 402, the input ends of the seal target detection 401 and the environment-based seal type recognition 402 are all electrically connected to the output end of the seal detection 4.

[0021] Among them, it mainly realizes the extraction of pictures in the PDF file that the user requires to input, and detects the seal position and seal type in the picture. The intelligent extraction, seal detection and seal positioning of pictures in PDF documents provide users with fast and accurate seal detection services, helping to efficiently locate the seal position. The data preprocessing module extracts the img picture from the input PDF file and performs data enhancement processing on the picture. The OCR recognition module extracts the text information in the picture into text format and classifies the picture accordingly. The seal detection module performs seal target detection on the input picture, and locates the text according to the information output by the OCR recognition module and the target detection output information. Finally, the picture type information 501, seal position information 502 and confidence value 503 can be obtained for user reference to verify the legality and validity of the file.

[0022] In this embodiment, Figure 1 and Figure 2As shown, the data output 5 includes picture type information 501, seal position information 502 and confidence value 503 respectively, and the input ends of the picture type information 501, the seal position information 502 and the confidence value 503 are electrically connected to the output end of the data output 5. The data preprocessing 2 includes picture detection 201 and picture processing 202 respectively, and the output ends of the picture detection 201 and the picture processing 202 are electrically connected to the input end of the data preprocessing 2. The text direction detection 302 includes text distortion and text tilt. The text recognition 303 includes semantic analysis, n character and pattern recognition and n text database clustering classification.

[0023] Among them, it can be applied to seal detection in various scenarios with PDF files as input, such as contract signing, bank account opening, company registration, etc. During the review process, it is necessary to verify whether the document is valid and legal. This system is mainly used to detect whether there is a seal in the image of the PDF file, helping people to quickly and accurately detect and verify the legality and validity of the document. It can automatically detect seals, avoid negligence and errors that may occur in manual review, improve work efficiency, reduce error rate, and enable efficient development of corporate business.

[0024] Workflow of the present invention: When the general seal detection system designed by this scheme for complex environments is working, data preprocessing plays a key role in ensuring the smooth completion of downstream tasks. It makes the original data more suitable for system calculation. Through appropriate data preprocessing, the effect of downstream tasks can be significantly improved, and the effect of getting twice the result with half the effort can be achieved. The specific process is: 1) Image detection. First, read the PDF file input by the system and parse the text and images in it. Specifically, traverse each page in the PDF file, convert the page into an image object (Image), and then determine whether there is an image by checking the image mode, size, pixels and other information. When an image is detected, extract the image, and determine the resolution of the image at the same time, and filter out the images with low resolution. Save the high-resolution images to the specified folder. The resolution of the final saved image is about 800*1100 (up or down 20pix).

[0025] (1) Image processing. The images extracted from PDF files are limited, and poor image quality will cause inaccurate system recognition. Diversified transformations of the extracted images can generate more diverse and richer data, thereby increasing the diversity of the data and improving the recognition effect of the system. Therefore, appropriate transformations of the images, such as scaling, rotating, and cropping, can expand the amount of data, increase the diversity and degree of change of the data, and thus improve the recognition effect and generalization ability of the system. OCR recognition. OCR determines the shape of the text and extracts the information in it by analyzing the brightness and darkness distribution pattern of the text in the paper or image document. Then, using the character recognition method, the obtained text is converted into a computer-recognizable character code, thereby converting the text content in the image into text format. Its main purpose is to extract text information carried by the image and turn it into text data that can be edited and processed. The OCR recognition module includes four processes: text positioning, text direction detection, text recognition, and image classification.

[0026] 1) Text localization: Use edge detection, connected region analysis and other technologies to detect and locate text areas in input images, and identify the location, layout and coordinate range of text information in the image.

[0027] 2) Text direction detection. In practical applications, the text area in the input image may have a variety of layouts, tilt, distortion, etc. Directly using the rectangular box of target detection or the corner box of OCR text positioning often cannot fully capture the effective information of the text area, resulting in poor recognition effect. Therefore, in order to improve the text recognition effect, we need to perform geometric changes and deformity correction on the input image to ensure the correctness and integrity of the text area in a unified direction.

[0028] 3) Text recognition, which is used to extract text information from non-text media such as pictures or scans. It processes the image through a specific algorithm, identifies the text features, and compares them with a text database to ultimately convert the text in the image into readable text output. OCR recognition, or optical character recognition, is a common text recognition method. It recognizes by line, because in the text recognition process, the same category target area usually contains multiple lines of text information. Therefore, after OCR recognition, multiple lines of text recognition results will be obtained. In order to obtain complete text information, we need to merge or splice these returned results to form a coherent text paragraph.

[0029] Image classification, after OCR recognition, we get complete text information, which contains various file information, such as file type, file name, etc. Based on this information, we classify the images into different categories, which can be roughly divided into two types: Type 1 and Type 2. Next, we can identify the seals in the image according to different types and perform different processing.

[0030] (2) Seal detection. The main function of this module is to detect, locate and classify seals in documents in different scenarios. This module is divided into two parts: seal target detection and environment-based seal type recognition. In seal target detection, the module will perform seal detection and seal classification recognition on the document in the input image, and output the seal type and positioning information. The environment-based seal type recognition part further processes documents in different environments based on the results of the OCR recognition stage, and gives the recognition results and seal location information. This can more accurately distinguish seal types and provide more detailed information. The specific process is as follows: 1) Seal target detection. The seal target detection process is based on the YoloV7 target detection algorithm to achieve seal target detection and perform preliminary classification of target categories. Compared with similar target detection algorithms, the YoloV7 algorithm achieves both good detection and classification performance, and is currently the only detector that can still exceed 30FPS under high precision (optimal accuracy 56.8% AP). The algorithm can adaptively constrain the size range of the detection target to achieve the effect of accelerating detection and reducing false detections. It is also lighter and more efficient among similar detection algorithms.

[0031] The seal target detection process takes the document image img, the detection threshold thresh_detec and the target intersection threshold thresh_nms as input, detects and locates the seal targets such as the upper left corner, lower left corner, blank space, and lower right corner, and limits the detection of abnormal targets according to the detection threshold thresh_detec, and limits the overlap detection degree between seals according to the target intersection threshold thresh_nms, and obtains the target positioning and classification information list seal_detec:seal_detec:[{pos 1 , cls 1 ,score 1},{pos 2 , cls 2 , score 2},...,{pos i , cls i , score i}], where pos i ,cls i 、scorei Identify the location information, category information and confidence of the seal target respectively, pos i The format is {x, y, w, h}, which indicates the positioning coordinates and area size.

[0032] 2) Environment-based seal type recognition. In the image classification part of OCR recognition, the images classified can be divided into two types of images (type 1 and type 2) according to the file information. In the environment-based seal type recognition process, different image types are divided into two categories: location-based (type 1) and category-based (type 2). Different types are processed in different ways.

[0033] ① Based on position (type 1), usually in target recognition, the category information output by the model can be used as the category output to meet user needs. However, sometimes the category information directly output by the model is not the final result required by the user. In order to meet the needs of users, we further process the type information output by the model. When the OCR recognition part outputs the image category, the text information and text location information in the image will be saved. In the location-based (type 1) type, the text information and text location information saved in the OCR stage and the seal positioning information will be used for judgment. Specifically: Step 1: Take the text information and location information of type 1 in the image classification stage as input, and filter and locate T according to keyword A. A Line Text {T A,1 ,T A,2 ,T A,3 ,...,T A,n}, get T A Line text position information P A ={P A,X ,P A,y ,P A,w ,P A,h ,}, Similarly, filter and locate T based on keyword B B Line Text {T B,1 ,T B,2 ,T B,3 ,...,T B,n}, get T B Line text position information P B ={P B,X ,P B,y ,P B,w ,P B,h ,}.

[0034] Step 2: Sequence the seal positioning information pos in the seal target detection stage i= {x, y, w, h} and text position information P A , T BMake a judgment. If P A,y < y and w < P B,w , then determine the picture as V and output {label: 'V', pos: pos i , score: score i}, where label, pos, and score represent picture type information, seal positioning information, and confidence level respectively. Otherwise, determine the picture as N and output {label: 'N', pos:[], score:[]}, where N represents picture type information and [] represents a null value.

[0035] ② Based on the category (type 2), use the target positioning, classification information, and confidence level list seal_detec: [{pos 1 , cls 1 , score 1}, {pos 2 , cls 2 , score 2},..., {pos i , cls i , score i}] in the seal target detection stage as the input object. According to the positioning information pos i and the classification information cls i , further judge the picture type. If the classification in cls i is "bottom right corner" and the x in pos i is greater than the threshold s 1 , and the y is greater than the threshold s 2 , mark the picture type as "At_co" and output {label: 'At_co', pos: pos i , score: score i}; if the classification in cls i is "blank", mark the picture type as "blank" and output {label: 'blank', pos: pos i , score: score i}; if the classification information in cls i is not one of the two, mark the picture type as "other" and output {label: 'other', pos: pos i , score: score i}.

[0036] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A general seal detection system for complex environments, comprising data input (1), data preprocessing (2), OCR recognition (3), seal detection (4) and data output (5), characterized in that: The output end of the data input (1) is electrically connected to the input end of the data preprocessing (2), the output end of the data preprocessing (2) is electrically connected to the input end of the OCR recognition (3), the output end of the OCR recognition (3) is electrically connected to the input end of the seal detection (4), and the output end of the seal detection (4) is electrically connected to the input end of the data output (5).

2. A general seal detection system for use in complex environments according to claim 1, characterized in that: The OCR recognition (3) includes text positioning (301), text direction detection (302), text recognition (303) and image classification (304).

3. A general seal detection system for complex environments according to claim 2, characterized in that: The input ends of the text positioning (301), text direction detection (302), text recognition (303) and image classification (304) are all electrically connected to the output end of the OCR recognition (3).

4. The general seal detection system for complex environments according to claim 1, characterized in that: The seal detection (4) includes seal target detection (401) and seal type recognition based on the environment (402).

5. A general seal detection system for complex environments according to claim 4, characterized in that: The input ends of the seal target detection (401) and the environment-based seal type recognition (402) are both electrically connected to the output end of the seal detection (4).

6. The general seal detection system for complex environments according to claim 1, characterized in that: The data output (5) includes picture type information (501), seal position information (502) and confidence value (503).

7. A general seal detection system for complex environments according to claim 6, characterized in that: The input ends of the image type information (501), the seal position information (502) and the confidence value (503) are all electrically connected to the output end of the data output (5).

8. The universal seal detection system for complex environments according to claim 1, characterized in that: The data preprocessing (2) includes image detection (201) and image processing (202).

9. A general seal detection system for complex environments according to claim 8, characterized in that: The output ends of the image detection (201) and the image processing (202) are both electrically connected to the input end of the data preprocessing (2).

10. The universal seal detection system for complex environments according to claim 2, characterized in that: The text direction detection (302) includes text distortion and text tilt, and the text recognition (303) includes semantic analysis, n-character and pattern recognition, and n-text database clustering classification.