Image processing method and system and electronic equipment

By evaluating its clarity, contrast, noise value and ambiguity before the digital image is recognized, it determines whether to identify user identity information, which solves the problem of low recognition efficiency caused by low-quality images and improves the overall recognition efficiency.

CN119478640APending Publication Date: 2025-02-18SHENZHEN HAIGUI NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411549430.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

In actual scenarios, the quality of the collected digital images cannot be guaranteed, which makes it difficult to accurately obtain user identity information when the digital image quality is poor, thereby reducing the execution efficiency of OCR recognition.

Method used

Before identifying the user identity information in the digital image, the image quality score result is obtained by calculating the image clarity, contrast, noise value and ambiguity, and based on the result, decide whether to perform the subsequent user identity information identification process.

Benefits of technology

By evaluating image quality and deciding whether to perform recognition, unnecessary recognition of low-quality digital images is avoided, and the execution efficiency of OCR recognition is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119478640A_ABST
    Figure CN119478640A_ABST
Patent Text Reader

Abstract

The invention provides an image processing method and system and electronic equipment, and relates to the field of image processing.The method includes the steps that before user identity information in a digital image is recognized, the image quality of the digital image is quantized through the definition, the contrast ratio, the noise value and the ambiguity of the digital image, and a corresponding image quality scoring result is obtained; and generating a corresponding image processing strategy by using an image quality scoring result to determine whether the digital image executes a subsequent user identity information identification process or not. According to the method, the image quality of the digital image is evaluated before the OCR recognition process is executed on the digital image, so that unnecessary recognition on a low-quality digital image is avoided, and the execution efficiency of OCR recognition is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing, and in particular to an image processing method, system, and electronic device. Background Technology

[0002] In systems involving various industries such as finance, shopping, and law, user identity information needs to be collected. In most cases, the collection of user identity information is achieved by taking pictures of user ID cards and other documents to obtain digital images containing the documents. Then, OCR (Optical Character Recognition) is performed on the digital images to obtain user identity information based on the recognition results.

[0003] Due to the complexity of real-world scenarios, the quality of acquired digital images cannot be guaranteed. When the quality of digital images is poor, it is difficult to accurately obtain user identity information. However, the digital image will still undergo the OCR recognition process, resulting in low efficiency in the processing flow. Summary of the Invention

[0004] In view of this, the purpose of this invention is to provide an image processing method, system, and electronic device. Before recognizing user identity information in a digital image, this method quantifies the image quality by considering factors such as sharpness, contrast, noise level, and blurriness to obtain a corresponding image quality score. The image quality score is then used to generate a corresponding image processing strategy to determine whether to proceed with the subsequent user identity information recognition process. This method assesses the image quality of a digital image before performing OCR recognition, thereby avoiding unnecessary recognition of low-quality digital images and improving the efficiency of OCR recognition.

[0005] In a first aspect, embodiments of the present invention provide an image processing method, the method comprising:

[0006] Acquire digital images containing user identification information;

[0007] Multiple regions to be identified in a digital image are determined based on the format parameters corresponding to the user's identity information.

[0008] Calculate the gradient value, gray value, spectrum value and variance value corresponding to the region to be identified, and use the sharpness corresponding to the gradient value, the contrast corresponding to the gray value, the noise value corresponding to the spectrum value and the ambiguity corresponding to the variance value to determine the image quality score result corresponding to the digital image.

[0009] Based on the image quality score, determine the corresponding image processing strategy for the digital image, and then use the image processing strategy to process the digital image.

[0010] Optionally, multiple regions to be identified in the digital image are determined based on format parameters corresponding to the user's identity information, including:

[0011] Retrieve the identity region in a digital image that contains user identification information;

[0012] The type parameter of the identity region is determined using the format parameter, and the segmentation parameter corresponding to the identity region is determined based on the type parameter;

[0013] After segmenting the identity region according to the segmentation parameters, multiple regions to be identified are obtained.

[0014] Optionally, the gradient value, gray value, spectral value, and variance value corresponding to the region to be identified are calculated, including:

[0015] Obtain the corresponding sharpness detection region in the region to be identified, and use the Sobel operator to calculate the directional gradient of the sharpness detection region to obtain the gradient value corresponding to the sharpness detection region;

[0016] Obtain the corresponding contrast detection area in the area to be identified, and use the grayscale histogram of the contrast detection area to obtain the grayscale value of the contrast detection area.

[0017] Obtain the noise value detection area corresponding to the area to be identified, and calculate the spectrum value corresponding to the noise value detection area using the Fourier transform result of the noise value detection area;

