De-wrinkling method, apparatus and storage medium of image

CN119991512BActive Publication Date: 2026-11-03GUANGZHOU ZHONO ELECTRONICS TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510096135.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2026-11-03
Estimated Expiration
2045-01-21

AI Technical Summary

Technical Problem

Traditional image processing methods struggle to effectively remove complex creases, leading to decreased image quality and impacting the efficiency and automation of document digitization, especially creating bottlenecks in large-scale document processing.

Method used

An image decrease method based on the U-Net model is adopted. The model is trained by acquiring crease image datasets and background image datasets. The weighted pixel loss value is used to automatically detect and eliminate crease regions, realizing full automation without human intervention.

Benefits of technology

It achieves efficient and automated crease removal, suitable for large-scale document processing, significantly improving image quality and processing efficiency while preserving document details and structural information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119991512B_ABST
    Figure CN119991512B_ABST
Patent Text Reader

Abstract

The application provides a crease removing method and device for an image and a storage medium. The method comprises the following steps: acquiring a crease image dataset and a background image dataset; performing model training on a U-Net model according to the crease image dataset and the background image dataset, and determining a network model; acquiring a feature parameter of a detection image and a weighted pixel loss value of the network model; and removing the crease in a region with the feature parameter being a preset feature parameter in the detection image according to the weighted pixel loss value, so as to determine a crease-removed image. The application is based on the weighted pixel loss value in the network model, and the full-process automation degree of the crease area detection and removal in the detection image is high, without the need of manual participation, and the application is suitable for large-scale document processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image technology, and in particular to a method, apparatus, and storage medium for removing creases from images. Background Technology

[0002] In the process of document digitization and management, creases in paper documents pose a significant challenge to image quality, processing efficiency, and automation. The presence of creases can cause document content to become blurry, incomplete, or unreadable, severely affecting the image quality after copying or scanning, reducing the readability and usability of the document. When performing OCR (Optical Character Recognition), creases may interfere with the accuracy of character recognition, or even cause characters to be unable to be correctly recognized, thereby further affecting the efficiency of document digitization.

[0003] Traditional image processing methods exhibit significant limitations when dealing with crease problems. For example, while filtering techniques can smooth images, they often fail to effectively remove creases in complex structures and may even blur important information in the document. Edge detection algorithms can locate creases, but they are prone to misjudgment or omission when processing large-area creases, resulting in poor repair effects. Image inpainting techniques can restore damaged areas to some extent, but their repair effect is not ideal for complex crease types and large-area creases, and their processing speed is slow, making it difficult to meet the needs of large-scale document processing.

[0004] In addition, traditional methods have a low degree of automation and require manual intervention for parameter adjustment and effect evaluation, which further limits their efficiency and applicability in practical applications. Although manual repair has certain advantages in terms of accuracy, it is time-consuming, inefficient, and prone to inconsistent repair results due to human factors. For documents with a large number of creases, manual repair requires page-by-page inspection and repair, which not only consumes a lot of time but also makes it difficult to meet the requirements of large-scale batch processing.

[0005] In practical applications, creases not only affect the visual effect of images but also interfere with the logical structure analysis of documents. For example, creases may lead to errors in the identification of text blocks, paragraphs, and lines, and even affect the reconstruction of tables and the recognition of elements such as images and barcodes. The contrast and directionality of creases may also increase the processing difficulty. Some creases have inconspicuous contrast and are difficult to detect and repair using conventional methods. At the same time, the direction of creases is complex and variable, and may overlap with the text direction or image edges in the document, further increasing the complexity of repair.

[0006] The types and distribution of creases also place higher demands on processing methods. Creases may appear anywhere in the document, including text areas, image areas, or blank areas, and may present different shapes, such as straight lines, curves, or interlacing. These complex crease types pose a severe challenge to the robustness and adaptability of image processing algorithms. Traditional methods often struggle to handle multiple types of creases simultaneously, especially when creases are intertwined with document content, which can easily lead to misoperation or incomplete repair.

[0007] In large-scale document processing scenarios, the impact of creases is even more significant. For example, in archives, libraries, or corporate document management, a large number of paper documents need to be digitized. The presence of creases not only reduces image quality but also increases processing time and costs. The inefficiency and non-automation of traditional methods make crease repair a bottleneck in the document digitization process. In addition, inconsistencies in crease repair may also lead to errors in subsequent processing. For example, in the process of document classification, retrieval, and analysis, documents with creases that have not been effectively repaired may be misjudged or missed.

[0008] In conclusion, the problem of creases in paper documents poses a significant challenge to image quality, processing efficiency, and automation during the digitization and management process. Traditional image processing methods and manual repair methods are ineffective, slow, and difficult to automate when dealing with complex creases and large-scale document processing, making it difficult to meet the high-efficiency and automated requirements of modern document digitization and management. Summary of the Invention

[0009] The present invention aims to solve at least one of the technical problems existing in the prior art.

[0010] Therefore, one objective of this invention is to propose an image decrease method that is based on weighted pixel loss values ​​in a network model to detect and eliminate crease regions in the detected image. The entire process is highly automated, requires no manual intervention, and is suitable for large-scale document processing.

[0011] Therefore, a second objective of the present invention is to provide an image decrease device.

