Method, system, device and medium for processing seal image

By using a trained semantic segmentation network model and post-processing techniques, combined with color features, the seal image is segmented and repaired, which solves the problem of insufficient robustness and generalization of seal extraction in existing technologies and achieves high-precision seal extraction results.

CN116453147BActive Publication Date: 2026-04-21INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INDUSTRIAL AND COMMERCIAL BANK OF CHINA
Filing Date
2023-04-20
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing seal extraction techniques are not robust enough when processing images with large ranges of color and brightness variation, making it difficult to accurately determine the seal area and often resulting in false extractions. Furthermore, they do not generalize well in the context of overlapping interference.

Method used

A pre-trained semantic segmentation network model is used to segment the image. Color space transformation and false negative index adjustment are combined with data augmentation technology to improve the model's generalization ability. A post-processing stage is introduced to refine and supplement local misjudged pixels, generating a high-precision seal image.

Benefits of technology

It significantly improves the accuracy and stability of seal extraction, effectively solves the problem of overlapping seals and interference, and is suitable for extracting red seals from scanned and photographed documents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116453147B_ABST
    Figure CN116453147B_ABST
Patent Text Reader

Abstract

This disclosure provides a method for processing seal images, applicable to the field of artificial intelligence. The method includes: segmenting the image to be processed using a pre-trained semantic segmentation network model to obtain a seal pixel mask; wherein the semantic segmentation network model is pre-trained based on automatically expanded training samples; performing a color space transformation on the image to be processed to obtain a transformed image pixel mask; determining the pixel difference between the seal pixel mask and the image pixel mask; calculating the pseudo-negative index for each pixel in the pixel difference, adjusting the seal pixel mask according to the pseudo-negative index to obtain an output mask; converting the output mask into a color sub-image and matching it with a preset background image to obtain a seal image. This disclosure also provides a system, device, and medium for processing seal images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of artificial intelligence technology, specifically to a method, system, device, and medium for processing seal images. Background Technology

[0002] Commercial banks handle a large amount of seal processing in their daily corporate banking operations. Previously, seal verification relied primarily on manual methods by tellers. If technology could be used to perform initial screening and comparison of seals in document images, only a small number of seals with low confidence levels would need to be manually verified, while the verification of a large number of high-confidence seals would be unnecessary. The core issue that needs to be addressed to achieve automated seal comparison is how to automatically extract red seals from various documents and vouchers.

[0003] Existing red seal extraction techniques can be broadly categorized as follows: 1) From the perspective of seal outline shape features, using Hough transform and its derived improved algorithms, the seal outline in the image is detected and extracted based on a predefined seal shape (circle or rectangle); 2) From the perspective of seal color features, based on the separation or conversion of image color channels, the red seal is filtered and extracted through a predefined target color range; 3) Using deep learning modeling algorithms, a seal detection model is trained based on real business data (including images of stamped business vouchers and corresponding labels) to predict and extract the coordinate position of the seal in the image.

[0004] Analysis of the shortcomings of existing seal extraction technologies: 1) Methods based on Hough transform and its derived improved algorithms for detecting and extracting seal contours often suffer from unstable performance in practical applications due to the numerous parameter tuning involved in the Hough transform algorithm and its sensitivity to parameter changes. Furthermore, the robustness of seal extraction needs improvement. Additionally, this method requires pre-defining the contour to be extracted based on the specific business scenario's seal characteristics, resulting in low generalization across different business scenarios and unsuitability for scenarios with large variations in seal shape. 2) Color filtering-based methods require extracting red seals through a predefined color filtering range. The extracted red seals are often not smooth enough, and color filtering alone can easily extract interference from similarly colored impurities. Moreover, these methods require relatively fixed image color and brightness ranges, typically only suitable for high-quality images with stable color and brightness spaces, such as scanned documents. They often perform poorly for images with large color and brightness variations, such as those taken with mobile phones. Furthermore, this method often struggles to distinguish between pixels in the image that are similar in color to the red stamp, especially interfering pixels that overlap with the stamp's position and are similar in color, which are easily mistaken for the stamp and extracted. 3) Methods using deep learning detection models have a certain degree of generalization because they train neural network models to detect stamp positions using a large number of samples. However, this method will also misextract stamps when there are overlapping interfering backgrounds. Summary of the Invention

[0005] In view of the above problems, this disclosure provides a method, system, device and medium for processing seal images.

[0006] According to a first aspect of this disclosure, a method for processing a seal image is provided, comprising: segmenting the image to be processed using a pre-trained semantic segmentation network model to obtain a seal pixel mask; wherein the semantic segmentation network model is pre-trained based on automatically expanded training samples; performing a color space transformation on the image to be processed to obtain a transformed image pixel mask; determining the pixel difference set between the seal pixel mask and the image pixel mask; calculating a pseudo-negative index for each pixel in the pixel difference set, adjusting the seal pixel mask according to the pseudo-negative index to obtain an output mask; converting the output mask into a color sub-image and fitting it with a preset background image to obtain a seal image.

[0007] According to embodiments of this disclosure, the semantic segmentation network model is pre-trained based on automatically augmented training samples. The pre-training operation includes: performing pixel-level foreground annotation on the stamped image training samples; performing data augmentation on the annotated image training samples to obtain a sample image dataset; and inputting the sample image data into the semantic segmentation network model for training to obtain the parameters of the semantic segmentation network model.

[0008] According to embodiments of this disclosure, data augmentation of training samples of images with stamps includes: copying the image data in the training samples to generate multiple image copies; randomly transforming each image copy to obtain a sample image dataset; wherein the random transformation includes one or more combinations of translation, rotation, saturation transformation, noise addition, brightness transformation, and contrast transformation.