[0018] Obtain the corresponding ambiguity detection region in the region to be identified, calculate the variance result of the ambiguity detection region using the Laplacian operator, and obtain the variance value corresponding to the ambiguity detection region.

[0019] Optionally, the image quality score for the digital image is determined using the sharpness corresponding to the gradient value, the contrast corresponding to the grayscale value, the noise value corresponding to the spectral value, and the blurriness corresponding to the variance value, including:

[0020] Obtain the horizontal and vertical gradient values ​​contained in the gradient values, and determine the sharpness based on the sum of the squares of the horizontal and vertical gradient values.

[0021] Obtain the maximum and minimum grayscale values ​​contained in the grayscale values, and use the maximum and minimum grayscale values ​​to determine the contrast.

[0022] The first sub-region in the noise value detection area whose spectral value is higher than a preset first threshold is obtained, and the noise value is determined by the range of the first sub-region.

[0023] Obtain a second sub-region in the ambiguity detection area whose variance value is less than a preset second threshold, and determine the ambiguity using the range of the second sub-region;

[0024] The image quality score is obtained by summing up the sharpness, contrast, noise level, and blur.

[0025] Optionally, the sharpness, contrast, noise level, and blurriness are summed to obtain an image quality score, including:

[0026] The first weight value corresponding to sharpness, the second weight value corresponding to contrast, the third weight value corresponding to noise, and the fourth weight value corresponding to blur are determined based on the format parameters.

[0027] The image quality score is obtained by summing the first, second, third, and fourth weight values ​​for sharpness, contrast, noise, and blur. The image quality score is calculated using the following formula:

[0028] QualityScore=a*Sharpnesss+b*Contrast+c*Noise+d*Blur;

[0029] Wherein, QualityScore is the numerical result corresponding to the image quality score; Sharpnesses is the numerical result of sharpness; Contrast is the numerical result of contrast; Noise is the numerical result of noise; Blur is the numerical result of blur; a is the first weight value; b is the second weight value; c is the third weight value; and d is the fourth weight value.

[0030] Optionally, the sharpness, contrast, noise level, and blurriness are summed to obtain an image quality score, including:

[0031] The sharpness, contrast, noise, and blur are normalized according to a preset threshold range to scale them to the same numerical range.

[0032] The first weight value corresponding to sharpness, the second weight value corresponding to contrast, the third weight value corresponding to noise, and the fourth weight value corresponding to blur are determined based on the format parameters and numerical range.

[0033] The image quality score is obtained by summing the sharpness, contrast, noise, and blur based on the maximum value within the numerical range, the first weight value, the second weight value, the third weight value, and the fourth weight value. The image quality score is calculated using the following formula:

[0034] QualityScore=a*Sharpnesss+b*Contrast+c*(M-Noise)+d*(M-Blur);

[0035] Where QualityScore is the numerical result corresponding to the image quality score; M is the maximum value of the numerical range; Sharpnesses is the numerical result of sharpness; Contrast is the numerical result of contrast; Noise is the numerical result of noise; Blur is the numerical result of blur; a is the first weight value; b is the second weight value; c is the third weight value; and d is the fourth weight value.

[0036] Optionally, an image processing strategy corresponding to the digital image is determined based on the image quality score, and the digital image is processed using the image processing strategy, including:

[0037] Obtain the quality score value corresponding to the image quality score result, and compare the quality score value with the preset compliance threshold.

[0038] If the quality score is greater than the threshold, a first image processing strategy is generated, and the first image processing strategy is used to perform OCR recognition on the user identity information in the digital image.

[0039] If the quality score is not greater than the threshold, a second image processing strategy is generated, and the image quality score is calculated again after the digital image is enhanced using the second image processing strategy.

[0040] Optionally, after performing image enhancement processing on the digital image using the second image processing strategy, the image quality score is calculated again, including:

[0041] The noise reduction parameters, contrast enhancement parameters, and sharpening parameters of the digital image are determined based on the second image processing strategy.

[0042] After performing image denoising, image contrast enhancement, and image sharpening on the digital image using denoising parameters, contrast enhancement parameters, and sharpening parameters respectively, the image quality score of the digital image after image enhancement is obtained.

[0043] In a second aspect, embodiments of the present invention provide an image processing system, the system comprising:

[0044] An image acquisition unit is used to acquire digital images containing user identity information;

[0045] The region to be identified unit determines multiple regions to be identified in the digital image based on the format parameters corresponding to the user identity information.