[0012] Therefore, a third objective of the present invention is to provide a computer-readable storage medium.

[0013] To achieve the above objectives, an embodiment of the first aspect of the present invention proposes a method for removing creases from an image. The method includes: acquiring a crease image dataset and a background image dataset; training a U-Net model based on the crease image dataset and the background image dataset to determine a network model; acquiring feature parameters of a detection image and a weighted pixel loss value of the network model; and eliminating creases in the detection image in the region where the feature parameters are preset based on the weighted pixel loss value, thereby determining a crease-removed image.

[0014] The image crease removal method according to embodiments of the present invention acquires a crease image dataset and a background image dataset, trains a U-Net model based on the crease image dataset and the background image dataset, determines the network model, acquires the feature parameters of the detection image and the weighted pixel loss value of the network model, the network model automatically determines whether there are regions in the detection image whose feature parameters are preset feature parameters to detect crease regions, eliminates creases in the crease regions based on the weighted pixel loss value, and effectively preserves the details and structural information of the detection image to obtain a crease-removed image. Its crease removal effect is more natural. The entire process of detecting and eliminating crease regions in the detection image based on the weighted pixel loss value in the network model is highly automated, requires no manual intervention, and is suitable for large-scale document processing.

[0015] In some embodiments, training a U-Net model based on the crease image dataset and the background image dataset to determine the network model includes: performing image enhancement and normalization processing on the crease image to obtain an enhanced crease image; extracting a first feature parameter of the enhanced crease image and a second feature parameter of the background image; determining initial pixel loss values ​​for the enhanced crease image and the background image based on the first feature parameter and the second feature parameter; determining an initial weighted pixel loss value based on the initial pixel loss value and weight parameters; and obtaining the network model when the initial weighted pixel loss value meets a preset pixel loss value range and reaches a preset number of iterations.

[0016] In some embodiments, when determining the initial pixel loss values ​​of the enhanced crease image and the background image based on the first feature parameter and the second feature parameter, the first feature parameter and the second feature parameter are substituted into the following formula: , in, This is the initial pixel loss value. The total number of pixels in the enhanced crease image. The first of the enhanced crease images pixel value, The first of the background image Each pixel value.

[0017] In some embodiments, when determining the initial pixel loss values ​​of the enhanced crease image and the background image based on the first feature parameter and the second feature parameter, the first feature parameter and the second feature parameter are substituted into the following formula: , in, This is the second initial pixel loss value. The first term of the pre-trained network model Layer features, The number of feature layers, The pixel values ​​of the enhanced crease image. The pixel value of the background image.

[0018] In some embodiments, when determining the initial pixel loss values ​​of the enhanced crease image and the background image based on the first feature parameter and the second feature parameter, the first feature parameter and the second feature parameter are substituted into the following formula: , in, This is the third initial pixel loss value. The pixel values ​​of the enhanced crease image. The pixel value of the background image.

[0019] In some embodiments, when determining the initial pixel loss values ​​of the enhanced crease image and the background image based on the first feature parameter and the second feature parameter, the first feature parameter and the second feature parameter are substituted into the following formula: , in, This is the fourth initial pixel loss value. The number of scales for the enhanced crease image. For the first Scale weights at the layer scale The pixel values ​​of the enhanced crease image. The pixel value of the background image.

[0020] In some embodiments, the initial pixel loss value includes a first initial pixel loss value, a second initial pixel loss value, a third initial pixel loss value, and a fourth initial pixel loss value. When determining the first initial pixel loss value of the enhanced crease image and the background image based on the first feature parameter and the second feature parameter, the first feature parameter and the second feature parameter are substituted into the following formula: , in, This is the first initial pixel loss value. The total number of pixels in the enhanced crease image. The first of the enhanced crease images pixel value, The first of the background image Each pixel value; When determining the second initial pixel loss value of the enhanced crease image and the background image based on the first feature parameter and the second feature parameter, the first feature parameter and the second feature parameter are substituted into the following formula: , in, This is the second initial pixel loss value. The first term of the pre-trained network model Layer features, The number of feature layers, The pixel values ​​of the enhanced crease image. The pixel values ​​of the background image; When determining the third initial pixel loss value of the enhanced crease image and the background image based on the first feature parameter and the second feature parameter, the first feature parameter and the second feature parameter are substituted into the following formula: , in, The third initial pixel loss value, The pixel values ​​of the enhanced crease image. The pixel values ​​of the background image; When determining the fourth initial pixel loss value of the enhanced crease image and the background image based on the first feature parameter and the second feature parameter, the first feature parameter and the second feature parameter are substituted into the following formula: , in, The fourth initial pixel loss value, The number of scales for the enhanced crease image. For the first Scale weights at the layer scale The pixel values ​​of the enhanced crease image. The pixel values ​​of the background image; When determining the initial weighted pixel loss value based on the initial pixel loss value and the weight parameters, substitute the initial pixel loss value and the weight parameters into the following formula: , in, The weighted pixel loss value, As the first weight parameter, This is the first initial pixel loss value. This is the second weighting parameter. This is the second initial pixel loss value. As the third weighting parameter, The third initial pixel loss value, This is the fourth weighting parameter. This is the fourth initial pixel loss value.