[0009] According to embodiments of this disclosure, color space transformation of the image to be processed includes: converting the image to be processed into an image matrix; mapping the image matrix to be processed to a hue-saturation-brightness color space; and obtaining a transformed image pixel mask based on the color range of the seal image in the hue-saturation-brightness color space.

[0010] According to embodiments of this disclosure, mapping an image matrix to be processed to a hue-saturation-brightness color space includes: calculating the red-green-blue color values ​​of the image matrix to be processed according to a conversion formula, decomposing the colors into three channels: hue, saturation, and brightness, to obtain the hue-saturation-brightness color space of the image to be processed.

[0011] According to embodiments of this disclosure, determining the pixel difference between a stamp pixel mask and an image pixel mask includes: obtaining a first coordinate position in the stamp pixel mask where the mask value is 0; obtaining a second coordinate position in the image pixel mask where the mask value is 1; and determining the intersection of the first coordinate position and the second coordinate position to obtain the pixel difference.

[0012] According to embodiments of this disclosure, calculating the false negative index of each pixel in the pixel difference set includes: obtaining the target probability of each pixel in the pixel difference set within a preset neighborhood range, where the target probability is the probability that the semantic segmentation network model determines that the pixel belongs to the color of the stamp image; and calculating the false negative index of each pixel based on the target probability and a preset threshold.

[0013] According to an embodiment of this disclosure, adjusting the stamp pixel mask image based on a false negative index includes: if the false negative index meets a preset condition, then the pixel is identified as belonging to the color of the stamp image, and the mask value of the corresponding pixel in the stamp pixel mask image is set to 1 to obtain the mask image to be output.

[0014] According to embodiments of this disclosure, converting a mask image to be output into a color sub-image includes: determining the size range of the output mask image; filling the coordinate positions of the mask values ​​of 1 within the size range with the corresponding red-green-blue components, and converting them into a color sub-image.

[0015] According to an embodiment of this disclosure, the process of laminating the image with a preset background image includes: generating a white background image that is adapted to the size range of the mask image; and laminating the white background image with the colored sub-image according to the coordinate position of the mask value of 1 to obtain a stamp image.

[0016] The second aspect of this disclosure provides a system for processing a seal image, comprising: a segmentation module for segmenting the image to be processed using a pre-trained semantic segmentation network model to obtain a seal pixel mask; wherein the semantic segmentation network model is pre-trained based on automatically expanded training samples; a transformation module for performing a color space transformation on the image to be processed to obtain a transformed image pixel mask; a determination module for determining the pixel difference between the seal pixel mask and the image pixel mask; a calculation module for calculating the pseudo-negative index of each pixel in the pixel difference, adjusting the seal pixel mask according to the pseudo-negative index to obtain an output mask; and a bonding module for converting the output mask into a color sub-image and bonding it with a preset background image to obtain a seal image.

[0017] A third aspect of this disclosure provides an electronic device comprising: one or more processors; and a memory for storing one or more programs, wherein, when the one or more programs are executed by the one or more processors, the one or more processors perform the above-described method for processing a seal image.

[0018] A fourth aspect of this disclosure also provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the above-described method for processing a seal image.

[0019] The fifth aspect of this disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method for processing a seal image. Attached Figure Description

[0020] The foregoing contents, as well as other objects, features, and advantages of this disclosure, will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0021] Figure 1 The illustration schematically depicts an application scenario of a method, system, device, and medium for processing seal images according to embodiments of the present disclosure.

[0022] Figure 2 A flowchart illustrating a method for processing a seal image according to an embodiment of the present disclosure is shown schematically.

[0023] Figure 3 The flowchart illustrates a pre-training method for a semantic segmentation network model according to an embodiment of the present disclosure, which is pre-trained based on automatically augmented training samples.

[0024] Figure 4 A flowchart illustrating a method for data augmentation of training samples of stamped images according to an embodiment of the present disclosure is shown.

[0025] Figure 5 A flowchart illustrating a method for color space transformation of an image to be processed according to an embodiment of the present disclosure is shown schematically.

[0026] Figure 6 A flowchart illustrating a method for determining the pixel difference between a seal pixel mask and an image pixel mask according to an embodiment of the present disclosure is shown schematically.

[0027] Figure 7 A flowchart illustrating a method for calculating a pseudo-negative index for each pixel in a pixel difference set according to an embodiment of the present disclosure is shown schematically.

[0028] Figure 8 This schematically illustrates a flowchart of a method for converting the mask image to be output into a color sub-image and then overlaying it with a preset background image, according to an embodiment of the present disclosure.

[0029] Figure 9 The illustration shows the stamp images before and after the output of an existing semantic segmentation network model;

[0030] Figure 10 The images before and after red seal extraction of a scanned document are schematically shown according to an embodiment of the present disclosure;

[0031] Figure 11 The images before and after red stamp extraction of the photographed document are schematically shown according to an embodiment of the present disclosure;

[0032] Figure 12 A schematic block diagram illustrating a system for processing seal images according to embodiments of the present disclosure is shown; and

[0033] Figure 13 A block diagram schematically illustrates an electronic device suitable for implementing the methods described above, according to embodiments of the present disclosure. Detailed Implementation

[0034] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.

[0035] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0036] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0037] When using expressions such as "at least one of A, B, and C," the expression should generally be interpreted in accordance with the meaning commonly understood by a person skilled in the art (e.g., "a system having at least one of A, B, and C" should include, but is not limited to, systems having A alone, having B alone, having C alone, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.). Similarly, when using expressions such as "at least one of A, B, or C," the expression should generally be interpreted in accordance with the meaning commonly understood by a person skilled in the art (e.g., "a system having at least one of A, B, or C" should include, but is not limited to, systems having A alone, having B alone, having C alone, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.).