[0046] The image quality scoring result determination unit is used to calculate the gradient value, gray value, spectrum value and variance value corresponding to the region to be identified, and to determine the image quality scoring result corresponding to the digital image using the sharpness corresponding to the gradient value, the contrast corresponding to the gray value, the noise value corresponding to the spectrum value and the ambiguity corresponding to the variance value.

[0047] The image processing unit determines the corresponding image processing strategy for the digital image based on the image quality score, and processes the digital image using the image processing strategy.

[0048] Thirdly, embodiments of the present invention also provide an electronic device, including a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the steps of the image processing method provided in the first aspect.

[0049] Fourthly, embodiments of the present invention also provide a storage medium storing computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the steps of the image processing method provided in the first aspect.

[0050] This invention provides an image processing method, system, and electronic device. Before recognizing user identity information in a digital image, the method first acquires a digital image containing user identity information; then, based on the format parameters corresponding to the user identity information, it determines multiple regions to be recognized in the digital image; by calculating the gradient value, grayscale value, spectral value, and variance value corresponding to the regions to be recognized, and using the sharpness corresponding to the gradient value, the contrast corresponding to the grayscale value, the noise value corresponding to the spectral value, and the ambiguity corresponding to the variance value, it determines the image quality score of the digital image; finally, based on the image quality score, it determines the image processing strategy corresponding to the digital image and processes the digital image using the image processing strategy. Specifically, before recognizing user identity information in a digital image, this method quantifies the image quality using the sharpness, contrast, noise value, and ambiguity of the digital image to obtain the corresponding image quality score, and uses the image quality score to generate a corresponding image processing strategy to determine whether the digital image should undergo the subsequent user identity information recognition process. This method evaluates the image quality of the digital image before performing the OCR recognition process, thereby avoiding unnecessary recognition of low-quality digital images and improving the execution efficiency of OCR recognition.

[0051] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or understood by practicing the present invention. The purposes and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.

[0052] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. Attached Figure Description

[0053] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0054] Figure 1 A flowchart of an image processing method provided in an embodiment of the present invention;

[0055] Figure 2 This is a flowchart of step S102 in an image processing method provided by an embodiment of the present invention;

[0056] Figure 3 A flowchart illustrating the calculation of gradient value, gray value, spectrum value, and variance value corresponding to the region to be identified in an image processing method provided in this embodiment of the invention.

[0057] Figure 4 A flowchart illustrating how an image processing method provided in this invention determines the image quality score of a digital image using the sharpness corresponding to the gradient value, the contrast corresponding to the gray value, the noise value corresponding to the spectrum value, and the ambiguity corresponding to the variance value.

[0058] Figure 5 This is a flowchart of step S405 in an image processing method provided in an embodiment of the present invention;

[0059] Figure 6 A flowchart of step S405 in another image processing method provided in an embodiment of the present invention;

[0060] Figure 7 This is a flowchart of step S104 in an image processing method provided in an embodiment of the present invention;

[0061] Figure 8 A flowchart illustrating the image quality score result calculated again after performing image enhancement processing on a digital image using a second image processing strategy, as provided in an embodiment of the present invention.

[0062] Figure 9 A flowchart of another image processing method provided in an embodiment of the present invention;

[0063] Figure 10This is a schematic diagram of the structure of an image processing system provided in an embodiment of the present invention;

[0064] Figure 11 A schematic structural diagram of an electronic device provided by an embodiment of the present invention.

[0065] icon:

[0066] 1010 - Image acquisition unit; 1020 - Region to be identified determination unit; 1030 - Image quality scoring result determination unit; 1040 - Image processing unit;

[0067] 101 - Processor; 102 - Memory; 103 - Bus; 104 - Communication interface. Detailed Implementation

[0068] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0069] In systems across various industries, including finance, shopping, and law, user identity information needs to be collected. This collection is often achieved through digital images. In practice, this involves photographing user ID cards or other identification documents to obtain digital images containing the documents. These images are then subjected to OCR (Optical Character Recognition) to identify the user's identity information. This process relies on high-resolution digital images to achieve high accuracy in identifying user identity information. The general workflow is as follows: Input a digital image containing user identity information - Preprocess the image - OCR recognition - Output the recognition result.

[0070] Due to the complexity of real-world scenarios, the quality of acquired digital images cannot be guaranteed. Preprocessing typically involves only basic image processing, such as grayscale and binarization. When the digital image quality is poor, it becomes difficult to accurately extract user identity information. If the image is blurry, preprocessing is unlikely to improve its quality, leading to poor OCR recognition results. Because current technology lacks methods for evaluating image quality, it cannot perform targeted optimization of low-quality digital images. Furthermore, it is difficult to provide timely feedback on the optimization process for low-quality digital images, causing them to continue undergoing subsequent OCR recognition, resulting in low overall process efficiency.

