Scanned document quality improvement method, device, storage medium and equipment

By constructing a database and using texture feature vector matching to select a binarization algorithm, the problem of inconsistent quality of binarization processing of scanned documents is solved, and work efficiency and binarization effects are improved.

CN117392685BActive Publication Date: 2024-10-29SHENZHEN SHENDANG DIGITAL TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202311493526.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-09
Publication Date
2024-10-29
Estimated Expiration
2043-11-09

AI Technical Summary

Technical Problem

In professional archiving, the quality of binarization processing of scanned documents varies, making it difficult for staff to choose the appropriate binarization method, which consumes too much time and reduces work efficiency.

Method used

Construct a database that contains document images with different texture patterns and their associated binarization algorithms, and automatically select a suitable binarization algorithm through texture feature vector matching for document binarization processing.

Benefits of technology

It greatly reduces the solution selection time in the binarization process, improves the binarization effect, and makes the binarization quality of documents more consistent and efficient.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117392685B_ABST
    Figure CN117392685B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, storage medium and equipment for improving the quality of scanned documents. The method comprises: constructing a database, wherein the database comprises a plurality of first document images with different texture patterns, wherein the first document images with different texture patterns have different first feature vectors and are associated with different binarization algorithms; cutting a sampling window containing a texture pattern and having a fixed size from a second document image to be binarized, and constructing a second feature vector of the sampling window; searching for a plurality of pairs of first feature vectors whose distances from the second feature vector are within a threshold range based on the Euclidean distance, and selecting the first document image associated with the first feature vector with the smallest distance after secondary comparison, and selecting the binarization algorithm associated with the first feature vector to binarize the second document image. The present invention automatically selects a suitable binarization algorithm based on the texture features of the second document image, thereby greatly reducing the scheme selection time of the scanned document in the binarization process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device, storage medium and equipment for improving the quality of scanned documents. Background Art

[0002] Binarization of scanned and saved documents is an important means of image enhancement. After document binarization, it has the following advantages:

[0003] Improve readability: Binarization can convert documents into black and white images, removing color and grayscale information, making text and images clearer and easier to read; Eliminate background noise: When scanning documents, they may be disturbed by background noise, such as paper texture, scanner noise, etc. Binarization can convert background noise into pure black or pure white, making the document content more prominent. Facilitate subsequent processing: Binarization can convert documents into binary images, making subsequent image processing tasks more simplified and efficient, such as text recognition, image segmentation, etc. Reduce file size: Binarization can convert color or grayscale images into black and white images, thereby reducing file size and saving storage space.

[0004] There are many methods for binarization of scanned documents. The most common method is to use various binarization algorithms to process images. However, in professional archives, the number of documents to be processed is very large, and the staff cannot select the appropriate binarization method for each document image, resulting in uneven quality of document binarization. Or too much time is spent on selecting the appropriate binarization algorithm, resulting in low work efficiency. Summary of the invention

[0005] In view of the above technical problems, the present invention provides a method, device, storage medium and equipment for improving the quality of scanned documents.

[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0007] According to one aspect of the present invention, a method for improving the quality of scanned documents is proposed, and the method comprises:

[0008] Constructing a database, wherein the database includes a plurality of first document images with different texture patterns, wherein the first document images with different texture patterns have different first feature vectors, and the first document images with different texture patterns are associated with different binarization algorithms;

[0009] Cutting a sampling window of a fixed size containing a texture pattern from the second document image to be binarized, and constructing a second feature vector of the sampling window;

[0010] Based on the Euclidean distance, multiple pairs of the first feature vectors whose distances to the second feature vector are within a threshold range are searched, and after secondary comparison, the first document image associated with the first feature vector with the smallest distance is selected, and the binarization algorithm associated with it is selected to binarize the second document image.

[0011] Furthermore, the first eigenvector and the second eigenvector include statistical data, and the statistical data at least include a mean value, a standard deviation, a mode, a minimum value, a maximum value, a median and a kurtosis.

[0012] Furthermore, among the multiple first document images in the database, there are multiple first document images with different front and back interference strengths, ink colors, pen types, and printing methods.

[0013] Furthermore, the basic framework of the binarization algorithm includes one of the following:

[0014] Deep learning algorithms;

[0015] Global threshold algorithm;

[0016] Local threshold algorithm;

