Image definition evaluation method and device, equipment and storage medium

By employing Gaussian pyramid downsampling and dynamic gradient thresholding denoising methods, the problems of balancing global blur and local detail and noise robustness in existing technologies are solved, achieving a more accurate and stable image sharpness assessment.

CN120807416APending Publication Date: 2025-10-17SHENZHEN YANXIANG JINMA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510860492.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-25
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

Existing image sharpness assessment methods cannot balance the contribution of global blur and local detail, and frequency domain analysis methods rely on human experience to set fixed thresholds, resulting in poor noise robustness.

Method used

By acquiring the grayscale image to be evaluated and performing Gaussian pyramid downsampling, combined with a dynamic gradient thresholding denoising method, the multi-scale sharpness score of the image is calculated, and the threshold is adaptively adjusted to suppress noise and preserve important details.

Benefits of technology

The accuracy and robustness of image clarity assessment are improved, the need for manual parameter adjustment is reduced, and operational complexity is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120807416A_ABST
    Figure CN120807416A_ABST
Patent Text Reader

Abstract

The invention discloses an image definition assessment method and device, equipment and a storage medium, and relates to the technical field of image processing, and the method comprises the steps: obtaining a to-be-assessed grayscale image; performing Gaussian pyramid downsampling processing of the target layer number on the to-be-evaluated grayscale image to obtain a to-be-evaluated multi-scale image corresponding to the target layer number; based on a dynamic gradient threshold denoising method, carrying out definition score calculation on the to-be-evaluated grayscale image and each to-be-evaluated multi-scale image to obtain an image definition score corresponding to the to-be-evaluated original image and each to-be-evaluated multi-scale image; and determining target image definition corresponding to the to-be-evaluated original image based on the to-be-evaluated original image and the image definition scores corresponding to the to-be-evaluated multi-scale images. According to the method, comprehensive evaluation of the image definition is realized by analyzing the multi-scale features of the image and performing dynamic threshold processing, meanwhile, noise is effectively suppressed, important details such as image edges and the like are reserved, and the accuracy and robustness of image definition evaluation are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, and particularly relates to an image sharpness evaluation method and device, equipment and a storage medium. BACKGROUND

[0002] With the continuous development of computer vision technology, the accuracy and stability of image sharpness evaluation are crucial for improving the performance of image processing systems. However, existing image sharpness evaluation methods face many challenges in practical applications.

[0003] Existing image sharpness evaluation techniques mainly include methods based on single-scale gradient calculation and methods based on frequency domain analysis. For example, the Brenner gradient method calculates the sum of squares of gray level differences between adjacent pixels as a sharpness indicator, while the method based on multi-scale wavelet transform extracts high-frequency component energy to evaluate image sharpness. These methods can quantitatively evaluate the sharpness of images to some extent, but have obvious limitations in practical applications. Single-scale methods cannot balance the contributions of global blur and local details, resulting in excessive sensitivity to noise or complex textures; while frequency domain analysis methods rely on artificial experience to set fixed thresholds, and have poor noise robustness. SUMMARY

[0004] The main purpose of the present application is to provide an image sharpness evaluation method, device, equipment and storage medium, which aims to solve the problem that single-scale methods in traditional evaluation methods cannot balance the contributions of global blur and local details, and frequency domain analysis methods rely on artificial experience to set fixed thresholds, and have poor noise robustness.

[0005] To achieve the above purpose, the present application provides an image sharpness evaluation method, which comprises:

[0006] obtaining a gray-scale image to be evaluated;

[0007] performing Gaussian pyramid downsampling processing on the gray-scale image to be evaluated to obtain a target number of layers, to obtain a multi-scale image to be evaluated corresponding to the target number of layers;

[0008] based on a dynamic gradient threshold denoising method, calculating the sharpness score of the gray-scale image to be evaluated and each multi-scale image to be evaluated to obtain the image sharpness score corresponding to the gray-scale image to be evaluated and each multi-scale image to be evaluated;

[0009] based on the image sharpness score corresponding to the gray-scale image to be evaluated and each multi-scale image to be evaluated, determining the target image sharpness corresponding to the gray-scale image to be evaluated.

[0010] In one embodiment, performing Gaussian pyramid downsampling processing on the grayscale image to be evaluated by a target number of layers to obtain a multi-scale image to be evaluated corresponding to the target number of layers includes:

[0011] Inputting the grayscale image to be evaluated into an image processing layer number prediction model to obtain a target layer number output by the image processing layer number prediction model;

[0012] Obtaining width and height values ​​of the grayscale image to be evaluated, and determining a Gaussian weight kernel based on the width and height values;

[0013] According to a preset Gaussian pyramid downsampling processing formula, the width and height values, and the Gaussian weight kernel, Gaussian pyramid downsampling processing of a target number of layers is performed on the grayscale image to be evaluated to obtain a multi-scale image to be evaluated corresponding to the target number of layers.

[0014] In one embodiment, the dynamic gradient threshold denoising method is used to calculate the clarity score of the grayscale image to be evaluated and each of the multi-scale images to be evaluated, and obtain the image clarity scores corresponding to the grayscale image to be evaluated and each of the multi-scale images to be evaluated, including:

[0015] Calculating, by a preset discrete differential operator, a first gradient magnitude in a transverse direction and a second gradient magnitude in a longitudinal direction of the grayscale image to be evaluated and each of the multi-scale images to be evaluated;

[0016] generating a plurality of gradient magnitude images based on each of the first gradient magnitudes and each of the second gradient magnitudes;

[0017] Double-threshold gradient continuity denoising is performed on each of the gradient amplitude images to obtain the grayscale image to be evaluated and the image clarity score corresponding to each of the multi-scale images to be evaluated.

[0018] In one embodiment, performing dual-threshold gradient continuity denoising on each of the gradient magnitude images to obtain the grayscale image to be evaluated and the image clarity score corresponding to each of the multi-scale images to be evaluated includes:

[0019] For any of the gradient magnitude images, calculating the number of pixels of the gradient magnitude image, and determining a histogram corresponding to the gradient magnitude image;

[0020] Based on the pixel quantity values ​​and the histogram, traversing and calculating to obtain the inter-class variance of all grayscale values ​​in the gradient magnitude image;

[0021] Double-threshold gradient continuity denoising is performed based on the inter-class variance of each of the grayscale values ​​to obtain the image clarity scores corresponding to the grayscale image to be evaluated and each of the multi-scale images to be evaluated.

[0022] In an embodiment, the double-threshold gradient continuity denoising based on the inter-class variance of each of the gray values is performed to obtain the image sharpness scores corresponding to the to-be-evaluated gray image and each of the to-be-evaluated multi-scale images, including:

[0023] For any of the gradient amplitude images, a peak value in the inter-class variance of each of the gray values is taken as a target global threshold value;

[0024] An average gradient value and a maximum gradient value of the gradient amplitude image are calculated, and a target local threshold value is obtained according to the average gradient value and the maximum gradient value, and the gradient amplitude image is fused based on the target global threshold value and the target local threshold value to obtain an edge binarization image corresponding to the gradient amplitude image;

