Document image correction method and device, electronic equipment and storage medium
By using feature extraction, enhancement, and fusion processing of the feature point prediction model, combined with Mamba network and CNN convolution, the problem of poor document image correction effect in existing technologies is solved, and higher quality image correction effect is achieved.
Patent Information
- Application Number
- CN202411053151.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2024-11-26
AI Technical Summary
Existing image correction methods are not ideal when dealing with complex image content such as paper creases in document images, resulting in poor quality of the corrected document images.
Feature point prediction model is used for feature extraction, enhancement and fusion processing. By combining Mamba network and CNN convolution, image correction is achieved through feature point prediction, which improves the accuracy of feature point prediction and avoids information loss.
It improves the quality of the corrected document images, enhances the ability to acquire deep feature information of the images, and improves the accuracy and stability of image correction.
Smart Images

Figure CN119027331A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of image correction, and in particular to a document image correction method, device, electronic device and storage medium. Background Art
[0002] Document image correction refers to processing the captured or scanned document images to correct image distortion caused by shooting angle, perspective distortion, uneven lighting, etc., making it closer to the true appearance of the original document. This technology has important applications in document management, digital archiving, optical character recognition (OCR) and other fields.
[0003] With the development of deep learning and computer vision technology, image correction methods based on neural networks have gradually become a research hotspot. Through a large amount of training data and a complex network structure, high-precision document image correction can be achieved.
[0004] However, existing image correction methods are not ideal when processing documents with complex image contents such as paper folds, resulting in a technical problem of poor image quality in the corrected document images. Summary of the invention
[0005] The present application provides a document image correction method, device, electronic device and storage medium, aiming to overcome the deficiencies of the prior art and enhance the image quality of the corrected document image.
[0006] In a first aspect, the present application provides a document image correction method, comprising:
[0007] Acquire a document image to be corrected, input the document image into a pre-trained feature point prediction model, and obtain feature points corresponding to the document image; the feature point prediction model includes a feature processing module and a feature point prediction module; the feature processing module is used to perform feature extraction and enhancement processing on the document image, and perform feature fusion on the enhanced feature image obtained after the enhancement processing and the document image to obtain a fused image; the feature point prediction module is used to perform feature point prediction processing on the fused image to obtain predicted feature points;
[0008] The document image is subjected to image correction processing according to the feature points to obtain a target document image after the document image is corrected.
[0009] In an optional implementation, the feature processing module includes a first image feature extraction submodule, an image enhancement submodule and an image fusion submodule;
[0010] The input of the first image feature extraction submodule is the input of the feature processing module, the output of the first image feature extraction submodule is connected to the input of the image enhancement submodule, the output of the image enhancement submodule is connected to the first input of the image fusion submodule, the second input of the image fusion submodule is the second input of the feature point prediction model, the output of the image fusion submodule is the output of the feature processing module and is connected to the feature point prediction submodule; wherein,
[0011] The first image feature extraction submodule is used to perform feature extraction processing on the image to obtain a processed feature image;
[0012] The image enhancement submodule is used to perform image enhancement processing on the feature image to obtain a processed enhanced feature image;
[0013] The image fusion submodule is used to perform fusion processing on the enhanced feature image and the document image to obtain a processed fused image.
[0014] In an optional implementation, the image enhancement submodule includes two enhancement units and an intermediate layer unit; wherein the input of the first enhancement unit is used as the input of the image enhancement submodule and is connected to the first image feature extraction submodule, and the output of the first enhancement unit is connected to the intermediate layer; the intermediate layer is also connected to the input of the second enhancement unit, and the output of the second enhancement unit is used as the output of the image enhancement submodule and is connected to the first input of the image fusion submodule;
[0015] The first enhancement unit / the second enhancement unit is used to perform feature enhancement on the input feature image to obtain a processed enhanced feature image; the enhanced feature image represents the deep image features of the document image;
[0016] The intermediate layer unit is used to receive the feature output of the first enhancement unit and input the output feature as an input feature to the second enhancement unit.
[0017] In an optional implementation, the feature point prediction module includes a second image feature extraction submodule and a feature point prediction submodule;
[0018] The input of the second image feature extraction submodule is the input of the feature point prediction module, the output of the second image feature extraction submodule is connected to the input of the feature point prediction submodule, and the output of the feature point prediction submodule is the output of the feature point prediction module; wherein,
[0019] The second image feature processing submodule is used to perform feature extraction processing on the fused image to obtain a processed fused feature image;
[0020] The feature point prediction submodule is used to perform feature point prediction processing on the fused feature image to obtain predicted feature points.
[0021] In an optional implementation, the feature point includes a plurality of control points and reference points corresponding to each control point;
[0022] Performing image correction processing on the document image according to the feature points to obtain a target image after the document image is corrected includes:
[0023] For any set of control points and reference points corresponding to the control points, determining a mapping matrix between the control points and the reference points;
[0024] Correcting the control points according to the mapping matrix to obtain corrected target control points;
[0025] According to each of the corrected target feature points, a target document image after the document image correction is obtained.
[0026] In an optional implementation, before acquiring the document image to be corrected, the method further includes:
[0027] A pre-built neural network structure is obtained, and the neural network structure is trained in a staged training manner to obtain the trained feature point prediction model; wherein, different loss functions are used in different training stages during the training process, and the model parameter adjustment step size corresponding to the loss function in the later training stage is smaller than the model parameter adjustment step size of the loss function in the earlier training stage.
[0028] In a second aspect, the present application provides a document image correction device, comprising:
[0029] An image feature point acquisition module is used to obtain a document image to be corrected, input the document image into a pre-trained feature point prediction model, and obtain feature points corresponding to the document image; the feature point prediction model includes a feature processing module and a feature point prediction module; the feature processing module is used to perform feature extraction and enhancement processing on the document image, and perform feature fusion on the enhanced feature image obtained after the enhancement processing and the document image to obtain a fused image; the feature point prediction module is used to perform feature point prediction processing on the fused image to obtain predicted feature points;
[0030] The feature point correction module is used to perform image correction processing on the document image according to the feature points to obtain a target document image after the document image is corrected.
[0031] In an optional implementation, the feature processing module includes a first image feature extraction submodule, an image enhancement submodule and an image fusion submodule;
[0032] The input of the first image feature extraction submodule is the input of the feature processing module, the output of the first image feature extraction submodule is connected to the input of the image enhancement submodule, the output of the image enhancement submodule is connected to the first input of the image fusion submodule, the second input of the image fusion submodule is the second input of the feature point prediction model, the output of the image fusion submodule is the output of the feature processing module and is connected to the feature point prediction submodule; wherein,
[0033] The first image feature extraction submodule is used to perform feature extraction processing on the image to obtain a processed feature image;
[0034] The image enhancement submodule is used to perform image enhancement processing on the feature image to obtain a processed enhanced feature image;
[0035] The image fusion submodule is used to perform fusion processing on the enhanced feature image and the document image to obtain a processed fused image.
[0036] In an optional implementation, the image enhancement submodule includes two enhancement units and an intermediate layer unit; wherein the input of the first enhancement unit is used as the input of the image enhancement submodule and is connected to the first image feature extraction submodule, and the output of the first enhancement unit is connected to the intermediate layer; the intermediate layer is also connected to the input of the second enhancement unit, and the output of the second enhancement unit is used as the output of the image enhancement submodule and is connected to the first input of the image fusion submodule;
[0037] The first enhancement unit / the second enhancement unit is used to perform feature enhancement on the input feature image to obtain a processed enhanced feature image; the enhanced feature image represents the deep image features of the document image;
[0038] The intermediate layer unit is used to receive the feature output of the first enhancement unit and input the output feature as an input feature to the second enhancement unit.
[0039] In an optional implementation, the feature point prediction module includes a second image feature extraction submodule and a feature point prediction submodule;
[0040] The input of the second image feature extraction submodule is the input of the feature point prediction module, the output of the second image feature extraction submodule is connected to the input of the feature point prediction submodule, and the output of the feature point prediction submodule is the output of the feature point prediction module; wherein,
[0041] The second image feature processing submodule is used to perform feature extraction processing on the fused image to obtain a processed fused feature image;
[0042] The feature point prediction submodule is used to perform feature point prediction processing on the fused feature image to obtain predicted feature points.
[0043] In an optional implementation, the feature point includes a plurality of control points and reference points corresponding to each control point;
[0044] Correspondingly, the feature point correction module includes:
[0045] A mapping matrix determination submodule, for determining, for any set of control points and reference points corresponding to the control points, a mapping matrix between the control points and the reference points;
[0046] A target control point obtaining submodule is used to perform correction processing on the control point according to the mapping matrix to obtain a corrected target control point;
[0047] The target document image obtaining submodule is used to obtain the target document image after the document image is corrected according to each of the corrected target feature points.
[0048] In an optional embodiment, the device further comprises:
[0049] The model training module is used to obtain a pre-built neural network structure, train the neural network structure in a staged training manner, and obtain the trained feature point prediction model; wherein different loss functions are used in different training stages during the training process, and the model parameter adjustment step size corresponding to the loss function in the later training stage is smaller than the model parameter adjustment step size of the loss function in the earlier training stage.
[0050] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;
[0051] The memory stores computer-executable instructions;
[0052] The processor executes the computer-executable instructions stored in the memory to implement the method according to the first aspect.
[0053] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect.
[0054] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the method described in the first aspect when executed by a processor.
[0055] The document image correction method, device, electronic device and storage medium provided by the present application obtain a document image to be corrected, input the document image into a pre-trained feature point prediction model, and obtain the feature points corresponding to the document image; the feature point prediction model includes a feature processing module and a feature point prediction module; the feature processing module is used to perform feature extraction and enhancement processing on the document image, and perform feature fusion on the enhanced feature image obtained after the enhancement processing and the document image to obtain a fused image; the feature point prediction module is used to perform feature point prediction processing on the fused image to obtain predicted feature points; the document image is subjected to image correction processing according to the feature points to obtain the target document image after the document image correction. In the implementation process of the above scheme, the model structure of the feature point prediction model is improved to improve the accuracy of the predicted position of the feature points, thereby improving the quality of the corrected image; specifically, feature optimization is added after feature extraction to obtain the deep features of the image and improve the accuracy of feature point prediction; and after feature extraction, in order to avoid the loss of feature information, the original image and the feature image after feature extraction are fused to jointly realize feature point prediction, and the document image is automatically corrected according to the feature points, thereby improving the image quality of the corrected document image. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0057] Figure 1 A diagram of an application scenario of the document image correction method provided in this application;
[0058] Figure 2 A schematic diagram of a flow chart of a document image correction method provided in an embodiment of the present application;
[0059] Figure 3 An example diagram of feature points corresponding to a set of document images provided in an embodiment of the present application;
[0060] Figure 4 A schematic diagram of the structure of a feature point prediction model provided in an embodiment of the present application;
[0061] Figure 5 A schematic diagram of the structure of a document image correction device provided in an embodiment of the present application;
[0062] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0063] Figure 7 A block diagram of a terminal device provided in an embodiment of the present application.
[0064] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0065] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0066] In modern information processing and management systems, document digitization has become a common demand. Document images acquired by scanners or cameras are often distorted due to various reasons (such as shooting angle, lighting conditions, device shaking, etc.). These distortions include but are not limited to tilt, distortion, shadow, and blur. These problems will significantly affect the readability of the document and the subsequent automated processing effects, such as optical character recognition (OCR).
[0067] Traditional image correction methods mainly rely on geometric transformation and image processing algorithms. These methods usually require manual parameter setting and have limited effectiveness in dealing with complex distortions. In recent years, with the development of deep learning technology, convolutional neural networks (CNN) and encoder-decoder Transformer model architectures have demonstrated powerful capabilities in the field of image processing.
[0068] Although existing deep learning-based document image correction methods have solved the document image distortion problem to a certain extent, they still have some shortcomings. For example, it often takes a lot of time and resources to train the correction model. At the same time, these methods are often unsatisfactory when dealing with distorted, tilted or other unstructured documents, and their accuracy and stability need to be improved.
[0069] The document image correction method provided by the present application is intended to solve the above technical problems of the prior art. Specifically, firstly, a combination of the Mamba network structure and the CNN convolution is introduced for document image correction, so as to increase the ability to obtain deep information of the image during the processing process to determine more accurate feature points; secondly, the original data of the image is introduced for subsequent processing to avoid missing information during the information extraction process, resulting in low accuracy in feature point determination; finally, the original image and the extracted feature image are fused to strengthen information sharing between the two types of data and improve the visual data understanding performance in the subsequent image processing process; in this way, the accuracy of the feature point selection results in the image correction process can be achieved, thereby achieving the image quality of the corrected document image.
[0070] Figure 1 An application scenario diagram of the document image correction method provided in this application. The technical solution provided in this application can be applied to the application scenario of correcting document images in the process of financial and bill data processing. Banks and financial institutions need to process a large number of documents such as bills, invoices and contracts, which are usually digitally archived by scanning or photographing. Scanned or photographed bill images may be distorted and unclear, affecting the extraction and verification of information. Document image correction technology can automatically correct bill images to ensure the accuracy and reliability of information extraction and improve the efficiency of financial business processing.
[0071] For ease of understanding, the following combination Figure 1 The application scenarios to which the embodiments of the present application are applicable are described. Figure 1 The above application scenario involves an image acquisition device 11 and a document image correction device 12; wherein, the image acquisition device 11 is used to photograph or scan the document image containing the financial bill, and the obtained document image is transmitted to the document image correction device 12 for automatic image correction processing to obtain a corrected document image.
[0072] The document image correction device 12 is provided with a pre-trained feature point prediction model and a feature point correction module; specifically, the document image correction device 12 inputs the received document image to be corrected into the feature point prediction model for feature point prediction processing; wherein the feature point prediction model includes a feature processing module and a feature point prediction module; the feature processing module is used to extract features and enhance the document image, and perform feature fusion on the enhanced feature image and the document image obtained after the enhancement processing to obtain a fused image; the feature point prediction module is used to perform feature point prediction processing on the fused image to obtain predicted feature points; further, the feature points are input into the feature point correction module for image correction to obtain a corrected target document image.
[0073] In the above scheme, the model structure of the feature point prediction model is improved to improve the accuracy of the predicted position of the feature points, thereby improving the quality of the corrected image; specifically, by adding feature optimization after feature extraction, the deep features of the image are obtained to improve the accuracy of feature point prediction; and by fusion of the original image and the feature image after feature extraction to avoid the loss of feature information after feature extraction, the feature point prediction is jointly realized to improve the accuracy of the feature point prediction results.
[0074] It should be explained that the document image correction method provided in the embodiment of the present application can be applied to various scenarios such as file management, mobile office, educational examinations and legal contract management in addition to financial bill processing scenarios. The embodiment of the present application does not specifically limit the application scenarios of the document image correction method provided.
[0075] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0076] Figure 2 The flowchart of a document image correction method provided in an embodiment of the present application is shown in FIG. The method can be executed by a document image correction device, which can also be an electronic device, including but not limited to a smart terminal device and a cloud server. The method in this embodiment can be implemented by software, hardware, or a combination of software and hardware, such as Figure 2 As shown, the method comprises the following steps:
[0077] S201, obtaining a document image to be corrected, inputting the document image into a pre-trained feature point prediction model, and obtaining feature points corresponding to the document image.
[0078] Document images are digital forms of paper documents, containing text, graphics, images, signatures and other information. Document images are obtained through scanners, digital cameras and mobile phone cameras. In the process of generating document images, problems such as tilt, shadow and blur may occur, which need to be corrected and optimized through a series of image processing technologies to improve the quality and readability of the image.
[0079] In the document image correction process, feature points are points in the document image with unique properties. These properties make the position of the feature points in the image and the surrounding environment significantly different, thereby helping to identify and correct geometric distortions in the image and perform corrections. In this application, feature points include corner points, edge points, texture points, etc.
[0080] The feature point prediction model can be interpreted as a neural network model that predicts the corresponding feature points in the document image that can be used for document correction processing; in some related technologies, the feature point prediction model can be a convolutional neural network and an encoder-decoder Transformer model, etc.; in the present application, the feature point prediction model can be a fusion neural network model that integrates the CNN and Mamba models.
[0081] The Mamba model is a deep learning model. Optionally, it can be understood as a selective structural state space model that performs well in long sequence modeling tasks. Mamba alleviates the modeling constraints of convolutional neural networks through global receptive fields and dynamic weighting, and provides advanced modeling capabilities similar to Transformers. Combining Mamba and CNN models can build an efficient and intelligent new model. Specifically, in the correction process, the CNN model is used for feature extraction, the Mamba model is used for feature enhancement processing, and then the CNN model is used for feature point prediction, etc., so that the accuracy of feature point prediction results can be better.
[0082] When a document image to be corrected is received, the document image is input into a feature point prediction model to obtain feature points output by the model, so as to realize automatic correction processing of the document image according to the feature points and obtain a corrected target document image.
[0083] In the present application, the feature point prediction model includes a feature processing module and a feature point prediction module; the feature processing module is used to extract features and enhance the document image, and perform feature fusion on the enhanced feature image and the document image obtained after the enhancement process to obtain a fused image; the feature point prediction module is used to perform feature point prediction processing on the fused image to obtain predicted feature points.
[0084] In the feature point prediction processing of the above-mentioned feature point prediction model, a feature enhancement step is added after feature extraction to obtain enhanced deep features, and the deep features are used as the data source for feature point prediction, which can improve the accuracy of feature point prediction results; after feature extraction, in order to avoid losing information in the original document image, the original image can be feature extracted and enhanced, and the enhanced feature image can be fused to realize feature point prediction, which can further improve the accuracy of feature point prediction results.
[0085] S202: Perform image correction processing on the document image according to the feature points to obtain a target document image after the document image is corrected.
[0086] In the embodiment of the present application, when the feature points of the document image required in the subsequent correction process are obtained, the image is automatically corrected according to the feature points, and a corrected target document image is obtained.
[0087] Optionally, the method for automatically correcting text images based on feature points may include a traditional algorithm or a machine learning algorithm, etc.; the embodiment of the present application does not specifically limit the correction algorithm used.
[0088] Optionally, in an embodiment of the present application, the feature points include multiple control points and reference points corresponding to each control point; in response, image correction processing is performed on the document image according to the feature points to obtain a target image after the document image is corrected, including: for any group of control points and reference points corresponding to the control points, determining a mapping matrix between the control points and the reference points; performing correction processing on the control points according to the mapping matrix to obtain corrected target control points; and obtaining a target document image after the document image is corrected according to each corrected target control point.
[0089] Among them, the control point can be understood as the feature point determined in the document image to be corrected for correction; the reference point can be understood as a blank reference image corresponding to the document image to be corrected or a point in the reference image, which is specifically used to match and align with the control point to achieve accurate correction of the image. In an embodiment of the present application, by inputting the image to be corrected into the feature point prediction model for processing, a set of control point coordinates and a set of reference point coordinates output by the model can be obtained, and then the document image can be automatically corrected according to the control point coordinates and the reference point coordinates. For example, see Figure 3 , Figure 3 The points in area A are the control points predicted by the feature point prediction model; Figure 3 The points in area B are reference points predicted by the feature point prediction model; it can be seen from the figure that the reference points and control points are one-to-one corresponding feature points.
[0090] In the process of image correction, the correction grid can be constructed by moving the control points to the positions of the reference points and converting them into pixel-level position mapping, thereby achieving image correction. In order to move the positions of the control points, an interpolation method can be used between the control points and the reference points to convert the sparse mapping into a dense mapping, thereby extracting pixels from the control points of the original distorted document image and mapping them to the positions of the corresponding reference points in the blank reference image; according to the above method, the pixels of each control point are mapped to the reference point to achieve correction of the document image.
[0091] In the above technical solution, by acquiring the document image to be corrected, the document image is input into the pre-trained feature point prediction model to obtain the feature points corresponding to the document image; the feature point prediction model includes a feature processing module and a feature point prediction module; the feature processing module is used to perform feature extraction and enhancement processing on the document image, and perform feature fusion on the enhanced feature image obtained after the enhancement processing and the document image to obtain a fused image; the feature point prediction module is used to perform feature point prediction processing on the fused image to obtain the predicted feature points; the document image is corrected according to the feature points to obtain the target document image after the document image correction. In the implementation process of the above solution, the model structure of the feature point prediction model is improved to improve the accuracy of the predicted position of the feature points, thereby improving the quality of the corrected image; specifically, by adding feature optimization after feature extraction, the deep features of the image are obtained to improve the accuracy of feature point prediction; and by fusing the original image and the feature image after feature extraction to avoid the loss of feature information after feature extraction, the feature point prediction is jointly realized, and the automatic correction of the document image is realized according to the feature points, thereby improving the image quality of the corrected document image.
[0092] Next, the specific network structure of the feature point prediction model provided in the embodiment of the present application is introduced. Figure 4 Provide an exemplary introduction. Figure 4 This is a schematic diagram of the structure of the feature point prediction model provided in the embodiment of the present application. Figure 4 As shown:
[0093] The feature point prediction model includes a feature processing module and a feature point prediction module; the input of the feature processing module is the first input of the feature point prediction model, the output of the feature processing module is connected to the feature point prediction module, and the output of the feature point prediction module is the output of the feature point prediction model; the feature processing module includes a first image feature extraction submodule, an image enhancement submodule and an image fusion submodule; the input of the first image feature extraction submodule is the input of the feature processing module, the output of the first image feature extraction submodule is connected to the input of the image enhancement submodule, the output of the image enhancement submodule is connected to the first input of the image fusion submodule, the second input of the image fusion submodule is the second input of the feature point prediction model, the output of the image fusion submodule is the output of the feature processing module and is connected to the feature point prediction submodule; the feature point prediction module includes a second image feature extraction submodule and a feature point prediction submodule; the input of the second image feature extraction submodule is the input of the feature point prediction module, the output of the second image feature extraction submodule is connected to the input of the feature point prediction submodule, and the output of the feature point prediction submodule is the output of the feature point prediction module.
[0094] Specifically, when the feature point processing model receives the document image input into the model, it will first input it into the feature processing module for feature processing, and then input the feature image output after processing into the feature point prediction module for feature point prediction processing to obtain the predicted feature points. Specifically, the feature processing module first extracts features from the input document image, and performs feature enhancement processing on the feature image after feature extraction, and then performs image fusion processing on the enhanced feature image obtained after feature enhancement processing and the original document image to obtain a fused image and input it into the feature point prediction module as the feature image output from the feature processing module for feature point prediction; specifically, in the feature point prediction module, the input fused image is subjected to feature point prediction processing to obtain the predicted feature points.
[0095] Optionally, in the feature processing module, the first image feature extraction submodule is used to perform feature extraction processing on the image to obtain a processed feature image; the image enhancement submodule is used to perform image enhancement processing on the feature image to obtain a processed enhanced feature image; and the image fusion submodule is used to perform fusion processing on the enhanced feature image and the document image to obtain a processed fused image.
[0096] Specifically, in the process of processing the image in the feature processing module, the feature extraction submodule is used in advance to extract features of the document image to obtain a feature image generated after the features are extracted.
[0097] Optionally, the first image feature extraction submodule may be a core network structure in a CNN network, such as a Conv2D network; illustratively, Conv2D is used to perform a convolution operation on a document image, thereby extracting features of the document image and obtaining a feature image; specifically, Conv2D extracts local features by sliding a window on the input document image and performing a convolution operation on each region, thereby gradually extracting more abstract and advanced features and generating a feature image;
[0098] In this application, the document image size input to Conv2D is: H = 64, W = 64, C = 3; the convolution kernel size of Conv2D is 5x5 convolution kernel, and the corresponding number of output channels is: out_ch = 128, padding: 2, stride: 2; on this basis, the size of the output feature image is calculated, and the calculation results include:
[0099] H_out=(64-5+2*2) / / 2+1=32;
[0100] W_out=(64-5+2*2) / / 2+1=32;
[0101] C_out = 128;
[0102] Therefore, the image size of the feature image output by the Conv2D network, i.e., the first image feature extraction submodule, is 32*32*128.
[0103] Optionally, in some other embodiments, in addition to the Conv2D network, the first image feature extraction submodule also includes a normalized network structure, such as a BatchNorm network; wherein the BatchNorm network is used to improve the stability of the model during training, increase the convergence speed, alleviate the problem of gradient disappearance or explosion, and provide a certain degree of regularization effect. Through standardization, BatchNorm helps the optimization process move more smoothly in the parameter space, which helps to accelerate convergence to the minimum loss. The output dimension of the BatchNorm network is the same as the input dimension, because BatchNorm performs normalization processing on the input data by channel (for convolutional layer) or by feature (for fully connected layer) without changing the size or dimension of the data. For example, if the output of the convolutional layer is a tensor with a shape of (32*64*28*28) (32 samples, 64 channels, and the size of each feature map is 28x28), then after the BatchNorm layer is processed, the output tensor dimension is still (32*64*28*28).
[0104] Furthermore, in the feature processing module, feature enhancement processing is performed on the feature image output by the feature extraction submodule to obtain deep features in the document image.
[0105] Specifically, the feature enhancement module can be generated by a Mamba network; illustratively, the Mamba network is used to perform feature depth convolution on the feature image to obtain deeper features of the feature image, that is, to enhance the feature image;
[0106] In this application, the feature enhancement module does not change the image size of the input image and the output image; that is, the input and output dimensions of the Mamba network are consistent. Therefore, the image size of the enhanced feature image output by the image enhancement submodule is also 32*32*128.
[0107] Continue to see Figure 4 In an embodiment of the present application, the image enhancement submodule includes two enhancement units and an intermediate layer unit; wherein the input of the first enhancement unit serves as the input of the image enhancement submodule and is connected to the first image feature extraction submodule, and the output of the first enhancement unit is connected to the intermediate layer; the intermediate layer is also connected to the input of the second enhancement unit, and the output of the second enhancement unit serves as the output of the image enhancement submodule and is connected to the first input of the image fusion submodule.
[0108] Among them, the first enhancement unit / the second enhancement unit is used to perform feature enhancement on the input feature image to obtain a processed enhanced feature image; the enhanced feature image represents the deep image features of the document image; the intermediate layer unit is used to receive the feature output of the first enhancement unit, and input the output features as input features to the second enhancement unit.
[0109] Specifically, in the present application, the first enhancement unit and the second enhancement unit can be two mamba networks with the same structure, respectively, and the intermediate layer unit can be an activation function, such as a Relu activation function; since the ReLU activation function performs well in processing sparse data, it helps to improve the generalization ability of the model, and its calculation is simple and can effectively alleviate the gradient disappearance problem, which can accelerate the training process of the model during the training process, thereby improving the efficiency of model training and the efficiency of subsequent model calculation and output results.
[0110] In this application, two identical network structures are set up in a symmetrical form, which has significant advantages in capturing symmetric features, parameter sharing, improving robustness, simplifying the training process, being suitable for specific tasks, improving interpretability and promoting information fusion, thereby improving the processing efficiency of model training and subsequent applications.
[0111] Optionally, in some other embodiments, in addition to the mamba network, the first enhancement unit and the second enhancement unit also include a normalized network structure, such as a BatchNorm network, or a LaverNorm network, etc., which also serves to improve the stability of the model during training, increase the convergence speed, etc.
[0112] Furthermore, the enhanced feature image output by the image enhancement submodule may be input into the image fusion submodule to be fused with the document image to be corrected, thereby obtaining a fused image.
[0113] Exemplarily, in the image fusion submodule, an autoencoder can be used to extract the latent representation of two images and fuse them in the latent space; optionally, a pyramid decomposition (such as a Laplacian pyramid) can be used to perform multi-resolution decomposition of the image, and then fuse them at different resolution levels, and finally reconstruct the fused image; the network structure of the image fusion submodule and the specific fusion method are not specifically limited in the embodiments of the present application.
[0114] Furthermore, in the feature point prediction module, the second image feature processing submodule is used to perform feature extraction processing on the fused image to obtain a processed fused feature image; the feature point prediction submodule is used to perform feature point prediction processing on the fused feature image to obtain predicted feature points.
[0115] In the embodiment of the present application, the network structure of the second image feature processing submodule can be set to the same network result as the first image feature processing submodule, such as Conv2D network and BatchNorm network, etc. Of course, it can also be set to other networks with feature extraction capabilities, which is not specifically limited in the embodiment of the present application.
[0116] Furthermore, the fused feature image outputted after the second image feature processing submodule performs feature extraction on the fused image is inputted into the feature point prediction submodule for feature point prediction processing.
[0117] Exemplarily, the feature point prediction submodule can be set as a fully connected network in a CNN network, etc. Of course, it can also be other network structures as long as it can predict the feature points, without specific limitation.
[0118] It should be noted that the output result of the feature point prediction submodule is two groups of corresponding numbers of control points and reference points, so as to realize subsequent image correction based on the above control points and reference points.
[0119] It should be explained that before using the feature point prediction model to execute the above-mentioned document image correction method, the feature point prediction model may be trained in advance to obtain a target corrected image with better correction effect during the execution process.
[0120] Optionally, in an embodiment of the present application, the training process may include: obtaining a pre-built neural network structure, training the neural network structure using a staged training method, and obtaining a trained feature point prediction model; wherein, different loss functions are used in different training stages during the training process, and the model parameter adjustment step size corresponding to the loss function in the later training stage is smaller than the model parameter adjustment step size of the loss function in the earlier training stage.
[0121] Specifically, for any training round in the first training stage, the predicted feature points of any training sample are obtained according to the neural network structure; the first model loss is generated according to the predicted feature points and the feature point labels of the training samples, the structural parameters of the neural network structure are adjusted according to the first model loss, and the next round of training is performed according to the adjusted neural network structure until the first iteration stop condition is met, thereby obtaining the neural network structure after the first training stage is completed.
[0122] In any training round of the second training stage, the predicted feature points of any training sample are obtained according to the neural network structure; the second model loss is generated according to the predicted feature points and the feature point labels of the training samples, the structural parameters of the neural network structure are adjusted according to the second model loss, and the next round of training is carried out according to the adjusted neural network structure until the second iteration stop condition is met, thereby obtaining a trained feature point prediction model.
[0123] In an embodiment of the present application, the first model loss may be Wing Loss generated based on the predicted control points and control point labels, predicted reference points and reference point labels of the training samples. Since Wing Loss uses a logarithmic function to deal with the sparsity problem, it penalizes larger errors while being more tolerant to smaller errors, making the model converge better. Thus, using Wing Loss as the loss function in the first stage of model training can increase the convergence speed of the model, that is, it can improve the efficiency of model training.
[0124] For example, the expression of Wing Loss in the embodiment of the present application may include:
[0125]
[0126] Among them, x is the result calculated from the predicted control points and control point labels, the predicted reference points and reference point labels of the training samples; exemplarily, |x| can be the absolute value of the difference between the predicted control points and the control point labels; ω is a constant parameter, which can be set to 10 exemplarily; ε is a constant parameter, which can be set to 2 exemplarily; C is a constant parameter, which can be calculated based on ω and ε.
[0127] On this basis, the second model loss can be SmoothL1 Loss generated based on the predicted control points and control point labels, predicted reference points and reference point labels of the training samples. Since SmoothL1 Loss can alleviate the problem of the existing L2 loss being allergic to outliers while maintaining sensitivity to small errors, using SmoothL1 Loss as the loss function in the second-stage model training process can improve the accuracy of the model bracelet, that is, it can improve the training effect of the model.
[0128] Figure 5 This is a schematic diagram of the structure of a document image correction device provided in an embodiment of the present application. Figure 5 The document image correction device 50 comprises: an image feature point acquisition module 501 and a feature point correction module 502; wherein,
[0129] The image feature point acquisition module 501 is used to obtain the document image to be corrected, input the document image into the pre-trained feature point prediction model, and obtain the feature points corresponding to the document image; the feature point prediction model includes a feature processing module and a feature point prediction module; the feature processing module is used to perform feature extraction and enhancement processing on the document image, and perform feature fusion on the enhanced feature image obtained after the enhancement processing and the document image to obtain a fused image; the feature point prediction module is used to perform feature point prediction processing on the fused image to obtain predicted feature points;
[0130] The feature point correction module 502 is used to perform image correction processing on the document image according to the feature points to obtain a target document image after the document image is corrected.
[0131] In an optional implementation, the feature processing module includes a first image feature extraction submodule, an image enhancement submodule and an image fusion submodule;
[0132] The input of the first image feature extraction submodule is the input of the feature processing module, the output of the first image feature extraction submodule is connected to the input of the image enhancement submodule, the output of the image enhancement submodule is connected to the first input of the image fusion submodule, the second input of the image fusion submodule is the second input of the feature point prediction model, the output of the image fusion submodule is the output of the feature processing module and is connected to the feature point prediction submodule; wherein,
[0133] The first image feature extraction submodule is used to perform feature extraction processing on the image to obtain a processed feature image;
[0134] The image enhancement submodule is used to perform image enhancement processing on the feature image to obtain a processed enhanced feature image;
[0135] The image fusion submodule is used to fuse the enhanced feature image and the document image to obtain a processed fused image.
[0136] In an optional embodiment, the image enhancement submodule includes two enhancement units and an intermediate layer unit; wherein the input of the first enhancement unit is used as the input of the image enhancement submodule and is connected to the first image feature extraction submodule, and the output of the first enhancement unit is connected to the intermediate layer; the intermediate layer is also connected to the input of the second enhancement unit, and the output of the second enhancement unit is used as the output of the image enhancement submodule and is connected to the first input of the image fusion submodule;
[0137] The first enhancement unit / the second enhancement unit is used to perform feature enhancement on the input feature image to obtain a processed enhanced feature image; the enhanced feature image represents the deep image features of the document image;
[0138] The middle layer unit is used to receive the feature output of the first enhancement unit and input the output feature as an input feature to the second enhancement unit.
[0139] In an optional implementation, the feature point prediction module includes a second image feature extraction submodule and a feature point prediction submodule;
[0140] The input of the second image feature extraction submodule is the input of the feature point prediction module, the output of the second image feature extraction submodule is connected to the input of the feature point prediction submodule, and the output of the feature point prediction submodule is the output of the feature point prediction module; wherein,
[0141] The second image feature processing submodule is used to perform feature extraction processing on the fused image to obtain a processed fused feature image;
[0142] The feature point prediction submodule is used to perform feature point prediction processing on the fused feature image to obtain predicted feature points.
[0143] In an optional implementation, the feature point includes a plurality of control points and reference points corresponding to each control point;
[0144] Correspondingly, the feature point correction module includes:
[0145] A mapping matrix determination submodule, for determining a mapping matrix between the control points and the reference points corresponding to any group of control points;
[0146] The target control point obtaining submodule is used to correct the control points according to the mapping matrix to obtain the corrected target control points;
[0147] The target document image obtaining submodule is used to obtain the target document image after the document image is corrected according to each corrected target feature point.
[0148] In an optional embodiment, the device further comprises:
[0149] The model training module is used to obtain a pre-built neural network structure, train the neural network structure in a phased training manner, and obtain a trained feature point prediction model; wherein different loss functions are used in different training stages during the training process, and the model parameter adjustment step size corresponding to the loss function in the later training stage is smaller than the model parameter adjustment step size of the loss function in the earlier training stage.
[0150] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 6 As shown, the electronic device of this embodiment may include: at least one processor 601; and a memory 602 communicatively connected to the at least one processor; wherein the memory 602 stores instructions executable by the at least one processor 601, and the instructions are executed by the at least one processor 601 so that the server executes a method as in any of the above embodiments.
[0151] Optionally, the memory 602 may be independent or integrated with the processor 601 .
[0152] The implementation principle and technical effects of the electronic device provided in this embodiment can be found in the aforementioned embodiments and will not be described in detail here.
[0153] An embodiment of the present application further provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the method of any of the aforementioned embodiments is implemented.
[0154] An embodiment of the present application also provides a computer program product, including a computer program, which implements the method of any of the aforementioned embodiments when executed by a processor.
[0155] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed.
[0156] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of various embodiments of the present application.
[0157] It should be understood that the above-mentioned processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor. The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and can also be a USB flash drive, a mobile hard disk, a read-only memory, a disk or an optical disk, etc.
[0158] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0159] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in a server or a main control device.
[0160] Figure 7 A block diagram of a terminal device provided in an embodiment of the present application. The device may be a mobile phone, a computer, a digital broadcast terminal, a message transceiver, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0161] Device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0162] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0163] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0164] The power supply component 806 provides power to the various components of the device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.
[0165] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0166] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0167] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0168] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, and the sensor assembly 814 can also detect the position change of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800, and the temperature change of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0169] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0170] In an exemplary embodiment, the device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0171] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, which can be executed by a processor 820 of the device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0172] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of a terminal device, enables the terminal device to execute the above method.
[0173] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0174] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A document image correction method, characterized in that: The method comprises: Acquire a document image to be corrected, input the document image into a pre-trained feature point prediction model, and obtain feature points corresponding to the document image; the feature point prediction model includes a feature processing module and a feature point prediction module; the feature processing module is used to perform feature extraction and enhancement processing on the document image, and perform feature fusion on the enhanced feature image obtained after the enhancement processing and the document image to obtain a fused image; the feature point prediction module is used to perform feature point prediction processing on the fused image to obtain predicted feature points; The document image is subjected to image correction processing according to the feature points to obtain a target document image after the document image is corrected.
2. The method according to claim 1, characterized in that The feature processing module includes a first image feature extraction submodule, an image enhancement submodule and an image fusion submodule; The input of the first image feature extraction submodule is the input of the feature processing module, the output of the first image feature extraction submodule is connected to the input of the image enhancement submodule, the output of the image enhancement submodule is connected to the first input of the image fusion submodule, the second input of the image fusion submodule is the second input of the feature point prediction model, the output of the image fusion submodule is the output of the feature processing module and is connected to the feature point prediction submodule; wherein, The first image feature extraction submodule is used to perform feature extraction processing on the image to obtain a processed feature image; The image enhancement submodule is used to perform image enhancement processing on the feature image to obtain a processed enhanced feature image; The image fusion submodule is used to perform fusion processing on the enhanced feature image and the document image to obtain a processed fused image.
3. The method according to claim 2, characterized in that The image enhancement submodule includes two enhancement units and an intermediate layer unit; wherein the input of the first enhancement unit is used as the input of the image enhancement submodule and is connected to the first image feature extraction submodule, and the output of the first enhancement unit is connected to the intermediate layer; the intermediate layer is also connected to the input of the second enhancement unit, and the output of the second enhancement unit is used as the output of the image enhancement submodule and is connected to the first input of the image fusion submodule; The first enhancement unit / the second enhancement unit is used to perform feature enhancement on the input feature image to obtain a processed enhanced feature image; the enhanced feature image represents the deep image features of the document image; The intermediate layer unit is used to receive the feature output of the first enhancement unit and input the output feature as an input feature to the second enhancement unit.
4. The method according to claim 1, characterized in that: The feature point prediction module includes a second image feature extraction submodule and a feature point prediction submodule; The input of the second image feature extraction submodule is the input of the feature point prediction module, the output of the second image feature extraction submodule is connected to the input of the feature point prediction submodule, and the output of the feature point prediction submodule is the output of the feature point prediction module; wherein, The second image feature processing submodule is used to perform feature extraction processing on the fused image to obtain a processed fused feature image; The feature point prediction submodule is used to perform feature point prediction processing on the fused feature image to obtain predicted feature points.
5. The method according to any one of claims 1 to 4, characterized in that: The feature points include a plurality of control points and reference points corresponding to the control points respectively; Performing image correction processing on the document image according to the feature points to obtain a target image after the document image is corrected includes: For any set of control points and reference points corresponding to the control points, determining a mapping matrix between the control points and the reference points; Correcting the control points according to the mapping matrix to obtain corrected target control points; According to each of the corrected target feature points, a target document image after the document image correction is obtained.
6. The method according to any one of claims 1 to 4, characterized in that: Before acquiring the document image to be corrected, the method further includes: A pre-built neural network structure is obtained, and the neural network structure is trained in a staged training manner to obtain the trained feature point prediction model; wherein, different loss functions are used in different training stages during the training process, and the model parameter adjustment step size corresponding to the loss function in the later training stage is smaller than the model parameter adjustment step size of the loss function in the earlier training stage.
7. A document image correction device, characterized in that: The device comprises: An image feature point acquisition module is used to obtain a document image to be corrected, input the document image into a pre-trained feature point prediction model, and obtain feature points corresponding to the document image; the feature point prediction model includes a feature processing module and a feature point prediction module; the feature processing module is used to perform feature extraction and enhancement processing on the document image, and perform feature fusion on the enhanced feature image obtained after the enhancement processing and the document image to obtain a fused image; the feature point prediction module is used to perform feature point prediction processing on the fused image to obtain predicted feature points; The feature point correction module is used to perform image correction processing on the document image according to the feature points to obtain a target document image after the document image is corrected.
8. An electronic device, characterized in that: include: A processor and a memory communicatively connected to the processor; The memory stores computer-executable instructions; When executing the computer-executable instructions, the processor is used to implement the document image correction method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the document image correction method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the document image correction method according to any one of claims 1 to 6 is implemented.