[0021] In some embodiments, the network model includes an encoder to obtain feature parameters of a detection image, including: the encoder extracting a third feature parameter of the detection image, or the encoder adjusting the resolution of the detection image to extract the third feature parameter of the detection image, wherein the third feature parameter includes a crease mask.

[0022] In some embodiments, the network model includes an encoder to obtain feature parameters of a detection image, including: after the encoder extracts a third feature parameter of the detection image, adjusting the resolution of the detection image, and extracting the third feature parameter again, wherein the third feature parameter includes a crease mask.

[0023] In some embodiments, the network model further includes a decoder, which eliminates creases in the detected image where the feature parameter is a preset feature parameter based on the weighted pixel loss value, to determine a crease-free image, including: the decoder eliminates creases in the detected image where the crease mask is a preset crease mask based on the weighted pixel loss value, until the weighted pixel loss value meets a preset pixel loss value range and reaches a preset number of times, to determine the crease-free image.

[0024] In some embodiments, after obtaining the crease-free image, the method further includes: performing equalization processing and / or enhancement processing on the crease-free image.

[0025] To achieve the above objectives, a second aspect of the present invention provides an image decrease device, comprising: a first acquisition module for acquiring a crease image dataset and a background image dataset; a first determination module for training a U-Net model based on the crease image dataset and the background image dataset to determine a network model; a second acquisition module for acquiring feature parameters of a detection image and a weighted pixel loss value of the network model; and a second determination module for eliminating creases in the detection image in regions where the feature parameters are preset feature parameters based on the weighted pixel loss value, thereby determining a decrease-free image.

[0026] The image decrease device according to an embodiment of the present invention acquires a crease image dataset and a background image dataset, trains a U-Net model based on the crease image dataset and the background image dataset, determines the network model, acquires the feature parameters of the detection image and the weighted pixel loss value of the network model, the network model automatically determines whether there is a region in the detection image with the feature parameters set to the preset feature parameters, so as to detect crease regions, and eliminates the creases in the crease regions based on the weighted pixel loss value, while effectively preserving the details and structural information of the detection image, and obtains a decrease image with a more natural decrease effect. The entire process of detecting and eliminating crease regions in the detection image based on the weighted pixel loss value in the network model is highly automated, requires no manual intervention, and is suitable for large-scale document processing.

[0027] To achieve the above objectives, a third aspect of the present invention provides a computer-readable storage medium storing an image decrease program, which, when executed by a processor, implements the image decrease method described in the above embodiments.

[0028] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0029] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which: Figure 1 This is a flowchart of an image decrease method according to an embodiment of the present invention; Figure 2 This is a flowchart of an image decrementing method according to a specific embodiment of the present invention; Figure 3 This is a structural block diagram of an image decrease device according to an embodiment of the present invention.

[0030] Figure label: Image decrease device 2; First acquisition module 21; first determination module 22; second acquisition module 23; second determination module 24. Detailed Implementation

[0031] The embodiments of the present invention are described in detail below. The embodiments described with reference to the accompanying drawings are exemplary. The embodiments of the present invention are described in detail below.

[0032] Deep learning technology has gradually developed, especially CNN (Convolutional Neural Networks), which has been widely used in image restoration, denoising and enhancement, providing new methods for solving complex image decrementing problems; U-Net, as an efficient deep learning model, has good image feature extraction and reconstruction capabilities and has performed well in medical image segmentation, image denoising and other fields.

[0033] The following is combined Figures 1-2 A method for removing creases from images according to an embodiment of the present invention is described.

[0034] like Figure 1 As shown, the image decrease method of this embodiment includes at least steps S1-S4.

[0035] Step S1: Obtain the crease image dataset and the background image dataset.

[0036] In this embodiment, a document image dataset containing various types of creases is collected. The dataset should contain multiple different crease forms, such as images of fine creases, severe creases, vertical creases, and cross creases, forming a crease image dataset. Background images containing plain text, patterns, tables, etc., are also collected to form a background image dataset. By acquiring a large number of crease image datasets and corresponding background image datasets without creases, data support is provided for subsequent model training.

[0037] Step S2: Train the U-Net model based on the crease image dataset and the background image dataset to determine the network model.

[0038] In this embodiment, after obtaining the crease image dataset and the background image dataset, the U-Net model is trained based on the crease image dataset and the background image dataset to determine the network model. The determined network model can handle crease processing of various types and complex backgrounds, and has strong generalization ability, adaptability and robustness.

[0039] The network model can be trained using the Adam (Adaptive Moment Estimation) optimizer, employing an adaptive learning rate adjustment strategy or a cosine annealing learning rate decay strategy to improve the stability of model training. On large-scale GPU (Graphics Processing Unit) servers, batch gradient descent is used, with an appropriate batch size, such as 16 or 32, for model training. During training, a validation set is used to monitor loss and performance metrics to prevent overfitting, and an early stopping strategy is employed to improve the generalization ability of the network model.

[0040] Step S3: Obtain the feature parameters of the detected image and the weighted pixel loss value of the network model.

[0041] The weighted pixel loss value is determined by the network model through optimization using multiple loss functions and a multi-scale fusion strategy.