[0025] A region mean value of the edge binarization image is calculated as the image sharpness score corresponding to the gradient amplitude image.

[0026] In an embodiment, the to-be-evaluated gray image is obtained, including:

[0027] A to-be-evaluated original image is obtained, and it is determined whether the to-be-evaluated original image is a gray image;

[0028] If yes, the to-be-evaluated original image is taken as the to-be-evaluated gray image;

[0029] If no, the to-be-evaluated original image is subjected to image gray processing according to a preset gray processing rule to obtain the to-be-evaluated gray image.

[0030] In an embodiment, the target image sharpness corresponding to the to-be-evaluated gray image is determined based on the image sharpness scores corresponding to the to-be-evaluated gray image and each of the to-be-evaluated multi-scale images, including:

[0031] A weight coefficient corresponding to a target layer number is obtained;

[0032] The image sharpness scores corresponding to the to-be-evaluated gray image and each of the to-be-evaluated multi-scale images are subjected to weighted mean processing based on the weight coefficient to obtain the target image sharpness corresponding to the to-be-evaluated gray image.

[0033] In addition, to achieve the above object, the present application further provides an image sharpness evaluation device, which comprises:

[0034] An image acquisition module is configured to obtain a to-be-evaluated gray image;

[0035] A multi-scale processing module is configured to perform Gaussian pyramid downsampling processing on the to-be-evaluated gray image to obtain to-be-evaluated multi-scale images corresponding to a target layer number.

[0036] a score calculation module configured to calculate a sharpness score of the to-be-evaluated gray image and each to-be-evaluated multi-scale image based on the dynamic gradient threshold denoising method, to obtain an image sharpness score corresponding to the to-be-evaluated gray image and each to-be-evaluated multi-scale image;

[0037] a sharpness evaluation module configured to determine a target image sharpness corresponding to the to-be-evaluated gray image based on the image sharpness score corresponding to the to-be-evaluated gray image and each to-be-evaluated multi-scale image.

[0038] In addition, to achieve the above object, the present application further provides an image sharpness evaluation device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the image sharpness evaluation method as described above.

[0039] In addition, to achieve the above object, the present application further provides a storage medium, which is a computer readable storage medium, and a computer program is stored on the storage medium, and the computer program is executed by a processor to implement the steps of the image sharpness evaluation method as described above.

[0040] In addition, to achieve the above object, the present application further provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the steps of the image sharpness evaluation method as described above.

[0041] The present application provides an image sharpness evaluation method, device, equipment and storage medium. The image sharpness evaluation method obtains a to-be-evaluated gray image, and then performs Gaussian pyramid downsampling processing on the to-be-evaluated gray image to obtain to-be-evaluated multi-scale images corresponding to a target layer number. Then, the image sharpness evaluation method calculates a sharpness score of the to-be-evaluated gray image and each to-be-evaluated multi-scale image based on a dynamic gradient threshold denoising method, to obtain an image sharpness score corresponding to the to-be-evaluated gray image and each to-be-evaluated multi-scale image. Then, the image sharpness evaluation method determines a target image sharpness corresponding to the to-be-evaluated gray image based on the image sharpness score corresponding to the to-be-evaluated gray image and each to-be-evaluated multi-scale image. Thus, the global structure and local details of an image are analyzed through multi-scale processing, so as to more comprehensively evaluate the sharpness of the image. Meanwhile, the threshold is adaptively adjusted according to the image content through the dynamic gradient threshold denoising method, so as to effectively suppress noise and preserve important details such as image edges, thereby improving the accuracy, precision and robustness of image sharpness evaluation, reducing the need for manual parameter adjustment, and reducing the operation complexity. BRIEF DESCRIPTION OF DRAWINGS

[0042] The accompanying drawings, which are incorporated herein and constitute part of the specification, illustrate embodiments consistent with the application and, together with the description, further serve to explain the principles of the application.

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, those skilled in the art can obtain other drawings from these drawings without any creative effort.

[0044] Figure 1 A flowchart provided for the image sharpness evaluation method embodiment one of the present application;

[0045] Figure 2 A flowchart provided for the image sharpness evaluation method embodiment two of the present application;

[0046] Figure 3 A flowchart provided for the image sharpness evaluation method embodiment three of the present application;

[0047] Figure 4 A brief flowchart provided for the image sharpness evaluation method of the present application;

[0048] Figure 5 A module structure diagram of the image sharpness evaluation device of the present application embodiment;

[0049] Figure 6 A device structure diagram of the hardware running environment involved in the image sharpness evaluation method of the present application embodiment.

[0050] The object implementation, functional features and advantages of the present application will be further explained with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION

[0051] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application, and are not used to limit the present application.

[0052] In order to better understand the technical solutions of the present application, the following will be described in detail in combination with the drawings and specific embodiments of the specification.

[0053] It should be noted that the execution subject of the present embodiment can be a computing service device with data processing, network communication and program running functions, such as tablet computers, personal computers, mobile phones and the like, or an electronic device, a big data service platform, an image sharpness evaluation system and the like capable of realizing the above functions. The present embodiment and the following embodiments will be described taking the image sharpness evaluation system as an example.

[0054] Based on this, the embodiment of the present application provides an image sharpness evaluation method, referring to Figure 1 , Figure 1 The flowchart provided by the embodiment one of the image sharpness evaluation method of the present application.

[0055] In this embodiment, the image sharpness evaluation method comprises steps S11-S14:

[0056] Step S11, obtaining a to-be-evaluated gray image;

[0057] It should be noted that the to-be-evaluated gray image refers to a gray image that needs to be evaluated for sharpness, wherein the gray image is a common format in image processing, and the value of each pixel represents its brightness, usually ranging from 0 (black) to 255 (white), thereby simplifying image data, reducing computational complexity, and retaining the brightness information of the image.

[0058] Specifically, a to-be-evaluated original image is obtained, and it is judged whether the to-be-evaluated original image is a gray image, and then if yes, the to-be-evaluated original image is taken as the to-be-evaluated gray image.

[0059] In addition, if no, the to-be-evaluated original image is subjected to image gray processing according to a preset gray processing rule, to obtain the to-be-evaluated gray image.

[0060] Step S12, performing Gaussian pyramid down-sampling processing on the to-be-evaluated gray image to obtain a to-be-evaluated multi-scale image corresponding to a target number of layers;

[0061] It should be noted that the Gaussian pyramid down-sampling processing is an image processing technique for generating a multi-scale representation of an image, wherein each layer of the Gaussian pyramid is obtained by convolving the previous layer of the image with a Gaussian kernel and performing down-sampling, thereby realizing the analysis of the image at different scales. The target number of layers refers to the number of image layers that need to be generated in the Gaussian pyramid, which can be determined according to the specific application requirements.

[0062] It should be further noted that the to-be-evaluated multi-scale image refers to a series of images of different resolutions obtained by Gaussian pyramid down-sampling processing, to reflect the features of the original gray image at multiple scales, thereby evaluating the sharpness of the image at different resolution levels.