[0038] The accompanying drawings illustrate several block diagrams and / or flowcharts. It should be understood that some blocks, or combinations thereof, in the block diagrams and / or flowcharts can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that, when executed by the processor, these instructions can create means for implementing the functions / operations described in these block diagrams and / or flowcharts. The technology of this disclosure can be implemented in hardware and / or software (including firmware, microcode, etc.). Alternatively, the technology of this disclosure can take the form of a computer program product stored on a computer-readable storage medium, which is available for use by or in conjunction with an instruction execution system.

[0039] In actual business vouchers and documents, the target seal often occupies only a small proportion of the area, while the majority of the area consists of non-seal elements. If the entire voucher or document image is directly compared with the reserved seal, the small proportion of seal features will be overwhelmed by the larger proportion of non-seal features, easily leading to distorted comparison results. As the upstream module of electronic seal verification, red seal extraction plays a crucial role in initially screening and retrieving a candidate set containing only a small area of ​​the seal from the large candidate set of the entire voucher or document image. The generated candidate set of seal areas will serve as input for downstream modules, therefore, it requires high accuracy. Based on project experience, the recall effect of red seal extraction directly determines the upper limit of the overall quality of the electronic seal verification system.

[0040] Existing seal extraction techniques have poor robustness. When processing images with large variations in color and brightness, it is often difficult to accurately determine the seal area, frequently resulting in erroneous extraction. To improve the accuracy of seal extraction, embodiments of this disclosure provide a method, system, device, and medium for processing seal images. Applied to the field of artificial intelligence, this method can significantly improve processing generalization while effectively solving the problem of overlapping interference from seals.

[0041] Figure 1 An exemplary system architecture 100, applicable to a method for processing seal images according to embodiments of this disclosure, is illustrated schematically. It should be noted that... Figure 1 The examples shown are merely examples of system architectures that can be applied to the embodiments of this disclosure, in order to help those skilled in the art understand the technical content of this disclosure, but do not mean that the embodiments of this disclosure cannot be used in other devices, systems, environments or scenarios.

[0042] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, and 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the terminal devices 103 and the server 105. The network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0043] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0044] Terminal devices 101, 102, and 103 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0045] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using terminal devices 101, 102, and 103 (for example only). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.

[0046] It should be noted that the seal image processing method provided in this embodiment can generally be executed by terminal devices 101, 102, 103 and server 105. Correspondingly, the seal image processing system provided in this embodiment can generally be located in terminal devices 101, 102, 103 and server 105. The seal image processing method provided in this embodiment can also be executed by a server or server cluster that is different from server 105 but capable of communicating with terminal devices 101, 102, 103 and / or server 105. Correspondingly, the seal image processing system provided in this embodiment can also be located in a server or server cluster that is different from server 105 but capable of communicating with terminal devices 101, 102, 103 and / or server 105.

[0047] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0048] The following will be based on Figure 1 The described scene, through Figures 2 to 13 The method for processing the seal image according to the disclosed embodiments will be described in detail.

[0049] This disclosure focuses on the electronic seal verification scenario in corporate banking, aiming to address the current limitations of red seal extraction technology in terms of accuracy, robustness, and versatility. By analyzing the shortcomings of current red seal extraction technology, it proposes a method that integrates contour and color features.

[0050] Figure 2 A flowchart illustrating a method for processing a seal image according to an embodiment of the present disclosure is shown.

[0051] like Figure 2 As shown, the processing method 200 for the seal image may include operations S210 to S250.

[0052] In operation S210, a pre-trained semantic segmentation network model is used to segment the image to be processed, and a stamp pixel mask image is obtained; wherein, the semantic segmentation network model is pre-trained based on automatically expanded training samples.

[0053] In this embodiment, the image to be processed is generally an image with one or more seals, and may also include other content such as text or tables. For real-world banking electronic seal verification scenarios where both scanned and photographed documents exist, this disclosure constructs a training dataset by preparing a mixture of scanned and photographed images with seals, and then trains the semantic segmentation network model. Training the seal semantic segmentation network model with a large number of real-world business samples effectively achieves pixel-level classification, thereby extracting the seal target pixels. Because the seal pixels are extracted at a fine-grained pixel-level classification level, it effectively handles situations where there is overlapping or interfering background on the seal. The seal semantic segmentation network model is generated based on a large amount of real-world business data from scanned and photographed documents, and has good generalization ability for changes in overall image lighting, brightness, and seal shape and position.

[0054] In operation S220, the image to be processed is transformed in color space to obtain the transformed image pixel mask.

[0055] The image to be processed is typically a red-green-blue (RGB) image. A color space transformation is performed to convert it to a hue-saturation-value (HSV) color space to suit various subsequent image processing methods. The hue-saturation-value (HSV) model, also known as the hexagonal pyramid model, is a relatively intuitive color space widely used in various image editing tools. The parameters of color in this model are hue (H), saturation (S), and value (V). After mapping the image to be processed to the HSV color space, a mask is applied based on the color range of the stamp to obtain the transformed image pixel mask M2. The stamp color is generally red, but some are blue.

[0056] In operation S230, the pixel difference between the stamp pixel mask and the image pixel mask is determined.

[0057] In operation S240, the pseudo-negative index of each pixel in the pixel difference set is calculated, and the stamp pixel mask is adjusted according to the pseudo-negative index to obtain the mask image to be output.

