A method for removing stains from scanned images based on deep learning
Through deep learning technology, the contrast enhancement and object detection are improved, and the problem of low accuracy of stain recognition in the scanned image is solved, effectively removing black, white and dot-like stains is achieved, and image quality is improved.
Patent Information
- Application Number
- CN202111510410.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-10
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2041-12-10
AI Technical Summary
The existing image stain removal methods are not accurate and have insufficient robustness when identifying and removing stains in scanned files. In particular, the removal effect of black and white, white edges, and dot-like stains is poor, and traditional methods are difficult to meet the real-time requirements.
Deep learning technology is used to identify and remove stains from scanned documents through improved contrast enhancement and object detection. Specific steps include: improving the contrast of the scanned file, marking the main components and making differences in the image to obtain edge stains, eliminating page number interference, and analyzing the color distribution around the stains and automatically filling the stain area.
It improves the contrast of scanned images and the accuracy of stain recognition, enhances the robustness of contrast enhancement, effectively removes black edges, white edges and dot-shaped stains in scanned images, and improves the readability and aesthetics of images.
Smart Images

Figure CN114299507B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the fields of computer vision and pattern recognition, image processing and picture stain removal systems, and in particular relates to a method for removing stains from scanned images based on deep learning. Background Art
[0002] The digitization of paper archives offers many advantages, such as long-term preservation and easy retrieval. However, actual archival materials often have some stains, which greatly affect the image quality of scanned images, affecting their aesthetics, readability, and even subsequent operations such as OCR recognition.
[0003] Currently, there are relatively few such algorithms. This may be because removing stains will slightly affect the authenticity of the scanned document (but there are many scenarios where stains in the image do need to be removed). More likely, stains themselves are complex, such as irregularity, fragmentation, diversity, and large scale differences. This makes the current design of stain identification and removal methods quite challenging.
[0004] In theory, removing stains from images can be accomplished through target detection, which can be divided into traditional target detection algorithms and deep learning-based target detection methods.
[0005] To address the problem of removing long, irregular, interfering lines of the same color from text images, Cong Cheng et al. (Long Hua, Duan Ying, Shao Yubin, et al. A Method for Removing Long Interfering Lines from Chinese Text Images, CN111209912A[P]. 2020.) used an image processing method to detect and remove these lines. This method scans the points to be tested and uses a greedy algorithm to obtain line segment weights. A threshold is set to determine whether the points are adjacent to the text. Finally, pixel-level domain features are used to remove interfering pixels from the text image. This method utilizes traditional image processing techniques and offers good real-time performance. However, the accuracy of the smudge removal needs to be further improved. Furthermore, the method is only suitable for removing long, irregular, interfering lines of the same color, but is ineffective for removing black and white smudges, smudges with white edges, and dot-like smudges.
[0006] To detect and repair solid stains in dashcam video and attempt to restore the contaminated areas, Liu Dongyang (Liu Dongyang. Research on Repairing In-Vehicle Video Debris Based on an Improved Criminisi Algorithm [D]. Jilin University) proposed a statistical approach based on time. This approach only marks a stain if the probability of it being identified exceeds 80% within a certain period. This method, which studies video stain removal, has shown good results. However, it is not applicable to single images, such as scanned images (missing consecutive video frames).
[0007] In summary, although the image stain removal method has achieved certain results, due to the difficulties of irregularity, fragmentation, diversity, large scale differences and other difficulties of stains, the effect of stain removal based on a single image using traditional methods is not ideal. According to our research, there is currently no method for removing stains from scanned copies based on deep learning. In order to meet the requirements of practical applications, there is an urgent need to make further improvements in the accuracy and real-time performance of stain removal. The present invention creatively proposes to use deep learning to identify the main components of the image, thereby cleverly removing the black and white and white edge types of stains around; for the point-like stain type stains in the main components, deep learning is used to perform target recognition to remove them, and it is analyzed that the page number target is the target type that is most likely to interfere with stain recognition, and the page number is involved in the training of the deep learning target, further improving the accuracy of stain recognition; in addition, in the image preprocessing stage, deep learning image classification technology is used to determine the key parameters of the logarithmic transformation by intelligently predicting the image contrast, thereby improving the traditional logarithmic transformation image enhancement, thereby further ensuring the accuracy of subsequent stain recognition. Summary of the Invention
[0008] The purpose of the embodiments of the present invention is to provide a method for removing stains from scanned images based on deep learning, aiming to solve the problems that the recognition accuracy of existing image stains is not up to standard and / or unsatisfactory and the robustness is not strong.
[0009] The feature of this system is that it improves the contrast of scanned bank archive images by combining the results of deep learning contrast classification with the improved traditional contrast enhancement. It also uses deep learning technology to detect the main components, stains, and page numbers of the entire scanned image. It obtains black and white edge stains at the edge by performing image subtraction, and analyzes the color distribution around the stains by designing a simple and limited algorithm to automatically fill in the stain area. Specifically, it includes:
[0010] Step 1: Use the deep learning contrast classification results to improve the contrast of the scanned image through traditional contrast enhancement.
[0011] Step 2: Label the main components of the scanned image, perform deep learning training to obtain a model, detect the main components of the scanned image, and obtain the edge position of the stain by performing image subtraction based on the main components;
[0012] Step 3: Using deep learning to eliminate page number interference, complete the detection of point-like stains;
[0013] Step 4: Automatically fill the stain area by analyzing the color distribution around the stain.
[0014] Furthermore, the present invention describes a method for removing stains from scanned images based on deep learning, characterized in that the deep learning contrast classification described in step one refers to collecting 10,000 archive scanned images in real scenes, and then dividing them into 10 contrast levels, manually dividing the images into 10 contrast categories, and using a self-streamlined VGG16 deep network for training to obtain an image contrast classification network model (the traditional VGG16 contains 16 hidden layers (13 convolutional layers and 3 fully connected layers), and this patent uses a self-streamlined VGG network with only 10 convolutional layers and 2 fully connected layers. Experiments show that the speed after such simplification is significantly improved, and the accuracy is minimally reduced), and then using this model to perform deep learning model inference on the original input image to obtain a deep learning contrast classification result of the test image, set as Level (abbreviated as L), and the range of Level is 1~10.
[0015] Furthermore, the method for removing stains from scanned images based on deep learning described in the present invention is characterized in that, in step 1, the deep learning contrast classification result is used to improve the traditional contrast enhancement, and the Level value obtained by the self-streamlined VGG deep learning classification network is used to adjust the key coefficient L of the traditional contrast enhancement. The traditional contrast enhancement refers to logarithmic transformation image enhancement, and the transformation function is , where r is the grayscale value of the input image, s is the grayscale value of the output image, and L is the key coefficient.
[0016] Furthermore, the deep learning-based method for removing stains from scanned images described in the present invention is characterized in that, in step 2, labeling the principal components of the scanned image refers to manually labeling the image regions (principal components) that need to be retained in the original scanned image, based on the requirements of electronic archiving, to serve as training data for subsequent deep learning. Detecting the principal components of the scanned image refers to training the labeled principal components using the YOLOV2 deep learning object detection network to obtain a principal component detection model, and then performing forward inference on the deep network to obtain the principal component image regions of the original scanned image.
[0017] Furthermore, the present invention describes a method for removing stains from scanned images based on deep learning, characterized in that the step 2 of obtaining stains at edge positions by image subtraction refers to subtracting the area of the original scanned image from the area of the main component image, thereby obtaining black edge and / or white edge type stains located at the edge of the original scanned image. This is because we have found that there is usually a high probability of black edge and / or white edge type stains at the edges of the scanned image.
[0018] Furthermore, the method for removing stains from scanned images based on deep learning described in the present invention is characterized in that, under the premise of using deep learning to eliminate page number interference as described in step three, the detection of point-like stain type stains is completed. When training the deep learning model, the YOLOV2 deep network is used to train not only point-like stain type stains, but also page numbers that are easily confused with point-like stain type stains, thereby improving the accuracy of the deep learning model for point-like stains.
[0019] Furthermore, the method for removing stains from scanned images based on deep learning described in the present invention is characterized in that the automatic filling of the stain area by analyzing the color distribution around the stain in step four means that, considering that each stain area should be filled with a different color, for each identified stain area, the image area around the area is counted, and after sorting and eliminating the first 10% and last 10% of the sequence, the majority color is counted and intelligent color filling is performed to achieve the purpose of harmonious stain removal.
[0020] The present invention provides a method for removing stains from scanned images based on deep learning, focusing on the recognition of black and white edge stains on the four sides of bank archive scans and point-shaped stains in the main components. Compared with existing image stain detection and removal technologies, the present invention has the following advantages and effects: in order to enhance the contrast quality of scanned images and enhance the contrast of stain detection at the same time, the scanned images are used to perform contrast image classification based on the characteristics of bank scanned images, thereby obtaining adaptive key parameters for subsequent contrast adjustment, and it is proposed to improve the traditional contrast enhancement by using the deep learning contrast classification results to improve the contrast of scanned images; identify special stains around the scanned images ( When there are black or white edge type stains with large aspect ratio differences, the main components of the scanned image are annotated. After deep learning training to obtain a model, the main components of the scanned image are detected. Based on the main components, the stains at the edge are cleverly obtained by image subtraction, overcoming the problem that the large aspect ratio differences of special stains around the image lead to poor direct recognition effect of deep learning. When identifying point-type stains, deep learning is used to eliminate the interference of page numbers to complete the detection of point-type stains. Since the background color distribution of the entire scanned image varies, it is proposed to automatically fill the stain area by analyzing the color distribution around the stain, so that the identified stain can be filled with a coordinated color. The method of the present invention can effectively address the impact of contrast differences in scanned images on stain recognition, can avoid the poor direct recognition effect of deep learning due to large aspect ratio differences of special stains (black or white edge type stains) around the image by designing main component recognition, and increase the recognition of page numbers (non-stains) to improve the recognition of point-type stains in the main components. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1This is a schematic diagram of the structure of a system for removing stains from scanned images based on deep learning, provided by an embodiment of the present invention;
[0022] Figure 1 Middle: A is the contrast offline training module, B is the image preprocessing module, C is the principal component detection offline training module, D is the point stain and page number detection offline classification module, and E is the stain online detection module
[0023] Figure 2 The main steps of the method for removing stains from scanned images based on deep learning provided by the embodiment of the present invention are as follows: DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0025] The application principle of the present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0026] like Figure 2 As shown, a method for removing stains from a scanned image based on deep learning in an embodiment of the present invention includes the following steps:
[0027] S101, uses the deep learning contrast classification results to improve the contrast of the scanned document;
[0028] S102, marking the main components of the scanned image, performing deep learning training to obtain a model, detecting the main components of the scanned image, and performing image subtraction based on the main components to obtain stains at the edge position;
[0029] S103, using deep learning to eliminate page number interference and complete the detection of point-like stains;
[0030] S104: Automatically fill the stain area by analyzing the color distribution around the stain.
[0031] The deep learning contrast classification described in step S101 refers to collecting 10,000 scanned images of archives in real scenes, and then dividing them into 10 contrast levels. The images are manually divided into 10 contrast categories, and trained using a self-streamlined VGG16 deep network to obtain an image contrast classification network model (the traditional VGG16 contains 16 hidden layers (13 convolutional layers and 3 fully connected layers). This patent uses a self-streamlined VGG network with only 10 convolutional layers and 2 fully connected layers. Experiments show that the speed after such streamlining is significantly improved, and the accuracy is minimally reduced). Then, using this model, deep learning model inference is performed on the original input image to obtain a deep learning contrast classification result of the test image, which is set as Level (abbreviated as L), and the range of Level is 1 to 10.
[0032] The step S101 uses the deep learning contrast classification results to improve the traditional contrast enhancement, and uses the Level value obtained by the self-streamlined VGG deep learning classification network to adjust the key coefficient L of the traditional contrast enhancement. The traditional contrast enhancement refers to logarithmic transformation image enhancement, and the transformation function is , where r is the grayscale value of the input image, s is the grayscale value of the output image, and L is the key coefficient.
[0033] Marking the principal components of the scanned image in step S102 refers to manually marking the image regions (principal components) that need to be retained in the original scanned image, based on the requirements of electronic archiving, to be used as training data for subsequent deep learning. Detecting the principal components of the scanned image refers to training the marked principal components using the YOLOV2 deep learning object detection network to obtain a principal component detection model, and then performing forward inference on the deep network to obtain the principal component image regions of the original scanned image.
[0034] The step S102 of obtaining the edge position of the stain by image subtraction refers to subtracting the area of the original scanned image from the area of the main component image, thereby obtaining black edge and / or white edge type stains located at the edge of the original scanned image. This is because we find that there is usually a high probability of black edge and / or white edge type stains on the edge of the scanned image.
[0035] Under the premise of using deep learning to eliminate page number interference as described in step S103, the detection of point-like stain type stains is completed. When training the deep learning model, the YOLOV2 deep network is used to train not only point-like stain type stains, but also page numbers that are easily confused with point-like stain type stains, thereby improving the accuracy of the deep learning model for point-like stains.
[0036] The automatic filling of the stain area by analyzing the color distribution around the stain in step S104 means that, considering that each stain area should be filled with a different color, for each identified stain area, the image area around the area is counted, and after sorting and eliminating the first 10% and last 10% of the sequence, the majority color is counted and intelligent color filling is performed to achieve the purpose of harmonious stain removal.
[0037] like Figure 1 As shown, a method for removing stains from scanned images based on deep learning in an embodiment of the present invention mainly consists of a contrast offline training module A, an image preprocessing module B, a principal component detection offline training module C, a point stain and page number detection offline classification module D, and a stain online detection module E.
[0038] The contrast offline training module A uses a deep learning image classification network to classify the contrast of scans.
[0039] The image preprocessing module B, connected to module A, is used to improve the traditional contrast enhancement algorithm through deep learning contrast classification.
[0040] The principal component detection offline training module C uses a deep learning object detection network to detect the principal components of the scanned image.
[0041] The offline classification module D for point stains and page number detection uses a deep learning object detection network to not only detect point stains but also detect page number targets that are most easily interfered with.
[0042] The online stain detection module E is connected to modules C and D to realize two types of stain recognition: one is the recognition of black and white edge stains, and the other is the recognition of dot stains. In addition, the online detection module also recognizes page numbers (to improve the recognition rate of dot stains). The recognized page numbers are not considered stains.
[0043] Specific embodiments of the present invention:
[0044] The overall process of the method of the present invention is as follows Figure 1 As shown, the main body of the method of the present invention includes four parts: 1) using the deep learning contrast classification results to improve the traditional contrast enhancement and improve the contrast of the scanned document; 2) marking the main components of the scanned document, performing deep learning training to obtain the model, detecting the main components of the scanned document, and obtaining the stains at the edge position by image subtraction based on the main components; 3) using deep learning to eliminate the interference of page numbers to complete the detection of point-like stains; 4) automatically filling the stain area by analyzing the color distribution around the stain.
[0045] 1. Use the results of deep learning contrast classification to improve the contrast of scanned images by using traditional contrast enhancement.
[0046] Scanned stains often have irregular shapes, a large background area (scattered objects), widely varying aspect ratios, diverse colors, and poor contrast, making them challenging to identify. The rapid development of computer vision and deep learning technologies has made it possible to apply deep learning techniques to the identification of stains in scanned images. Contrast is particularly problematic in scanned images of natural scenes. To improve the accuracy and robustness of stain recognition, this paper proposes to first classify contrast using a streamlined VGG deep learning network to obtain a contrast level. This level is then used as a key parameter for subsequent image enhancement using traditional logarithmic transformations, improving upon existing logarithmic transformation contrast enhancement methods.
[0047] When performing contrast classification, we use deep learning-based contrast classification, specifically using a streamlined VGG network. This includes a contrast classification offline training module and a contrast online classification module.
[0048] 1.1 Contrast Classification Offline Training Module and Contrast Online Classification Module
[0049] Offline training is implemented using a self-streamlined VGG16 network. Compared to AlexNet, VGG16 uses a continuous 3x3 convolution kernel instead of the larger kernels (11x11, 7x7, and 5x5) found in AlexNet. For a given receptive field, stacking small kernels achieves superior performance over using larger kernels. This is because multiple nonlinear layers increase network depth, enabling learning of more complex patterns while reducing computational overhead. Simply put, in VGG, three 3x3 convolution kernels are used instead of 7x7 kernels, and two 3x3 convolution kernels are used instead of 5x5 kernels. This increases network depth while maintaining the same receptive field, significantly improving neural network performance. The traditional VGG16 contains 16 hidden layers (13 convolutional layers and 3 fully connected layers). This patent uses a self-streamlined VGG network with only 10 convolutional layers and 2 fully connected layers. Experiments show that this streamlined approach significantly improves speed with minimal loss of accuracy.
[0050] Table 1 shows the structure of the VGG16 network after self-pruning. The entire network uses the same convolution kernel size (3x3) and maximum pooling size (2x2). Combining several convolutional layers with small filters (3x3) performs better than a single convolutional layer with a single large filter (5x5 or 7x7), demonstrating that performance can be improved by deepening the network structure.
[0051] Table 1 VGG16 network structure after self-simplification
[0052]
[0053] When training the self-streamlined VGG network, 10,000 real-world archive scans were collected and then manually divided into 10 contrast levels. The images were trained for 60 iterations with a learning rate of 3×10 -3 , and a weight decay of 0.9 was added to the learning rate of all models. The batch size (BatchSize) was set to 20, and the Adam algorithm was used to optimize the loss function to complete offline contrast classification training and obtain the contrast classification model. For online contrast classification, the original scanned image was input into the contrast classification model to obtain 10 contrast level categories L. L serves as the key parameter for subsequent image enhancement using traditional logarithmic transformation.
[0054] 1.2 Improvement of traditional logarithmic transformation image enhancement
[0055] When a display cannot display a wide range of grayscale values, many grayscale details are lost. A logarithmic transformation can shift the dynamic range to a suitable range, allowing for greater detail. This transformation expands the low grayscale values of an image, revealing more detail, while compressing the high grayscale values, reducing detail in these areas, thereby emphasizing the low grayscale portions of the image. The logarithmic transformation is shown in Formula 1.
[0056] (1)
[0057] Wherein, L is the contrast classification level obtained by the present invention through the self-simplified VGG network model, r is the grayscale value of a certain pixel input, and the present invention performs an improved contrast enhancement on each of the RGB channels of the original scan.
[0058] 2. Label the main components of the scanned image, perform deep learning training to obtain the model, detect the main components of the scanned image, and use image subtraction to obtain the edge position of the stain based on the main components.
[0059] The YOLOv2 algorithm uses a single convolutional network model for end-to-end object detection. It first resizes the input image to 448x448, feeds it into the convolutional network, and finally processes the network's predictions to obtain the detected objects. Compared to the R-CNN algorithm, YOLOv2 utilizes a unified framework, which is not only faster but also end-to-end. YOLOv2 uses a convolutional network to extract features and then uses fully connected layers to generate predictions. The network architecture is modeled after the Google LeNet model, consisting of 24 convolutional layers and two fully connected layers. Convolutional layers primarily use 1x1 convolutions to reduce the dimensionality of feature channels, followed by 3x3 convolutions. Leaky ReLU activation functions (max(x, 0.1x)) are used in both convolutional and fully connected layers. However, the final layer uses a linear activation function.
[0060] In terms of YOLOv2 training, for the annotation benchmark (Ground Truth) in the scanned image, if the center point of a certain annotation box falls within a certain cell, then the bounding box corresponding to the 5 prior boxes in the cell is responsible for predicting it. Which specific bounding box predicts it needs to be determined during training, that is, the bounding box with the largest IOU with the annotation benchmark predicts it, and the remaining 4 bounding boxes do not match the annotation benchmark. YOLOv2 also needs to assume that each cell contains at most one annotation benchmark, but in reality there will basically not be more than 1. The prior box that matches the annotation benchmark calculates the coordinate error, confidence error, and classification error, while the other bounding boxes only calculate the confidence error. The loss function of YOLOv2 is also the mean square error function. In the present invention, a total of 20,000 scanned images were annotated with their principal components. The attenuation coefficient, momentum parameter, and learning rate of each image were set to 0.0003, 0.85, and 0.001, respectively. The steps mode was selected to update the learning rate. When the number of training iterations reached 12,000 and 18,000, the learning rate was reduced to 25% and 5% of the initial learning rate, respectively, to further converge the loss function.
[0061] After training the principal component deep learning model, the contrast-enhanced scanned image is fed into the model for forward inference. Detection boxes with a confidence score above 0.5 are considered the principal components of the current scanned image. The purpose of obtaining the principal components is, firstly, to identify black and white edge stains by subtracting the original scanned image from the image region containing the principal components; secondly, to identify remaining point-like stains solely within the principal components, thereby improving the accuracy of subsequent point-like stain identification. This cleverly identifies black and white edge stains located at the edges of the scanned image.
[0062] 3. Detecting dot-type stains by using deep learning to eliminate page number interference
[0063] Experiments have shown that directly using the YOLOv2 network to detect point-like stains in the principal component can easily lead to page numbers being mistakenly identified as point-like stains. The reason for this is that the page numbers in bank archive scans are small objects, and the resolution of the entire image is relatively high. Therefore, the YOLOv2 deep learning network is prone to mistaking small page numbers for stains. However, page numbers are important information in the scans that must be preserved and cannot be determined. Therefore, this patent improves the detection accuracy of the YOLOv2 stain detection network by simultaneously learning page numbers (and also learning point-like stains) in the stain detection network, thereby enhancing the protection of page numbers.
[0064] 4. Automatically fill the stain area by analyzing the color distribution around the stain
[0065] After identifying the stains (this patent includes black edges, white edges and dot-shaped stains around the scanned document), the purpose is to remove them from the scanned document to improve the readability and aesthetics of the scanned document. However, directly filling with fixed values will result in a large difference in color between the filled area and the surrounding original image. The present invention proposes to automatically fill the stain area by analyzing the color distribution of the surrounding area. Specifically, all pixels in the surrounding image area of the current stain area are taken (2 or 3 stain areas located at the edge are taken, and four are taken as much as possible for the others, and the area size of each is the size of the current stain area to be filled), and the RGB values of the obtained pixels are grayscaled (according to formula 2, the grayscale value Gray is obtained, multiple), and then the obtained grayscale values are sorted, and the top 10% and the bottom 10% are removed. The mode of the remaining grayscale values is calculated to determine the corresponding pixel that should be filled, and then the RGB value of the pixel is taken, and further, the RGB value is filled into the current stain area. Finally, the filling operation of the current stain area is completed. A scanned document usually has multiple stained areas. For each stained area, the above-mentioned color distribution analysis around the stain is performed to automatically fill the stained area.
[0066] (2)
[0067] Among them, R, G, and B are the RGB channel values of a pixel respectively, and Gray is the grayscale value after conversion.
Claims
1. A method for removing stains from scanned images based on deep learning, characterized in that In view of the imaging characteristics of bank archive scans, we improve the contrast of scanned documents by using the results of deep learning contrast classification to improve traditional contrast enhancement. Deep learning technology is also used to detect the main components, dot stains, and page numbers of the entire scanned document. Stains at the edge are obtained by image subtraction. A simple and limited algorithm is designed to analyze the color distribution around the stains and automatically fill in the stained areas. Specifically, the following are included: Step 1: Use the deep learning contrast classification results to improve the traditional contrast enhancement and improve the contrast of the scanned documents. Specifically: collect 10,000 archive scanned images in real scenes, and then divide them into 10 contrast levels. Manually divide the images into 10 contrast categories, and use the self-streamlined VGG16 deep network for training to obtain an image contrast classification network model; the image contrast classification network model refers to a deep network obtained by streamlining the traditional VGG16 to only 10 convolutional layers and 2 fully connected layers; then use this model to perform deep learning model inference on the original input image to obtain the deep learning contrast classification result of the test image, set as Level, and the range of Level is 1~10. Use the Level value to adjust the key coefficient L of the traditional contrast enhancement. The traditional contrast enhancement refers to logarithmic transformation image enhancement, and the transformation function is , where r is the grayscale value of the input image and s is the grayscale value of the output image; Step 2: Label the main components of the scanned image, perform deep learning training to obtain a model, detect the main components of the scanned image, and obtain the edge position of the stain by performing image subtraction based on the main components; Step 3: Using deep learning to eliminate page number interference, complete the detection of point-like stains; Step 4: Automatically fill the stain area by analyzing the color distribution around the stain.
2. The method for removing stains from scanned images based on deep learning according to claim 1, characterized in that: The marking of the main components of the scanned copy in step 2 refers to manually marking the image areas that need to be retained in the original scanned copy, namely the main components, according to the requirements of the electronicization of the archive, so as to be used as training data for subsequent deep learning; the detection of the main components of the scanned copy refers to using the YOLOV2 deep learning target detection network to train the marked main components, obtain the main component detection model, and perform deep network forward reasoning to obtain the main component image area of the original scanned image.
3. The method for removing stains from scanned images based on deep learning according to claim 1, characterized in that: Obtaining the stain at the edge position by image subtraction in step 2 means subtracting the area of the original scanned image from the area of the main component image, thereby obtaining black edge and / or white edge type stains located at the edge of the original scanned image.
4. The method for removing stains from scanned images based on deep learning according to claim 1, characterized in that: Under the premise of using deep learning to eliminate page number interference as described in step three, the detection of point-like stain type stains is completed. When training the deep learning model, the YOLOV2 deep network is used. In addition to training point-like stain type stains, page numbers that are easily confused with point-like stain type stains are also trained, thereby improving the accuracy of the deep learning model for point-like stains.
5. The method for removing stains from scanned images based on deep learning according to claim 1, characterized in that: The automatic filling of the stained area by analyzing the color distribution around the stain as described in step 4 means that, considering that each stain area should be filled with a different color, for each identified stain area, the image area around the area is counted, and after sorting and eliminating the first 10% and last 10% of the sequence, the majority color is counted and intelligent color filling is performed to achieve the purpose of harmonious stain removal.
Citation Information
Patent Citations
Method and system for recognizing format template
CN102081732A
Certificate text information collection method and device and electronic equipment
CN110942063A