[0071] Based on this, the present invention provides an image processing method, system, and electronic device. Before recognizing user identity information in a digital image, this method quantifies the image quality by considering factors such as sharpness, contrast, noise level, and blurriness to obtain a corresponding image quality score. The image quality score is then used to generate a corresponding image processing strategy to determine whether to proceed with the subsequent user identity information recognition process. This method assesses the image quality of a digital image before performing OCR recognition, thereby avoiding unnecessary recognition of low-quality digital images and improving the efficiency of OCR recognition.

[0072] To facilitate understanding of this embodiment, a detailed description of an image processing method disclosed in this invention will be provided first, such as... Figure 1 As shown, the method includes the following steps:

[0073] Step S101: Obtain a digital image containing user identity information;

[0074] Step S102: Determine multiple regions to be identified in the digital image based on the format parameters corresponding to the user identity information;

[0075] Step S103: Calculate the gradient value, gray value, spectrum value and variance value corresponding to the region to be identified, and use the sharpness corresponding to the gradient value, the contrast corresponding to the gray value, the noise value corresponding to the spectrum value and the ambiguity corresponding to the variance value to determine the image quality score result corresponding to the digital image.

[0076] Step S104: Determine the image processing strategy corresponding to the digital image based on the image quality score result, and process the digital image using the image processing strategy.

[0077] For systems involving various industries such as finance, shopping, and law, it is necessary to collect digital images of users to identify the user's identity information contained therein. Specifically, digital images can be collected through the built-in camera or obtained directly through relevant data transmission interfaces.

[0078] After acquiring the digital image, the document type containing the user's identity information is determined by the format parameters corresponding to the user's identity information in the digital image. Then, the area containing the user's identity information in the document is obtained and used as the area to be identified for subsequent recognition.

[0079] The region to be identified contains user identity information. The image quality of the region needs to be evaluated. The corresponding sharpness, contrast, noise and blur are determined by calculating the gradient value, gray value, spectrum value and variance value of the region to be identified. The image quality of the digital image is evaluated using the above indicators to obtain the image quality score.

[0080] Image quality scoring results characterize the overall quality of digital images. For low-quality digital images, corresponding image processing strategies can be implemented to enhance the image until the image quality meets the high-quality criteria before proceeding with the subsequent OCR recognition process. For high-quality digital images, the subsequent OCR recognition process can be performed directly, thus avoiding the problem of low execution efficiency caused by performing OCR recognition on low-quality digital images.

[0081] Optionally, step S101, which determines multiple regions to be identified in a digital image based on format parameters corresponding to user identity information, is as follows: Figure 2 Shown, including:

[0082] Step S201: Obtain the identity region containing user identity information in the digital image;

[0083] Step S202: Determine the type parameter of the identity region using the format parameter, and determine the segmentation parameter corresponding to the identity region based on the type parameter;

[0084] Step S203: After segmenting the identity region according to the segmentation parameters, multiple regions to be identified are obtained.

[0085] In determining the region to be identified, the first step is to acquire the region in the digital image that contains the user's identity information, and use this region as the identity region for subsequent segmentation. The identity region contains the image area of ​​the user's complete identification document. After determining the type parameter of this region using format parameters, the segmentation parameters can be determined in conjunction with the document type. Subsequently, the identity region is segmented using these segmentation parameters. Specifically, this segmentation can include image areas corresponding to the user's portrait, text information, and numerical information, which are then used as the region to be identified for subsequent recognition.

[0086] Optionally, the gradient value, gray value, spectral value, and variance value corresponding to the region to be identified are calculated, such as... Figure 3 Shown, including:

[0087] Step S301: Obtain the sharpness detection region corresponding to the region to be identified, and use the Sobel operator to calculate the directional gradient of the sharpness detection region to obtain the gradient value corresponding to the sharpness detection region.

[0088] Step S302: Obtain the corresponding contrast detection area in the area to be identified, and use the grayscale histogram of the contrast detection area to obtain the grayscale value corresponding to the contrast detection area.

[0089] Step S303: Obtain the noise value detection area corresponding to the area to be identified, and calculate the spectrum value corresponding to the noise value detection area using the Fourier transform result of the noise value detection area;

[0090] Step S304: Obtain the corresponding ambiguity detection area in the area to be identified, calculate the variance result of the ambiguity detection area using the Laplacian operator, and calculate the variance value corresponding to the ambiguity detection area.