[0058] To further improve the seal extraction performance, post-processing is introduced for the seal segmentation prediction results. This involves refining and supplementing misclassified pixels in localized areas by incorporating color features, addressing potential misclassifications in local pixel regions by the image segmentation model. The general idea of ​​post-processing is as follows: Pixels conforming to the red range (taking red as an example for seal colors) are extracted to generate a mask image. The pixel difference between this mask image and the seal pixel mask image M1 predicted by the semantic segmentation model is calculated (i.e., the set of pixels that meet the preset red range but are classified as non-red seals by the semantic segmentation model). Then, for each pixel in the difference set, a false negative index value is calculated within its surrounding W*W neighborhood. Pixels with index values ​​exceeding a threshold are filled in and repaired, further improving the overall performance of red seal extraction.

[0059] In operation S250, the mask image to be output is converted into a color sub-image and then matched with a preset background image to obtain a stamp image.

[0060] According to the above embodiments, the pixels at the corresponding positions in the original image are extracted based on the coordinate information in the mask image to be output, and a color target image containing only the seal is generated.

[0061] This disclosure generates a lightweight semantic segmentation network model for seals through modeling and training. It efficiently utilizes the semantic features of seal contours to achieve pixel-level seal extraction, significantly improving the generalization ability of the processing while effectively solving the problem of overlapping interference in seals. By reasonably fusing contour features and color features, the two features are organically complementary, achieving a 1+1 greater than 2 effect, and greatly improving the accuracy and stability of seal extraction.

[0062] Figure 3 The illustration shows a flowchart of a pre-training method for a semantic segmentation network model according to an embodiment of the present disclosure, which is pre-trained based on automatically augmented training samples.

[0063] like Figure 3 As shown, the pre-training operation method may include operations S211 to S213.

[0064] In operation S211, pixel-level foreground annotation is performed on the training samples of the image with the stamp.

[0065] In operation S212, the labeled image training samples are augmented to obtain the sample image dataset.

[0066] In operation S213, the sample image data is input into the semantic segmentation network model for training, and the parameters of the semantic segmentation network model are obtained.

[0067] The seal image data is labeled by assigning a value of 1 to each pixel as foreground and a value of 0 as background, thus obtaining foreground annotations. Data augmentation is then used to increase the data volume, resulting in sample image data. Based on this labeled sample image dataset, a semantic segmentation network model is trained to learn how to separate seal features from background features according to the annotation information, thus obtaining the parameters of the semantic segmentation network model. The semantic segmentation network model can be a Unet neural network model.

[0068] Analyzing the electronic seal verification business scenario, the target seal size in the image to be processed is usually small (mostly less than 5%). Therefore, the segmentation model technology selected is Unet, which is more suitable for small target tasks, as the model network structure to better fit the characteristics of the bank's electronic seal verification scenario. Considering that both scanned and photographed images exist in actual electronic seal verification scenarios, it is necessary to prepare a training set with a mixture of scanned and photographed images to train the seal semantic segmentation network model.

[0069] Figure 4 A flowchart illustrating a method for data augmentation of training samples of stamped images according to an embodiment of the present disclosure is shown.

[0070] like Figure 4 As shown, the method for data augmentation of training samples of images with stamps may include operations S2111 to S2112.

[0071] In operation S2111, the image data in the image training samples is copied to generate multiple image copies.

[0072] In operation S2112, each image copy is randomly transformed to obtain a sample image dataset; wherein, the random transformation includes one or more combinations of translation, rotation, saturation transformation, noise addition, brightness transformation and contrast transformation.

[0073] Semantic segmentation models essentially solve dense reasoning tasks involving pixel-level classification. To achieve good results, the training sample size needs to be as large as possible. However, a larger training sample size means more manual annotation work. Therefore, it is necessary to automatically expand the training sample size through data augmentation methods, increasing the training sample size without increasing the cost of manual annotation and improving the model training effect. Furthermore, as mentioned earlier, the target red stamp size in electronic seal verification scene images is usually small. To address the sample imbalance problem, the number of red stamps in the image is specifically increased during the augmentation process to obtain better model generalization performance.

[0074] Specifically, the training dataset is expanded by performing a series of random transformations on each image copy to generate similar but different training samples. Data augmentation includes random rotation; random translation along the horizontal or vertical direction with a percentage variation of the image size; proportional random scaling of the image size; saturation transformation; noise addition; brightness transformation; contrast transformation; and a combination of the above methods.

[0075] Figure 5 A flowchart illustrating a method for color space transformation of an image to be processed according to an embodiment of the present disclosure is shown.

[0076] like Figure 5 As shown, the method for color space transformation of the image to be processed may include operations S221 to S223.

[0077] In operation S221, the image to be processed is transformed into an image matrix.

[0078] In operation S222, the image matrix to be processed is mapped to the hue-saturation-brightness color space.

[0079] In operation S223, the transformed image pixel mask is obtained based on the color range of the stamp image in the hue-saturation-brightness color space.

[0080] When preprocessing the image to be processed, the first step is to matrix-process the image after it has been standardized to a uniform size, transforming it into a matrix of images to be processed. This matrix is ​​typically an RGB image matrix. After obtaining the image matrix, it needs to be mapped to the HSV color space to accommodate various subsequent image processing methods. The color value range is used to represent the color range of the stamp image, for example, it can be a portion of the HSV color space. This color range can be specifically determined by sampling the stamp image. A mask is then applied based on the stamp's color value range to obtain a transformed image pixel mask.

[0081] Based on the above embodiments, mapping the image matrix to be processed to the hue-saturation-brightness color space includes: calculating the red-green-blue color values ​​of the image matrix to be processed according to the conversion formula, decomposing the colors into three channels: hue, saturation, and brightness, to obtain the hue-saturation-brightness color space of the image to be processed.

[0082] In this embodiment, to further improve the seal extraction effect, post-processing is introduced for the seal segmentation prediction results. This involves refining and supplementing locally misclassified pixels in the semantic segmentation network model by combining color features, thus addressing potential local pixel misclassification issues. First, a mask image of red pixels (taking red as the seal color as an example) in the image is generated using color feature extraction. The color extraction uses the HSV color model, requiring the image to be converted from RGB to HSV. The conversion formula is shown below:

[0083]

[0084]

[0085] V = C max

[0086] Formula (1)

[0087] in:

[0088] R′=R / 255, B′=B / 255, G′=G / 255

[0089] C max =max(R′, G′, B′)

[0090] C min =min(R′, G′, B′)

[0091] Δ=C max -C min

[0092] In the HSV color model, the range of red is as follows:

[0093] H∈[0, 10]∪[156, 180]

[0094] S∈[43, 255]

[0095] V∈[46, 255]

[0096] Formula (2)

[0097] For the image after conversion to the HSV color model, the pixel values ​​of HSV components that fall within the red range are set to 1, and the pixel values ​​of other HSV components that fall outside the red range are set to 0, resulting in the image pixel mask M2 of all red pixels in the image.

[0098] Figure 6 A flowchart illustrating a method for determining the pixel difference between a stamp pixel mask and an image pixel mask according to an embodiment of the present disclosure is shown.

[0099] like Figure 6As shown, the method for determining the pixel difference between the stamp pixel mask and the image pixel mask may include operations S231 to S233.

[0100] In operation S231, obtain the first coordinate position of the mask value of 0 in the stamp pixel mask image.

[0101] In operation S232, the second coordinate position of the mask value of 1 is obtained in the image pixel mask image.

[0102] In operation S233, the intersection of the first coordinate position and the second coordinate position is determined, and the pixel difference set is obtained.

[0103] According to the above embodiment, the seal image mask matrix is ​​determined based on the seal pixel mask map. Then, the seal image mask matrix can be ANDed with the image to be processed to obtain the seal acquisition image portion in the image to be processed. Then, the pixel difference D between the image pixel mask map M2 and the seal pixel mask map M1 predicted by the semantic segmentation network model (i.e., the coordinate positions where the value in M2 is 1, but the value in M1 is 0) is calculated. The pixels at the positions where the mask value is 1 in the difference set D correspond to the color feature that conforms to the red range, but the semantic segmentation network model determines them to be pixels that are not part of the seal.

[0104] Figure 7 A flowchart illustrating a method for calculating a pseudo-negative index for each pixel in a pixel difference set according to an embodiment of the present disclosure is shown.

[0105] like Figure 7 As shown, the method for calculating the pseudo-negative index of each pixel in the pixel difference set may include operations S241 to S242.

[0106] In operation S241, the target probability of each pixel in the pixel difference set within the preset neighborhood is obtained. The target probability is the probability that the semantic segmentation network model determines that the pixel belongs to the color of the seal image.

[0107] In operation S242, the false negative index of each pixel is calculated based on the target probability and the preset threshold.

[0108] For each pixel in the difference set D, calculate the false negative index value within its surrounding W×W neighborhood. The calculation formula is as follows:

[0109]

[0110] Where [[.]] represents the number of pixels that meet the condition. prob(X ij ) to determine pixel X in the segmentation model ijThis represents the probability of a red stamp, with a preset threshold of 0.3 (which can be set separately for different scenarios). For example, the neighborhood window W×W is set to a 7×7 window for bank vouchers and documents (which can be set separately for different business scenarios).

[0111] Based on the above embodiments, adjusting the stamp pixel mask image according to the false negative index includes: if the false negative index meets the preset conditions, the pixel is identified as belonging to the color of the stamp image, and the mask value of the corresponding pixel in the stamp pixel mask image is set to 1 to obtain the mask image to be output.

[0112] According to the above embodiment, for pixels with a false negative index greater than the threshold of 0.3, they are repaired and determined to be stamp pixels, that is, the corresponding pixel in M1 is set from 0 to 1. After the above processing, the output mask image M3 is obtained, which realizes the fine-tuning of locally misjudged pixels in the segmentation model and further improves the red stamp extraction effect.

[0113] Figure 8 The flowchart illustrates a method for converting the mask image to be output into a color sub-image and then overlaying it with a preset background image, according to an embodiment of the present disclosure.

[0114] like Figure 8 As shown, the method for converting the mask image to be output into a color sub-image and fitting it with a preset background image may include operations S251 to S254.

[0115] In operation S251, the size range of the output mask image is determined.

[0116] In operation S252, the coordinate positions with a mask value of 1 within the size range are filled with the corresponding red-green-blue components, and converted into a color sub-image.

[0117] In operation S253, a white background image is generated that is adapted to the size range of the mask image.

[0118] In operation S254, the white background image is overlaid with the colored sub-image according to the coordinate position of the mask value of 1 to obtain the stamp image.

[0119] The output mask image M3 obtained after the above processing is in binary image format and needs to be converted back to RGB three-color image. The specific process is as follows: create an RGB image with a pure white background, fill in the red RGB components at the corresponding coordinate positions in the image according to the position of the value of 1 in the red stamp mask image M3, and generate a target color image T with a white background and only containing red stamps.

[0120] This disclosure is applicable to both scanned and photographed images for extracting red seals. It trains a semantic segmentation network model to perform pixel-level classification of the image, determining whether each pixel belongs to the seal portion. The semantic segmentation network model predicts and outputs a seal pixel mask image M1. Considering the potential for misclassification in deep neural networks based on statistical probability models, post-processing is introduced for the semantic segmentation network model's predicted output. By incorporating color features, the model refines and corrects locally misclassified pixels, further improving the accuracy and stability of seal extraction.

[0121] The present disclosure will be further described below through specific embodiments. The processing method and system for the above-mentioned seal image will be specifically described in the following embodiments. However, the following embodiments are merely illustrative of the present disclosure, and the scope of the present disclosure is not limited thereto.