[0042] In this embodiment, the detection image can be a single-channel or three-channel scanned document image or a photocopied document image. Feature parameters are extracted from the detection image to determine whether there is a crease region in the detection image. After determining the network model, the network model uses multi-loss function optimization and multi-scale fusion strategy to determine the weighted pixel loss value according to the crease removal requirements, which effectively improves the image restoration quality and perceptual consistency.

[0043] The network model can also use crease image datasets and background image datasets of different scales to perform crease removal processing on the same test image multiple times, and fuse the crease removal results at multiple scales, such as by weighted averaging, to determine the weighted pixel loss value.

[0044] Step S4: Eliminate creases in the detected image where the feature parameters are preset based on the weighted pixel loss value, so as to determine the crease-free image.

[0045] In this embodiment, after obtaining the feature parameters of the detection image and the weighted pixel loss value of the network model, it is determined whether there is a region in the detection image whose feature parameters are preset feature parameters. If there are preset feature parameters in the detection image, the region where the preset feature parameters are located is considered to be a crease region. Then, the crease region is eliminated according to the weighted pixel loss value, which significantly improves the effect and efficiency of crease removal in the detection image. The detection image after crease removal is determined to be a crease-removed image. The crease-removed image can restore the original clarity and integrity of the document image.

[0046] The image crease removal method according to embodiments of the present invention acquires a crease image dataset and a background image dataset, trains a U-Net model based on the crease image dataset and the background image dataset, determines the network model, acquires the feature parameters of the detection image and the weighted pixel loss value of the network model, the network model automatically determines whether there are regions in the detection image whose feature parameters are preset feature parameters to detect crease regions, eliminates creases in the crease regions based on the weighted pixel loss value, and effectively preserves the details and structural information of the detection image to obtain a crease-removed image. Its crease removal effect is more natural. The entire process of detecting and eliminating crease regions in the detection image based on the weighted pixel loss value in the network model is highly automated, requires no manual intervention, and is suitable for large-scale document processing.

[0047] In some embodiments, training a U-Net model based on a crease image dataset and a background image dataset to determine the network model includes: performing image enhancement and normalization on the crease image to obtain an enhanced crease image; extracting a first feature parameter of the enhanced crease image and a second feature parameter of the background image; determining initial pixel loss values ​​for the enhanced crease image and the background image based on the first feature parameter and the second feature parameter; determining an initial weighted pixel loss value based on the initial pixel loss value and weight parameters; and obtaining the network model when the initial weighted pixel loss value meets a preset pixel loss value range and reaches a preset number of iterations.

[0048] In this embodiment, after obtaining the crease image dataset and the background image dataset, the crease images are enhanced, including but not limited to data enhancement operations such as rotation, flipping, scaling, adding noise, adjusting brightness and contrast. The enhanced crease images retain the original crease features, increasing the diversity of image data. At the same time, the crease images are normalized to normalize the pixel values ​​to the range of [0, 1]. Meanwhile, the image size is adjusted, for example, to 256x256 or 512x512, to unify the input format, resulting in enhanced crease images, which facilitate network model training and improve the robustness of the network model.

[0049] Extract the first feature parameters of the enhanced crease image, such as the total number of pixels. Pixel value Parameters, and second feature parameters of the background image, such as pixel values. The parameters mentioned above are substituted into different initial pixel loss value calculation formulas to determine the pixel-level error between the enhanced crease image and the background image, where the background image is the ideal output image without creases. According to the crease removal requirements, such as MSE (Mean-Square Error) loss, SSIM (Structural Similarity) loss, perceptual loss, etc., different initial pixel loss values ​​are fused together by weighted summation to determine the initial weighted pixel loss value, which effectively improves the image restoration quality and perceptual consistency.

[0050] Observe the changes in the initial weighted pixel loss value after fusion during training. If the initial weighted pixel loss value gradually decreases and tends to stabilize with training iterations, it usually means that the network model has learned enough features. In order to ensure the training effect, in addition to relying on the loss function, some image quality evaluation metrics are also used to measure the effect of decrementing. For example, PSNR (Peak Signal-to-Noise Ratio) is one of the standard metrics for measuring image quality. It is usually used to evaluate image reconstruction tasks such as denoising and decrementing. If the PSNR value is high, it means that the quality of the reconstructed image is good. During training, the PSNR value should gradually increase and tend to stabilize. If the PSNR value is stable at a high level, it usually means that the image quality has reached a good level.

[0051] To prevent overfitting and save training time, early stopping techniques are used during training. The early stopping strategy is based on the performance on the validation set and defines a tolerance. For example, if the loss value of the initial 200 weighted pixels does not improve significantly, it is considered that the model's performance on the validation set will no longer improve during training, and training is stopped early to obtain the network model.

[0052] During training, the training process is optimized by adjusting some hyperparameters such as learning rate, batch size, and network depth, and by monitoring the performance of the network model on the validation set. The hyperparameters are dynamically adjusted based on the performance of the training curve to further improve the model's performance. The initial learning rate can be set to 10⁻³, the batch size to 16, the network depth to 4 layers, the kernel size to 3×3, and the stride to 1.