[0017] Clustering algorithms;

[0018] Edge-based detection algorithms;

[0019] Image processing algorithms;

[0020] Shallow machine learning algorithms.

[0021] Furthermore, when associating the first document images with different texture patterns with different binarization algorithms, it is evaluated whether the binarization algorithm matches the current first document image, and the binarization algorithm with the highest quality is selected as the matching algorithm for the first document image.

[0022] Furthermore, when evaluating whether the binarization algorithm matches the current first document image, it includes:

[0023] Based on the formula Confirm the binarization quality, where k is the quality measure, P O The number of pixels mapped for binary conversion;

[0024] Among them, n bf and n bb is the number of pixels mapping the foreground and background on the binary drawing, n gf and n gb and are the number of pixels of the foreground and background of the binarized first document image, and N is the total number of pixels.

[0025] Furthermore, when evaluating whether the binarization algorithm matches the current first document image, it also includes:

[0026] The peak signal-to-noise ratio of the first document image after binarization is determined based on the following formula:

[0027]

[0028] Determine the inverse distance distortion, based on the following formula:

[0029]

[0030]

[0031] Where NUBN(GT) is the number of non-uniform 8×8 binary blocks in the original first document image, S is the flipped pixel, and DRD ij is the distortion between the pixel at position (i, j) and the first document image after binarization, DRD ij is equal to the weighted sum of the pixels in the 5×5 block in the original first document image that are different from the kth flipped pixel at the center of the binarized first document image at (x, y). The smaller the DRD, the higher the quality;

[0032] Confirm the F measure based on the following formula:

[0033]

[0034] in, TP, FP, and FN represent the values ​​of true positives, false positives, and false negatives, respectively.

[0035] According to a second aspect of the present disclosure, there is provided a device for improving the quality of scanned documents, comprising:

[0036] A pre-construction module, used for constructing a database, wherein the database includes a plurality of first document images with different texture patterns, wherein the first document images with different texture patterns have different first feature vectors, and the first document images with different texture patterns are associated with different binarization algorithms;

[0037] A sampling module, used for cutting out a sampling window of a fixed size containing a texture pattern from the second document image to be binarized, and constructing a second feature vector of the sampling window;

[0038] A processing module is used to search for multiple pairs of the first feature vectors whose distances to the second feature vector are within a threshold range based on the Euclidean distance, and select the first document image associated with the first feature vector with the smallest distance after secondary comparison, and select the binarization algorithm associated with it to binarize the second document image.

[0039] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, storing a computer program, wherein when the computer program is executed by a processor, the method for improving the quality of scanned documents as described above is implemented.

[0040] According to a fourth aspect of the present disclosure, there is provided a device for improving the quality of scanned documents, comprising: a processor; and a memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor executes the above-mentioned method for improving the quality of scanned documents.

[0041] The technical solution disclosed in this disclosure has the following beneficial effects:

[0042] The present invention classifies relevant binarization algorithms in advance, performs texture sampling on the second document image, and automatically selects a suitable binarization algorithm based on the texture features of the second document image, which greatly reduces the scheme selection time in the binarization process of the scanned document, and the selected binarization algorithm can be better matched with the scanned document, so that the binarization effect is better. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 This is a flow chart of a method for improving the quality of scanned documents in an embodiment of this specification;

[0044] Figure 2 This is a structural block diagram of a device for improving the quality of scanned documents in an embodiment of this specification;

[0045] Figure 3 A terminal device for implementing a method for improving the quality of scanned documents in an embodiment of this specification;

[0046] Figure 4 A computer-readable storage medium storing a method for improving the quality of scanned documents in an embodiment of the present specification. DETAILED DESCRIPTION

[0047] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0048] In addition, the accompanying drawings are only schematic illustrations of the present disclosure. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities, which do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0049] The present invention provides a method for improving the quality of product scanning documents. Figure 1 FIG. 1 is a flow chart of a method for improving the quality of scanned documents of a product provided by an embodiment of the present invention. The method can be applied to electronic devices such as personal computers and servers. The method can be performed by a device, which can be implemented by software and / or hardware. The method can specifically include the following steps S101 to S103:

[0050] In step S101, a database is constructed, wherein the database includes a plurality of first document images with different texture patterns, wherein the first document images with different texture patterns have different first feature vectors, and the first document images with different texture patterns are associated with different binarization algorithms.