[0122] This embodiment provides a method and system for processing seal images. The processing method includes:

[0123] (1) Train a semantic segmentation model for red stamps.

[0124] First, training samples are constructed based on real bank corporate business documents and voucher images. Then, using deep neural network modeling technology, a semantic segmentation network model specifically designed for seals is trained and generated. This achieves fine-grained pixel-level classification and extracts seal pixels, effectively addressing situations where there is overlapping or interfering background on the seal. In this embodiment, Unet, which is more suitable for small-objective tasks, is used as the model network structure to better fit the characteristics of electronic seal verification scenarios in banks.

[0125] The Unet seal semantic segmentation network model, trained on an augmented dataset, can effectively segment red seal pixels (the seal is red in this example) at the overall level, and also exhibits good generalization ability for changes in brightness, illumination, seal position, and shape. The data augmentation and semantic segmentation network model training specifically includes:

[0126] 1.1) Using the training set S of images with red stamps as the basis for data augmentation, multiple copies of each image are generated at a ratio of 1:30.

[0127] 1.2) For each copy, a corresponding data augmentation transformation combination A is randomly generated. The augmentation transformation combination A can be represented by a 6-dimensional vector: A = [a1 a2 a3 a4 a5 a6], ai ∈ {0, 1}, i = 1, 2, ..., 6. Here, a1, a2, a3, a4, a5, and a6 correspond to translation, rotation, saturation, noise addition, brightness, and contrast, respectively. 1 indicates that the corresponding transformation is activated, and 0 indicates that it is not activated, with an activation probability of 0.5.

[0128] 1.3) Check whether the randomly generated augmented transformation combination A contains translation or rotation (i.e., whether the first dimension a1 or the second dimension a2 of the A vector is 1). If it contains translation or rotation, perform the corresponding transformation on the segmentation annotation pixel mask of the corresponding image.

[0129] 1.4) Apply the corresponding random transformation to the image copy according to the transformation combination A, and obtain the segmentation annotation mask of the red seal therein.

[0130] 1.5) Based on the segmentation annotation mask, crop the red seal contour in the image, randomly select 10 from the corresponding copies of different images, and paste the red seal contour on them.

[0131] 1.6) Based on the augmented dataset of images with red seals, perform transfer learning on the open-source pre-trained Unet segmentation model to obtain a semantic segmentation network model dedicated to red seals.

[0132] However, since the underlying layer of the semantic segmentation network model is still based on a deep neural network and is essentially a probabilistic method, there may be cases of misjudgment of some local detail pixels, resulting in unevenness of the red seal in the target segmentation map. As Figure 9 shown in the existing seal images before and after the output of the semantic segmentation network model, Figure 9 in (a) is the original red seal slice, Figure 9 in (b) is the extraction effect of the segmentation model. After segmentation extraction, the lower half of the character "Zhang" in the "Financial Special Seal" is lost.

[0133] Deploy the offline-trained red seal semantic segmentation network model online, and use the red seal semantic segmentation network model to perform inference on the to-be-processed service image I to obtain the seal pixel mask map M1. This is equivalent to the above step S210.

[0134] (2) In the post-processing stage, based on constructing a heuristic metric by combining color features, perform fine-grained repair on the output of the red seal semantic segmentation model.

[0135] 2.1) Perform color model conversion on the to-be-processed service image I, and convert it from RGB to HSV according to the above formula (1) to obtain I_1.

[0136] 2.2) For I_1 converted to HSV, set the pixel values whose HSV component values fall within the red range to 1 according to the above formula (2), and set the pixel values of other HSV component values outside the red range to 0, to obtain the red image pixel mask map M2 based on color features.

[0137] 2.3) Calculate the pixel difference set D between the image pixel mask map M2 and the seal pixel mask map M1 (i.e., the set of pixels whose color features conform to the red range but are judged as non-red seal parts by the image segmentation model).

[0138] 2.4) For each pixel in the difference set D, calculate the false negative index of the red stamp in the W×W neighborhood according to the above formula (3).

[0139] 2.5) If the false negative index of a pixel is greater than the threshold of 0.3, set the pixel at the corresponding position in M1 from 0 to 1; otherwise, keep it at 0, and the resulting mask image M3 is obtained. This is equivalent to steps S220 to S240 above.

[0140] (3) Based on the coordinate information in the red stamp pixel mask, extract the pixels at the corresponding positions in the original image to generate a color target image containing only the red stamp.

[0141] 3.1) Create an RGB image T according to the size of the mask image M3 to be output, and initialize the background to white.

[0142] 3.2) For the pixels with a value of 1 in the mask image M3 to be output, fill in the red RGB components at the corresponding coordinate positions in T, and output the target color image T with a white background and only red stamps.

[0143] The input to this algorithm step is a training set S of images with red stamps and a business image I to be processed, and the output is a target color image T from which the red stamps are extracted.

[0144] Figure 10 , Figure 11 The following are demonstrations of the results of extracting red seals from scanned and photographed documents in practical applications. Figure 10 Image (a) is a schematic diagram of the scanned document. Figure 10 (b) is the image extracted from the red stamp on the scanned document; Figure 11 (a) is a schematic diagram of the photographed object. Figure 11 Image (b) shows the image extracted from the red stamp on the photographed document. As can be seen from the example, this disclosure can simultaneously handle the task of extracting red stamps from both scanned and photographed documents, demonstrating excellent versatility in various scenarios.

