A method and device for denoising electronic document images

By performing grayscale conversion, binarization and morphological operations on electronic document images, noise points are determined and removed, which solves the problem of noise affecting OCR recognition and reading in the existing technology, and improves the recognition accuracy and reading experience of electronic documents.

CN112785508BActive Publication Date: 2024-09-20ZHUHAI KINGSOFT OFFICE SOFTWARE +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201911094253.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-11-11
Publication Date
2024-09-20
Estimated Expiration
2039-11-11

AI Technical Summary

Technical Problem

Existing denoising algorithms are difficult to effectively remove noise in electronic documents without losing text edge information, resulting in low OCR recognition accuracy and poor reading experience.

Method used

By converting electronic document images into grayscale images and forming binary images, morphological operations and contour detection algorithms are used to determine suspected noise areas, and filtering is performed to remove noise and retain text and symbol details.

Benefits of technology

It effectively improves the OCR recognition accuracy and reading experience of electronic documents, and removes noise without blurring text information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112785508B
    Figure CN112785508B
Patent Text Reader

Abstract

The present invention discloses a method for denoising an electronic document image, comprising: converting the electronic document image into a grayscale image, and converting the obtained grayscale image into a binary image; forming a connected domain map according to the binary image; determining suspected noise point areas according to each connected domain in the connected domain map; filtering the electronic document image according to the suspected noise point areas to obtain a denoised document image. The present invention also discloses a device for denoising an electronic document image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electronic document processing, and in particular to a method and device for electronic document image denoising. Background Art

[0002] During the generation and transmission of images, the quality of images is often degraded due to the interference and influence of various noises, which will have an adverse effect on the subsequent image processing and image visual effects, such as subsequent image segmentation, target recognition, edge extraction, optical character recognition (OCR), etc. Therefore, in order to obtain high-quality digital images, it is necessary to perform noise reduction on the images, while maintaining the integrity of the original information as much as possible and removing the interfering information in the image.

[0003] The ultimate goal of image denoising is to improve a given image and solve the problem of image quality degradation caused by noise interference in the actual image. It is an important preprocessing method to better reflect the information carried by the original image.

[0004] Among the existing denoising algorithms, the denoising of photos and pictures is mainly targeted. Some denoising algorithms achieve good results in low-dimensional signal image processing, but are not suitable for high-dimensional signal image processing; or, the denoising effect is good, but some image edge information is lost. There are some related denoising algorithms in this field, such as: methods based on the spatial domain, such as median filtering, mean filtering, Gaussian filtering, etc., wavelet threshold denoising based on the wavelet domain, and ROF (Rudin-Osher-Fatemi) denoising algorithm based on the idea of ​​variational method. Since this type of smoothing filter will make the edge smooth, when applied to denoising in electronic documents, for text that contains a large number of dots and sharp strokes, the text strokes will be blurred; if the strokes are to be retained, the denoising effect is not good. In electronic documents, there is mainly text information, and edge detail information is particularly important. When OCR recognizes text information in documents, noise will cause great interference.

[0005] There is no denoising solution specifically designed for the characteristics of electronic documents in current technical solutions. Therefore, in order to effectively improve the accuracy of OCR text recognition in electronic documents and improve the reading effect of electronic documents, a denoising solution different from general images is needed, which can not only make the detailed information such as text and symbols in electronic documents clear, but also remove stain noise. Summary of the invention

[0006] In view of the above problems, the present invention provides a method and device for electronic document image denoising, which solves the denoising solution based on the characteristics of electronic document images, can not only make the detailed information such as text and symbols in the electronic document clear, but also remove stain noise.

[0007] In order to solve the above problem, the present invention provides a method for denoising an electronic document image, comprising:

[0008] Converting the electronic document image into a grayscale image, and converting the obtained grayscale image into a binary image;

[0009] According to the binary graph, a connected domain graph is formed;

[0010] Determine a suspected noise point area according to each connected domain in the connected domain graph;

[0011] The electronic document image is filtered according to the suspected noise area to obtain a denoised document image.