[0053] In some embodiments, when determining the initial pixel loss values ​​of the enhanced crease image and the background image based on the first feature parameter and the second feature parameter, the first feature parameter and the second feature parameter are substituted into the following formula: , in, This is the initial pixel loss value. To increase the total number of pixels in the crease image, To enhance the crease image pixel value, The first background image Each pixel value is used to determine the mean squared error loss between the enhanced crease image and the background image.

[0054] In some embodiments, when determining the initial pixel loss values ​​of the enhanced crease image and the background image based on the first feature parameter and the second feature parameter, the first feature parameter and the second feature parameter are substituted into the following formula: , in, This is the second initial pixel loss value. The first term of the pre-trained network model is represented by the second term. Layer features, The number of feature layers, To enhance the pixel values ​​of the crease image, These are the pixel values ​​of the background image.

[0055] Pre-trained networks such as VGG (Visual Geometry Group) are used to compute the feature space loss between the enhanced crease image and the background image. The goal is to optimize the network model through high-level features rather than pixel-level errors, so that the decrease image output by the network model is perceptually closer to the real decrease image.

[0056] In some embodiments, when determining the initial pixel loss values ​​of the enhanced crease image and the background image based on the first feature parameter and the second feature parameter, the first feature parameter and the second feature parameter are substituted into the following formula: , in, This is the third initial pixel loss value. To enhance the pixel values ​​of the crease image, These are the pixel values ​​of the background image.

[0057] In this embodiment, preserving edge information in the image is crucial, especially when removing creases from document images to retain text edges. Therefore, an edge detection function is used. Extract the edges of the image, and then calculate and determine the pixel error between the enhanced crease image and the background image.

[0058] In some embodiments, when determining the initial pixel loss values ​​of the enhanced crease image and the background image based on the first feature parameter and the second feature parameter, the first feature parameter and the second feature parameter are substituted into the following formula: , in, This is the fourth initial pixel loss value. To increase the scale of the crease image, For the first Scale weights at the layer scale To enhance the pixel values ​​of the crease image, These are the pixel values ​​of the background image.

[0059] In the embodiment, scale weight This is used to control the contribution of this scale loss to the total multiscale loss. It is the first Layer-scale loss is typically the absolute error loss. Multi-scale loss considers image errors at different resolutions, thereby optimizing image performance at different scales. By reconstructing images at multiple scales, it helps the network capture details.

[0060] In some embodiments, the initial pixel loss values ​​include a first initial pixel loss value, a second initial pixel loss value, a third initial pixel loss value, and a fourth initial pixel loss value. When determining the first initial pixel loss values ​​for the enhanced crease image and the background image based on the first feature parameter and the second feature parameter, the first feature parameter and the second feature parameter are substituted into the following formula: , in, This is the initial pixel loss value. To increase the total number of pixels in the crease image, To enhance the crease image pixel value, The first background image Each pixel value; When determining the second initial pixel loss value for the enhanced crease image and the background image based on the first feature parameter and the second feature parameter, the first feature parameter and the second feature parameter are substituted into the following formula: , in, This is the second initial pixel loss value. The first term of the pre-trained network model is represented by the second term. Layer features, The number of feature layers, To enhance the pixel values ​​of the crease image, These are the pixel values ​​of the background image; When determining the third initial pixel loss value for the enhanced crease image and the background image based on the first feature parameter and the second feature parameter, the first feature parameter and the second feature parameter are substituted into the following formula: , in, This is the third initial pixel loss value. To enhance the pixel values ​​of the crease image, These are the pixel values ​​of the background image; When determining the fourth initial pixel loss value for the enhanced crease image and the background image based on the first feature parameter and the second feature parameter, the first feature parameter and the second feature parameter are substituted into the following formula: , in, This is the fourth initial pixel loss value. To increase the scale of the crease image, For the first Scale weights at the layer scale To enhance the pixel values ​​of the crease image, These are the pixel values ​​of the background image; When determining the initial weighted pixel loss value based on the initial pixel loss value and the weight parameters, substitute the initial pixel loss value and the weight parameters into the following formula: , in, The weighted pixel loss value. As the first weight parameter, This is the initial pixel loss value. This is the second weighting parameter. This is the second initial pixel loss value. As the third weighting parameter, This is the third initial pixel loss value. This is the fourth weighting parameter. This is the loss value for the fourth initial pixel.

[0061] In this embodiment, the weighted fusion method described above enables the enhanced crease image to not only be closer to the background image at the pixel level, but also to retain higher-level structural information, resulting in a more ideal crease removal effect.

[0062] In some embodiments, the network model includes an encoder to obtain feature parameters of the detection image, including: the encoder extracting a third feature parameter of the detection image, or the encoder adjusting the resolution of the detection image to extract a third feature parameter of the detection image, wherein the third feature parameter includes a crease mask.

[0063] In this embodiment, after determining the network model, the test image is input into the trained network model. The network model includes an encoder, which consists of several convolutional layers. The convolutional layers in the encoder process the detection image through convolution operations to extract the third feature parameters of the detection image, such as edges and textures. Specifically, the crease regions of the detection image are labeled using a semi-automatic annotation tool to generate crease masks, which serve as supervision signals for the network model. The values ​​of the crease masks are in binary form: the crease mask for crease regions is 1, and the crease mask for non-crease regions is 0. The global information of the detection image can be roughly determined through the simple structure of the convolutional layers.