[0063] Specifically, the to-be-evaluated gray image is input into the image processing layer number prediction model to obtain a target layer number output by the image processing layer number prediction model, and then the width and height values of the to-be-evaluated gray image are obtained, and a Gaussian weight kernel is determined based on the width and height values, so that the to-be-evaluated gray image is subjected to Gaussian pyramid down-sampling processing of the target layer number according to a preset Gaussian pyramid down-sampling processing formula, the width and height values, and the Gaussian weight kernel, to obtain a to-be-evaluated multi-scale image corresponding to the target layer number.

[0064] In step S13, the to-be-evaluated gray image and each to-be-evaluated multi-scale image are subjected to sharpness score calculation based on a dynamic gradient threshold denoising method, to obtain image sharpness scores corresponding to the to-be-evaluated gray image and each to-be-evaluated multi-scale image.

[0065] It should be noted that the dynamic gradient threshold denoising method is a self-adaptive image denoising technology that dynamically adjusts the threshold according to the image content to retain edge information and remove noise. The sharpness score is a quantitative index for measuring the sharpness of an image.

[0066] Specifically, the first gradient amplitude in the transverse direction and the second gradient amplitude in the longitudinal direction of the to-be-evaluated gray image and each to-be-evaluated multi-scale image are calculated by a preset discrete differential operator, and then a plurality of gradient amplitude images are generated based on each of the first gradient amplitudes and each of the second gradient amplitudes, so that each of the gradient amplitude images is subjected to double-threshold gradient continuity denoising to obtain image sharpness scores corresponding to the to-be-evaluated gray image and each to-be-evaluated multi-scale image.

[0067] In step S14, a target image sharpness corresponding to the to-be-evaluated gray image is determined based on the image sharpness scores corresponding to the to-be-evaluated gray image and each to-be-evaluated multi-scale image.

[0068] It should be noted that the target image sharpness is a comprehensive index that reflects the overall sharpness of the original image.

[0069] Specifically, a weight coefficient corresponding to the target layer number is obtained, and then the image sharpness scores corresponding to the to-be-evaluated gray image and each to-be-evaluated multi-scale image are subjected to weighted mean processing based on the weight coefficient to obtain the target image sharpness corresponding to the to-be-evaluated gray image.

[0070] The embodiment obtains an to-be-evaluated gray image, and then performs Gaussian pyramid downsampling processing on the to-be-evaluated gray image to obtain a to-be-evaluated multi-scale image corresponding to a target layer number, thereby performing sharpness score calculation on the to-be-evaluated gray image and each to-be-evaluated multi-scale image based on a dynamic gradient threshold denoising method to obtain image sharpness scores corresponding to the to-be-evaluated gray image and each to-be-evaluated multi-scale image, and then determining a target image sharpness corresponding to the to-be-evaluated gray image based on the image sharpness scores corresponding to the to-be-evaluated gray image and each to-be-evaluated multi-scale image, so as to analyze the global structure and local details of the image through multi-scale processing, more comprehensively evaluate the sharpness of the image, and effectively suppress noise and retain important details such as image edges by adaptively adjusting the threshold according to the image content through the dynamic gradient threshold denoising method, thereby improving the accuracy, precision and robustness of the image sharpness evaluation, reducing the need for manual parameter adjustment, and reducing the operation complexity.

[0071] Based on this, the embodiment of the present application provides an image sharpness evaluation method, which refers to Figure 2 , Figure 2 is a flowchart provided for the second embodiment of the image sharpness evaluation method of the present application.

[0072] In a feasible implementation manner, the Gaussian pyramid downsampling processing on the to-be-evaluated gray image to obtain a to-be-evaluated multi-scale image corresponding to a target layer number comprises:

[0073] In step S21, the to-be-evaluated gray image is input into an image processing layer number prediction model to obtain a target layer number output by the image processing layer number prediction model.

[0074] It should be noted that the image processing layer number prediction model refers to a model capable of automatically predicting a layer number suitable for Gaussian pyramid downsampling processing according to the characteristics of an input image. The model can determine the optimal downsampling layer number based on a machine learning algorithm by analyzing factors such as the texture, complexity and size of the image.

[0075] Specifically, the system receives a to-be-evaluated gray image and inputs it into a pre-trained image processing layer number prediction model. The model analyzes the image content and outputs a recommended layer number, which will be used for subsequent Gaussian pyramid downsampling processing.

[0076] In addition, the user can also manually input the target layer number to quickly determine the layer number required for the Gaussian pyramid downsampling processing of the current to-be-evaluated image according to the user's expertise.

[0077] Step S22, obtain the width and height values of the to-be-evaluated gray image, and determine a Gaussian weight kernel based on the width and height values;

[0078] It should be noted that the width and height values refer to the width and height of the to-be-evaluated gray image, which determines the resolution of the image. The Gaussian weight kernel, also known as a Gaussian filter or a Gaussian mask, is a widely used filter in image processing, which is used to smooth the image and reduce noise to ensure the continuity and smoothness of the image content in the downsampling process. In a possible implementation, the determination of the Gaussian weight kernel can be automatically adjusted based on the width and height values of the image to adapt to images of different sizes.

[0079] Step S23, performing Gaussian pyramid downsampling processing on the to-be-evaluated gray image according to a preset Gaussian pyramid downsampling processing formula, the width and height values, and the Gaussian weight kernel, to obtain a to-be-evaluated multi-scale image corresponding to the target number of layers.

[0080] Specifically, in an embodiment, the target number of layers is 2, and the to-be-evaluated gray image is subjected to 2-layer Gaussian pyramid downsampling, thereby obtaining 2 images. Among them, the to-be-evaluated gray image G K-1 The k-th layer of the Gaussian pyramid image is obtained according to the preset Gaussian pyramid downsampling processing formula, as follows:

[0081]

[0082] wherein G k (x,y) represents the pixel value of the k-th layer of the Gaussian pyramid at position (x,y), m and n are the width and height values of the image, and w(m,n) is the Gaussian weight kernel, which can be represented as:

[0083]

[0084] Specifically, each pixel value G k (x,y) of the k-th layer image is obtained by performing Gaussian blur (using the weight kernel w(m,n)) and downsampling (i.e., taking every 2 pixels) on the (k-1)-th layer image G k-1

[0085] ​The embodiment inputs the to-be-evaluated gray image into the image processing layer number prediction model, obtains a target layer number output by the image processing layer number prediction model, further obtains the width and height values of the to-be-evaluated gray image, and determines a Gaussian weight kernel based on the width and height values, so as to perform Gaussian pyramid down-sampling processing on the to-be-evaluated gray image according to a preset Gaussian pyramid down-sampling processing formula, the width and height values, and the Gaussian weight kernel, obtain a to-be-evaluated multi-scale image corresponding to the target layer number, and further realize automatic determination of an optimal layer number without manual intervention, thereby reducing human errors and improving processing efficiency, so as to adapt to images of different complexities and sizes. Because the model predicts a suitable layer number according to the characteristics of each image, and further determines the Gaussian weight kernel by obtaining the width and height values of the image to ensure the accuracy of the down-sampling process and the preservation of the image content, the generated multi-scale image can capture the features of the image at different resolutions, which is helpful to more comprehensive evaluation of the sharpness of the image, thereby improving the evaluation accuracy and precision.