[0012] Optionally, converting the obtained grayscale image into a binary image includes: converting the grayscale image into a binary image according to a preset conversion threshold.

[0013] Optionally, forming a connected domain graph according to the binarized graph includes:

[0014] The connected domain graph is obtained by sequentially performing erosion operations and dilation operations on the binary graph through structural elements of different sizes.

[0015] Optionally, the performing erosion operations and dilation operations on the binary image in sequence by using structural elements of different sizes includes:

[0016] Define an x*x structure element, where x is an integer greater than or equal to 2, and use a morphological erosion algorithm to operate on the binary image;

[0017] A y*y structural element is defined, where y is an integer greater than or equal to 1 and y is less than x, and the binary graph processed by the erosion algorithm is operated by a morphological expansion algorithm to obtain the connected domain graph.

[0018] Optionally, determining the suspected noise point area according to each connected domain in the connected domain graph includes:

[0019] Extracting position coordinate information of each connected domain in the connected domain graph by using a contour detection algorithm;

[0020] According to the position coordinate information, it is determined whether each connected domain in the connected domain map is a suspected noise point area.

[0021] Optionally, judging respectively whether each connected domain in the connected domain graph is a suspected noise point area according to the position coordinate information includes:

[0022] The size of each connected domain is determined according to the position coordinate information of each connected domain extracted, and the connected domain whose size is lower than the noise threshold is defined as a suspected noise area and marked as 1, otherwise marked as 0;

[0023] According to the marks, a noise matrix diagram is formed for the entire connected domain diagram; wherein the noise threshold is determined according to the resolution of the electronic document image.

[0024] Optionally, the method further includes: presetting a corresponding relationship between the resolution and the noise threshold;

[0025] The noise threshold is determined according to the resolution of the electronic document image, including: determining the corresponding noise threshold according to the resolution of the electronic document image and a correspondence between a preset resolution and the noise threshold.

[0026] Optionally, filtering the electronic document image according to the suspected noise area to obtain a denoised document image includes:

[0027] Performing filtering processing on the electronic document image to obtain a filtering result image;

[0028] According to the noise matrix diagram, the pixel values ​​of the areas corresponding to the non-suspected noise points in the filtering result diagram are all set to 0 to obtain a suspected area result diagram;

[0029] According to the noise matrix diagram, the pixel values ​​of the areas corresponding to the suspected noise points in the electronic document image are all set to 0 to obtain a non-suspected area result diagram;

[0030] A matrix addition operation is performed on the suspected area result image and the non-suspected area result image to obtain a denoised document image.

[0031] Optionally, the filtering process includes: median filtering, mean filtering or Gaussian filtering.

[0032] In order to solve the above problem, the present invention also provides a device for denoising an electronic document image, comprising:

[0033] A conversion module, configured to convert the electronic document image into a grayscale image, and convert the obtained grayscale image into a binary image;

[0034] A connected domain generation module, configured to form a connected domain graph according to the binary graph;

[0035] A noise point determination module, configured to determine a suspected noise point area according to each connected domain in the connected domain graph;

[0036] The denoising module is configured to filter the electronic document image according to the suspected noise point area to obtain a denoised document image.

[0037] The present invention provides a method and device for electronic document image denoising, which solves the problem that when general denoising solutions are applied to electronic documents, text breakpoints and punctuation marks are misjudged as noise points, and text edges are blurred and details are lost. The present invention provides a method and device for electronic document image denoising, which can not only make detailed information such as text and symbols in electronic documents unblurred, but also remove stain noise, effectively improving the accuracy of electronic document OCR recognition and improving the user's electronic document reading experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 A flow chart of a method for denoising an electronic document image provided in Embodiment 1 of the present invention;

[0039] Figure 2 A flow chart of a method for electronic document image denoising provided in Embodiment 2 of the present invention;

[0040] Figure 3 A schematic diagram of a process of a method for denoising an electronic document image provided by Embodiment 2 of the present invention;

