Method and device for determining blurriness of OCR scene images
Through bidirectional low-pass filtering and gradient difference mean calculation methods, the large error problem of determining the image blur in OCR scene in the prior art is solved, and a higher precision image clarity judgment is achieved.
Patent Information
- Application Number
- CN202210727734.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-23
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2042-06-23
AI Technical Summary
The image ambiguity determination method in the existing OCR scene depends on the overall gradient information of the image and cannot accurately reflect the ambiguity of the text area, resulting in large errors.
The combination of bidirectional low-pass filtering and gradient calculation is used to perform low-pass filtering in horizontal and vertical directions on the image, calculate the mean of gradient difference in horizontal and vertical directions, and map the final ambiguity through the ambiguity calculation function.
It improves the accuracy of OCR scene image blur calculation, effectively suppresses the influence of background and shading, and can more accurately judge the sharpness of the image.
Smart Images

Figure CN115330673B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision, and in particular to a method and device for determining the fuzziness of an OCR scene image. Background Art
[0002] In Optical Character Recognition (OCR) tasks, it's often necessary to pre-evaluate the blur level of an image. For example, when performing OCR on a video stream using a mobile phone camera, motion blur can easily occur, making text unclear and difficult to recognize. Therefore, it's necessary to filter out blurry frames and select clear ones for OCR.
[0003] The main idea behind current methods for determining image blur is to calculate the sum or mean of image gradients to determine the degree of blur. Larger gradients indicate a sharp image, while smaller gradients indicate blur. The main drawback of this method is that its measurement metric is the absolute characteristic of the original image's gradients, which can lead to large errors in calculating blur.
[0004] Therefore, there is an urgent need to provide a novel and effective method for determining the blurriness of OCR scene images with small errors. Summary of the Invention
[0005] In order to solve the above problems, the present invention proposes a method and device for determining the blurriness of OCR scene images, which are used to calculate the blurriness of OCR scene images and determine whether they meet the OCR quality standards. For special OCR text scenes, the technical solution of the present invention proposes a high-precision blurriness determination method based on the characteristics of OCR text scene images through mathematical calculations and large-scale data (9,768 manually annotated data) analysis and verification. In addition, since motion blur in OCR scenes is mostly dominated by horizontal movement or vertical movement, the technical solution of the present invention performs gradient information analysis and calculation in the horizontal and vertical directions within the calculation process, thereby improving the calculation accuracy.
[0006] According to a first aspect of the technical solution of the present invention, a method for determining blurriness of an OCR scene image is provided, the method comprising the following steps:
[0007] Step 1, bidirectional low-pass filtering step: perform horizontal and vertical low-pass filtering on the input original image respectively to obtain a horizontally blurred image and a vertically blurred image;
[0008] Step 2, bidirectional gradient calculation step: calculating a first horizontal gradient map and a first vertical gradient map of the original image, and calculating a second horizontal gradient map of the horizontally blurred image and a second vertical gradient map of the vertically blurred image;
[0009] Step 3, effective gradient difference mean calculation step: Calculate the effective gradient difference mean in the horizontal direction and the effective gradient difference mean in the vertical direction based on the first horizontal gradient map and the second horizontal gradient map, and the first vertical gradient map and the second vertical gradient map, and take the minimum value as the effective gradient difference mean of the entire map;
[0010] Step 4, fuzziness function mapping step: obtaining the fuzziness of the entire image through the fuzziness calculation function according to the effective gradient difference mean of the entire image.
[0011] Furthermore, the step 1 specifically includes
[0012] Perform horizontal low-pass filtering on the input original image, set the filter kernel shape to 1x k, k is the filter kernel size, and k = 14, to obtain a horizontally blurred image;
[0013] Perform a vertical low-pass filter on the input original image, set the filter kernel shape to kx 1, k is the filter kernel size, and k=14, to obtain a vertically blurred image.
[0014] Furthermore, in step 1, the filter kernel is a mean filter kernel, a Gaussian filter kernel, etc.
[0015] Furthermore, in step 2, the method for calculating the gradient includes a horizontal and vertical difference method, a Sobel operator, and the like.
[0016] Furthermore, the step 3 specifically includes:
[0017] Step 31: input the first horizontal gradient map and the second horizontal gradient map, calculate the effective gradient difference of each pixel in the horizontal direction, and obtain a first horizontal effective gradient difference map;
[0018] Step 32: Input the first vertical gradient map and the second vertical gradient map, calculate the effective gradient difference of each pixel in the vertical direction, and obtain a first vertical effective gradient difference map;
[0019] Step 33: setting an effective gradient difference threshold, setting pixel values in the first horizontal effective gradient difference map and the first vertical effective gradient difference map whose effective gradient difference values are less than the effective gradient difference threshold to 0, to obtain a second horizontal effective gradient difference map and a second vertical effective gradient difference map, respectively;
[0020] Step 34: For the second horizontal effective gradient difference map and the second vertical effective gradient difference map, count the number of non-zero pixel values, record it as n, calculate the sum of the effective gradient differences of all pixels, record it as sum, calculate sum / n, and obtain the mean effective gradient difference in the horizontal direction and the mean effective gradient difference in the vertical direction, respectively;
[0021] Step 35: Take the minimum value of the horizontal effective gradient difference mean and the vertical effective gradient difference mean as the effective gradient difference mean of the entire image.
[0022] Furthermore, in step 31, the formula for calculating the effective gradient difference of each pixel in the horizontal direction is:
[0023] max(0,G_F_hor-G_B_hor),
[0024] Among them, G_F_hor is the pixel value of a certain pixel point in the first horizontal gradient map, and G_B_hor is the pixel value of the pixel point in the second horizontal gradient map.
[0025] Furthermore, in step 32, the formula for calculating the effective gradient difference of each pixel in the vertical direction is:
[0026] max(0,G_F_ver-G_B_ver),
[0027] Among them, G_F_ver is the pixel value of a certain pixel point in the first vertical gradient map, and G_B_ver is the pixel value of the pixel point in the second vertical gradient map.
[0028] Furthermore, in step 33, the effective gradient difference threshold is 0.3.
[0029] Furthermore, in step 4, the ambiguity calculation function is:
[0030] blur_score=1-1 / (1+e^(-3*(V-2.4))),
[0031] Wherein, e is the natural exponent, and V is the mean effective gradient difference of the entire image.
[0032] According to a second aspect of the present invention, there is provided an apparatus for determining blurriness of an OCR scene image, the apparatus being operated based on the method provided in any of the aforementioned aspects, the apparatus comprising:
[0033] A bidirectional low-pass filtering unit is used to perform horizontal and vertical low-pass filtering on the input original image to obtain a horizontally blurred image and a vertically blurred image;
[0034] a bidirectional gradient calculation unit, configured to calculate a first horizontal gradient map and a first vertical gradient map of the original image, and calculate a second horizontal gradient map of the horizontally blurred image and a second vertical gradient map of the vertically blurred image;
[0035] an effective gradient difference mean calculation unit, configured to calculate a horizontal effective gradient difference mean and a vertical effective gradient difference mean based on the first horizontal gradient map and the second horizontal gradient map, and the first vertical gradient map and the second vertical gradient map, and take the minimum value as the effective gradient difference mean of the entire map;
[0036] The fuzziness function mapping unit is used to obtain the fuzziness of the entire image through a fuzziness calculation function according to the effective gradient difference mean of the entire image.
[0037] According to a third aspect of the present invention, a system for calculating the blurriness of an OCR scene image is provided, the system comprising: a processor and a memory for storing executable instructions; wherein the processor is configured to execute the executable instructions to perform the OCR scene image blurriness determination method as described in any of the above aspects.
[0038] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, characterized in that a computer program is stored thereon, and when the computer program is executed by a processor, the method for determining the blurriness of an OCR scene image as described in any one of the above aspects is implemented.
[0039] Beneficial effects of the present invention:
[0040] The present invention proposes a method for determining the blurriness of an OCR scene image, which can be used to calculate the blurriness of an OCR scene image and determine whether it meets the OCR quality standard;
[0041] Innovatively focuses gradient analysis on the text outline of the image, effectively ignoring and suppressing the influence of text background and shading, significantly improving calculation accuracy;
[0042] The proposed effective gradient difference mean calculation module effectively solves the local gradient rise problem caused by the fuzzification step in conventional methods and improves the calculation accuracy;
[0043] A fuzziness calculation function is designed with a value range of (0,1) and a very reasonable discrimination threshold adjustment range, which can effectively separate clear images from blurry images. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.
[0045] Figure 1 The following is an overall flow chart of a method for determining blurriness of an OCR scene image according to an embodiment of the present invention.
[0046] Figure 2 A flow chart of a bidirectional low-pass filtering module according to an embodiment of the present invention is shown.
[0047] Figure 3 A flow chart of a bidirectional gradient calculation module according to an embodiment of the present invention is shown.
[0048] Figure 4 A flow chart of an effective gradient difference mean calculation module according to an embodiment of the present invention is shown.
[0049] Figure 5 A schematic diagram of the ambiguity mapping function result according to an embodiment of the present invention is shown.
[0050] Figure 6 A schematic diagram of ambiguity results according to an embodiment of the present invention is shown.
[0051] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION
[0052] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
[0053] The terms "first," "second," and the like in the description and claims of the present disclosure are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, such that the embodiments of the present disclosure described herein can, for example, be implemented in orders other than those illustrated or described herein.
[0054] In addition, the terms "comprises" and "having" and any variations thereof are intended to cover a non-exclusive inclusion. For example, a process, method, system, product or apparatus that includes a series of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, product or apparatus.
[0055] Multiple includes two or more.
[0056] It should be understood that the term "and / or" as used in this disclosure simply describes an association between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0057] In the OCR scene, the focus is on whether the text is blurred, that is, the fuzziness calculation should only focus on the text area in the image. The current conventional fuzziness determination methods are based on the overall gradient information of the image and cannot focus on local information. Especially in OCR scene images, the proportion of pixels in non-text areas (including background, shading, etc.) is much higher than that in text areas. The calculation results of conventional methods instead reflect the fuzziness of the non-text areas of the image more, and it is difficult to reflect the fuzziness information of the text area. In view of the characteristics of OCR images, the present invention proposes an effective method for determining the fuzziness of OCR scene images, which focuses the fuzziness calculation on the text area and effectively eliminates the influence of non-text areas such as background and shading. The innovations mainly include the following three points:
[0058] Perform gradient analysis and calculation in the horizontal and vertical directions respectively;
[0059] A method for determining the "effective gradient difference mean" is proposed to help focus on the text area, which is suitable for calculating the blur in OCR scenes.
[0060] A new ambiguity mapping function is proposed and fitted with a large number of data sets, which has accurate discrimination effect.
[0061] Example
[0062] The overall module flow chart of this method is as follows Figure 1 For more detailed flowcharts of each module, please refer to the respective module sections.
[0063] Bidirectional low-pass filter module
[0064] like Figure 2 As shown, let the input image be denoted as F. First, the image is low-pass filtered horizontally with a filter kernel shape of 1x k (k = 14 is recommended). A mean filter kernel, a Gaussian filter kernel, or other filters can be used. After this low-pass filtering step, a horizontally blurred image is obtained, denoted as B_hor.
[0065] Then, perform vertical low-pass filtering on the image, setting the filter kernel shape to kx 1 (k=14 is recommended), and using mean filter kernel, Gaussian filter kernel, etc. After this step of low-pass filtering, a vertically blurred image is obtained, which is recorded as B_ver.
[0066] Bidirectional gradient calculation module
[0067] like Figure 3As shown, for the input original image F, its horizontal gradients are calculated, denoted as G_F_hor and G_F_ver. For the image B_hor obtained from the previous module, its horizontal gradient is calculated, denoted as G_B_hor. For the image B_ver obtained from the previous module, its vertical gradient is calculated, denoted as G_B_ver. The method for calculating the gradient can be selected from the horizontal and vertical difference method, the Sobel operator, etc. The method used in this embodiment is the horizontal and vertical difference method.
[0068] For example, the horizontal and vertical difference method for calculating the image gradient is as follows: to calculate the gradient of a certain point in the horizontal direction, there are three common methods: the pixel value to the right of the point - the pixel value of the point, the pixel value of the point - the pixel value to the left of the point, or the pixel value to the right of the point minus the pixel value to the left of the point and then dividing by two.
[0069] Effective gradient difference mean calculation module
[0070] like Figure 4 As shown, we first use the input images G_F_hor and G_B_hor to calculate the effective horizontal gradient difference for each pixel. Low-pass filtering can cause slight changes in the pixel values around edge pixels, primarily those at the text boundary, in the OCR image. This can especially affect the gradients of previously smooth background pixels outside the edge. To eliminate this adverse effect, we only consider the areas where the gradient decreases after low-pass filtering and ignore the pixels where the gradient increases to eliminate the effect of local gradient increases. This is expressed as max(0, G_F_hor – G_B_hor), and the result is recorded as image S_hor_1.
[0071] Because OCR scene images often contain background textures, such as the striped, mesh-like textures found on ID cards, these textures are often light in color and have low gradients. Failure to filter these textures can result in low overall gradients and high blurriness. Based on extensive data statistics and experimental verification during the experiment, we recommend setting the effective gradient difference threshold to 0.3. For image S_hor_1, set the pixel values below the gradient difference threshold to 0, and the result is recorded as image S_hor_2. This ignores pixels with small gradient differences, further corrects the effective gradient difference, and suppresses the influence of background textures.
[0072] Then calculate the mean of the effective gradient difference in the horizontal direction. Since in the OCR scene image, the text contour pixels often account for a very small proportion, the background pixels account for a large proportion, and the proportions are varied; and the main consideration for measuring the blurriness of the OCR scene image is precisely the gradient information of the text contour pixels. Therefore, it is not reasonable to calculate the mean of all pixel information of the image. The present invention excludes the influence of background pixels as much as possible and only calculates the mean of the gradient information of the text contour pixels. Since background pixels often have small gradients and small gradient differences, these pixels have basically been set to 0 under the filtering of the effective gradient difference threshold in the previous step. This step only needs to ignore the pixels with a gradient difference of 0 and calculate the mean of the remaining pixels. That is, for the image S_hor_2, the number of non-zero pixel values is recorded as n, the sum of all pixel values of the image is calculated as sum, and sum / n is calculated as V_hor, which is the mean of the effective gradient difference in the horizontal direction.
[0073] Similarly, the mean of the effective vertical gradient difference is calculated based on the input images G_F_ver and G_B_ver, which is recorded as V_ver.
[0074] The minimum value of V_hor and V_ver is taken as the mean of the effective gradient difference of the entire image, recorded as V.
[0075] Fuzzy function mapping module
[0076] The embodiment of the present invention proposes a fuzziness mapping function for mapping the effective gradient difference mean V to a final fuzziness value.
[0077] The purpose of designing this mapping function is as follows:
[0078] Purpose 1: The effective gradient difference mean V calculated above reflects the clarity of the image. The larger the V value, the clearer the image, that is, the blurriness decreases monotonically with V. However, the indicator we want to calculate is blurriness, which reflects the blurriness of the image. We hope that the larger the calculated result value, the blurrier the image, that is, the blurriness should increase monotonically with the calculated result.
[0079] Purpose 2: The value range of V is [0,255], and we hope to map the value range of the calculation result to the range of (0,1) to more vividly reflect the image blur.
[0080] Objective 3: When the blur value range is (0, 1), we hope to set the blur threshold to an intermediate value of 0.5 so that the image can be most accurately classified into clear and blurry categories.
[0081] Objective 4: Since the demarcation line between fuzzy and clear is highly subjective, we hope that when the fuzziness range is (0,1):
[0082] For obviously blurred images, the blur calculation result should be close to 1;
[0083] For an obviously clear image, the calculated result of the blurriness should approach 0;
[0084] For an ambiguous and controversial image, it is hoped that the calculated result of the blurriness is between 0.2 and 0.8, with a wide distribution, so as to flexibly adjust the blurriness threshold according to the specific scenario.
[0085] For the above purposes, based on a large amount of manually annotated data (a total of 9,768 pictures, manually annotated as clear and blurry), through data distribution analysis, gradient feature statistics, and search for the optimal blurriness threshold, the following information is obtained:
[0086] Information 1: After calculating the mean value V of the effective gradient difference described in the present invention for all images, when the threshold is V = 2.4 (classifying images with V >= 2.4 as clear and images with V < 2.4 as blurry), the classification accuracy of clear and blurry images reaches the highest, that is, 2.4 is the optimal threshold for V; therefore, the designed mapping function needs to have a blurriness of 0.5 when V = 2.4 to achieve the purpose of 0.5 being the optimal threshold;
[0087] Information 2: When 1.94 < V < 2.86, when V < 1.94, it can be determined that the image is obviously blurry, and when V > 2.86, it can be determined that the image is obviously clear; images with 1.94 < V < 2.86 may have blurriness disputes. Therefore, the designed mapping function should recognize images with V < 1.94 as obviously blurry and map the blurriness value to between 0.8 and 1.0. Recognize images with V > 2.86 as obviously clear and map the blurriness value to between 0 and 0.2. Map the blurriness of images with 1.94 < V < 2.86 to between 0.2 and 0.8, with a wide distribution, which can meet the need to flexibly adjust the blurriness threshold according to the specific scenario.
[0088] Based on the above information, the embodiment of the present invention designs a blurriness calculation function: blur_score = 1 - 1 / (1 + e^(-3*(V - 2.4)))
[0089] The image of this function is as Figure 5 shown, and this function has the following characteristics:
[0090] 1. It achieves Purpose 1. The function is monotonically decreasing. The blurrier the image, the smaller V is, and the larger the calculated output blurriness is;
[0091] 2. It achieves Purpose 2. It satisfies mapping the input within the range of [0, 255] to the output within the range of (0, 1);
[0092] 3. Objective three is achieved. With (2.4, 0.5) as the center of symmetry, the optimal threshold 2.4 of V is mapped to the ambiguity 0.5, and it expands on both sides centered on this value, facilitating a more balanced display and adjustment of the ambiguity threshold.
[0093] 4. Objective four is achieved. The input of 1.94 < V < 2.86 is mapped to the output range of [0.2, 0.8]. The ambiguity range that may be controversial is more widely exposed within the adjustable range of the threshold, and the judgment stability of clearly blurred and clearly clear images is effectively guaranteed.
[0094] Use this function to calculate the final image ambiguity, and the statistical chart of the results is as Figure 6 shown. In the figure, the horizontal axis is the calculation result of the blur_score of the ambiguity, the light-colored column on the vertical axis is the proportion of clear pictures, and the dark-colored column on the vertical axis is the proportion of blurred pictures. It can be seen that the ambiguity calculation function of the technical solution of the present invention can well separate clear pictures and blurred pictures, and the adjustable range of the horizontal axis (ambiguity) is wide and stable.
[0095] It should be noted that in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. Without further limitations, the element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including that element.
[0096] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments.
[0097] Through the description of the above embodiments, those skilled in the art can clearly understand that the above implementation methods can be realized by means of software plus a necessary general hardware platform. Of course, it can also be realized by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to enable a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in various embodiments of the present invention.
[0098] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are protected by the present invention.
Claims
1. A method for determining blurriness of an OCR scene image, characterized in that: The method comprises the following steps: Step 1, bidirectional low-pass filtering step: perform horizontal and vertical low-pass filtering on the input original image respectively to obtain a horizontally blurred image and a vertically blurred image; Step 2, bidirectional gradient calculation step: calculating a first horizontal gradient map and a first vertical gradient map of the original image, and calculating a second horizontal gradient map of the horizontally blurred image and a second vertical gradient map of the vertically blurred image; Step 3, effective gradient difference mean calculation step: Calculate the effective gradient difference mean in the horizontal direction and the effective gradient difference mean in the vertical direction based on the first horizontal gradient map and the second horizontal gradient map, and the first vertical gradient map and the second vertical gradient map, and take the minimum value as the effective gradient difference mean of the entire map; Step 4, fuzziness function mapping step: obtaining the fuzziness of the entire image through the fuzziness calculation function according to the effective gradient difference mean of the entire image.
2. The method for determining blurriness of an OCR scene image according to claim 1, wherein: The step 1 specifically includes: Perform horizontal low-pass filtering on the input original image, set the filter kernel shape to 1x k, k is the filter kernel size, and k = 14, to obtain a horizontally blurred image; Perform a vertical low-pass filter on the input original image, set the filter kernel shape to kx 1, k is the filter kernel size, and k=14, to obtain a vertically blurred image.
3. The method for determining blurriness of an OCR scene image according to claim 1, wherein: The step 3 specifically includes: Step 31: input the first horizontal gradient map and the second horizontal gradient map, calculate the effective gradient difference of each pixel in the horizontal direction, and obtain a first horizontal effective gradient difference map; Step 32: Input the first vertical gradient map and the second vertical gradient map, calculate the effective gradient difference of each pixel in the vertical direction, and obtain a first vertical effective gradient difference map; Step 33: setting an effective gradient difference threshold, setting pixel values in the first horizontal effective gradient difference map and the first vertical effective gradient difference map whose effective gradient difference values are less than the effective gradient difference threshold to 0, to obtain a second horizontal effective gradient difference map and a second vertical effective gradient difference map, respectively; Step 34: For the second horizontal effective gradient difference map and the second vertical effective gradient difference map, count the number of non-zero pixel values, record it as n, calculate the sum of the effective gradient differences of all pixels, record it as sum, calculate sum / n, and obtain the mean effective gradient difference in the horizontal direction and the mean effective gradient difference in the vertical direction, respectively; Step 35: Take the minimum value of the horizontal effective gradient difference mean and the vertical effective gradient difference mean as the effective gradient difference mean of the entire image.
4. The method for determining the blurriness of an OCR scene image according to claim 3, wherein: In step 31, the formula for calculating the effective gradient difference of each pixel in the horizontal direction is: max(0,G_F_hor-G_B_hor), Among them, G_F_hor is the pixel value of a certain pixel point in the first horizontal gradient map, and G_B_hor is the pixel value of the pixel point in the second horizontal gradient map.
5. The method for determining blurriness of an OCR scene image according to claim 3, wherein: In step 32, the formula for calculating the effective gradient difference of each pixel in the vertical direction is: max(0,G_F_ver-G_B_ver), Among them, G_F_ver is the pixel value of a certain pixel point in the first vertical gradient map, and G_B_ver is the pixel value of the pixel point in the second vertical gradient map.
6. The method for determining blurriness of an OCR scene image according to claim 3, wherein: In step 33, the effective gradient difference threshold is 0.
3.
7. The method for determining blurriness of an OCR scene image according to claim 1, wherein: In step 4, the ambiguity calculation function is: blur_score=1-1 / (1+e^(-3*(V-2.4))), Wherein, e is the natural exponent, and V is the mean effective gradient difference of the entire image.
8. An OCR scene image fuzziness determination device, characterized in that: The device operates based on the method according to any one of claims 1 to 7, and the device comprises: A bidirectional low-pass filtering unit is used to perform horizontal and vertical low-pass filtering on the input original image to obtain a horizontally blurred image and a vertically blurred image; a bidirectional gradient calculation unit, configured to calculate a first horizontal gradient map and a first vertical gradient map of the original image, and calculate a second horizontal gradient map of the horizontally blurred image and a second vertical gradient map of the vertically blurred image; an effective gradient difference mean calculation unit, configured to calculate a horizontal effective gradient difference mean and a vertical effective gradient difference mean based on the first horizontal gradient map and the second horizontal gradient map, and the first vertical gradient map and the second vertical gradient map, and take the minimum value as the effective gradient difference mean of the entire map; The fuzziness function mapping unit is used to obtain the fuzziness of the entire image through a fuzziness calculation function according to the effective gradient difference mean of the entire image.
9. A system for calculating blurriness of an OCR scene image, the system comprising: A processor and a memory for storing executable instructions; wherein the processor is configured to execute the executable instructions to perform the OCR scene image ambiguity determination method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the computer program is executed by a processor, the method for determining the blurriness of an OCR scene image according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Image blur determination method and apparatus, computer device and storage medium
CN109447942A
Image fuzziness evaluation method and device
CN110232680A