[0051] Among them, these databases can be established by themselves or the data of any binarization website. The time spent on binarization of document images also depends on the document characteristics, and there are great differences between different binarization algorithms. The present invention is to solve a basic problem: if the document characteristics are deterministic for the quality output of binary images, and there is also a large time performance change, and the number of binarization algorithms is increasing, then how to select an algorithm that matches the current document, has a suitable processing time, and has excellent quality. Based on this, a database is first established to select the corresponding binarization algorithm for documents of different texture types.

[0052] In addition, texture is selected as a feature for the following reasons:

[0053] Texture is one of the important visual features in a document: Texture is composed of repeated patterns or structures that can provide information about the surface characteristics and details of a document. In a document image, texture can represent the texture of the paper, the distribution of ink, the shadow of the image, etc. Therefore, texture can be used to distinguish the differences between different documents.

[0054] Texture is highly recognizable and stable: Texture is highly recognizable between different documents, i.e., the texture features of different documents are usually different. In addition, texture is usually more stable than other features (such as color or shape), i.e., the texture features change less under different lighting conditions or scanning settings.

[0055] Texture can provide more information: Texture can provide more information than other features because it can capture finer details and structures in the document. By extracting and comparing texture features, documents can be matched and recognized more accurately.

[0056] Texture features are easy to extract and represent: Compared with other complex features, such as shape or color, texture features are relatively easy to extract and represent. Common texture feature extraction methods include Local Binary Patterns and Gray-Level Co-occurrence Matrix, which can effectively capture the statistical characteristics of texture.

[0057] In step S102, a sampling window of a fixed size containing a texture pattern is cut from the second document image to be binarized, and a second feature vector of the sampling window is constructed.

[0058] Specifically, the sampling position may be determined according to the document type of the second document image. For example, in a letter document, the header area of ​​the document may be sampled.

[0059] In addition, the first feature vector and the second feature vector include statistical data, which include at least mean value, standard deviation, mode, minimum value, maximum value, median and kurtosis. Among them, the mean value of the texture pattern pixel value in the sampling window can reflect the overall brightness or color distribution of the image; the standard deviation of the texture pattern pixel value is used to measure the degree of change of the pixel value of the image, that is, the fineness of the texture; the mode, as the value with the highest frequency in the texture pattern pixel value in the sampling window, can reflect the main texture features in the image; the minimum value of the texture pattern pixel value represents the darkest texture part in the image; the maximum value of the texture pattern pixel value represents the brightest texture part in the image; the median of the texture pattern pixel value can reflect the central trend of the image; the kurtosis of the texture pattern pixel value distribution is used to describe the flatness or sharpness of the image pixel value distribution; based on these feature vectors, important evaluation indicators in the document image are selected.

[0060] In step S103, multiple pairs of the first feature vectors whose distances to the second feature vector are within a threshold range are searched based on the Euclidean distance, and after secondary comparison, the first document image associated with the first feature vector with the smallest distance is selected, and the binarization algorithm associated with it is selected to binarize the second document image.

[0061] Among them, the first eigenvector and the second eigenvector with the smallest Euclidean distance mean that the second document image can be confirmed to be similar to the first document image in the database, and then the binarization algorithm represented by the first document image can be confirmed, and the corresponding binarization algorithm can be used to binarize the second document image.

[0062] In one embodiment, among the plurality of first document images in the database, there are also a plurality of first document images having different fore-and-aft interference intensities, ink colors, pen types, and printing methods.

[0063] Specifically, the data that represents the features may not only be limited to texture patterns, but may also be the mixed intensity of the foreground and background of the document (the intensity of front and back interference), ink color, type of pen, printing or handwriting method, etc. These features can also be used to distinguish and select different binarization algorithms. Different binarization algorithms achieve different binarization effects when faced with different mixed intensity of the foreground and background (the intensity of front and back interference), ink color, type of pen, printing or handwriting method.

[0064] In one embodiment, the basic framework of the binarization algorithm includes one of the following:

[0065] Deep learning algorithms can achieve image binarization by training a neural network. For example, a convolutional neural network can be used for image segmentation to divide the pixels of an image into black and white.