[0091] The calculation of gradient values, grayscale values, spectral values, and variance values ​​utilizes specific detection regions within the region to be identified. Specifically, in calculating gradient values, the Sobel operator is used to calculate the directional gradient of the sharpness detection region, thus obtaining the corresponding gradient value. In calculating grayscale values, the specific grayscale value of the region is obtained by analyzing the grayscale histogram in the contrast detection region. In calculating spectral values, the frequency values ​​of the image are obtained by performing a Fourier transform or Fast Fourier transform on the noise detection region. In calculating variance values, the Laplacian operator is used to calculate the variance of the blurriness detection region, obtaining the corresponding variance result for that region, and finally, the variance value of the image is calculated.

[0092] Optionally, the image quality score for the digital image can be determined using the sharpness corresponding to the gradient value, the contrast corresponding to the grayscale value, the noise value corresponding to the spectral value, and the blurriness corresponding to the variance value. Figure 4 Shown, including:

[0093] Step S401: Obtain the horizontal and vertical gradient values ​​contained in the gradient values, and determine the sharpness based on the sum of the squares of the horizontal and vertical gradient values.

[0094] Step S402: Obtain the grayscale maxima and minima contained in the grayscale values, and use the grayscale maxima and minima to determine the contrast.

[0095] Step S403: Obtain the first sub-region in the noise value detection area whose spectral value is higher than the preset first threshold, and determine the noise value using the range of the first sub-region;

[0096] Step S404: Obtain a second sub-region in the ambiguity detection area whose variance value is less than a preset second threshold, and determine the ambiguity using the range of the second sub-region;

[0097] Step S405: The sharpness, contrast, noise value and blur are accumulated and calculated to obtain the image quality score result.

[0098] After obtaining the horizontal and vertical gradient values ​​contained in the gradient values, the sum of the squares of the horizontal and vertical gradient values ​​is calculated to obtain the overall gradient value calculation result. This gradient value calculation result can characterize the image sharpness; the larger the gradient value, the sharper the image; conversely, the smaller the gradient value, the blurrier the image.