[0041] Figure 4 This is a comparison chart of the effects of electronic document image denoising provided by the present invention;

[0042] Figure 5 This is a structural diagram of an electronic document image denoising device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION

[0043] To make the purpose, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other arbitrarily without conflict.

[0044] Embodiment 1

[0045] This embodiment provides a method for denoising an electronic document image. Figure 1 As shown, including:

[0046] Step 101, converting the electronic document image into a grayscale image, and converting the obtained grayscale image into a binary image;

[0047] Step 102, forming a connected domain graph according to the binary graph;

[0048] Step 103, determining suspected noise point areas according to each connected domain in the connected domain graph;

[0049] Step 104 : filtering the electronic document image according to the suspected noise area to obtain a denoised document image.

[0050] Optionally, in step 101, the electronic document image may be read in a grayscale image manner to obtain a grayscale image.

[0051] Optionally, in step 101, converting the obtained grayscale image into a binary image includes: converting the grayscale image into a binary image according to a preset conversion threshold.

[0052] Optionally, before step 101, the conversion threshold is preset.

[0053] Optionally, in step 102, forming a connected domain graph according to the binarized graph includes: performing erosion operations and dilation operations on the binarized graph in sequence through structural elements of different sizes to obtain the connected domain graph. Through the erosion operation and dilation operation, the text in the electronic document, the text together with the adjacent symbols and the noise points are separated and each forms a separate connected domain; all the text in the electronic document image, the text together with the adjacent symbols, and the connected domain of the noise points together constitute the connected domain graph.

[0054] Optionally, wherein the binary graph is sequentially subjected to erosion operations and dilation operations using structural elements of different sizes to obtain the connected domain graph, including:

[0055] Define an x*x structural element, where x is an integer greater than or equal to 2, and use a morphological erosion algorithm to operate on the binary image; the algorithm allows a single character to form an enclosed whole; and if the symbols near the single character are very close to the character, they can also form a whole with the adjacent characters, thereby achieving the purpose of separating noise points.

[0056] Define a y*y structural element, where y is an integer greater than or equal to 1 and y is less than x. The binary image processed by the erosion algorithm is operated by the morphological expansion algorithm, so that the background color of the electronic document expands to the black area. Through this operation, the area of ​​the outlier individuals will be reduced, so that noise points and text and symbols can be better distinguished by size; among them, noise points generally appear as outliers.

[0057] Optionally, x and y may be set to different values ​​according to different electronic document images, and may be set such that the value of x is greater than the value of y; or the value of x is twice the value of y.

[0058] After the above two steps, each character, character, adjacent symbol and noise point form their own connected domain. The connected domains formed by single characters and / or single characters plus adjacent symbols and / or noise points in the entire electronic document image together constitute a connected domain graph.

[0059] Optionally, in step 103, the suspected noise area is determined according to each connected domain in the connected domain map, including: using a contour detection algorithm FindContours to extract position coordinate information of each connected domain in the connected domain map; and judging whether each connected domain in the connected domain map is a suspected noise area according to the position coordinate information.

[0060] Wherein, judging whether each connected domain in the connected domain graph is a suspected noise point area according to the position coordinate information includes:

[0061] The size of each connected domain is determined according to the position coordinate information of each connected domain extracted, and the connected domain whose size is lower than the noise threshold is defined as a suspected noise area and marked as 1, otherwise marked as 0;

[0062] According to the mark, a noise matrix diagram of the suspected noise distribution area is generated for the entire connected domain diagram, that is, a 0-1 noise matrix diagram;

[0063] The noise threshold is determined according to the resolution of the electronic document image.