[0066] A global threshold algorithm compares the pixel values ​​of the entire image with a global threshold. Pixels greater than the threshold are set to white, and pixels less than the threshold are set to black. Specifically, the global threshold algorithm includes the Otsu algorithm and the histogram-based method.

[0067] Local threshold algorithm, which divides the image into multiple local regions and then calculates a local threshold in each region. The pixels are set to black or white according to the local threshold. Specifically, local threshold algorithms include Niblack algorithm, Sauvola algorithm and Nick algorithm;

[0068] Clustering algorithm, which clusters the pixel values ​​of the image into different categories and then sets the pixels to black or white according to the clustering results. Specifically, the clustering algorithm includes K-means algorithm and Mean Shift algorithm;

[0069] An edge-based detection algorithm determines the binary result of a pixel by detecting edge information in an image. Specifically, edge-based detection algorithms include the Canny edge detection algorithm and the Sobel algorithm.

[0070] Image processing algorithms, other image processing algorithms may also be used for binarization, such as filter-based methods, morphological operation-based methods, etc.

[0071] Shallow machine learning algorithms, which can classify image pixels into two categories (black and white) by training a classifier. Specifically, shallow machine learning algorithms include Support Vector Machine and Random Forest.

[0072] In one embodiment, when associating the first document images with different texture patterns with different binarization algorithms, it is evaluated whether the binarization algorithm matches the current first document image, and the binarization algorithm with the highest quality is selected as the matching algorithm for the first document image.

[0073] Specifically, when evaluating whether the binarization algorithm matches the current first document image, it includes:

[0074] Based on the formula Confirm the binarization quality, where k is the quality measure, P Ois the number of pixels mapped by binary value, Among them, n bf and n bb is the number of pixels mapping the foreground and background on the binary drawing, n gf and n gb and are the number of pixels of the foreground and background of the binarized first document image, and N is the total number of pixels.

[0075] Based on the quality metric K, the effect of binarization can be evaluated, and then a suitable binarization algorithm can be set for the first document image represented by the current type of texture pattern.

[0076] In another embodiment, when evaluating whether the binarization algorithm matches the current first document image, the method further includes:

[0077] The peak signal-to-noise ratio of the first document image after binarization is determined based on the following formula:

[0078]

[0079] Determine the inverse distance distortion, based on the following formula:

[0080]

[0081]

[0082] Where NUBN(GT) is the number of non-uniform 8×8 binary blocks in the original first document image, S is the flipped pixel, and DRD ij is the distortion between the pixel at position (i, j) and the first document image after binarization, DRD ij is equal to the weighted sum of the pixels in the 5×5 block in the original first document image that are different from the kth flipped pixel at the center of the binarized first document image at (x, y). The smaller the DRD, the higher the quality;

[0083] Confirm the F measure based on the following formula:

[0084]

[0085] in, TP, FP, and FN represent the values ​​of true positives, false positives, and false negatives, respectively.

[0086] In the above implementation, the peak signal-to-noise ratio can be used to measure the quality of image binarization, specifically to evaluate the degree of distortion between the binarized image and the original image. The higher the PSNR, the higher the similarity between the binarized image and the original image, and the lower the degree of distortion. The inverse distance distortion evaluates the accuracy of binarization by calculating the inverse of the distance between the binarized image and the original image. The F measure is used to evaluate the accuracy and recall rate in the binarization result. The accuracy and recall rate of the binarization can be measured by calculating the true positive, false positive and false negative in the binarized image. The higher the F measure, the higher the accuracy and recall rate of the binarization result.

[0087] It can be seen from all the above embodiments that the present invention classifies the relevant binarization algorithms in advance, performs texture sampling on the second document image, and automatically selects a suitable binarization algorithm based on the texture features of the second document image, which greatly reduces the scheme selection time in the binarization process of the scanned document, and the selected binarization algorithm can be better matched with the scanned document, so that the binarization effect is better.

[0088] Based on the same idea, Figure 2 As shown, a device for improving the quality of scanned documents is provided, comprising:

[0089] A pre-construction module 201 is used to construct a database, wherein the database includes a plurality of first document images with different texture patterns, wherein the first document images with different texture patterns have different first feature vectors, and the first document images with different texture patterns are associated with different binarization algorithms;

[0090] A sampling module 202, used for cutting a sampling window of a fixed size containing a texture pattern from the second document image to be binarized, and constructing a second feature vector of the sampling window;