[0086] Based on this, the embodiment of the present application provides an image sharpness evaluation method, referring to Figure 3 , Figure 3 The flowchart provided by the third embodiment of the image sharpness evaluation method of the present application is shown in FIG. 6.

[0087] In a feasible implementation, the dynamic gradient threshold-based denoising method calculates the sharpness scores of the to-be-evaluated gray image and each to-be-evaluated multi-scale image, to obtain image sharpness scores corresponding to the to-be-evaluated gray image and each to-be-evaluated multi-scale image, including:

[0088] Step S31: calculating the first gradient amplitude in the transverse direction and the second gradient amplitude in the longitudinal direction of the to-be-evaluated gray image and each to-be-evaluated multi-scale image by using a preset discrete differential operator.

[0089] It should be noted that the preset discrete differential operator refers to a mathematical tool for approximating the derivative of the image brightness function, including Sobel, Scharr or Laplacian operators, so as to obtain the rate of gray scale change in the image, that is, the gradient. The first gradient amplitude refers to the gradient amplitude in the transverse direction (usually the x direction), and the second gradient amplitude refers to the gradient amplitude in the longitudinal direction (usually the y direction), so as to reveal the edge and detail information in the image.

[0090] Specifically, the first gradient amplitude in the transverse direction and the second gradient amplitude in the longitudinal direction of the to-be-evaluated gray image and each to-be-evaluated multi-scale image are calculated by using a preset discrete differential operator. In an embodiment, the X / Y direction gradient is calculated by using a Sobel operator, specifically as follows:

[0091]

[0092] Step S32, based on each of the first gradient magnitude and each of the second gradient magnitude, generate several gradient magnitude images;

[0093] It should be noted that the gradient magnitude image refers to the image containing image gradient information obtained by calculation, so as to intuitively show the edges and details in the image.

[0094] Specifically, based on the to-be-evaluated gray image and each of the first gradient magnitude and each of the second gradient magnitude corresponding to each of the to-be-evaluated multi-scale images, generate several gradient magnitude images corresponding to the to-be-evaluated gray image and each of the to-be-evaluated multi-scale images, wherein the gradient magnitude image is obtained by a gradient magnitude calculation formula, and the gradient magnitude calculation formula is specifically as follows:

[0095]

[0096] Wherein, G is the gradient magnitude image, G x is the first gradient magnitude in the horizontal direction, G y is the second gradient magnitude in the vertical direction.

[0097] In a possible implementation, the first gradient magnitude and the second gradient magnitude can be combined to generate an image containing complete gradient information, or two images can be generated respectively, which is not limited here.

[0098] Step S33, double-threshold gradient continuity denoising is performed on each of the gradient magnitude images to obtain the image sharpness score corresponding to the to-be-evaluated gray image and each of the to-be-evaluated multi-scale images.

[0099] It should be noted that the double-threshold gradient continuity denoising is an image processing technology for removing noise while preserving image edge information, that is, by setting two thresholds, one for detecting strong edges and the other for detecting weak edges, to achieve fine processing of the image. In a possible implementation, the two thresholds can be automatically adjusted according to the image content and noise characteristics to achieve the best denoising effect.

[0100] Specifically, for any gradient magnitude image, the pixel number value of the gradient magnitude image is calculated, and the histogram corresponding to the gradient magnitude image is determined, and then based on each of the pixel number value and the histogram, the inter-class variance of all gray values in the gradient magnitude image is calculated by iteration, and based on the inter-class variance of each of the gray values, double-threshold gradient continuity denoising is performed to obtain the image sharpness score corresponding to the to-be-evaluated gray image and each of the to-be-evaluated multi-scale images.

[0101] The embodiment calculates the first gradient amplitude in the transverse direction and the second gradient amplitude in the longitudinal direction of the to-be-evaluated gray image and each to-be-evaluated multi-scale image by presetting a discrete differential operator, and then generates a plurality of gradient amplitude images based on each first gradient amplitude and each second gradient amplitude, performs double-threshold gradient continuity denoising on each gradient amplitude image, and obtains the image definition scores corresponding to the to-be-evaluated gray image and each to-be-evaluated multi-scale image. Then, the gradient of the image is accurately calculated according to the preset discrete differential operator, so that the edges in the image are accurately identified, the edges and the noise in the image are effectively distinguished through the double-threshold gradient continuity denoising, the noise is removed while the important edge information is retained, and the definition of the image is quantified by calculating the gradient amplitude image, so that the image features are analyzed from different resolutions, and the evaluation accuracy is improved.

[0102] In a possible implementation, the double-threshold gradient continuity denoising on each gradient amplitude image to obtain the image definition scores corresponding to the to-be-evaluated gray image and each to-be-evaluated multi-scale image comprises:

[0103] In step S41, for any gradient amplitude image, the pixel number value of the gradient amplitude image is calculated, and a histogram corresponding to the gradient amplitude image is determined.

[0104] It should be noted that the pixel number value refers to the number of pixels corresponding to each gray level in the image. The histogram is a graphical representation of the gray distribution of the image, which groups all the pixels in the image according to the gray level and counts the number of pixels in each group. The histogram provides global information about the gray distribution of the image.

[0105] Specifically, for any gradient amplitude image, the pixel number value of the gradient amplitude image is calculated, such as the calculation of the pixel number by the following formula.

[0106]

[0107] Where h(i) is the histogram of the gradient amplitude image, and L is the number of gray values (usually 256).

[0108] Further, the histogram corresponding to the gradient amplitude image is determined. In a possible implementation, the histogram can be constructed by traversing each pixel in the image and counting the number of pixels for each gray level.

[0109] In step S42, based on each pixel number value and the histogram, the inter-class variance of all gray values in the gradient amplitude image is calculated.

[0110] It should be noted that the gray value refers to the brightness value of each pixel point in the image, indicating the color information of the pixel point, and is limited to the brightness (or intensity) level and does not contain color information. In a gray image, the gray value of each pixel is usually represented by an integer between 0 and 255, wherein: 0 represents black, that is, the darkest brightness; 255 represents white, that is, the brightest brightness; and other values between 0 and 255 represent different gray levels, and the greater the value, the higher the brightness.

[0111] Further, it should be noted that the inter-class variance is an index for measuring the difference between the foreground and the background in the image.

[0112] Specifically, based on the pixel quantity values and the histogram, the inter-class variances of all the gray values in the gradient magnitude images are calculated, and the inter-class variance calculation formula is as follows:

[0113]

[0114] wherein the foreground weight is the background weight is the foreground mean value is the background mean value is the probability of each gray value is

[0115] Step S43, based on the inter-class variances of the gray values, the double-threshold gradient continuity denoising is performed to obtain the image sharpness scores corresponding to the to-be-evaluated gray image and the to-be-evaluated multi-scale images.