[0064] Optionally, in step 104, filtering the electronic document image according to the suspected noise area to obtain a denoised document image includes: filtering the original electronic document image (referred to as the original Figure 1 ) to filter, such as median filtering, and obtain the filtered image (recorded as the filtering result Figure 2 );According to the noise matrix, the filtering result Figure 2 The pixel values ​​of the areas corresponding to the non-suspected noise points are all set to 0, and the suspected area result map is obtained (referred to as the suspected area result map). Figure 3 ); According to the noise matrix diagram, the original electronic document image (original Figure 1 ) are all set to 0, and the non-suspected area result map is obtained (denoted as the non-suspected area result map Figure 4 );The suspected area results obtained above are Figure 3 and non-suspected area results Figure 4 The pixel matrix is ​​added to obtain the denoised electronic document image (denoised as the denoising result Figure 5 ).

[0065] Optionally, the method further includes, before step 101 or 103, presetting a corresponding relationship between the resolution and the noise threshold; optionally, the higher the resolution, the larger the corresponding noise threshold. For example, when the resolution is 800*600, the corresponding noise threshold is 20 pixels; when the resolution is 1200*800, the corresponding noise threshold is 30 pixels. Different corresponding relationships can be set according to the resolution characteristics of the electronic document image.

[0066] The noise threshold is determined according to the resolution of the electronic document image, including: determining the corresponding noise threshold according to the resolution of the electronic document image and the correspondence between the preset resolution and the noise threshold. When the resolution of the electronic document image does not correspond exactly to the preset data, a close noise threshold can be selected; or a noise threshold can be determined by calculation according to a relevant algorithm. The specific determination method is not limited to the method described in this embodiment.

[0067] Optionally, the filtering process includes spatial filtering processes such as median filtering, mean filtering or Gaussian filtering.

[0068] Embodiment 2

[0069] Figure 2 This is a flow chart of the electronic document image denoising method of the present invention:

[0070] Step 201), converting the electronic document image into a grayscale image, and converting the grayscale image into a binary image according to a preset conversion threshold, such as 250; the conversion threshold can be set to different values ​​according to different electronic document images.

[0071] Step 202), define an n*n structural element, n is an even number, the default value is 6 (it can also be set to other values), use the morphological erosion algorithm to operate the binary image of the entire electronic document image, the algorithm will make a single word form an enclosed whole; and if the symbols near the single word are very close, they can also form a whole with the adjacent words, so as to achieve the purpose of separating noise points; define another (n / 2)*(n / 2) structural element, use the morphological expansion algorithm to operate the binary image processed by the erosion algorithm, so that the background color of the electronic document image expands to the black area, through this operation, the area of ​​the outlier individual will be reduced, so as to better distinguish the noise points and words and symbols by size; wherein, the outlier individual is understood as a noise point. Through these two steps, each word, the word together with the adjacent symbols and noise points form a connected domain. The connected domains formed by the single word and / or the single word plus the adjacent symbols and / or noise points in the entire electronic document image together constitute a connected domain graph.

[0072] Step 203), using the contour detection algorithm FindContours to extract the position coordinate information of all connected domains formed in step 202 in the connected domain graph.

[0073] Step 204), according to the resolution of the electronic document image, a threshold is determined, the default threshold is 50 pixels (optionally, the default threshold is set to other values), the size of each connected domain is determined according to the position coordinate information of each connected domain extracted in step 203, and the connected domain with a size lower than the threshold is defined as a suspected noise area, and this area is marked as 1, otherwise it is marked as 0. Finally, a 0-1 noise matrix map of the suspected noise distribution area is generated for the entire connected domain map.

[0074] Step 205), using the 0-1 noise matrix to filter the suspected noise area in the electronic document image, to obtain a denoised electronic document image.

[0075] Optionally, including: the original electronic document image (referred to as the original Figure 1 ) to filter, such as median filtering, and obtain the filtered image (recorded as the filtering result Figure 2 ); According to the 0-1 noise matrix, the filtering result Figure 2 The pixel values ​​of the areas corresponding to non-suspected noise points are set to 0, that is, the filtering result Figure 2 The pixel matrix of the 0-1 noise matrix is ​​multiplied by the dot operation to obtain the suspected area result map (referred to as the suspected area result map Figure 3 ); According to the 0-1 noise matrix, the original electronic document image (original Figure 1 ) are all set to 0 in the area corresponding to the suspected noise points. Figure 1 The pixel matrix of the pixel matrix is ​​multiplied by the result of 1 minus the 0-1 noise matrix to obtain the non-suspicious area result map (recorded as the non-suspicious area result map Figure 4 );The suspected area results obtained above are Figure 3 and non-suspected area results Figure 4 The pixel matrix is ​​added to obtain the denoised electronic document image (denoised as the denoising result Figure 5 ).