[0099] After obtaining the grayscale values, their corresponding grayscale maxima and minima are acquired to represent the difference between the brightest and darkest areas of the image. Using (L... max -L min The Michelson contrast ratio is calculated from the result of (Lmax + Lmin) / (Lmax + Lmin); max and L min These represent the maximum and minimum grayscale values ​​of the image, respectively.

[0100] After acquiring the spectrum values, regions with spectrum values ​​above a first threshold are identified as high-frequency signal regions, and the noise level is determined by the range of the corresponding first sub-region. The more high-frequency regions there are, the higher the image noise level and the less clear the image. After acquiring the variance values, regions with variance values ​​below a second threshold are identified as second sub-regions, and the blurriness is determined by the range of these second sub-regions. The larger the variance, the clearer the image; conversely, the smaller the variance, the blurrier the image.

[0101] After the above parameters are quantized, the image quality score can be obtained by summing them. Optionally, step S405, which involves summing the sharpness, contrast, noise value, and blur, to obtain the image quality score, is as follows: Figure 5 Shown, including:

[0102] Step S501: Determine the first weight value corresponding to sharpness, the second weight value corresponding to contrast, the third weight value corresponding to noise, and the fourth weight value corresponding to blur according to the format parameters.

[0103] Step S502: Based on the first weight value, the second weight value, the third weight value, and the fourth weight value, the sharpness, contrast, noise value, and blur are cumulatively calculated to obtain the image quality score result.

[0104] The image quality score is calculated using the following formula:

[0105] QualityScore=a*Sharpnesss+b*Contrast+c*Noise+d*Blur;

[0106] Wherein, QualityScore is the numerical result corresponding to the image quality score; Sharpnesses is the numerical result of sharpness; Contrast is the numerical result of contrast; Noise is the numerical result of noise; Blur is the numerical result of blur; a is the first weight value; b is the second weight value; c is the third weight value; and d is the fourth weight value.

[0107] The four weight values ​​mentioned above are obtained through format parameters. Different format parameters correspond to different types of documents and ultimately determine the calculation requirements for the image quality score. For example, the larger the noise value, the less clear the image; therefore, the third weight value can be set to a negative number. In this case, the noise value has a side effect on the image quality score. Simply put, the larger the noise value, the worse the image quality, and the lower the image quality score.

[0108] Optionally, the sharpness, contrast, noise level, and blurriness are summed to obtain an image quality score, such as... Figure 6 Shown, including:

[0109] Step S601: Normalize the sharpness, contrast, noise value and blur according to the preset threshold range to scale them to the same numerical range.

[0110] Step S602: Determine the first weight value corresponding to sharpness, the second weight value corresponding to contrast, the third weight value corresponding to noise, and the fourth weight value corresponding to blur based on the format parameters and numerical range.

[0111] Step S603: Based on the maximum value of the numerical range, the first weight value, the second weight value, the third weight value, and the fourth weight value, the sharpness, contrast, noise value, and blur are cumulatively calculated to obtain the image quality score result.

[0112] The image quality score is calculated using the following formula:

[0113] QualityScore=a*Sharpnesss+b*Contrast+c*(M-Noise)+d*(M-Blur);

[0114] Where QualityScore is the numerical result corresponding to the image quality score; M is the maximum value of the numerical range; Sharpnesses is the numerical result of sharpness; Contrast is the numerical result of contrast; Noise is the numerical result of noise; Blur is the numerical result of blur; a is the first weight value; b is the second weight value; c is the third weight value; and d is the fourth weight value.

[0115] In practical scenarios, sharpness, contrast, noise, and blur can be normalized, for example, by scaling their range to the [0,1] interval. In this case, the four weight values ​​are also limited to the [0,1] interval. The formula then reverses the constraints on noise and blur, using (M-Noise) and (M-Blur) respectively to change their roles in image quality scoring. If the interval is [0,1], then (M-Noise) and (M-Blur) become (1-Noise) and (1-Blur).

[0116] Optionally, step S104 involves determining the image processing strategy corresponding to the digital image based on the image quality score and processing the digital image using the image processing strategy, such as... Figure 7 Shown, including:

[0117] Step S701: Obtain the quality score value corresponding to the image quality score result, and compare the quality score value with the preset pass threshold.

[0118] Step S702: If the quality score value is greater than the threshold, a first image processing strategy is generated, and the first image processing strategy is used to perform OCR recognition on the user identity information in the digital image.

[0119] In step S703, if the quality score value is not greater than the threshold, a second image processing strategy is generated, and the image quality score result is calculated again after the digital image is enhanced using the second image processing strategy.

[0120] Image quality scoring results characterize the overall quality of a digital image, using a preset threshold to determine subsequent processes. If the quality score is greater than the threshold, the digital image is considered high-quality and can proceed directly to the OCR recognition process. If the quality score is less than the threshold, the digital image is considered low-quality. For low-quality images, appropriate image processing strategies are applied to enhance the image before recalculating the quality score to obtain an updated result.

[0121] Optionally, the image quality score can be recalculated after performing image enhancement processing on the digital image using the second image processing strategy, such as... Figure 8 Shown, including:

[0122] Step S801: Determine the noise reduction parameters, contrast enhancement parameters, and sharpening parameters of the digital image based on the second image processing strategy;

[0123] Step S802: After performing image denoising, image contrast enhancement, and image sharpening on the digital image using denoising parameters, contrast enhancement parameters, and sharpening parameters respectively, obtain the image quality score result corresponding to the digital image that has completed image enhancement processing.

[0124] For the image enhancement process, the noise reduction parameters, contrast enhancement parameters, and sharpening parameters of the digital image determined by the second image processing strategy can be used to perform image noise reduction, contrast enhancement, and image sharpening operations on the digital image respectively. In layman's terms, after image enhancement processing, the display effect of user identity information in the digital image can be improved as much as possible. The image quality of the digital image after image enhancement processing is then scored again to obtain an updated score result.

[0125] like Figure 9 The flowchart of another image processing method, using an ID card image as an example, first inputs the ID card image, then applies the calculation rules from the above embodiments to score its image quality, and determines whether the quality score meets the standard. The standard is determined by comparing it with a preset threshold. If it meets the standard, it directly proceeds to OCR recognition; if it does not, the image quality of the ID card image is optimized and re-scored, and the image quality is re-evaluated to ensure it meets the requirements.

[0126] As can be seen from the image processing method described in the above embodiments, before recognizing user identity information in a digital image, this method quantifies the image quality by using the image's sharpness, contrast, noise level, and blurriness to obtain a corresponding image quality score. The image quality score is then used to generate a corresponding image processing strategy to determine whether the digital image should undergo the subsequent user identity information recognition process. This method assesses the image quality of the digital image before performing the OCR recognition process, thereby avoiding unnecessary recognition of low-quality digital images and improving the efficiency of OCR recognition.

[0127] Corresponding to the above-described image processing method embodiments, this invention also provides an image processing system, such as... Figure 10 As shown, the system includes:

[0128] Image acquisition unit 1010 is used to acquire a digital image containing user identity information;

[0129] The region to be identified unit 1020 determines multiple regions to be identified in the digital image based on the format parameters corresponding to the user identity information.

[0130] The image quality scoring result determination unit 1030 is used to calculate the gradient value, gray value, spectrum value and variance value corresponding to the region to be identified, and to determine the image quality scoring result corresponding to the digital image using the sharpness corresponding to the gradient value, the contrast corresponding to the gray value, the noise value corresponding to the spectrum value and the ambiguity corresponding to the variance value.

[0131] The image processing unit 1040 determines the image processing strategy corresponding to the digital image based on the image quality score result, and processes the digital image using the image processing strategy.

[0132] As can be seen from the image processing system mentioned in the above embodiments, this system can quantify the image quality of a digital image by using its sharpness, contrast, noise level, and blurriness to obtain a corresponding image quality score before recognizing user identity information in the digital image. It then uses this image quality score to generate a corresponding image processing strategy to determine whether to proceed with the subsequent user identity information recognition process. This system assesses the image quality of a digital image before performing OCR recognition, thereby avoiding unnecessary recognition of low-quality digital images and improving the efficiency of OCR recognition.

[0133] The image processing system provided in this embodiment of the invention has the same implementation principle and technical effects as the aforementioned image processing method embodiment. For the sake of brevity, any parts not mentioned in the method embodiment can be referred to the corresponding content in the aforementioned image processing method embodiment.

[0134] This embodiment also provides an electronic device, the structural schematic diagram of which is shown below. Figure 11 As shown, the device includes a processor 101 and a memory 102; wherein, the memory 102 is used to store one or more computer instructions, which are executed by the processor to implement the steps of the above-described image processing method.

[0135] Figure 11 The electronic device shown also includes a bus 103 and a communication interface 104, with the processor 101, communication interface 104 and memory 102 connected via the bus 103.

[0136] The memory 102 may include high-speed random access memory (RAM), and may also include non-volatile memory, such as at least one disk storage device. The bus 103 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 11 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0137] The communication interface 104 is used to connect to at least one user terminal and other network units through a network interface, and to send encapsulated IPv4 packets or IPv4 packets to the user terminal through the network interface.