[0116] Specifically, for any gradient magnitude image, the peak value in the inter-class variances of the gray values is taken as a target global threshold, and then the average gradient value and the maximum gradient value of the gradient magnitude image are calculated, and a target local threshold is obtained according to the average gradient value and the maximum gradient value. The gradient magnitude image is fused based on the target global threshold and the target local threshold to obtain an edge binary image corresponding to the gradient magnitude image, so as to calculate the area mean value of the edge binary image as the image sharpness score corresponding to the gradient magnitude image.

[0117] The embodiment calculates pixel quantity values of the gradient magnitude images and determines histograms corresponding to the gradient magnitude images, and then iteratively calculates inter-class variances of all gray values in the gradient magnitude images based on the pixel quantity values and the histograms, so as to perform double-threshold gradient continuity denoising based on the inter-class variances of the gray values, and obtain image sharpness scores corresponding to the to-be-evaluated gray images and the to-be-evaluated multi-scale images. Thus, the edges in the images are more accurately identified by calculating gradient magnitudes and histograms, and the denoising strategy is adaptively adjusted according to the image content by double-threshold gradient continuity denoising, so that the important edge information is retained while the noise is removed, the accuracy of image quality evaluation is improved, and the robustness of sharpness evaluation is enhanced.

[0118] In a feasible implementation, the double-threshold gradient continuity denoising based on the inter-class variances of the gray values and the obtaining of the image sharpness scores corresponding to the to-be-evaluated gray images and the to-be-evaluated multi-scale images comprise:

[0119] In step S51, for any gradient magnitude image, a peak value in the inter-class variances of the gray values is taken as a target global threshold.

[0120] It should be noted that the peak value refers to a specific gray value that can maximize the difference between the foreground and the background when the gradient magnitude image is subjected to gray level segmentation. The target global threshold is a key parameter for distinguishing the foreground and the background in the image binarization process, and can directly affect the accuracy of edge detection.

[0121] Specifically, the inter-class variance of the image histogram is calculated, and a gray value that maximizes the inter-class variance is taken as the target global threshold T global Thus, the optimal threshold can be determined automatically without human intervention.

[0122] In step S52, an average gradient value and a maximum gradient value of the gradient magnitude image are calculated, and a target local threshold is obtained according to the average gradient value and the maximum gradient value. Double-threshold fusion is performed on the gradient magnitude image based on the target global threshold and the target local threshold, and an edge binarization image corresponding to the gradient magnitude image is obtained.

[0123] It should be noted that the average gradient value and the maximum gradient value are important statistical quantities for describing the features of the gradient magnitude image. The average gradient value reflects the overall edge intensity of the image, and the maximum gradient value represents the most significant edge intensity in the image. Therefore, the double-threshold fusion is a strategy combining the global threshold and the local threshold, aiming to more accurately detect the edges in the image, so as to retain the important edge information while removing the noise and improve the accuracy of edge detection.

[0124] Further need to be explained, the edge binarization image refers to the image obtained by binarization processing, wherein each pixel in the image has only two possible values, usually 0 and 1 (or 0 and 255, depending on the specific implementation), to indicate whether the pixel belongs to the edge of the image. That is, the gray image or color image is converted into an image containing only two colors, thereby distinguishing the edge pixels from the non-edge pixels in the image.

[0125] Specifically, the average gradient value and the maximum gradient value of the gradient magnitude image are calculated, and then the target local threshold is calculated according to the average gradient value and the maximum gradient value of the gradient magnitude image, wherein the local threshold calculation formula is:

[0126] T local =(G mean +G max ) / 2

[0127] Where T local is the target local threshold, G mean is the average gradient value, and G max is the maximum gradient of each pixel neighborhood of 8.

[0128] Further, the gradient magnitude image is fused based on the target global threshold and the target local threshold, that is, if the target local amplitude of the gradient magnitude image G is greater than the threshold max(T local ,T global ), the amplitude is 255, otherwise the amplitude is 0, thereby obtaining the edge binarization image.

[0129] Through morphological closing operation (3*3 kernel), the broken edges are connected, and then the filtered edge binarization image is obtained by removing the edges with an area less than 10 pixels.

[0130] Step S53, calculating the area mean of the edge binarization image as the image sharpness score corresponding to the gradient magnitude image.

[0131] It should be noted that the area mean refers to the average value of the foreground pixel value in the binarized image, which reflects the intensity and distribution of the edges in the image.

[0132] Specifically, the area mean of the edge binarization image is calculated as the image sharpness score corresponding to the gradient magnitude image, thereby achieving a 25% improvement in edge detection accuracy using a multi-scale adaptive threshold, and a 40% improvement in stability in a noisy environment. At the same time, the sharpness score of the telephoto is more stable and effective, and in the autofocus field, the focusing sharpness curve can be fitted into a unimodal curve, and the focusing result can be more stably obtained in the focusing strategy.

[0133] The embodiment takes the peak value in the inter-class variance of each gray value as a target global threshold for any gradient magnitude image, further calculates the average gradient value and the maximum gradient value of the gradient magnitude image, and obtains a target local threshold according to the average gradient value and the maximum gradient value, performs double-threshold fusion on the gradient magnitude image based on the target global threshold and the target local threshold to obtain an edge binarization image corresponding to the gradient magnitude image, and calculates the area mean value of the edge binarization image as the image sharpness score corresponding to the gradient magnitude image, so that the peak value in the inter-class variance is automatically taken as the target global threshold, human intervention is reduced, important edge information in the image is more accurately identified and reserved, and the accuracy of image sharpness evaluation is improved.

[0134] In a possible implementation, the obtaining the gray-scale image to be evaluated includes:

[0135] In step S61, the original image to be evaluated is obtained, and it is determined whether the original image to be evaluated is a gray-scale image.

[0136] It should be noted that the original image to be evaluated refers to an image that a user hopes to evaluate in terms of sharpness. The image can be a gray-scale image or a color image. The gray-scale image is a single-channel image, in which the value of each pixel represents the brightness thereof, and the range is usually between 0 (black) and 255 (white).

[0137] Specifically, the original image to be evaluated is obtained, and it is determined whether the original image to be evaluated is a gray-scale image. In an embodiment, it can be determined whether the original image to be evaluated is a gray-scale image by checking the data structure or file metadata of the image, or by checking the number of channels of the image. If the image has only one channel, it is determined to be a gray-scale image. The method of determination is not limited herein, and can be set according to actual conditions to ensure that subsequent processing steps can be performed on a unified data format, thereby improving the universality and adaptability of the algorithm.

[0138] In step S62, if yes, the original image to be evaluated is taken as the gray-scale image to be evaluated.

[0139] Specifically, if the original image to be evaluated is already a gray-scale image, the original image to be evaluated can be directly used in the subsequent sharpness evaluation process, thereby avoiding unnecessary image processing steps, saving computing resources, and preserving the original brightness information of the image.

[0140] In step S63, if no, the original image to be evaluated is subjected to image gray-scale processing according to a preset gray-scale processing rule to obtain the gray-scale image to be evaluated.

[0141] Specifically, if the to-be-evaluated original image is not a grayscale image, it needs to be processed into a grayscale image, and the preset grayscale processing rule refers to a series of rules or algorithms for converting a color image into a grayscale image, which can be a weighted sum based on brightness or a conversion based on other color spaces, without limitation.