[0145] This disclosure focuses on the electronic seal verification scenario in corporate banking, aiming to address the current limitations of red seal extraction technology, particularly its low accuracy, robustness, and versatility. By analyzing the shortcomings of current seal extraction techniques, a seal extraction method applicable to both scanned and photographed images is proposed. This method integrates contour and color features, expanding the dataset through a data augmentation method suitable for the verification scenario to train a lightweight seal semantic segmentation network model. This model efficiently utilizes seal contour semantic features to achieve pixel-level seal extraction, significantly improving generalization while effectively resolving the problem of overlapping seals. By rationally fusing contour and color features, the two features are organically complementary, achieving a synergistic effect greater than the sum of its parts, greatly improving the accuracy and stability of seal extraction and laying a solid foundation for overall seal verification processing.

[0146] Figure 12 A block diagram of a stamp image processing system according to an embodiment of the present disclosure is shown schematically.

[0147] like Figure 12 As shown, the processing system 1200 for the seal image includes: a segmentation module 1210, a transformation module 1220, a determination module 1230, a calculation module 1240, and a bonding module 1250.

[0148] The segmentation module 1210 is used to segment the image to be processed using a pre-trained semantic segmentation network model to obtain a stamp pixel mask image; wherein the semantic segmentation network model is pre-trained based on automatically augmented training samples. According to embodiments of this disclosure, the segmentation module 1210 can, for example, be used to perform the functions described above. Figure 2 The steps described in S210 will not be repeated here.

[0149] Transformation module 1220 is used to perform color space transformation on the image to be processed to obtain a transformed image pixel mask map. According to embodiments of this disclosure, transformation module 1220 can, for example, be used to perform the functions described above. Figure 2 The steps described in S220 will not be repeated here.

[0150] The determining module 1230 is used to determine the pixel difference between the stamp pixel mask image and the image pixel mask image. According to embodiments of this disclosure, the determining module 1230 can, for example, be used to perform the above-described... Figure 2 The steps described in S230 will not be repeated here.

[0151] The calculation module 1240 is used to calculate the pseudo-negative index of each pixel in the pixel difference set, and adjust the stamp pixel mask image according to the pseudo-negative index to obtain the mask image to be output. According to embodiments of this disclosure, the calculation module 1240 can, for example, be used to perform the functions described above. Figure 2 The steps described in S240 will not be repeated here.

[0152] The lamination module 1250 is used to convert the mask image to be output into a color sub-image and laminate it with a preset background image to obtain a stamp image. According to embodiments of this disclosure, the lamination module 1250 can, for example, be used to perform the functions described above. Figure 2 The steps described in S250 will not be repeated here.

[0153] It should be noted that any one or more of the modules, sub-modules, units, and sub-units according to the embodiments of this disclosure, or at least part of the functions of any one or more of them, can be implemented in one module. Any one or more of the modules, sub-modules, units, and sub-units according to the embodiments of this disclosure can be divided into multiple modules for implementation. Any one or more of the modules, sub-modules, units, and sub-units according to the embodiments of this disclosure can be at least partially implemented as hardware circuits, such as field-programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems-on-a-chip, systems-on-a-substrate, systems-on-package, application-specific integrated circuits (ASICs), or implemented in hardware or firmware by any other reasonable means of integrating or packaging circuits, or implemented in software, hardware, and firmware, or in any appropriate combination of any of these three implementation methods. Alternatively, one or more of the modules, sub-modules, units, and sub-units according to the embodiments of this disclosure can be at least partially implemented as computer program modules, which, when run, can perform corresponding functions.

[0154] For example, any plurality of the segmentation module 1210, transformation module 1220, determination module 1230, calculation module 1240, and bonding module 1250 may be combined into one module, or any one of these modules may be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of other modules and implemented in one module. According to embodiments of the present disclosure, at least one of the segmentation module 1210, transformation module 1220, determination module 1230, calculation module 1240, and bonding module 1250 may be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, at least one of the segmentation module 1210, transformation module 1220, determination module 1230, calculation module 1240 and bonding module 1250 may be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.

[0155] Figure 13 A block diagram schematically illustrates an electronic device suitable for implementing the methods described above, according to embodiments of the present disclosure. Figure 13 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0156] like Figure 13 As shown, an electronic device 1300 according to an embodiment of the present disclosure includes a processor 1301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1302 or a program loaded from a storage portion 1308 into a random access memory (RAM) 1303. The processor 1301 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1301 may also include onboard memory for caching purposes. The processor 1301 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0157] RAM 1303 stores various programs and data required for the operation of electronic device 1300. Processor 1301, ROM 1302, and RAM 1303 are interconnected via bus 1304. Processor 1301 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 1302 and / or RAM 1303. It should be noted that the programs may also be stored in one or more memories other than ROM 1302 and RAM 1303. Processor 1301 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.

[0158] According to embodiments of this disclosure, the electronic device 1300 may further include an input / output (I / O) interface 1305, which is also connected to a bus 1304. The electronic device 1300 may also include one or more of the following components connected to the I / O interface 1305: an input section 1306 including a keyboard, mouse, etc.; an output section 1307 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1308 including a hard disk, etc.; and a communication section 1309 including a network interface card such as a LAN card, modem, etc. The communication section 1309 performs communication processing via a network such as the Internet. A drive 1310 is also connected to the I / O interface 1305 as needed. A removable medium 1311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 1310 as needed so that computer programs read from it can be installed into the storage section 1308 as needed.

[0159] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method for processing a seal image according to embodiments of this disclosure.

[0160] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 1302 and / or RAM 1303 and / or one or more memories other than ROM 1302 and RAM 1303 described above.

[0161] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code enables the computer system to implement the seal image processing method provided in the embodiments of this disclosure.

[0162] When the computer program is executed by the processor 1301, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, modules, units, etc., described above can be implemented by computer program modules.