[0138] Processor 101 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 101 or by instructions in software form. The processor 101 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this disclosure can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 102. The processor 101 reads the information in memory 102 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.

[0139] This invention also provides a storage medium storing a computer program, which, when run by a processor, executes the steps of the image processing method described in the foregoing embodiments.

[0140] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0141] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0142] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0143] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, electronic device, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0144] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. An image processing method, characterized in that: The method comprises: obtaining a digital image containing user identification information; Determine a plurality of to-be-identified areas corresponding to the digital image based on the format parameters corresponding to the user identity information; Calculating the gradient value, gray value, spectrum value and variance value corresponding to the area to be identified, and determining the image quality score result corresponding to the digital image using the clarity corresponding to the gradient value, the contrast corresponding to the gray value, the noise value corresponding to the spectrum value and the blurriness corresponding to the variance value; An image processing strategy corresponding to the digital image is determined according to the image quality scoring result, and the digital image is processed using the image processing strategy.

2. The image processing method according to claim 1, characterized in that: Determining a plurality of to-be-recognized areas corresponding to the digital image based on the format parameters corresponding to the user identity information includes: Acquire the identity area containing the user identity information in the digital image; Determining a type parameter of the identity region using the format parameter, and determining a segmentation parameter corresponding to the identity region according to the type parameter; After the identity region is segmented according to the segmentation parameters, a plurality of regions to be identified are obtained.

3. The image processing method according to claim 1, characterized in that: Calculating the gradient value, grayscale value, spectrum value and variance value corresponding to the area to be identified, including: Acquire a clarity detection region corresponding to the to-be-identified region, calculate a directional gradient of the clarity detection region using a Sobel operator, and obtain the gradient value corresponding to the clarity detection region; Acquire a contrast detection area corresponding to the area to be identified, and obtain the grayscale value corresponding to the contrast detection area using a grayscale histogram of the contrast detection area; Acquire a noise value detection area corresponding to the to-be-identified area, and calculate the frequency spectrum value corresponding to the noise value detection area using a Fourier transform result of the noise value detection area; Obtain the blur detection area corresponding to the to-be-identified area, calculate the variance result of the blur detection area using the Laplace operator, and calculate the variance value corresponding to the blur detection area.