[0142] In an embodiment, the preset grayscale processing rule can be achieved by weighted sum of the red, green and blue channels of the color image, and the specific conversion formula is: Gray = R*0.299 + G*0.587 + B*0.114, so as to convert the color image into a grayscale image for subsequent clarity evaluation.

[0143] The embodiment obtains a to-be-evaluated original image, judges whether the to-be-evaluated original image is a grayscale image, and then if yes, takes the to-be-evaluated original image as the to-be-evaluated grayscale image, and otherwise, performs image grayscale processing on the to-be-evaluated original image according to a preset grayscale processing rule to obtain the to-be-evaluated grayscale image, thereby realizing the unification of processing formats. Since a grayscale image has fewer data dimensions than a color image, it helps to reduce the consumption of computing resources, improve system processing speed, and reduce computational complexity, while preserving the brightness information of the image to preserve key information, reducing the interference of color information in the color image on the algorithm performance, and improving the robustness of the algorithm.

[0144] In a feasible embodiment, the determination of the target image clarity corresponding to the to-be-evaluated grayscale image based on the to-be-evaluated grayscale image and the image clarity scores corresponding to each to-be-evaluated multi-scale image comprises:

[0145] Step S71: obtaining a weight coefficient corresponding to the target number of layers;

[0146] It should be noted that the weight coefficient refers to a group of numerical values for weighted mean calculation, which reflects the importance of different scale images in the final clarity evaluation. The weight coefficient corresponding to the target number of layers is set according to different layers of the Gaussian pyramid, and the weight coefficient of each layer can be different to reflect the contribution of image features at different resolutions to the overall clarity evaluation.

[0147] Specifically, the weight coefficient can be determined by pre-setting, user input, or matching according to an experience rule base of image processing, or by a machine learning method, without limitation, so as to balance the influence of different scale images and ensure that the final clarity evaluation result takes into account both the detailed features of the image and the overall structure of the image.

[0148] Step S72, based on the weight coefficient, the image clarity score corresponding to the to-be-evaluated gray image and each to-be-evaluated multi-scale image is weighted and averaged to obtain a target image clarity corresponding to the to-be-evaluated gray image.

[0149] It should be noted that the weighted average processing is a mathematical operation, that is, each image clarity score is multiplied by the weight coefficient corresponding thereto, then the products are added, and finally the sum is divided by the sum of the weight coefficients to obtain the final image clarity score, thereby effectively integrating image information of different scales and improving the accuracy and reliability of image clarity evaluation.

[0150] In a possible implementation, the weighted average processing can be realized by programming, for example, using the NumPy library for array operation in Python, and the weight calculation can also be realized by a lightweight model CNN, which is not limited herein.

[0151] In an embodiment, the target number of layers is two, and each to-be-evaluated multi-scale image is a first-layer image of a pyramid and a second-layer image of a pyramid. At this time, the weight coefficient corresponding to the target number of layers is {0.6, 0.3, 0.1}, so that the weighted average is performed through the weight coefficient, that is, the image clarity score of the to-be-evaluated gray image * 0.6 + the image clarity score of the first-layer image of the pyramid * 0.3 + the image clarity score of the second-layer image of the pyramid * 0.1 are calculated to obtain the target image clarity corresponding to the to-be-evaluated gray image as the final output.

[0152] The embodiment obtains the weight coefficient corresponding to the target number of layers, and then performs weighted average processing on the image clarity score corresponding to the to-be-evaluated gray image and each to-be-evaluated multi-scale image based on the weight coefficient to obtain the target image clarity corresponding to the to-be-evaluated gray image, thereby balancing the clarity scores of images of different scales through the weighted average processing, which helps to improve the accuracy of the final image clarity evaluation, and the overall clarity of the image is comprehensively evaluated by considering the image clarity scores of different scales, thereby obtaining a more comprehensive evaluation result, reducing the influence of noise on the final evaluation result, and improving the robustness of the evaluation.

[0153] For the purpose of facilitating understanding of the implementation process of the image clarity evaluation method, refer to Figure 4 , Figure 4 A brief flowchart of the image clarity evaluation method provided in the present application.

[0154] Specifically, the input original image is acquired and converted into a grayscale image, which is then input into a Gaussian pyramid to generate image layers with different resolutions. The first layer of the pyramid (pyramid 1 layer) is obtained by Gaussian blurring and downsampling the original grayscale image. Then, the same process is repeated for the first layer of the pyramid to obtain the image of the second layer (pyramid 2 layer). This process can continue as needed to generate more layers of images, which is not limited here.

[0155] Further, for each layer of image (including the original image and the images of each layer of the pyramid), the gradient magnitude of the image in the horizontal and vertical directions is calculated using a discrete differential operator (such as the Sobel operator), and then the dynamic noise removal processing is performed on the calculated gradient magnitude image, so as to dynamically adjust the noise removal strategy according to the image content, so as to retain the edge information and remove the noise.

[0156] Further, all the gradient magnitude images after noise removal are weighted and calculated to obtain the final image sharpness score, wherein the weighted calculation usually involves assigning different weights to the images of different layers to reflect their relative importance in sharpness evaluation.

[0157] Through the above process, a sharpness evaluation result considering the image details and structural features comprehensively can be obtained, thereby providing a basis for image quality control and optimization. For example, in an autofocus system, the sharpness of the focusing result can be evaluated using this process, and the image quality can be optimized by adjusting the focal length.

[0158] It should be noted that the examples in the figures are only used to understand the present application and do not constitute a limitation on the image sharpness evaluation method of the present application. More forms of simple transformation based on this technical concept are within the protection scope of the present application.

[0159] It should be understood that the size of the serial number of each step in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0160] The present application also provides an image sharpness evaluation device, please refer to Figure 5 , the image sharpness evaluation device comprises:

[0161] The image acquisition module 51 is configured to acquire a grayscale image to be evaluated;

[0162] The multi-scale processing module 52 is configured to perform Gaussian pyramid downsampling processing on the grayscale image to be evaluated to obtain a target number of layers of multi-scale images to be evaluated corresponding to the target number of layers;

[0163] The score calculation module 53 is configured to calculate the clarity scores of the to-be-evaluated gray image and the to-be-evaluated multi-scale images based on the dynamic gradient threshold denoising method, so as to obtain the image clarity scores corresponding to the to-be-evaluated gray image and the to-be-evaluated multi-scale images.

[0164] The clarity evaluation module 54 is configured to determine the target image clarity corresponding to the to-be-evaluated gray image based on the image clarity scores corresponding to the to-be-evaluated gray image and the to-be-evaluated multi-scale images.

[0165] The image clarity evaluation device is further configured to:

[0166] input the to-be-evaluated gray image into the image processing layer number prediction model to obtain a target layer number output by the image processing layer number prediction model;

[0167] obtain the width and height values of the to-be-evaluated gray image, and determine a Gaussian weight kernel based on the width and height values;