[0064] Alternatively, the encoder consists of several convolutional and pooling layers. The pooling layers in the encoder retain key information of the detected image through aggregation operations, such as gradually reducing the resolution of the detected image to capture higher-level global information. While retaining key feature information of the detected image, such as the feature information of the crease region, some redundant feature information, such as the feature information of the edge region, is removed. The convolutional layers in the encoder then extract a third feature parameter from the key feature information. Here, the crease region of the detected image is labeled using a semi-automatic annotation tool to generate a crease mask, which serves as a supervision signal for the network model. The value of the crease mask is in binary form: the crease mask of the crease region is 1, and the crease mask of the non-crease region is 0. The feature parameters extracted through the structure of the convolutional and pooling layers are more conducive to the subsequent crease removal operation.

[0065] In some embodiments, the network model includes an encoder to obtain feature parameters of the detection image, including: after the encoder extracts a third feature parameter of the detection image, adjusting the resolution of the detection image, and extracting the third feature parameter again, wherein the third feature parameter includes a crease mask.

[0066] In this embodiment, after determining the network model, the test image is input into the trained network model. The encoder consists of several convolutional layers and pooling layers. The network model typically uses convolutional layers and pooling layers alternately. That is, the convolutional layers in the encoder process the detection image through convolution operations and extract the third feature parameter of the detection image. Then, the pooling layers in the encoder gradually adjust the resolution of the detection image. The convolutional layers in the encoder extract the third feature parameter again and repeat the above operations. This improves the accuracy of extracting and abstracting the feature parameters of the detection image while gradually adjusting the spatial size of the detection image, thereby enhancing the generalization ability of the network model.

[0067] In some embodiments, the network model further includes a decoder, which eliminates creases in the detected image whose feature parameters are preset feature parameters based on weighted pixel loss values ​​to determine a crease-free image. This includes: the decoder eliminating creases in the detected image whose crease mask is preset crease mask based on weighted pixel loss values ​​until the weighted pixel loss values ​​meet a preset pixel loss value range and a preset number of times are reached to determine a crease-free image.

[0068] In this embodiment, the decoder consists of a deconvolutional layer and an upsampling layer, used to progressively restore the spatial resolution of the detected image. It determines whether there exists a region in the detected image where the feature parameter crease mask is a preset crease mask (i.e., 1). If the preset crease mask exists, the region containing the preset crease mask is considered a crease region. The decoder then eliminates the crease region based on the weighted pixel loss value, without operating on other regions, until the weighted pixel loss value meets the preset pixel loss value range and a preset number of operations are performed. After the above image reconstruction, a clear image without creases is output, i.e., a crease-free image. The crease-free image can restore the original clarity and integrity of the document image. Through skip connections between the decoder and encoder, the decoder can effectively utilize the high-resolution features of the encoder to improve image restoration and repair effects. The skip connections are used to pass the third feature parameter of the encoder to the decoder, helping the network model preserve the document's structural and detailed information during crease removal.

[0069] In some embodiments, after obtaining the crease-free image, the method further includes: performing equalization and / or enhancement processing on the crease-free image.

[0070] In the embodiments, after obtaining the crease-free image, adaptive histogram equalization is performed on the crease-free image to enhance the local contrast of the crease-free image; or image sharpening and denoising methods are used to enhance the edges and details of the crease-free image, while reducing noise in the crease-free image, making the image look smoother and clearer; or, based on the adaptive histogram equalization of the crease-free image, image sharpening and denoising methods are used to enhance the crease-free image simultaneously, to prevent the loss of details, overexposure, or over-enhancement of the crease-free image that may occur when the background and foreground are too bright or too dark, thereby further improving the visual quality of the crease-free image.

[0071] The image decrease method of this invention can be deployed on various platforms such as server, PC client, and embedded devices such as scanners and copiers, enabling flexible application. It is also applicable to multiple application scenarios of document management and digitization, such as document digitization and printing in libraries and archives, document processing in the insurance industry, document scanning and restoration in the legal field, and document organization in the education and publishing industries.

[0072] The following is for reference. Figure 2 An example of the image decrease method according to an embodiment of the present invention will be provided.

[0073] like Figure 2 As shown, the image crease removal method of this embodiment of the invention includes at least steps S11-S21.

[0074] Step S11: Obtain the crease image dataset and the background image dataset.

[0075] Step S12: Perform image enhancement and normalization processing on the crease image to obtain an enhanced crease image.

[0076] Step S13: Extract the first feature parameters of the enhanced crease image and the second feature parameters of the background image.

[0077] Step S14: Determine the initial pixel loss values ​​of the enhanced crease image and the background image based on the first feature parameter and the second feature parameter.

[0078] Step S15: Determine the initial weighted pixel loss value based on the initial pixel loss value and the weight parameters.

[0079] Step S16: When the initial weighted pixel loss value meets the preset pixel loss value range and reaches the preset number of iterations, the network model is obtained.

[0080] Step S17: The encoder extracts the third feature parameter of the detection image, or the encoder adjusts the resolution of the detection image and extracts the third feature parameter of the detection image, wherein the third feature parameter includes the crease mask.

[0081] Step S18: After the encoder extracts the third feature parameter of the detection image, it adjusts the resolution of the detection image and extracts the third feature parameter again. The third feature parameter includes the crease mask.