[0076] like Figure 3 As shown, step 501, the original Figure 1 Perform filtering operation and get filtering result Figure 2 ; Step 502, according to the 0-1 noise matrix, filter the result Figure 2 The pixel values ​​of the areas corresponding to non-suspected noise points are set to 0, and the suspected area result is obtained. Figure 3 ; Step 503, according to the 0-1 noise matrix diagram, the original Figure 1 The pixel values ​​of the areas corresponding to the suspected noise points are set to 0, and the results of the non-suspected areas are obtained. Figure 4 ; Step 504, the suspected area result Figure 3 and non-suspected area results Figure 4 Perform matrix addition operation to obtain the denoising result Figure 5 .

[0077] Optionally, the filtering in step 205) can be replaced by filtering performed by a spatial domain filter such as a mean filter or a Gaussian filter.

[0078] Figure 4 The following are comparison diagrams of the denoising effects of several electronic document images. Among them, a) is the original electronic document image, b) is the denoising effect diagram after ROF algorithm, c) is the denoising effect diagram after median filtering, and d) is the denoising effect diagram after the method described in Example 2 of the present invention.

[0079] It can be seen that the denoising effect of the ROF algorithm shown in b) is not as good as the denoising effect d) of the second embodiment of the present invention; the denoising effect of the median filtering processing shown in c) is better than the denoising effect d) of the second embodiment of the present invention, although the noise removal is improved compared with b), the text becomes blurred.

[0080] In contrast, the denoising result shown in the denoising effect diagram d) of the second embodiment of the present invention can not only effectively remove noise points, but also maintain the integrity and clarity of the text information in the original image, reduce the loss of text edges, greatly improve the accuracy of subsequent image-based OCR text recognition, and effectively improve the reading experience of electronic document images.

[0081] Embodiment 3

[0082] This embodiment provides an electronic document image denoising device 30, such as Figure 5 As shown, the device comprises:

[0083] The conversion module 301 is configured to convert the electronic document image into a grayscale image, and convert the obtained grayscale image into a binary image;

[0084] A connected domain generation module 302 is configured to form a connected domain graph according to the binary graph;

[0085] A noise point determination module 303 is configured to determine a suspected noise point area according to each connected domain in the connected domain graph;

[0086] The denoising module 304 is configured to perform filtering processing on the electronic document image according to the suspected noise point area to obtain a denoised document image.

[0087] Optionally, the conversion module 301 is configured to convert the grayscale image into a binary image according to a preset conversion threshold.

[0088] Optionally, the connected domain generating module 302 is configured to sequentially perform erosion operations and dilation operations on the binary graph using structural elements of different sizes to obtain the connected domain graph.

[0089] Optionally, the connected domain generation module 302 is configured to define an x*x structural element, where x is an integer greater than or equal to 2, and use a morphological erosion algorithm to operate on the binary image; the algorithm enables a single character to form an enclosed whole; and if the symbols near a single character are very close, they can also form a whole with the adjacent characters, thereby achieving the purpose of separating noise points.

[0090] Define a y*y structural element, where y is an integer greater than or equal to 1 and y is less than x. The binary image processed by the erosion algorithm is operated by the morphological expansion algorithm, so that the background color of the electronic document expands to the black area. Through this operation, the area of ​​the outlier individuals will be reduced, so that noise points and text and symbols can be better distinguished by size; among them, noise points generally appear as outliers.

[0091] Optionally, x and y may be set to different values ​​according to different electronic document images, and may be set such that the value of x is greater than the value of y; or the value of x is twice the value of y.