[0168] perform Gaussian pyramid down-sampling processing on the to-be-evaluated gray image according to a preset Gaussian pyramid down-sampling processing formula, the width and height values, and the Gaussian weight kernel, to obtain a to-be-evaluated multi-scale image corresponding to the target layer number.

[0169] The image clarity evaluation device is further configured to:

[0170] calculate the first gradient amplitude in the transverse direction and the second gradient amplitude in the longitudinal direction of the to-be-evaluated gray image and the to-be-evaluated multi-scale images by using a preset discrete differential operator;

[0171] generate a plurality of gradient amplitude images based on the first gradient amplitudes and the second gradient amplitudes;

[0172] perform double-threshold gradient continuity denoising on the gradient amplitude images to obtain the image clarity scores corresponding to the to-be-evaluated gray image and the to-be-evaluated multi-scale images.

[0173] The image clarity evaluation device is further configured to:

[0174] for any gradient amplitude image, calculate a pixel number value of the gradient amplitude image, and determine a histogram corresponding to the gradient amplitude image;

[0175] based on the pixel number values and the histogram, iteratively calculate the inter-class variance of all gray values in the gradient amplitude image;

[0176] perform double-threshold gradient continuity denoising based on the inter-class variance of each of the gray values to obtain the image sharpness scores corresponding to the to-be-evaluated gray image and each of the to-be-evaluated multi-scale images.

[0177] The image sharpness evaluation apparatus is further configured to:

[0178] For any of the gradient magnitude images, take a peak value in the inter-class variance of each of the gray values as a target global threshold value;

[0179] calculate an average gradient value and a maximum gradient value of the gradient magnitude image, and obtain a target local threshold value according to the average gradient value and the maximum gradient value, perform double-threshold fusion on the gradient magnitude image based on the target global threshold value and the target local threshold value to obtain an edge binarization image corresponding to the gradient magnitude image;

[0180] calculate a region mean value of the edge binarization image as the image sharpness score corresponding to the gradient magnitude image.

[0181] The image sharpness evaluation apparatus is further configured to:

[0182] obtain a to-be-evaluated original image, and determine whether the to-be-evaluated original image is a gray image;

[0183] if yes, take the to-be-evaluated original image as the to-be-evaluated gray image;

[0184] if no, perform image gray processing on the to-be-evaluated original image according to a preset gray processing rule to obtain the to-be-evaluated gray image.

[0185] The image sharpness evaluation apparatus is further configured to:

[0186] obtain a weight coefficient corresponding to a target layer number;

[0187] perform weighted mean processing on the image sharpness scores corresponding to the to-be-evaluated gray image and each of the to-be-evaluated multi-scale images based on the weight coefficient to obtain a target image sharpness corresponding to the to-be-evaluated gray image.

[0188] The image sharpness evaluation apparatus provided in the present application adopts the image sharpness evaluation method in the above embodiments, and can solve the technical problems in the background art. Compared with the prior art, the image sharpness evaluation apparatus provided in the present application has the same beneficial effects as the image sharpness evaluation method provided in the above embodiments, and other technical features in the image sharpness evaluation apparatus are the same as the features disclosed in the above embodiments, which will not be repeated here.

[0189] The present application provides an image sharpness evaluation device, comprising: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the image sharpness evaluation method in the above-mentioned embodiment one.

[0190] Reference will now be made to the following description Figure 6 , which shows a structural schematic diagram of an image sharpness evaluation device suitable for implementing the embodiments of the present application. The image sharpness evaluation device in the embodiments of the present application can include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and the like, as well as fixed terminals such as digital TVs, desktop computers, and the like. Figure 6 The image sharpness evaluation device shown is only an example and should not impose any limitation on the functions and use range of the embodiments of the present application.

[0191] As shown in Figure 6 , the image sharpness evaluation device can include a processing apparatus 1001 (such as a central processing unit, a graphics processing unit, or the like) that can perform various appropriate actions and processes according to programs stored in a read-only memory 1002 or loaded from a storage apparatus 1003 into a random access memory 1004. In the random access memory 1004, various programs and data required for the operation of the image sharpness evaluation device are also stored. The processing apparatus 1001, the read-only memory 1002, and the random access memory 1004 are connected to each other through a bus 1005. An input / output interface 1006 is also connected to the bus. Generally, the following systems can be connected to the input / output interface 1006: input apparatuses 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, and the like; output apparatuses 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, and the like; the storage apparatus 1003 including, for example, a magnetic tape, a hard disk, and the like; and a communication apparatus 1009. The communication apparatus 1009 can allow the image sharpness evaluation device to communicate with other devices wirelessly or by wire to exchange data. Although the image sharpness evaluation device with various systems is shown in the figure, it should be understood that all the systems shown are not required to be implemented or possessed. More or fewer systems can be alternatively implemented or possessed.

[0192] In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer readable medium, the computer program comprising program code for performing the methods illustrated by the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 1003, or installed from a read-only memory 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are performed.

[0193] The image sharpness evaluation device provided by the present application adopts the image sharpness evaluation method in the above-mentioned embodiments, and can solve the technical problems in the background art. Compared with the prior art, the beneficial effects of the image sharpness evaluation device provided by the present application are the same as those of the image sharpness evaluation method provided by the above-mentioned embodiments, and other technical features in the image sharpness evaluation device are the same as those disclosed in the previous embodiment method, which will not be repeated here.

[0194] It should be understood that various parts of the present disclosure can be realized by hardware, software, firmware or a combination thereof. In the description of the above-mentioned embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0195] The above is merely specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

[0196] The present application provides a computer readable storage medium having stored thereon computer readable program instructions (i.e. computer program) for performing the image sharpness evaluation method in the above-mentioned embodiments.

[0197] The computer readable storage medium provided in the application may be, for example, a U disk, but is not limited to an electric, magnetic, optical, electromagnetic, infrared, or semiconductor system or device, or any combination thereof. More specific examples of the computer readable storage medium may include, but are not limited to, an electric connection with one or more conductive wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the embodiment, the computer readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system or device. The program code contained on the computer readable storage medium can be transmitted by any suitable medium, including but not limited to an electric wire, an optical cable, an RF (Radio Frequency), and the like, or any suitable combination thereof.

[0198] The computer readable storage medium described above may be contained in the image sharpness evaluation device, or may exist separately without being assembled into the image sharpness evaluation device.

[0199] The computer readable storage medium described above carries one or more programs, which, when executed by the image sharpness evaluation device, cause the image sharpness evaluation device to:

[0200] obtain a gray-scale image to be evaluated;

[0201] perform Gaussian pyramid downsampling processing on the gray-scale image to be evaluated to obtain a target number of layers, to obtain a multi-scale image corresponding to the target number of layers to be evaluated;

[0202] perform sharpness score calculation on the gray-scale image to be evaluated and each multi-scale image to be evaluated based on a dynamic gradient threshold denoising method, to obtain image sharpness scores corresponding to the gray-scale image to be evaluated and each multi-scale image to be evaluated;

[0203] determine a target image sharpness corresponding to the gray-scale image to be evaluated based on the image sharpness scores corresponding to the gray-scale image to be evaluated and each multi-scale image to be evaluated.