[0091] The processing module 203 is used to search for multiple pairs of the first feature vectors whose distances to the second feature vector are within a threshold range based on the Euclidean distance, and select the first document image associated with the first feature vector with the smallest distance after secondary comparison, and select the binarization algorithm associated with it to binarize the second document image.

[0092] The specific details of each module / unit in the above-mentioned device have been described in detail in the implementation method of the method part. The undisclosed details can be found in the implementation method of the method part, so they will not be repeated here.

[0093] Based on the same idea, the embodiment of this specification also provides a device for improving the quality of scanned documents, such as Figure 3 shown.

[0094] The device for improving the quality of scanned documents may be the terminal device or the server provided in the above-mentioned embodiment.

[0095] The device for improving the quality of scanned documents may have relatively large differences due to different configurations or performances, and may include one or more processors 301, memory 302 and a bus, and the memory 302 may store one or more storage applications or data. Among them, the memory 302 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) and / or a cache storage unit, that is, for example, a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on an electronic device, and may further include a read-only storage unit. The application stored in the memory 302 may include one or more program modules (not shown in the figure), such program modules include but are not limited to: an operating system, one or more application programs, other program modules and program data, each of these examples or some combination may include the implementation of a network environment. Further, the processor 301 may be configured to communicate with the memory 302 to execute a series of computer executable instructions in the memory 302 on the device for improving the quality of scanned documents. The scanned document quality improvement device may also include one or more power supplies 303, one or more wired or wireless network interfaces 304, one or more I / O interfaces (input and output interfaces) 305, one or more external devices 306 (e.g., a keyboard), and may also communicate with one or more devices that enable a user to interact with the device, and / or communicate with any device that enables the device to communicate with one or more other computing devices (e.g., a router, a network switch, etc.). Such communication may be performed through the I / O interface 305. Furthermore, the device may also communicate with one or more networks (e.g., a local area network (LAN)) through the wired or wireless interface 304.

[0096] The processor 301 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The processor 301 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules (such as product scanning document quality improvement programs, etc.) stored in the memory 11, and calls data stored in the memory 11 to perform various functions of the processing device and process data.

[0097] The bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 302 and at least one processor 301, etc.

[0098] The power supply can be logically connected to the at least one processor 301 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power supply can also include any components such as one or more DC or AC power supplies, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, etc. The electronic device 1 can also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0099] Optionally, the processing device may further include a user interface, which may be a display (Display). Optionally, the user interface may also be a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual user interface.

[0100] Figure 3 Only the scanned document quality improvement device with components is shown, and those skilled in the art can understand that Figure 3The structure shown does not constitute a limitation on the device for improving the quality of scanned documents, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0101] Specifically, in this embodiment, the device for improving the quality of scanned documents includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions for the device for improving the quality of scanned documents, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following:

[0102] Constructing a database, wherein the database includes a plurality of first document images with different texture patterns, wherein the first document images with different texture patterns have different first feature vectors, and the first document images with different texture patterns are associated with different binarization algorithms;

[0103] Cutting a sampling window of a fixed size containing a texture pattern from the second document image to be binarized, and constructing a second feature vector of the sampling window;

[0104] Based on the Euclidean distance, multiple pairs of the first feature vectors whose distances to the second feature vector are within a threshold range are searched, and after secondary comparison, the first document image associated with the first feature vector with the smallest distance is selected, and the binarization algorithm associated with it is selected to binarize the second document image.

[0105] Based on the same idea, the exemplary embodiment of the present invention also provides a computer-readable storage medium, on which a program product capable of implementing the above method of this specification is stored. In some possible implementations, various aspects of the present disclosure can also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present disclosure described in the above "Exemplary Method" section of this specification.

[0106] refer to Figure 4 As shown, a program 400 for implementing the above method according to an exemplary embodiment of the present disclosure is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0107] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0108] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0109] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, CSS, HTML, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0110] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the exemplary implementation of the present disclosure.

[0111] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiment of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0112] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0113] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

[0114] It should be understood that the present disclosure is not limited to the exact 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 disclosure is limited only by the appended claims.

Claims