[0092] After the above processing by the connected domain generation module 302, each character, character together with adjacent symbols and noise points form their own connected domains. The connected domains formed by the single character and / or the single character plus adjacent symbols and / or noise points in the entire electronic document image together constitute a connected domain graph.

[0093] Optionally, the noise point determination module 303 is configured to use a contour detection algorithm FindContours to extract position coordinate information of each connected domain in the connected domain map; and determine whether each connected domain in the connected domain map is a suspected noise point area based on the position coordinate information.

[0094] The noise point determination module 303 is further configured to determine the size of each connected domain according to the position coordinate information of each connected domain extracted, and define the connected domain whose size is lower than the noise point threshold as a suspected noise point area, and mark it as 1, otherwise mark it as 0;

[0095] The noise point determination module 303 is further configured to generate a noise point matrix diagram of the suspected noise point distribution area, that is, a 0-1 noise point matrix diagram, for the entire connected domain diagram according to the mark;

[0096] The noise threshold is determined according to the resolution of the electronic document image.

[0097] Optionally, the device further includes: a preset module 305, which is set to preset a correspondence between a resolution and a noise threshold; optionally, the higher the resolution, the larger the corresponding noise threshold. For example, when the resolution is 800*600, the corresponding noise threshold is 20 pixels; when the resolution is 1200*800, the corresponding noise threshold is 30 pixels. Different correspondences can be set according to the resolution characteristics of the electronic document image.

[0098] Optionally, the noise determination module 303 is further configured to determine the corresponding noise threshold according to the resolution of the electronic document image and the correspondence between the preset resolution and the noise threshold. When the resolution of the electronic document image does not exactly correspond to the preset data, a close noise threshold can be selected; or a noise threshold can be determined by calculation according to a relevant algorithm. The specific determination method is not limited to the method described in this embodiment.

[0099] Optionally, the denoising module 304 is configured to denoise the entire original electronic document image (referred to as original Figure 1 ) to filter, such as median filtering, and obtain the filtered image (recorded as the filtering result Figure 2 ); According to the noise matrix, the filtering result Figure 2 The pixel values ​​of the areas corresponding to the non-suspected noise points are all set to 0, and the suspected area result map is obtained (referred to as the suspected area result map). Figure 3 ); According to the noise matrix diagram, the original electronic document image (original Figure 1 ) are all set to 0, and the non-suspected area result map is obtained (denoted as the non-suspected area result map Figure 4 );The suspected area results obtained above are Figure 3 and non-suspected area results Figure 4 The pixel matrix is ​​added to obtain the denoised electronic document image (denoised as the denoising result Figure 5 ).

[0100] The filtering process includes: spatial filtering processes such as median filtering, mean filtering or Gaussian filtering.

[0101] A person of ordinary skill in the art can understand that all or part of the steps of the above-mentioned embodiments can be implemented using a computer program flow. The computer program can be stored in a computer-readable storage medium. The computer program is executed on a corresponding hardware platform (such as a system, device, apparatus, component, etc.). When executed, it includes one of the steps of the method embodiment or a combination thereof.

[0102] Optionally, all or part of the steps of the above embodiment may also be implemented using an integrated circuit, and these steps may be made into integrated circuit modules, or multiple modules or steps therein may be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0103] The various devices / functional modules / functional units in the above embodiments may be implemented using a general-purpose computing device. They may be concentrated on a single computing device or distributed on a network composed of multiple computing devices.

[0104] When each device / functional module / functional unit in the above embodiments is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. The above-mentioned computer-readable storage medium can be a read-only memory, a disk or an optical disk, etc.

[0105] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope described in the claims.

Claims