[0163] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 1309, and / or installed from the removable medium 1311. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0164] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1309, and / or installed from the removable medium 1311. When the computer program is executed by the processor 1301, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, modules, units, etc., described above can be implemented by computer program modules.

[0165] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0166] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0167] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.

[0168] Although this disclosure has been shown and described with reference to specific exemplary embodiments thereof, those skilled in the art will understand that various changes in form and detail may be made to this disclosure without departing from the spirit and scope of the disclosure as defined by the appended claims and their equivalents. Therefore, the scope of this disclosure should not be limited to the above embodiments, but should be defined not only by the appended claims, but also by their equivalents.

Claims

1. A method for processing a seal image, characterized in that, include: A pre-trained semantic segmentation network model is used to segment the image to be processed, resulting in a stamp pixel mask image; wherein, the semantic segmentation network model is pre-trained based on automatically expanded training samples; The image to be processed is transformed in color space to obtain the transformed image pixel mask. Determine the pixel difference between the seal pixel mask and the image pixel mask; Calculate the pseudo-negative index for each pixel in the pixel difference set, and adjust the stamp pixel mask image according to the pseudo-negative index to obtain the mask image to be output; The mask image to be output is converted into a color sub-image and then matched with a preset background image to obtain a stamp image; The calculation of the false negative index for each pixel in the pixel difference set includes: The target probability of each pixel in the pixel difference set within a preset neighborhood is obtained, and the target probability is the probability that the semantic segmentation network model determines that the pixel belongs to the color of the seal image; The false negative index for each pixel is calculated based on the target probability and a preset threshold.

2. The method for processing a seal image according to claim 1, characterized in that, The semantic segmentation network model is pre-trained based on automatically expanded training samples. The pre-training operation includes: Pixel-level foreground annotation is performed on training samples of images with stamps; Data augmentation is performed on the labeled image training samples to obtain a sample image dataset; The sample image data is input into the semantic segmentation network model for training to obtain the parameters of the semantic segmentation network model.

3. The method for processing a seal image according to claim 2, characterized in that, The data augmentation of the training samples of the stamped images includes: The image data in the image training samples is copied to generate multiple image copies; Each of the image copies is randomly transformed to obtain a sample image dataset; wherein the random transformation includes one or more combinations of translation, rotation, saturation transformation, noise addition, brightness transformation and contrast transformation.

4. The method for processing a seal image according to claim 1, characterized in that, The step of performing color space transformation on the image to be processed includes: The image to be processed is converted into an image matrix. Map the image matrix to be processed to a hue-saturation-brightness color space; Based on the color range of the seal image in the hue-saturation-brightness color space, a transformed image pixel mask is obtained.

5. The method for processing a seal image according to claim 4, characterized in that, The step of mapping the image matrix to be processed to the hue-saturation-brightness color space includes: The red-green-blue color values ​​of the image matrix to be processed are calculated according to the conversion formula, and the color is decomposed into three channels: hue, saturation and brightness, to obtain the hue-saturation-brightness color space of the image to be processed.

6. The method for processing a seal image according to claim 4, characterized in that, Determining the pixel difference between the seal pixel mask and the image pixel mask includes: Obtain the first coordinate position of the mask value being 0 in the seal pixel mask image; Obtain the second coordinate position of the image pixel mask image with a mask value of 1; The intersection of the first coordinate position and the second coordinate position is determined to obtain the pixel difference set.

7. The method for processing a seal image according to claim 1, characterized in that, The step of adjusting the stamp pixel mask image according to the false negative index includes: If the false negative index meets the preset conditions, the pixel is identified as belonging to the color of the seal image, and the mask value of the corresponding pixel in the seal pixel mask image is set to 1 to obtain the mask image to be output.

8. The method for processing a seal image according to claim 1, characterized in that, The step of converting the mask image to be output into a color sub-image includes: Determine the size range of the output mask image; The coordinate positions with a mask value of 1 within the specified size range are filled with the corresponding red-green-blue components, thus converting them into the color sub-image.

9. The method for processing a seal image according to claim 8, characterized in that, The process of fitting the preset background image includes: Generate a white background image that is adapted to the size range of the mask image; The white background image is overlaid with the colored sub-image based on the coordinate position where the mask value is 1, to obtain the stamp image.

10. A system for processing a seal image, characterized in that, include: The segmentation module is used to segment the image to be processed using a pre-trained semantic segmentation network model to obtain a stamp pixel mask image; wherein, the semantic segmentation network model is pre-trained based on automatically expanded training samples; The transformation module is used to perform a color space transformation on the image to be processed to obtain a transformed image pixel mask map. The determining module is used to determine the pixel difference between the seal pixel mask and the image pixel mask; A calculation module is used to calculate the pseudo-negative index of each pixel in the pixel difference set, and adjust the stamp pixel mask image according to the pseudo-negative index to obtain the mask image to be output; wherein, calculating the pseudo-negative index of each pixel in the pixel difference set includes: obtaining the target probability of each pixel in the pixel difference set within a preset neighborhood range, the target probability being the probability that the semantic segmentation network model determines that the pixel belongs to the color of the stamp image; and calculating the pseudo-negative index of each pixel according to the target probability and a preset threshold. The bonding module is used to convert the mask image to be output into a color sub-image and bond it with a preset background image to obtain a stamp image.

11. An electronic device, comprising: processor; A memory storing a computer-executable program that, when executed by the processor, causes the processor to perform the method for processing a seal image according to any one of claims 1 to 9.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the method for processing a seal image according to any one of claims 1 to 9.

13. A computer program product comprising a computer program that, when executed by a processor, implements a method for processing a seal image according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Intelligent identification method for vehicle exhaust inspection report

    CN110245583A

  • Handwritten signature segmentation method and device, computer equipment, storage medium and product

    CN115862027A