4. The image processing method according to claim 3, characterized in that: Determining the image quality score result corresponding to the digital image by using the clarity corresponding to the gradient value, the contrast corresponding to the gray value, the noise value corresponding to the spectrum value, and the blurriness corresponding to the variance value, comprises: Acquire a horizontal gradient and a vertical gradient value included in the gradient value, and determine the clarity according to a square sum of the horizontal gradient and the vertical gradient value; Acquire a grayscale maximum value and a grayscale minimum value contained in the grayscale value, and determine the contrast using the grayscale maximum value and the grayscale minimum value; Acquire a first sub-region in the noise value detection region where the spectrum value is higher than a preset first threshold, and determine the noise value using the range of the first sub-region; Acquire a second sub-region in the blur detection region where the variance value is less than a preset second threshold, and determine the blur using a range of the second sub-region; The clarity, the contrast, the noise value and the blur are cumulatively calculated to obtain the image quality score result.

5. The image processing method according to claim 4, characterized in that: The clarity, the contrast, the noise value and the blur are cumulatively calculated to obtain the image quality score result, including: Determine, according to the format parameter, a first weight value corresponding to the clarity, a second weight value corresponding to the contrast, a third weight value corresponding to the noise value, and a fourth weight value corresponding to the blur; The clarity, the contrast, the noise value and the blur are cumulatively calculated based on the first weight value, the second weight value, the third weight value and the fourth weight value to obtain the image quality score result; wherein the image quality score result is calculated by the following formula: QualityScore=a*Sharpnesss+b*Contrast+c*Noise+d*Blur; Among them, QualityScore is the numerical result corresponding to the image quality score result; Sharpnesss is the numerical result of the clarity; Contrast is the numerical result of the contrast; Noise is the numerical result of the noise value; Blur is the numerical result of the blurriness; a is the first weight value; b is the second weight value; c is the third weight value; d is the fourth weight value.

6. The image processing method according to claim 4, characterized in that: The clarity, the contrast, the noise value and the blur are cumulatively calculated to obtain the image quality score result, including: Normalizing the clarity, the contrast, the noise value, and the blur according to a preset threshold range, so as to scale them to the same value range; Determine, according to the format parameter and the value range, a first weight value corresponding to the clarity, a second weight value corresponding to the contrast, a third weight value corresponding to the noise value, and a fourth weight value corresponding to the blur; The clarity, the contrast, the noise value and the blur are cumulatively calculated based on the maximum value of the numerical range, the first weight value, the second weight value, the third weight value and the fourth weight value to obtain the image quality score result; wherein the image quality score result is calculated by the following formula: QualityScore=a*Sharpnesss+b*Contrast+c*(M-Noise)+d*(M-Blur); Among them, QualityScore is the numerical result corresponding to the image quality score result; M is the maximum value of the numerical range; Sharpnesss is the numerical result of the clarity; Contrast is the numerical result of the contrast; Noise is the numerical result of the noise value; Blur is the numerical result of the blur; a is the first weight value; b is the second weight value; c is the third weight value; d is the fourth weight value.

7. The image processing method according to claim 1, characterized in that: Determining an image processing strategy corresponding to the digital image according to the image quality scoring result, and processing the digital image using the image processing strategy, including: Obtaining a quality score value corresponding to the image quality score result, and comparing the quality score value with a preset standard threshold; If the quality score value is greater than the threshold, a first image processing strategy is generated, and the first image processing strategy is used to perform OCR recognition on the user identity information in the digital image; If the quality score value is not greater than the threshold, a second image processing strategy is generated, and the image quality score result is calculated again after image enhancement processing is performed on the digital image using the second image processing strategy.

8. The image processing method according to claim 7, characterized in that: The step of performing image enhancement processing on the digital image by using the second image processing strategy and then calculating the image quality score result again comprises: Determining noise reduction parameters, contrast enhancement parameters, and sharpening parameters of the digital image based on the second image processing strategy; After performing image noise reduction processing, image contrast enhancement processing and image sharpening processing on the digital image using the noise reduction parameters, the contrast enhancement parameters and the sharpening parameters respectively, the image quality score result corresponding to the digital image that has completed the image enhancement processing is obtained.

9. An image processing system, characterized in that: The system comprises: An image acquisition unit, used to acquire a digital image containing user identity information; a to-be-recognized area determining unit, which determines a plurality of to-be-recognized areas corresponding to the digital image based on a format parameter corresponding to the user identity information; An image quality score result determination unit, used to calculate the gradient value, gray value, spectrum value and variance value corresponding to the to-be-identified area, and determine the image quality score result corresponding to the digital image using the clarity corresponding to the gradient value, the contrast corresponding to the gray value, the noise value corresponding to the spectrum value and the blurriness corresponding to the variance value; The image processing unit determines an image processing strategy corresponding to the digital image according to the image quality scoring result, and processes the digital image using the image processing strategy.

10. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the steps of the image processing method according to any one of claims 1 to 8.