1. A method for improving the quality of scanned documents, characterized in that: The lifting method comprises: A database is constructed, wherein the database includes a plurality of first document images with different texture patterns, wherein the first document images with different texture patterns have different first feature vectors, and the first document images with different texture patterns are associated with different binarization algorithms. When associated, whether the binarization algorithm matches the current first document image is evaluated, and the binarization algorithm with the highest quality is selected as the matching algorithm for the first document image. When evaluating, based on the formula Confirm the binarization quality, where is the number of pixels mapped by binary value, , and is the number of pixels mapping the foreground and background on the binary drawing, and and are the number of pixels of the foreground and background of the first document image binarized, is the total number of pixels; Cutting a sampling window of a fixed size containing a texture pattern from the second document image to be binarized, and constructing a second feature vector of the sampling window; Based on the Euclidean distance, multiple pairs of the first feature vectors whose distances to the second feature vector are within a threshold range are searched, and after secondary comparison, the first document image associated with the first feature vector with the smallest distance is selected, and the binarization algorithm associated with it is selected to binarize the second document image.

2. The method for improving the quality of scanned documents according to claim 1, characterized in that: The first eigenvector and the second eigenvector include statistical data, and the statistical data at least include a mean value, a standard deviation, a mode, a minimum value, a maximum value, a median, and a kurtosis.

3. The method for improving the quality of scanned documents according to claim 1, characterized in that: Among the multiple first document images in the database, there are multiple first document images with different front and back interference strengths, ink colors, pen types, and printing methods.

4. The method for improving the quality of scanned documents according to claim 1, characterized in that: The basic framework of the binarization algorithm includes one of the following: Deep learning algorithms; Global threshold algorithm; Local threshold algorithm; Clustering algorithms; Edge-based detection algorithms; Image processing algorithms; Shallow machine learning algorithms.

5. The method for improving the quality of scanned documents according to claim 1, characterized in that: When evaluating whether the binarization algorithm matches the current first document image, it also includes: The peak signal-to-noise ratio of the first document image after binarization is determined based on the following formula: Determine the inverse distance distortion, based on the following formula: where NUBN(GT) is the number of non-uniform 8×8 binary blocks in the original first document image, S is the flipped pixels, is the distortion between the pixel at position (i, j) and the first document image after binarization, is equal to the weighted sum of pixels in a 5×5 block in the original first document image that are different from the kth flipped pixel at the center of the binarized first document image at (x, y). The smaller the DRD, the higher the quality; Confirm the F measure based on the following formula: in, , , TP, FP, and FN represent the values ​​of true positives, false positives, and false negatives, respectively.

6. A device for improving the quality of scanned documents, characterized in that: include: A pre-construction module is used to construct a database, wherein the database includes a plurality of first document images with different texture patterns, wherein the first document images with different texture patterns have different first feature vectors, and the first document images with different texture patterns are associated with different binarization algorithms. When associated, it is evaluated whether the binarization algorithm matches the current first document image, and the binarization algorithm with the highest quality is selected as the matching algorithm for the first document image. When evaluating, based on the formula Confirm the binarization quality, where is the number of pixels mapped by binary value, , and is the number of pixels mapping the foreground and background on the binary drawing, and and are the number of pixels of the foreground and background of the first document image binarized, is the total number of pixels; A sampling module, used for cutting out a sampling window of a fixed size containing a texture pattern from the second document image to be binarized, and constructing a second feature vector of the sampling window; A processing module is used to search for multiple pairs of the first feature vectors whose distances to the second feature vector are within a threshold range based on the Euclidean distance, and select the first document image associated with the first feature vector with the smallest distance after secondary comparison, and select the binarization algorithm associated with it to binarize the second document image.

7. A device for improving the quality of scanned documents, characterized in that: The device comprises: A processor; and a memory arranged to store computer executable instructions, which, when executed, cause the processor to perform the method for improving the quality of scanned documents as claimed in claim 1.

8. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method for improving the quality of scanned documents according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Binary method for low-quality document image based on local contract and estimation of stroke width

    CN105374015A

  • Multispectral imaging technology-based low-quality document image binarization method

    CN106295648A

  • Intelligent electric meter chip image binarization processing method based on adaptive mixed threshold

    CN111986222A

  • Image processing method, device and equipment

    CN112215761A

  • Texture pictorial query using CO-occurence matrix and normalised Euclidean distance

    KR1020010004402A