[0204] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0205] The flow diagrams and the block diagrams in the drawings are illustrations of architectures, functionalities, and operations of possible implementations of systems, methods, and computer program products according to various embodiments of present application. In this regard, each block in the flow diagrams or block diagrams can represent a module, a procedure, or a part of code, which comprises one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may

[0206] The modules involved in the embodiments of the present application can be implemented in the form of software or in the form of hardware. Among them, the name of the module does not constitute a limitation to the unit itself in some cases.

[0207] The readable storage medium provided by the present application is a computer readable storage medium, which stores computer readable program instructions (i.e. computer program) for executing the image definition evaluation method described above, and can solve the technical problems in the background art. Compared with the prior art, the computer readable storage medium provided by the present application has the same beneficial effects as the image definition evaluation method provided by the above embodiments, which will not be repeated here.

[0208] The embodiment of the present application provides a computer program product, comprising a computer program, which realizes the steps of the image definition evaluation method as described above when executed by a processor.

[0209] The computer program product provided by the present application can solve the technical problems in the background art. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of the present application are the same as those of the image definition evaluation method provided by the above-mentioned embodiment, and are not described here.

[0210] The above-mentioned is only part of the embodiments of the present application, and does not limit the patent scope of the present application. Any equivalent structural transformation, direct / indirect application in other related technical fields based on the technical concept of the present application, and the contents of the specification and drawings of the present application are included in the patent protection scope of the present application.

Claims

1. A method for evaluating image clarity, characterized in that: include: Obtain the grayscale image to be evaluated; Performing Gaussian pyramid downsampling processing on the grayscale image to be evaluated by a target number of layers to obtain a multi-scale image to be evaluated corresponding to the target number of layers; Calculating the clarity scores of the grayscale image to be evaluated and each of the multi-scale images to be evaluated based on a dynamic gradient threshold denoising method to obtain image clarity scores corresponding to the grayscale image to be evaluated and each of the multi-scale images to be evaluated; Based on the grayscale image to be evaluated and the image clarity scores corresponding to each of the multi-scale images to be evaluated, the clarity of the target image corresponding to the grayscale image to be evaluated is determined.

2. The image clarity evaluation method according to claim 1, wherein: The step of performing Gaussian pyramid downsampling processing on the grayscale image to be evaluated by a target number of layers to obtain a multi-scale image to be evaluated corresponding to the target number of layers includes: Inputting the grayscale image to be evaluated into an image processing layer number prediction model to obtain a target layer number output by the image processing layer number prediction model; Obtaining width and height values ​​of the grayscale image to be evaluated, and determining a Gaussian weight kernel based on the width and height values; According to a preset Gaussian pyramid downsampling processing formula, the width and height values, and the Gaussian weight kernel, Gaussian pyramid downsampling processing of a target number of layers is performed on the grayscale image to be evaluated to obtain a multi-scale image to be evaluated corresponding to the target number of layers.

3. The image clarity evaluation method according to claim 1, wherein: The dynamic gradient threshold denoising method is used to calculate the clarity score of the grayscale image to be evaluated and each of the multi-scale images to be evaluated, to obtain the image clarity scores corresponding to the grayscale image to be evaluated and each of the multi-scale images to be evaluated, including: Calculating, by a preset discrete differential operator, a first gradient magnitude in a transverse direction and a second gradient magnitude in a longitudinal direction of the grayscale image to be evaluated and each of the multi-scale images to be evaluated; generating a plurality of gradient magnitude images based on each of the first gradient magnitudes and each of the second gradient magnitudes; Double-threshold gradient continuity denoising is performed on each of the gradient amplitude images to obtain the grayscale image to be evaluated and the image clarity score corresponding to each of the multi-scale images to be evaluated.

4. The image clarity evaluation method according to claim 3, wherein: The performing dual-threshold gradient continuity denoising on each of the gradient magnitude images to obtain the grayscale image to be evaluated and the image clarity score corresponding to each of the multi-scale images to be evaluated includes: For any of the gradient magnitude images, calculating the number of pixels of the gradient magnitude image, and determining a histogram corresponding to the gradient magnitude image; Based on the pixel quantity values ​​and the histogram, traversing and calculating to obtain the inter-class variance of all grayscale values ​​in the gradient magnitude image; Double-threshold gradient continuity denoising is performed based on the inter-class variance of each of the grayscale values ​​to obtain the image clarity scores corresponding to the grayscale image to be evaluated and each of the multi-scale images to be evaluated.

5. The image clarity evaluation method according to claim 4, wherein: The performing of dual-threshold gradient continuity denoising based on the inter-class variance of each grayscale value to obtain the image clarity score corresponding to the grayscale image to be evaluated and each multi-scale image to be evaluated includes: For any of the gradient magnitude images, taking the peak value of the inter-class variance of each of the grayscale values ​​as the target global threshold; Calculating an average gradient value and a maximum gradient value of the gradient magnitude image, obtaining a target local threshold value based on the average gradient value and the maximum gradient value, and performing dual-threshold fusion on the gradient magnitude image based on the target global threshold value and the target local threshold value to obtain an edge binarization image corresponding to the gradient magnitude image; The regional mean of the edge binarization image is calculated as the image clarity score corresponding to the gradient magnitude image.

6. The image clarity evaluation method according to claim 1, wherein: The step of obtaining the grayscale image to be evaluated includes: Obtaining an original image to be evaluated, and determining whether the original image to be evaluated is a grayscale image; If yes, the original image to be evaluated is used as the grayscale image to be evaluated; If not, grayscale processing is performed on the original image to be evaluated according to a preset grayscale processing rule to obtain the grayscale image to be evaluated.

7. The image clarity evaluation method according to claim 1, wherein: The determining, based on the grayscale image to be evaluated and the image clarity scores corresponding to each of the multi-scale images to be evaluated, the clarity of the target image corresponding to the grayscale image to be evaluated includes: Get the weight coefficient corresponding to the target number of layers; Based on the weight coefficient, weighted mean processing is performed on the image clarity scores corresponding to the grayscale image to be evaluated and each of the multi-scale images to be evaluated to obtain the target image clarity corresponding to the grayscale image to be evaluated.

8. An image clarity evaluation device, characterized in that: include: An image acquisition module, used to acquire a grayscale image to be evaluated; A multi-scale processing module is used to perform Gaussian pyramid downsampling processing on the grayscale image to be evaluated to obtain a multi-scale image to be evaluated corresponding to the target number of layers; a score calculation module, configured to calculate a clarity score for the grayscale image to be evaluated and each of the multi-scale images to be evaluated based on a dynamic gradient threshold denoising method, to obtain image clarity scores corresponding to the grayscale image to be evaluated and each of the multi-scale images to be evaluated; The clarity evaluation module is configured to determine the clarity of a target image corresponding to the grayscale image to be evaluated based on the grayscale image to be evaluated and the image clarity scores corresponding to each of the multi-scale images to be evaluated.

9. An image clarity evaluation device, characterized in that: The image clarity evaluation device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the image clarity evaluation method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the image clarity evaluation method according to any one of claims 1 to 7 are implemented.