A seal processing method, device, electronic device and storage medium
By separating seal features and background features, the impact of seals on file recognition is solved, the rapid elimination of seals and image integrity is achieved, and the processing efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202111496866.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-08
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2041-12-08
AI Technical Summary
When processing documents carrying seals, seals affect the document identification process, resulting in low recognition efficiency and high error rate. The existing noise removal methods have poor effect on seals and background superposition.
By acquiring the original image, using pre-trained detection model and image reconstruction model, separating seal features and background features, generating target background images, and restoring them to the original image, combining the cosine annealing Lp loss function to optimize the denoising process, the seal is quickly eliminated.
It realizes the rapid elimination of seals, ensures the integrity and recognition accuracy of the original image, improves processing efficiency, and reduces the burden of manual processing.
Smart Images

Figure CN114120335B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a seal processing method, device, electronic device and storage medium. Background Art
[0002] In recent years, electronic documents bearing official seals have become increasingly common, and the types of documents bearing official seals are also increasing. Manually processing these documents would consume significant manpower and resources, burdening reviewers and requiring significant additional effort from users. Furthermore, manual processing of documents bearing official seals is inefficient and prone to errors. Therefore, automated processing of documents bearing official seals holds great practical value.
[0003] Using image processing and artificial intelligence technologies to identify text in documents bearing seals and automatically process seals is of great significance. This improves work efficiency, avoids wasted effort and time, and reduces the workload. However, when using image processing and artificial intelligence to identify text in documents bearing seals, the seals on the documents can interfere with the recognition process. Therefore, preprocessing of the documents bearing seals is necessary to remove the seals and improve the accuracy of seal recognition.
[0004] Currently, removing seals from documents containing official seals primarily relies on image processing techniques, with image component extraction and threshold segmentation being key components of these methods. Existing denoising methods typically use the L1 loss as the optimization objective for seal noise. This relatively simple approach results in poor denoising results when seal content and background text overlap. Summary of the Invention
[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the present application provides a seal processing method, device, electronic device and storage medium.
[0006] According to one aspect of an embodiment of the present application, a seal processing method is provided, comprising:
[0007] Acquire an original image to be detected, wherein the original image carries at least one seal;
[0008] Segmenting the original image to obtain an original seal image and an original sub-image;
[0009] Detecting the original seal image to obtain image features, and if background features of the original image are present in the image features, generating a target background image based on the background features;
[0010] Fit the target background image to the original sub-image to obtain a target image.
[0011] Further, the segmenting the original image to obtain an original seal image and an original sub-image includes:
[0012] Detect the original image to determine the position information of the seal carried by the original image;
[0013] Segment the original image according to the position information to obtain the original seal image and the original sub-image.
[0014] Further, the detecting the original image to determine the position information of the seal carried by the original image includes:
[0015] Obtain a pre-trained detection model;
[0016] Input the original image into the detection model so that the detection model extracts the original image features of the original image, determine the features that all meet the preset color features and preset shape features in the original image features as target features, and determine the position information of the target features in the original image.
[0017] Further, when the image features are obtained by detecting the original seal image and there are background features of the original image in the image features, and generating a target background image based on the background features includes:
[0018] Obtain a pre-trained image reconstruction model;
[0019] Input the seal image into the image reconstruction model so that the image reconstruction model extracts image features from the seal image, separates the seal features from the background features in the image features, and generates a target background image based on the background features.
[0020] Further, the obtaining a pre-trained image reconstruction model includes:
[0021] Obtain training sample images, where the training sample images include seals;
[0022] Obtain the annotation information corresponding to the training sample images, where the annotation information is used to annotate the background features that coincide with the seal features in the training sample images;
[0023] Input the training sample images and the annotation information into a preset neural network model so that the preset neural network model learns to separate the seal features and the background features according to the annotation information to obtain the image reconstruction model.
[0024] Further, after detecting the seal image to obtain image features, when the background features of the original image exist in the image features and a target background image is generated based on the background features, the method further includes:
[0025] Obtain at least one region of interest in the target seal image, and crop a seal feature image according to the at least one region of interest;
[0026] Perform authenticity identification on the seal feature image to obtain a seal identification result;
[0027] When the seal identification result is used to indicate that the seal in the target seal image is a genuine seal, query the corresponding review process of the target image;
[0028] Determine the recipient of the target image based on the review process, and send the target image to the recipient.
[0029] Further, the performing authenticity identification on the seal feature image to obtain a seal identification result includes:
[0030] Input the seal feature image into a pre-trained classification model, so that the classification model calculates the similarity between the seal feature image and a sample seal feature image, where the sample seal feature image is an image generated according to real sample features;
[0031] Determine the seal identification result according to the similarity.
[0032] According to another aspect of the embodiments of the present application, there is also provided a seal processing device, including:
[0033] An acquisition module, configured to acquire an original image to be detected, where at least one seal is carried in the original image;
[0034] A segmentation module, configured to segment the original image to obtain an original seal image and an original sub-image;
[0035] A detection module, configured to detect the original seal image to obtain image features, and when the background features of the original image exist in the image features, generate a target background image based on the background features;
[0036] A processing module, configured to fit the target background image with the original sub-image to obtain a target image.
[0037] According to another aspect of the embodiments of the present application, there is also provided a storage medium, which includes a stored program, and the program executes the above steps when running.
[0038] According to another aspect of the embodiments of the present application, an electronic device is further provided, including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus. Among them: the memory is used to store a computer program; the processor is used to execute the steps in the above method by running the program stored on the memory.
[0039] The embodiments of the present application further provide a computer program product containing instructions. When it runs on a computer, it enables the computer to execute the steps in the above method.
[0040] The above technical solutions provided by the embodiments of the present application have the following advantages compared with the prior art: The method provided by the embodiments of the present application extracts the seal image from the original image and detects the seal image. When the image features of the seal image carry the background features of the original image, the background features are extracted and restored to the original image, realizing the rapid elimination of the electronic seal and ensuring the integrity of other features of the original image at the same time. Description of the Drawings
[0041] The drawings here are incorporated into the description and form a part of this description, showing the embodiments that conform to the present application, and are used together with the description to explain the principles of the present application.
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0043] Figure 1 It is a flowchart of a seal processing method provided by the embodiments of the present application;
[0044] Figure 2 It is a flowchart of a seal processing method provided by another embodiment of the present application;
[0045] Figure 3 It is a block diagram of a seal processing device provided by the embodiments of the present application;
[0046] Figure 4 It is a schematic structural diagram of an electronic device provided by the embodiments of the present application. Detailed Embodiments
[0047] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of this application. Apparently, the described embodiments are only a part rather than all of the embodiments of this application. The exemplary embodiments of this application and their descriptions are used to explain this application and shall not constitute an improper limitation to this application. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of this application.
[0048] It should be noted that, in this text, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another similar entity or operation, and do not necessarily require or imply any actual relationship or sequence between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover a non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "comprising a..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the element.
[0049] The embodiments of this application provide a seal processing method, apparatus, electronic device, and storage medium. The method provided by the embodiments of the present invention can be applied to any required electronic device. For example, it can be an electronic device such as a server or a terminal. Specific limitations are not made here. For the convenience of description, it will be simply referred to as an electronic device hereinafter.
[0050] According to one aspect of the embodiments of this application, a method embodiment of a seal processing method is provided. Figure 1 The flowchart of a seal processing method provided for the embodiments of this application is as Figure 1 shown, and the method includes:
[0051] Step S11, obtaining an original image to be detected, where at least one seal is carried in the original image.
[0052] The method provided by the embodiments of this application is applied to an image processing terminal, and the image processing terminal can be an intelligent electronic device such as a computer or a mobile phone. In the embodiments of this application, the image processing terminal is used to receive the original image sent by the acquisition device and perform elimination processing on the seal carried in the original image. Specifically, the acquisition device can collect a paper document with a seal to obtain an electronic document with a seal. In addition, the original image can also be sent to the image processing terminal by other devices. The electronic document with a seal can be an electronic invoice, an approval document, etc.
[0053] Step S12: Segment the original image to obtain the original seal image and the original sub-image.
[0054] In the embodiment of the present application, step S11: Segment the original image to obtain the original seal image and the original sub-image, including the following steps A1 - A2:
[0055] Step A1: Detect the original image and determine the position information of the seal carried by the original image.
[0056] In the embodiment of the present application, step A1: Detect the original image and determine the position information of the seal carried by the original image, including the following steps A201 - A202:
[0057] Step A201: Obtain a pre-trained detection model.
[0058] Step A202: Input the original image into the detection model, so that the detection model extracts the original image features of the original image, determines the features that satisfy both the preset color feature and the preset shape feature in the original image features as the target features, and determines the position information of the target features in the original image.
[0059] In the embodiment of the present application, when the original image is input into the detection model, the detection model first extracts the original image features of the original image, and then determines the features that satisfy both the preset color feature and the preset shape feature in the original image features as the target features. The preset color feature can be a blue feature, a red feature, etc. The preset shape features include: an elliptical feature, a square feature, a circular feature, etc. After the detection model determines the target features, it obtains the position information of the target features from the original image.
[0060] In the embodiment of the present application, the training process of the detection model is as follows: First, obtain the seal sample image and the annotation information of the seal sample image, where the annotation information is used to annotate the feature information belonging to the seal in the seal sample image (for example: shape feature and color feature), and the position where the feature information is located. Then input the seal sample image and the annotation information into the preset detection model, so that the preset detection model learns the relationship between the seal features and the seal types to obtain the above detection model.
[0061] Step A2: Segment the original image according to the position information to obtain the original seal image and the original sub-image.
[0062] In the embodiment of the present application, the position information of the target features can be the vertex coordinates of the minimum bounding rectangle of the seal, and then segment the original image based on the vertex coordinates of the minimum bounding rectangle to obtain the original seal image and the original sub-image. It should be noted that the original sub-image does not carry a seal.
[0063] Step S13, detect the original seal image to obtain image features. When the background features of the original image exist in the image features, generate a target background image based on the background features.
[0064] In the embodiment of the present application, step S13, detect the original seal image to obtain image features. When the background features of the original image exist in the image features, generate a target background image based on the background features, including the following steps B1 - B2:
[0065] Step B1, obtain a pre - trained image reconstruction model.
[0066] In the embodiment of the present application, step B1, obtain a pre - trained image reconstruction model, including steps B101 - B103:
[0067] Step B101, obtain training sample images, where the training sample images include seals.
[0068] Step B102, obtain the annotation information corresponding to the training sample images, where the annotation information is used to annotate the background features that coincide with the seal features in the training sample images.
[0069] Step B103, input the training sample images and the annotation information into a preset neural network model, so that the preset neural network model learns to separate the seal features and the background features according to the annotation information, and obtain an image reconstruction model.
[0070] In the embodiment of the present application, after obtaining the training sample images, also obtain the sample output images corresponding to the training sample images, and the sample output images are the images after separating the seal features and the image background features.
[0071] In the embodiment of the present application, collect the seal image styles to obtain training sample images, and then train the preset neural network model by simulating and establishing the method of fitting and generating seals on clean sample images to obtain the final image reconstruction model. Among them, the preset neural network model can be a Unet neural network model.
[0072] Specifically, input the training sample images and the annotation information into the preset neural network model. It should be noted that the training sample images carrying the annotation information are all the images after randomly fitting the seals at different positions on the clean sample images. The preset neural network model separates the seal features and the background features in the training sample images, and generates an initial background image based on the separated background features. Calculate the loss function value based on the initial background image and the sample output image. When the loss function value does not meet the preset conditions, perform iterative training on the preset neural network model until the loss function value meets the preset conditions. Among them, the formula for calculating the loss function value is as follows:
[0073]
[0074] Among them,
[0075] In the above formula, n represents a total of n training samples, and m represents a total of m pixel values in each sample; respectively represent the predicted value and the label value of the model for the i-th pixel of the current j-th sample; represents the cosine function, PI represents the pi 3.1415..., exp represents the exponential function with base e; log represents the logarithmic function with base e; Epoch represents the number of iteration cycles of the current training; T is a given preset frequency, generally set to 5; Total_epochs represents the total number of training iteration cycles.
[0076] Step B2: Input the seal image into the image reconstruction model, so that the image reconstruction model extracts image features from the seal image, separates the seal features in the image features from the background features in the original image, and generates a target background image based on the background features.
[0077] In the embodiment of the present application, the seal features in the seal image can be separated from the background features (such as background text) through the image reconstruction model, and the target background image is generated by using the background features. Subsequently, the target background image is restored to the original image, thereby ensuring the integrity of the original image. In addition, in the training process of the embodiment of the present application, the optimization objective of the denoising process is improved, and a cosine annealing type Lp loss function is proposed, taking into account the situation where Gaussian noise and impulse noise exist at the same time, and having higher robustness for the situation where the seal and background text are severely aliased.
[0078] Step S14: Fit the target background image with the original sub-image to obtain a target image.
[0079] In the embodiment of the present application, the target background image is restored to the same size as the original seal image, and the restored target background image is fitted with the original sub-image to obtain a target image.
[0080] The method provided by the embodiment of the present application extracts the seal image from the original image, detects the seal image, extracts the background features when the image features of the seal image carry the background features of the original image, and restores them to the original image, realizing the rapid elimination of the electronic seal and ensuring the integrity of other features of the original image at the same time.
[0081] In the embodiment of the present application, after detecting the seal image to obtain image features and generating a target background image based on the background features when the background features of the original image exist in the image features, Figure 2 is a flowchart of a seal processing method provided by an embodiment of the present application, as Figure 2As shown, the method may include the following steps:
[0082] Step S21: Obtain at least one region of interest in the target seal image, and crop the seal feature image according to the at least one region of interest.
[0083] In the embodiments of the present application, the regions of interest in the target seal image are determined based on preset seal features, and the preset seal features may be text features, digital features, graphic features, etc. Then, an image segmentation algorithm for edge detection is used to segment the regions of interest (such as text, digital, graphic regions) in the target seal image. Among them, the edge detection algorithm includes the Laplace operator or the Sobel operator, etc.
[0084] Step S22: Perform authenticity identification on the seal feature image to obtain a seal identification result.
[0085] In the embodiments of the present application, step S22, performing authenticity identification on the seal feature image to obtain a seal identification result, includes the following steps C1 - C2:
[0086] Step C1: Input the seal feature image into a pre - trained classification model, so that the classification model calculates the similarity between the seal feature image and the sample seal feature image, where the sample seal feature image is an image generated according to real sample features.
[0087] Step C2: Determine the seal identification result according to the similarity.
[0088] Step S23: When the seal identification result is used to indicate that the seal in the target seal image is a genuine seal, query the corresponding review process of the target image.
[0089] In the embodiments of the present application, only by determining the authenticity of the seal can the validity of the target image be ensured, so that the corresponding review process of the target image can be determined. The corresponding review process of the target image may be the reimbursement process of an invoice or the approval process of an approval document.
[0090] Step S24: Determine the recipient of the target image based on the review process, and send the target image to the recipient.
[0091] In the embodiments of the present application, the regions of interest in the seal image are segmented; the authenticity of the segmented seal feature image is identified using an identification model. The trained identification model is used to judge the authenticity of the features of the seal feature image, so as to identify the authenticity of the seal - used seal image. Thus, the authenticity of the seal can be accurately and quickly detected.
[0092] Figure 3The block diagram of a seal processing device provided by an embodiment of the present application. The device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. As Figure 3 shown, the device includes:
[0093] An acquisition module 31, configured to acquire an original image to be detected, where at least one seal is carried in the original image;
[0094] A segmentation module 32, configured to segment the original image to obtain an original seal image and an original sub-image;
[0095] A detection module 33, configured to detect the original seal image to obtain image features. When there are background features of the original image in the image features, generate a target background image based on the background features;
[0096] A processing module 34, configured to fit the target background image with the original sub-image to obtain a target image.
[0097] In an embodiment of the present application, the segmentation module 32 is configured to detect the original image, determine the position information of the seal carried in the original image; segment the original image according to the position information to obtain an original seal image and an original sub-image.
[0098] In an embodiment of the present application, the segmentation module 32 is configured to obtain a pre-trained detection model; input the original image into the detection model, so that the detection model extracts the original image features of the original image, and determine the features that all meet the preset color features and preset shape features in the original image features as target features, and determine the position information of the target features in the original image.
[0099] In an embodiment of the present application, the detection module 33 is configured to obtain a pre-trained image reconstruction model; input the seal image into the image reconstruction model, so that the image reconstruction model extracts image features from the seal image, separate the seal features in the image features from the background features in the original image, and generate a target background image based on the background features.
[0100] In an embodiment of the present application, the detection module 33 is configured to obtain a training sample image, where the training sample image includes a seal; obtain the annotation information corresponding to the training sample image, where the annotation information is used to annotate the background features that coincide with the seal features in the training sample image; input the training sample image and the annotation information into a preset neural network model, so that the preset neural network model learns to separate the seal features and the background features according to the annotation information to obtain an image reconstruction model.
[0101] In an embodiment of the present application, the seal processing device further includes: an identification module, configured to obtain at least one region of interest in the target seal image, crop a seal feature image according to the at least one region of interest; perform authenticity identification on the seal feature image to obtain a seal identification result; when the seal identification result is used to indicate that the seal in the target seal image is a genuine seal, query the corresponding review process of the target image; determine the recipient of the target image based on the review process, and send the target image to the recipient.
[0102] In an embodiment of the present application, the identification module is configured to input the seal feature image into a pre-trained classification model, so that the classification model calculates the similarity between the seal feature image and a sample seal feature image, where the sample seal feature image is an image generated according to real sample features; determine the seal identification result according to the similarity.
[0103] An embodiment of the present application further provides an electronic device, as Figure 4 shown, the electronic device may include: a processor 1501, a communication interface 1502, a memory 1503, and a communication bus 1504, where the processor 1501, the communication interface 1502, and the memory 1503 communicate with each other through the communication bus 1504.
[0104] The memory 1503 is used to store a computer program;
[0105] The processor 1501, when executing the computer program stored on the memory 1503, implements the steps of the above embodiment.
[0106] The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, only a thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.
[0107] The communication interface is used for communication between the above terminal and other devices.
[0108] The memory may include a Random Access Memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.
[0109] The above-mentioned processor may be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it may also be a digital signal processor (DSP for short), an application specific integrated circuit (ASIC for short), a field-programmable gate array (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0110] In another embodiment provided by the present application, there is also provided a computer-readable storage medium, in which instructions are stored. When it runs on a computer, it causes the computer to execute the seal processing method described in any one of the above embodiments.
[0111] In another embodiment provided by the present application, there is also provided a computer program product containing instructions. When it runs on a computer, it causes the computer to execute the seal processing method described in any one of the above embodiments.
[0112] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a dedicated computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that a computer can access, or a data storage device such as a server or data center that includes one or more integrated available media. The available medium may be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state disk).
[0113] The above are only the preferred embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
[0114] The above are only the specific implementation manners of the present application, enabling those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments shown herein, but rather to the broadest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for processing a seal, characterized in that, Including: Obtain an original image to be detected, where at least one seal is carried in the original image; Segment the original image to obtain an original seal image and an original sub-image; Detect the original seal image to obtain image features. When the background features of the original image exist in the image features, generate a target background image based on the background features; Fit the target background image with the original sub-image to obtain a target image; Detect the original image to determine the position information of the seal carried in the original image, including: Obtain a pre-trained detection model; Input the original image into the detection model, so that the detection model extracts the original image features of the original image, determine the features that all meet the preset color features and preset shape features in the original image features as target features, and determine the position information of the target features in the original image; The preset color features are blue features and red features; the preset shape features include: oval features, square features, and circular features; Detect the original seal image to obtain image features. When the background features of the original image exist in the image features, generate a target background image based on the background features, including: Obtain a pre-trained image reconstruction model; Input the seal image into the image reconstruction model, so that the image reconstruction model extracts image features from the seal image, separates the seal features from the background features in the image features, and generates a target background image based on the background features; The obtaining of the pre-trained image reconstruction model includes: Obtain training sample images, where the training sample images include seals; Obtain the annotation information corresponding to the training sample images, where the annotation information is used to annotate the background features that coincide with the seal features in the training sample images; Input the training sample images and the annotation information into a preset neural network model, so that the preset neural network model learns to separate the seal features and the background features according to the annotation information to obtain the image reconstruction model; The training sample images are all images after randomly attaching seals to clean samples; the formula for calculating the loss function value is as follows: Among them, Where n represents the total number of n training samples, and m represents the total number of m pixel values in each sample; respectively represent the predicted value and the label value of the model for the i-th pixel of the current j-th sample; cos represents the cosine function, PI represents the pi 3.1415..., exp represents the exponential function with e as the base; log represents the logarithmic function with e as the base; Epoch represents the number of iteration cycles of the current training; T is a given preset frequency; Total_epochs represents the total number of training iteration cycles; After the background features of the original image exist in the image features and a target background image is generated based on the background features, the method further includes: Obtain at least one region of interest in the target seal image, and crop a seal feature image according to the at least one region of interest; Perform authenticity identification on the seal feature image to obtain a seal identification result; When the seal identification result is used to indicate that the seal in the target seal image is a genuine seal, query the audit process corresponding to the target image; Determine the recipient of the target image based on the audit process, and send the target image to the recipient; The performing of authenticity identification on the seal feature image to obtain a seal identification result includes: Input the seal feature image into a pre-trained classification model so that the classification model calculates the similarity between the seal feature image and the sample seal feature image, where the sample seal feature image is an image generated based on real sample features; Determine the seal recognition result according to the similarity.
2. The method according to claim 1, wherein The segmenting the original image to obtain an original seal image and original sub-images includes: Detect the original image to determine the position information of the seal carried by the original image; Segment the original image according to the position information to obtain the original seal image and the original sub-images.
3. The method according to claim 2, wherein The detecting the original image to determine the position information of the seal carried by the original image includes: Obtain a pre-trained detection model; Input the original image into the detection model so that the detection model extracts the original image features of the original image, determine the features that all meet the preset color features and preset shape features in the original image features as target features, and determine the position information of the target features in the original image.
4. A seal processing device, which adopts the method according to any one of claims 1 to 3, characterized in that, Includes: An acquisition module, configured to acquire an original image to be detected, where at least one seal is carried in the original image; A segmentation module, configured to segment the original image to obtain an original seal image and original sub-images; A detection module, configured to detect the original seal image to obtain image features, and when the background features of the original image exist in the image features, generate a target background image based on the background features; A processing module, configured to fit the target background image and the original sub-images to obtain a target image.
5. A storage medium, characterized in that The storage medium includes a stored program, where the program, when running, executes the method steps described in any one of claims 1 to 3 above.
6. An electronic device, characterized in that, Includes a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete mutual communication through the communication bus; where: The memory is used to store a computer program; The processor is configured to execute the method steps described in any one of claims 1-3 by running the program stored on the memory.
Citation Information
Patent Citations
Invoice seal removing method, device and computer storage medium
CN109284758A
Seal authenticity identification method and device
CN109767436A