[0082] Step S19: Obtain the weighted pixel loss value of the network model.

[0083] In step S20, the decoder eliminates creases in the detected image whose crease mask is a preset crease mask based on the weighted pixel loss value, until the weighted pixel loss value meets the preset pixel loss value range and reaches the preset number of times, so as to determine the decrease-free image.

[0084] Step S21: Perform equalization and / or enhancement processing on the decrease-free image.

[0085] The image crease removal method according to embodiments of the present invention acquires a crease image dataset and a background image dataset, trains a U-Net model based on the crease image dataset and the background image dataset, determines the network model, acquires the feature parameters of the detection image and the weighted pixel loss value of the network model, the network model automatically determines whether there are regions in the detection image whose feature parameters are preset feature parameters to detect crease regions, eliminates creases in the crease regions based on the weighted pixel loss value, and effectively preserves the details and structural information of the detection image to obtain a crease-removed image. Its crease removal effect is more natural. The entire process of detecting and eliminating crease regions in the detection image based on the weighted pixel loss value in the network model is highly automated, requires no manual intervention, and is suitable for large-scale document processing.

[0086] The following is combined Figure 3 The image decrease device 2 described in this embodiment of the invention.

[0087] like Figure 3 As shown, the image decrease device 2 of this embodiment includes: a first acquisition module 21, a first determination module 22, a second acquisition module 23, and a second determination module 24, wherein, The first acquisition module 21 is used to acquire the crease image dataset and the background image dataset; the first determination module 22 is used to train the U-Net model based on the crease image dataset and the background image dataset to determine the network model; the second acquisition module 23 is used to acquire the feature parameters of the detection image and the weighted pixel loss value of the network model; the second determination module 24 is used to eliminate the creases in the detection image in the region where the feature parameters are preset based on the weighted pixel loss value to determine the crease-removed image.

[0088] The image decrease device 2 according to an embodiment of the present invention acquires a crease image dataset and a background image dataset, trains a U-Net model based on the crease image dataset and the background image dataset, determines the network model, acquires the feature parameters of the detection image and the weighted pixel loss value of the network model, the network model automatically determines whether there is a region in the detection image with the preset feature parameters to detect crease regions, eliminates the creases in the crease regions based on the weighted pixel loss value, and effectively preserves the details and structural information of the detection image to obtain a decrease image. Its decrease effect is more natural. The entire process of detecting and eliminating crease regions in the detection image based on the weighted pixel loss value in the network model is highly automated, requires no manual intervention, and is suitable for large-scale document processing.

[0089] The following describes a computer-readable storage medium according to embodiments of the present invention.

[0090] The computer-readable storage medium of this invention stores an image decrease program, which, when executed by a processor, implements the image decrease method of the above embodiments.

[0091] According to the computer-readable storage medium of the present invention, by acquiring a crease image dataset and a background image dataset, training a U-Net model based on the crease image dataset and the background image dataset, determining the network model, acquiring the feature parameters of the detection image and the weighted pixel loss value of the network model, the network model automatically determines whether there is a region in the detection image with the preset feature parameters to detect crease regions, and eliminates the creases in the crease regions based on the weighted pixel loss value, while effectively preserving the details and structural information of the detection image, resulting in a crease-free image with a more natural crease-free effect. The entire process of detecting and eliminating crease regions in the detection image based on the weighted pixel loss value in the network model is highly automated, requires no manual intervention, and is suitable for large-scale document processing.

[0092] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example.

[0093] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

Claims

1. A method for removing creases from an image, characterized in that, include: Obtain the crease image dataset and the background image dataset; The U-Net model is trained based on the crease image dataset and the background image dataset to determine the network model, including: The crease image is enhanced and normalized to obtain an enhanced crease image; Extract the first feature parameters of the enhanced crease image and the second feature parameters of the background image, wherein the background image is the ideal output image without creases; The initial pixel loss values ​​of the enhanced crease image and the background image are determined based on the first feature parameter and the second feature parameter. The initial pixel loss values ​​include a first initial pixel loss value, a second initial pixel loss value, a third initial pixel loss value, and a fourth initial pixel loss value. The third initial pixel loss value is obtained by extracting the edges of the enhanced crease image and the background image through an edge detection function, and calculating the pixel error between them based on this. The fourth initial pixel loss value includes losses at multiple scales, and the losses at each scale are weighted according to corresponding scale weights to obtain multi-scale losses. The initial weighted pixel loss value is determined based on the initial pixel loss value and the weight parameters, and the network model is obtained when the initial weighted pixel loss value meets the preset pixel loss value range and reaches the preset number of times. The network model includes an encoder and a decoder, with the decoder connected to the encoder via skip connections, so that the decoder can utilize the high-resolution features extracted by the encoder; Obtaining the feature parameters of the detected image and the weighted pixel loss value of the network model includes: the encoder extracting the third feature parameter of the detected image, the third feature parameter including the crease mask; The method for eliminating creases in the detected image where the feature parameter is a preset feature parameter based on the weighted pixel loss value to determine a crease-free image includes: the decoder performing image reconstruction on the region in the detected image where the crease mask is a preset crease mask based on the weighted pixel loss value, without operating on other regions, to determine the crease-free image.