1. A method for denoising an electronic document image, characterized in that: include: Converting the electronic document image into a grayscale image, and converting the obtained grayscale image into a binary image; the electronic document image includes text and symbols; According to the binary graph, a connected domain graph is formed, so that the text, the text together with the adjacent symbols and the noise points in the electronic document image are separated from each other and each forms a separate connected domain; Determine a suspected noise point area according to each connected domain in the connected domain map; and form a noise point matrix map for the entire connected domain map according to the suspected noise point area; The electronic document image is filtered according to the noise matrix to obtain a denoised document image, including: Performing filtering processing on the electronic document image to obtain a filtering result image; According to the noise matrix diagram, the pixel values ​​of the areas corresponding to the non-suspected noise points in the filtering result diagram are all set to 0 to obtain a suspected area result diagram; According to the noise matrix diagram, the pixel values ​​of the areas corresponding to the suspected noise points in the electronic document image are all set to 0 to obtain a non-suspected area result diagram; A matrix addition operation is performed on the suspected region result image and the non-suspected region result image to obtain a denoised document image.

2. The method according to claim 1, characterized in that The step of converting the obtained grayscale image into a binary image includes: converting the grayscale image into a binary image according to a preset conversion threshold.

3. The method according to claim 1 or 2, characterized in that: The forming of a connected domain graph according to the binarized graph comprises: The connected domain graph is obtained by sequentially performing erosion operations and dilation operations on the binary graph through structural elements of different sizes.

4. The method according to claim 3, characterized in that The step of sequentially performing erosion operations and dilation operations on the binary image using structural elements of different sizes includes: Define an x*x structure element, where x is an integer greater than or equal to 2, and use a morphological erosion algorithm to operate on the binary image; A y*y structural element is defined, where y is an integer greater than or equal to 1 and y is less than x, and the binary graph processed by the erosion algorithm is operated by a morphological expansion algorithm to obtain the connected domain graph.

5. The method according to claim 4, characterized in that The determining of the suspected noise point area according to each connected domain in the connected domain graph includes: Extracting position coordinate information of each connected domain in the connected domain graph by using a contour detection algorithm; According to the position coordinate information, it is determined whether each connected domain in the connected domain map is a suspected noise point area.

6. The method according to claim 5, characterized in that The step of determining, according to the position coordinate information, whether each connected domain in the connected domain graph is a suspected noise point area comprises: The size of each connected domain is determined according to the position coordinate information of each connected domain extracted, and the connected domain whose size is lower than the noise threshold is defined as a suspected noise area and marked as 1, otherwise marked as 0; The forming of a noise matrix map for the entire connected domain map according to the suspected noise area comprises: According to the marks, a noise matrix diagram is formed for the entire connected domain diagram; wherein the noise threshold is determined according to the resolution of the electronic document image.

7. The method according to claim 6, characterized in that The method further includes: presetting a corresponding relationship between a resolution and a noise threshold; The noise threshold is determined according to the resolution of the electronic document image, including: determining the corresponding noise threshold according to the resolution of the electronic document image and a correspondence between a preset resolution and the noise threshold.

8. The method according to claim 1, characterized in that The filtering process includes: median filtering, mean filtering or Gaussian filtering.

9. A device for denoising an electronic document image, characterized in that: include: A conversion module, configured to convert the electronic document image into a grayscale image, and convert the obtained grayscale image into a binary image; the electronic document image includes text and symbols; A connected domain generation module is configured to form a connected domain map according to the binary map, so that the text, the text together with the adjacent symbols and the noise points in the electronic document image are separated from each other and each forms a separate connected domain; A noise point determination module, configured to determine a suspected noise point area according to each connected domain in the connected domain graph; According to the suspected noise point area, a noise point matrix diagram is formed for the entire connected domain diagram; A denoising module is configured to filter the electronic document image according to the noise matrix diagram to obtain a denoised document image, including: Performing filtering processing on the electronic document image to obtain a filtering result image; According to the noise matrix diagram, the pixel values ​​of the areas corresponding to the non-suspected noise points in the filtering result diagram are all set to 0 to obtain a suspected area result diagram; According to the noise matrix diagram, the pixel values ​​of the areas corresponding to the suspected noise points in the electronic document image are all set to 0 to obtain a non-suspected area result diagram; A matrix addition operation is performed on the suspected region result image and the non-suspected region result image to obtain a denoised document image.