2. The method for removing creases from an image according to claim 1, characterized in that, When determining the initial pixel loss values ​​of the enhanced crease image and the background image based on the first feature parameter and the second feature parameter, the first feature parameter and the second feature parameter are substituted into the following formula: in, This is the initial pixel loss value. The total number of pixels in the enhanced crease image. The first of the enhanced crease images pixel value, The first of the background image Each pixel value.

3. The method for removing creases from an image according to claim 1, characterized in that, When determining the initial pixel loss values ​​of the enhanced crease image and the background image based on the first feature parameter and the second feature parameter, the first feature parameter and the second feature parameter are substituted into the following formula: in, This is the second initial pixel loss value. The first term of the pre-trained network model Layer features, The number of feature layers, The pixel values ​​of the enhanced crease image. The pixel value of the background image.

4. The method for removing creases from an image according to claim 1, characterized in that, When determining the initial pixel loss values ​​of the enhanced crease image and the background image based on the first feature parameter and the second feature parameter, the first feature parameter and the second feature parameter are substituted into the following formula: in, This is the third initial pixel loss value. The pixel values ​​of the enhanced crease image. The pixel value of the background image.

5. The method for removing creases from an image according to claim 1, characterized in that, When determining the initial pixel loss values ​​of the enhanced crease image and the background image based on the first feature parameter and the second feature parameter, the first feature parameter and the second feature parameter are substituted into the following formula: in, This is the fourth initial pixel loss value. The number of scales for the enhanced crease image. For the first Scale weights at the layer scale The pixel values ​​of the enhanced crease image. The pixel value of the background image.

6. The method for removing creases from an image according to claim 1, characterized in that, When determining the first initial pixel loss value of the enhanced crease image and the background image based on the first feature parameter and the second feature parameter, the first feature parameter and the second feature parameter are substituted into the following formula: in, This is the first initial pixel loss value. The total number of pixels in the enhanced crease image. The first of the enhanced crease images pixel value, The first of the background image Each pixel value; When determining the second initial pixel loss value of the enhanced crease image and the background image based on the first feature parameter and the second feature parameter, the first feature parameter and the second feature parameter are substituted into the following formula: in, This is the second initial pixel loss value. The first term of the pre-trained network model Layer features, The number of feature layers, The pixel values ​​of the enhanced crease image. The pixel values ​​of the background image; When determining the third initial pixel loss value of the enhanced crease image and the background image based on the first feature parameter and the second feature parameter, the first feature parameter and the second feature parameter are substituted into the following formula: in, The third initial pixel loss value, The pixel values ​​of the enhanced crease image. The pixel values ​​of the background image; When determining the fourth initial pixel loss value of the enhanced crease image and the background image based on the first feature parameter and the second feature parameter, the first feature parameter and the second feature parameter are substituted into the following formula: in, The fourth initial pixel loss value, The number of scales for the enhanced crease image. For the first Scale weights at the layer scale The pixel values ​​of the enhanced crease image. The pixel values ​​of the background image; When determining the initial weighted pixel loss value based on the initial pixel loss value and the weight parameters, substitute the initial pixel loss value and the weight parameters into the following formula: in, The weighted pixel loss value, As the first weight parameter, This is the first initial pixel loss value. This is the second weighting parameter. This is the second initial pixel loss value. As the third weighting parameter, The third initial pixel loss value, This is the fourth weighting parameter. This is the fourth initial pixel loss value.

7. The method for removing creases from an image according to claim 1, characterized in that, After obtaining the crease-free image, the process further includes: performing equalization and / or enhancement processing on the crease-free image.

8. A device for removing creases from an image, characterized in that, include: The first acquisition module is used to acquire the crease image dataset and the background image dataset; The first determining module is used to train the U-Net model based on the crease image dataset and the background image dataset to determine the network model; perform image enhancement and normalization processing on the crease image, extracting the first feature parameter of the enhanced crease image and the second feature parameter of the background image, wherein the background image is an ideal output image without creases; determine initial pixel loss values ​​including a first initial pixel loss value, a second initial pixel loss value, a third initial pixel loss value, and a fourth initial pixel loss value, wherein the third initial pixel loss value extracts the edges of the enhanced crease image and the background image through an edge detection function, and calculates the pixel error between them based on this; the fourth initial pixel loss value includes losses at multiple scales, and the losses at each scale are weighted according to corresponding scale weights to obtain multi-scale losses; determine initial weighted pixel loss values ​​based on the initial pixel loss values ​​and weight parameters, and obtain the network model when the initial weighted pixel loss values ​​meet a preset pixel loss value range and reach a preset number of times; The second acquisition module is used to acquire feature parameters of the detected image and weighted pixel loss values ​​of the network model; wherein, the network model includes an encoder and a decoder, the decoder and the encoder are connected by a skip connection, and the encoder is used to extract a third feature parameter including a crease mask; The second determining module is used to enable the decoder to perform image reconstruction on the area in the detected image where the crease mask is a preset crease mask based on the weighted pixel loss value, without operating on other areas, so as to determine the crease-free image.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a decrementing program for an image, which, when executed by a processor, implements the decrementing method for an image as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Image restoration method and device

    CN114331912A