An image quality evaluation method, device, equipment and storage medium

By standardizing the local gradient energy and effective grayscale range, the low accuracy problem of traditional image quality evaluation methods is solved, and efficient image quality evaluation is achieved while reducing the influence of noise and illumination changes.

CN119649199BActive Publication Date: 2025-10-14CHANGCHUN INST OF OPTICS FINE MECHANICS & PHYSICS CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411910067.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-10-14
Estimated Expiration
2044-12-24

AI Technical Summary

Technical Problem

Traditional image quality evaluation methods are difficult to simultaneously meet the requirements of unimodality, unbiasedness, stability, high sensitivity and low computational complexity. Moreover, the results are easily affected by noise and background light, and the accuracy is not high.

Method used

By obtaining the local gradient energy of the target image, using the preset gradient statistics method to determine the target pixel points and perform cumulative calculations, combined with the standardization of the effective grayscale range, reducing the influence of noise and illumination changes, an image quality evaluation curve is constructed to determine the clarity.

Benefits of technology

Without increasing the amount of calculation, the influence of noise on image quality evaluation is reduced, the instability of smooth areas is improved, the influence of illumination changes is reduced, and the accuracy and stability of image quality evaluation are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119649199B_ABST
    Figure CN119649199B_ABST
Patent Text Reader

Abstract

The application discloses an image quality evaluation method and device, equipment and a storage medium, and relates to the technical field of image processing. The method comprises the following steps: acquiring a target image obtained by shooting a current scene, and determining local gradient energy of a pixel point in the target image; determining a target pixel point from each pixel point of the target image based on a preset gradient statistical method, and performing accumulated calculation on target local gradient energy corresponding to the target pixel point to obtain image change energy of the target image; determining an effective gray scale range of the target image by using a preset brightness statistical method, and performing standardization processing on the image change energy based on the effective gray scale range to determine the definition of the target image. In this way, the influence of noise on image quality evaluation is reduced by using local gradient, and the influence of illumination change on image quality evaluation is reduced by using effective gray scale range standardization, so that the image quality is accurately evaluated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to an image quality evaluation method, device, equipment and storage medium. Background Art

[0002] Optical devices are often subject to interference from various external factors, such as temperature and pressure fluctuations, shock, and vibration, which can cause the system to lose focus and produce out-of-focus blur. Therefore, as a common cause of image quality degradation in optical imaging systems, defocusing has a significant impact and is a problem that must be addressed in optical imaging systems. Autofocus technology aims to keep the target image plane consistently within the focal plane of the image sensor. Based on the optical transmission characteristics of the optical device, the optical system automatically adjusts the position of the target image plane along the optical axis, ensuring the optical system's ability to observe and capture the target and improving the quality of images captured by the image sensor. Image processing-based autofocus methods analyze and calculate the image's gradient or spectral information by designing an image quality evaluation function to determine the image's clarity and, consequently, its degree of defocus. An image feedback device is then used to drive a stepper motor, moving the lens to complete the autofocus operation.

[0003] Traditional image quality evaluation methods for automatic camera focus are difficult to simultaneously meet the properties of unimodality, unbiasedness, stability, high sensitivity and low computational complexity. At the same time, the results of image quality evaluation are often interfered by noise and background light, resulting in local fluctuation points and low accuracy.

[0004] In summary, how to accurately evaluate image quality is a technical problem that needs to be solved urgently. Summary of the Invention

[0005] In view of this, the purpose of the present invention is to provide an image quality assessment method, apparatus, device, and storage medium that can accurately assess image quality. The specific solution is as follows:

[0006] In a first aspect, the present application provides an image quality evaluation method, comprising:

[0007] Acquire a target image obtained by photographing the current scene, and determine the local gradient energy of pixels in the target image;

[0008] Determining a target pixel from each pixel of the target image based on a preset gradient statistics method, and accumulating target local gradient energies corresponding to the target pixel to obtain image change energy of the target image;

[0009] The effective grayscale range of the target image is determined by using a preset brightness statistics method, and the image change energy is normalized based on the effective grayscale range to determine the clarity of the target image.

[0010] Optionally, determining the local gradient energy of a pixel in the target image includes:

[0011] Determine a first horizontal neighborhood pixel point set and a second horizontal neighborhood pixel point set for any pixel point in the target image; wherein the first horizontal neighborhood pixel point set includes each first horizontal neighborhood pixel point within a preset horizontal neighborhood range of the any pixel point, and the second horizontal neighborhood pixel point set includes each second horizontal neighborhood pixel point within the preset horizontal neighborhood range of the any pixel point, and an interval between any two adjacent first horizontal neighborhood pixel points is a preset number of pixels, the preset number is a non-zero value, and an interval between any two adjacent second horizontal neighborhood pixel points is zero pixels;

[0012] Determine a first brightness sum value of the any pixel point and each of the first horizontally neighboring pixel points, and a second brightness sum value of the any pixel point and each of the second horizontally neighboring pixel points;

[0013] The local gradient energy of each pixel in the target image is determined based on a difference between the first brightness sum value and the second brightness sum value.

[0014] Optionally, determining a target pixel from each pixel of the target image based on a preset gradient statistics method, and accumulating target local gradient energies corresponding to the target pixel to obtain image change energy of the target image includes:

[0015] Determining a target gradient histogram corresponding to the absolute value of the local gradient energy of each pixel in the target image based on a preset gradient histogram statistical method;

[0016] The target pixel points whose absolute values ​​of the local gradient energies are within a preset target range are determined from the target gradient histogram, the target local gradient energies corresponding to the target pixel points are determined, and the target local gradient energies are accumulated and calculated to obtain the image change energy of the target image.

[0017] Optionally, determining the effective grayscale range of the target image by using a preset brightness statistics method includes:

[0018] Determining a target brightness histogram corresponding to the number of pixels of the target image and the brightness of the target image using a preset brightness statistical method, and performing a clipping process on the target brightness histogram based on a preset clipping ratio;

[0019] A brightness clipping maximum value and a brightness clipping minimum value of the target brightness histogram are determined based on the clipping result, and the effective grayscale range of the target image is determined based on the difference between the brightness clipping maximum value and the brightness clipping minimum value.

[0020] Optionally, the normalizing the image change energy based on the effective grayscale range includes:

[0021] Determining an ambient light component and a background light component corresponding to the current target image; wherein the ambient light component is determined based on the ambient light intensity of the current scene under preset lighting conditions, and the background light component is determined based on the background light intensity of the current scene under the preset lighting conditions;

[0022] determining a target brightness of the target image under the preset lighting conditions based on the ambient light component and the background light component according to the original brightness of the target image, and determining a local gradient energy of the target image under the preset lighting conditions based on the target brightness;

[0023] Based on the effective grayscale range, the local gradient energy under the preset lighting conditions is normalized to obtain a corresponding normalization result, so that based on the normalization result, the image change energy of the target image under the preset lighting conditions is correspondingly normalized.

[0024] Optionally, the image quality evaluation method further includes:

[0025] Acquire a target image sequence group obtained by photographing the current scene based on a preset focal length transformation method, and determine the clarity corresponding to each target image in the target image sequence group;

[0026] A corresponding image quality evaluation curve is constructed using each of the target images in the target image sequence group and the clarity corresponding to each of the target images in the target image sequence group.

[0027] Optionally, after acquiring a target image sequence group obtained by photographing the current scene based on a preset focal length transformation method and determining the clarity corresponding to each target image in the target image sequence group, the method further includes:

[0028] Determining the maximum definition of the definitions corresponding to the target images in the target image sequence group as a target definition;

[0029] A target focal length position corresponding to the target clarity is determined, so as to control a stepper motor to move the lens based on the target focal length position to complete a corresponding automatic focusing operation.

[0030] In a second aspect, the present application provides an image quality evaluation device, comprising:

[0031] A local gradient energy determination module is used to obtain a target image obtained by photographing the current scene and determine the local gradient energy of pixel points in the target image;

[0032] a local gradient energy accumulation module, configured to determine a target pixel from each pixel of the target image based on a preset gradient statistics method, and accumulate and calculate the target local gradient energy corresponding to the target pixel to obtain the image change energy of the target image;

[0033] The clarity determination module is used to determine the effective grayscale range of the target image using a preset brightness statistics method, and to normalize the image change energy based on the effective grayscale range to determine the clarity of the target image.

[0034] In a third aspect, the present application provides an electronic device, comprising:

[0035] Memory, used to store computer programs;

[0036] The processor is used to execute the computer program to implement the aforementioned image quality evaluation method.

[0037] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned image quality evaluation method is implemented.

[0038] In the present application, first, a target image obtained by photographing the current scene is obtained, and the local gradient energy of the pixel points in the target image is determined; then, a target pixel point is determined from each pixel point of the target image based on a preset gradient statistics method, and the target local gradient energy corresponding to the target pixel point is accumulated and calculated to obtain the image change energy of the target image; finally, the effective grayscale range of the target image is determined using a preset brightness statistics method, and the image change energy is normalized based on the effective grayscale range to determine the clarity of the target image. As can be seen from the above, in the present application, the local gradient energy of each pixel point in the target image is first determined, and then the target local gradient energy in the local gradient energy is determined, and the target local gradient energy is accumulated and calculated to obtain the image change energy, and then the effective grayscale range is calculated, and the image change energy is normalized using the effective grayscale range. In this way, the image change energy is calculated using local gradient energy, which reduces the impact of noise on image quality evaluation without significantly increasing the amount of calculation; the target local gradient energy is determined and accumulated, which effectively improves the instability of image quality evaluation with more smooth areas; the effective grayscale range is normalized to reduce the impact of illumination changes on image quality evaluation, and the calculation method is simple and the effect is obvious. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0040] Figure 1 A flow chart of an image quality evaluation method provided in this application;

[0041] Figure 2 A schematic diagram of local gradient energy provided by this application;

[0042] Figure 3 A schematic diagram of a statistical method for the maximum effective brightness value provided in this application;

[0043] Figure 4 A flowchart of a specific image quality evaluation method provided in this application;

[0044] Figure 5 A flowchart of a specific image quality evaluation method provided in this application;

[0045] Figure 6 A schematic diagram of the test results of an image quality evaluation method provided in this application;

[0046] Figure 7 A schematic diagram of the structure of an image quality evaluation device provided in this application;

[0047] Figure 8 This is a structural diagram of an electronic device provided in this application. DETAILED DESCRIPTION

[0048] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0049] The automatic focusing method based on image processing is to analyze and calculate the gradient information or spectrum information of the image by designing an image quality evaluation function, so as to judge the clarity of the image and then determine its degree of defocus. Then, the image feedback device is used to drive the stepper motor to move the lens to complete the automatic focusing operation. The traditional image quality evaluation method is difficult to simultaneously meet the properties of unimodality, unbiasedness, stability, high sensitivity and small computational complexity for automatic camera focusing. At the same time, the results of image quality evaluation are often affected by noise and background light, which will produce local fluctuation points and the accuracy is not high. To this end, the present application provides an image quality evaluation scheme that can accurately evaluate the quality of images.

[0050] See also Figure 1 As shown, an embodiment of the present invention discloses an image quality evaluation method, which may include:

[0051] Step S11: Acquire a target image obtained by photographing the current scene, and determine the local gradient energy of pixels in the target image.

[0052] In this embodiment, the current scene can first be photographed by an optical device to obtain a corresponding target image. In order to determine the clarity of the target image, an image clarity evaluation function that is resistant to noise and illumination changes can be designed based on the spatial domain focusing evaluation method. The spatial domain-based focusing evaluation method mainly calculates the gradient information between digital image pixels to determine the clarity of the image. A clear image has more detail features than a blurred image, and the gradient information of the image can effectively distinguish detail features. Therefore, by calculating the gradient information of the image, the out-of-focus image and the in-focus image can be effectively distinguished. Commonly used spatial domain focusing evaluation functions include Laplace function, grayscale difference function, gradient energy function, etc. Specifically, the basic function for image clarity evaluation can be expressed as:

[0053] , ;

[0054] in, represents the brightness of the target image, represents the gradient energy of the target image, represents the row index of the pixel in the target image, Represents the column index of the pixel in the target image. It is understandable that the basis function calculates the difference in brightness of adjacent spaced pixels. Although this method can effectively extract image edge information, the basis function used for image clarity evaluation will be affected by noise. In order to overcome the influence of noise on the basis function, a pre-processing method can be used to perform low-pass filtering on the collected target image. However, low-pass filtering of the target image affects the efficiency of gradient calculation. In this embodiment, the local gradient energy can be used to improve the basis function, that is, the local gradient energy can be used to improve the basis function. The sum of the lateral neighborhood of , complete the calculation of gradient energy.

[0055] It should be noted that, in order to reduce the impact of noise on gradient calculation, the above-mentioned determination of the local gradient energy of the pixel point in the target image may include: determining the first horizontal neighborhood pixel point set and the second horizontal neighborhood pixel point set of any pixel point in the target image; wherein, the first horizontal neighborhood pixel point set includes each first horizontal neighborhood pixel point within the preset horizontal neighborhood range of the any pixel point, and the second horizontal neighborhood pixel point set includes each second horizontal neighborhood pixel point within the preset horizontal neighborhood range of the any pixel point, and the interval between any two adjacent first horizontal neighborhood pixel points is a preset number of pixels, the preset number is a non-zero value, and the interval between any two adjacent second horizontal neighborhood pixel points is zero pixels; determining the first brightness sum of any pixel point and each first horizontal neighborhood pixel point, and the second brightness sum of any pixel point and each second horizontal neighborhood pixel point; determining the local gradient energy of each pixel point in the target image based on the difference between the first brightness sum and the second brightness sum. Specifically, the image clarity evaluation function improved using local gradient energy can be expressed as:

[0056] , ;

[0057] Among them, step represents the interval between pixels in the target image. Indicates the preset horizontal neighborhood range, Represents the first horizontal neighboring pixel set of any pixel point, Represents the second set of horizontal neighboring pixels of any pixel. In this embodiment, step=4 can be set, that is, the brightness difference of non-adjacent interval pixels is calculated to obtain the local gradient energy of the pixel. Figure 2 As shown, The value of , that is, the local gradient energy is expressed as the first brightness sum of each pixel in the left area minus the second brightness sum of each pixel in the right area.

[0058] Step S12: determining a target pixel from each pixel of the target image based on a preset gradient statistics method, and accumulating and calculating the target local gradient energy corresponding to the target pixel to obtain the image change energy of the target image.

[0059] It is understandable that smooth areas in natural images usually account for a large proportion, that is, the gradient energy of most areas is small, and the main component of local gradient energy in natural images is noise, and the image quality evaluation function is the cumulative sum of all local gradient energies. Therefore, in order to further reduce the interference of noise on the image clarity evaluation function, the above-mentioned method of determining the target pixel from each pixel of the target image based on the preset gradient statistics method and accumulating the target local gradient energies corresponding to the target pixel to obtain the image change energy of the target image can include: determining the target gradient histogram corresponding to the absolute value of the local gradient energy of each pixel in the target image based on the preset gradient histogram statistics method; determining the target pixel whose absolute value of the local gradient energy is within a preset target range from the target gradient histogram, determining the target local gradient energy corresponding to the target pixel, and accumulating the target local gradient energies to obtain the image change energy of the target image. Specifically, it is first necessary to determine the absolute value of the local gradient energy of each pixel in the target image, and determine the target gradient histogram based on the distribution of the absolute value of the local gradient energy. In order to reduce the interference of noise on the image clarity evaluation function, the target local gradient energy corresponding to the target pixel points within the preset target range can be selected for cumulative calculation. In a specific embodiment, the preset target range can be set to 5%, that is, the first 5% of the local gradient energy is determined as the target local gradient energy, and the target local gradient energy is accumulated. Specifically, the image clarity evaluation function determined by the target local gradient energy can be expressed as:

[0060] , ;

[0061] in, Indicates that all The local gradient energies in the top 5% are sorted from largest to smallest, and the target local gradient energies are identified. By using the local gradient energy histogram, the target local gradient energy can be quickly determined without the need for sorting local gradient energies. Determining the image clarity evaluation function using the target local gradient energy avoids the interference of noise in smooth areas on the overall image clarity evaluation function, while also reducing the impact of noise on gradient calculations in edge and detail areas without significantly increasing the algorithm's computational complexity.

[0062] Step S13: Determine the effective grayscale range of the target image using a preset brightness statistics method, and perform normalization processing on the image change energy based on the effective grayscale range to determine the clarity of the target image.

[0063] It is understandable that directly counting the maximum and minimum values ​​of the brightness of each pixel in the target image is easily interfered by noise and oversaturated pixels. The above-mentioned determination of the effective grayscale range of the target image using a preset brightness statistical method may include: determining a target brightness histogram corresponding to the number of pixels and the brightness of the target image using a preset brightness statistical method, and performing a clipping process on the target brightness histogram based on a preset clipping ratio; determining the maximum and minimum brightness clipping values ​​of the target brightness histogram based on the clipping result, and determining the effective grayscale range of the target image based on the difference between the maximum and minimum brightness clipping values. Figure 3 As shown, in this embodiment, the brightness of each pixel in the target image is first counted using a histogram statistical method to obtain a target brightness histogram. Then, based on a preset clipping ratio, the number of pixels with a small number of grayscale levels at the two ends of the target brightness histogram is clipped. Specifically, the pixels at the left and right ends that account for 1% of the total number of pixels can be clipped. Finally, the clipped values ​​at the left and right ends, namely the clipped maximum brightness value and the clipped minimum brightness value, are used as the effective maximum brightness value and minimum brightness value, and the difference between the maximum brightness value and the minimum brightness value is determined as the effective grayscale range.

[0064] In this embodiment, in order to eliminate the influence of illumination changes on image quality evaluation, the above-mentioned normalization processing of the image change energy based on the effective grayscale range may include: determining the ambient light component and background light component corresponding to the current target image; wherein, the ambient light component is determined according to the ambient light intensity of the current scene under the preset illumination conditions, and the background light component is determined according to the background light intensity of the current scene under the preset illumination conditions; based on the ambient light component and the background light component and the original brightness of the target image, determining the target brightness of the target image under the preset illumination conditions, and determining the local gradient energy of the target image under the preset illumination conditions based on the target brightness; normalizing the local gradient energy under the preset illumination conditions based on the effective grayscale range to obtain a corresponding normalization processing result, so as to perform corresponding normalization processing on the image change energy of the target image under the preset illumination conditions based on the normalization processing result. It is understandable that illumination affects the brightness amplitude of each pixel in the target image. Therefore, based on Retinex theory (i.e., Retinal-cortex theory) and the atmospheric scattering model, this embodiment proposes a simplified linear model to express the target brightness of the target image under preset illumination conditions as:

[0065] ;

[0066] in, Indicates the target brightness of the target image under the preset lighting conditions, Indicates the ambient light intensity of the current scene under preset lighting conditions. represents the original brightness of the target image, Indicates the background light intensity of the current scene under the preset lighting conditions. At the same time, it can be determined that the target brightness of the target image under the preset lighting conditions has the following relationship:

[0067] ;

[0068] ;

[0069] in, Indicates the maximum target brightness of the target image under the preset lighting conditions. Indicates the minimum target brightness of the target image under the preset lighting conditions. Indicates the maximum original brightness of the target image, Represents the minimum original brightness of the target image. Further, we can get:

[0070] ;

[0071] Specifically, the local gradient energy of the target image under preset lighting conditions can be expressed as:

[0072] ;

[0073] The normalization of the local gradient energy of the target image under the preset lighting conditions based on the effective grayscale range can be expressed as:

[0074] ;

[0075] Subsequently, the target image's image variation energy under the preset lighting conditions can be normalized based on the normalized results of the local gradient energy of the target image under the preset lighting conditions. Normalizing the image variation energy of the target image under the preset lighting conditions can eliminate the effects of ambient and background light caused by lighting variations, thereby reducing the impact of lighting on image quality assessment.

[0076] See also Figure 4 As shown, in a specific embodiment, the specific process of the image quality evaluation method can be: image acquisition; calculating the local gradient of the acquired image; and performing histogram statistics on the absolute value of the local gradient; then calculating the cumulative sum of the large values ​​corresponding to the local gradient; at the same time, performing histogram statistics on the brightness of the acquired image; calculating the effective grayscale range; then normalizing the cumulative sum of the large values ​​based on the effective grayscale range; and finally outputting the image quality evaluation result.

[0077] As can be seen from the above, in this embodiment, the target image obtained by shooting the current scene is first obtained, and the local gradient energy of the pixel points in the target image is determined; then, based on the preset gradient statistics method, the target pixel point is determined from each pixel point of the target image, and the target local gradient energies corresponding to the target pixel points are accumulated and calculated to obtain the image change energy of the target image; finally, the effective grayscale range of the target image is determined using the preset brightness statistics method, and the image change energy is normalized based on the effective grayscale range to determine the clarity of the target image. As can be seen from the above, in this embodiment, the local gradient energy of each pixel point in the target image is first determined, and then the target local gradient energy in the local gradient energies is determined, and the target local gradient energies are accumulated and calculated to obtain the image change energy, and then the effective grayscale range is calculated, and the image change energy is normalized using the effective grayscale range. In this way, the image change energy is calculated using local gradient energy, which reduces the impact of noise on image quality evaluation without significantly increasing the amount of calculation; the target local gradient energy is determined and accumulated, which effectively improves the instability of image quality evaluation with more smooth areas; the effective grayscale range is normalized to reduce the impact of illumination changes on image quality evaluation, and the calculation method is simple and the effect is obvious.

[0078] Based on the previous embodiment, it can be seen that the present application uses local gradient to reduce the impact of noise on image quality evaluation, and uses effective grayscale range normalization to reduce the impact of illumination changes on image quality evaluation, thereby accurately evaluating image quality. Next, this embodiment will test the image quality evaluation method. Figure 5 As shown, the embodiment of the present invention further discloses an image quality evaluation method, which may include:

[0079] Step S21: obtaining a target image sequence group obtained by photographing the current scene based on a preset focal length transformation method, determining the clarity corresponding to each target image in the target image sequence group, and constructing a corresponding image quality evaluation curve using each target image in the target image sequence group and the clarity corresponding to each target image in the target image sequence group.

[0080] See also Figure 6As shown, in this embodiment, camera parameters such as exposure and white balance can be adjusted based on the current scene lighting and shooting requirements. At the same time, the camera is ensured to be stable to avoid jitter during shooting. The camera's focal length can then be continuously varied from far to near to capture the current scene, obtaining a set of clear target images with smooth focal length changes. To test the performance of the image quality evaluation method, an image clarity evaluation function and an improved grayscale difference focusing method (SMD2, or Gray-scale Difference Product Method) can be used to determine the clarity of each target image in a target image sequence group, and image quality evaluation curves are determined for each. It can be appreciated that the image quality evaluation curve corresponding to the target image sequence group determined by the image clarity evaluation function has a distinct unimodal and consistent nature compared to the image quality evaluation curve corresponding to the target image sequence group determined by the grayscale difference focusing method. Furthermore, the grayscale difference focusing method cannot determine the clarity of the target image under varying lighting conditions.

[0081] Step S22: Determine the maximum definition of the definitions corresponding to the target images in the target image sequence group as the target definition.

[0082] In this embodiment, the clarity of each target image in the target image sequence group is determined by using an image clarity evaluation function. The clarity values ​​of all target images are compared to find the maximum clarity, and the maximum clarity found is set as the target clarity. The target clarity represents the highest clarity level that can be achieved in the entire target image sequence group. Figure 6 As shown in sub-images (a)-(f), the 3rd, 48th, 90th, 142nd, 190th, and 252nd images in the target image sequence, respectively, we can see a progression from partially sharp, blurred, sharp, and then blurred again, with significant illumination variations and the influence of noise. Visually, we can determine that the 142nd image is the optimal focus position.

[0083] Step S23: determining a target focal length position corresponding to the target definition, so as to control a stepping motor to move the lens based on the target focal length position to complete a corresponding automatic focusing operation.

[0084] In this embodiment, a corresponding target image is determined from a target image sequence based on the target clarity, and the target focal position corresponding to the target image is determined. Parameters such as the step angle and maximum rotational speed of the stepper motor are then determined. Based on the difference between the target focal position and the current focal position of the stepper motor, the number and frequency of pulses required to be sent to the stepper motor are calculated, and a corresponding control signal is generated. The control signal includes a pulse signal and a direction signal. The generated control signal is then sent to the stepper motor driver, which then drives the stepper motor to rotate a specified angle in a set direction. While the stepper motor is moving the lens, image clarity can be captured in real time for feedback. If the image clarity does not meet expectations or deviates from the target clarity, the stepper motor control signal can be adjusted promptly for fine-tuning. After the autofocus operation is completed, the optical device's focal length can be maintained stable by locking the stepper motor position or reducing its rotational speed.

[0085] As can be seen above, this embodiment first obtains a target image sequence group corresponding to the current scene, determines the clarity corresponding to each target image in the target image sequence group, and constructs a corresponding image quality evaluation curve. This allows for performance test results of the image quality evaluation method of this embodiment to be obtained. Furthermore, this embodiment determines the target clarity from the clarity corresponding to each target image, and determines the target focal position based on the target clarity, thereby enabling the automatic focusing operation of the optical device to be performed based on the target focal position. This prevents out-of-focus blur in the optical device, ensures the optical device's ability to observe and capture the target, and improves the quality of images captured by the image sensor.

[0086] Accordingly, see Figure 7 As shown, the embodiment of the present application further provides an image quality evaluation device, which may include:

[0087] A local gradient energy determination module 11 is configured to obtain a target image obtained by photographing a current scene and determine the local gradient energy of pixels in the target image;

[0088] a local gradient energy accumulation module 12, configured to determine a target pixel from each pixel of the target image based on a preset gradient statistics method, and accumulate and calculate the target local gradient energy corresponding to the target pixel to obtain the image change energy of the target image;

[0089] The clarity determination module 13 is configured to determine the effective grayscale range of the target image using a preset brightness statistics method, and to normalize the image change energy based on the effective grayscale range to determine the clarity of the target image.

[0090] In the present application, first, a target image obtained by photographing the current scene is obtained, and the local gradient energy of the pixel points in the target image is determined; then, a target pixel point is determined from each pixel point of the target image based on a preset gradient statistics method, and the target local gradient energy corresponding to the target pixel point is accumulated and calculated to obtain the image change energy of the target image; finally, the effective grayscale range of the target image is determined using a preset brightness statistics method, and the image change energy is normalized based on the effective grayscale range to determine the clarity of the target image. As can be seen from the above, in the present application, the local gradient energy of each pixel point in the target image is first determined, and then the target local gradient energy in the local gradient energy is determined, and the target local gradient energy is accumulated and calculated to obtain the image change energy, and then the effective grayscale range is calculated, and the image change energy is normalized using the effective grayscale range. In this way, the image change energy is calculated using local gradient energy, which reduces the impact of noise on image quality evaluation without significantly increasing the amount of calculation; the target local gradient energy is determined and accumulated, which effectively improves the instability of image quality evaluation with more smooth areas; the effective grayscale range is normalized to reduce the impact of illumination changes on image quality evaluation, and the calculation method is simple and the effect is obvious.

[0091] In some specific implementations, the local gradient energy determination module 11 may include:

[0092] a pixel point set determination unit, configured to determine a first horizontal neighborhood pixel point set and a second horizontal neighborhood pixel point set for any pixel point in the target image; wherein the first horizontal neighborhood pixel point set includes each first horizontal neighborhood pixel point within a preset horizontal neighborhood range of the any pixel point, and the second horizontal neighborhood pixel point set includes each second horizontal neighborhood pixel point within the preset horizontal neighborhood range of the any pixel point, and an interval between any two adjacent first horizontal neighborhood pixel points is a preset number of pixels, the preset number is a non-zero value, and an interval between any two adjacent second horizontal neighborhood pixel points is zero pixels;

[0093] a brightness sum determination unit, configured to determine a first brightness sum of the any pixel point and each of the first horizontally neighboring pixel points, and a second brightness sum of the any pixel point and each of the second horizontally neighboring pixel points;

[0094] A local gradient energy determining unit is configured to determine the local gradient energy of each pixel in the target image based on a difference between the first brightness sum value and the second brightness sum value.

[0095] In some specific embodiments, the local gradient energy accumulation module 12 may include:

[0096] a target gradient histogram determining unit, configured to determine a target gradient histogram corresponding to the absolute value of the local gradient energy of each pixel in the target image based on a preset gradient histogram statistical method;

[0097] A local gradient energy accumulation unit is used to determine, from the target gradient histogram, the target pixel points whose absolute values ​​of the local gradient energies are within a preset target range, determine the target local gradient energies corresponding to the target pixel points, and accumulate the target local gradient energies to obtain the image change energy of the target image.

[0098] In some specific implementations, the clarity determination module 13 may include:

[0099] a target brightness histogram interception unit, configured to determine a target brightness histogram corresponding to the number of pixels of the target image and the brightness of the target image using a preset brightness statistics method, and intercept the target brightness histogram based on a preset interception ratio;

[0100] An effective grayscale range determining unit is used to determine a brightness clipping maximum value and a brightness clipping minimum value of the target brightness histogram based on a clipping result, and to determine the effective grayscale range of the target image based on a difference between the brightness clipping maximum value and the brightness clipping minimum value.

[0101] In some specific implementations, the clarity determination module 13 may include:

[0102] an ambient light component determination unit, configured to determine an ambient light component and a background light component corresponding to the current target image; wherein the ambient light component is determined based on the ambient light intensity of the current scene under preset lighting conditions, and the background light component is determined based on the background light intensity of the current scene under the preset lighting conditions;

[0103] a target brightness determination unit, configured to determine a target brightness of the target image under the preset lighting conditions based on the ambient light component and the background light component according to the original brightness of the target image, and determine a local gradient energy of the target image under the preset lighting conditions based on the target brightness;

[0104] An image change energy normalization unit is used to perform normalization processing on the local gradient energy under the preset lighting conditions based on the effective grayscale range to obtain a corresponding normalization processing result, so as to perform corresponding normalization processing on the image change energy of the target image under the preset lighting conditions based on the normalization processing result.

[0105] In some specific implementations, the image quality assessment device may further include:

[0106] a target image sequence group acquisition module, configured to acquire a target image sequence group obtained by photographing the current scene based on a preset focal length transformation method, and determine the clarity corresponding to each target image in the target image sequence group;

[0107] The image quality evaluation curve construction module is used to construct a corresponding image quality evaluation curve by using each target image in the target image sequence group and the definition corresponding to each target image in the target image sequence group.

[0108] In some specific implementations, the image quality assessment device may further include:

[0109] a target definition determining unit, configured to determine a maximum definition of the definitions corresponding to the target images in the target image sequence group as a target definition;

[0110] The target focal length determination unit is used to determine the target focal length position corresponding to the target clarity, so as to control the stepping motor to move the lens based on the target focal length position to complete the corresponding automatic focusing operation.

[0111] Furthermore, the embodiment of the present application also discloses an electronic device, Figure 8 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of this diagram should not be construed as limiting the scope of application of this application. The electronic device 20 may include at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps of the image quality assessment method disclosed in any of the aforementioned embodiments. Furthermore, the electronic device 20 in this embodiment may be a computer.

[0112] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0113] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0114] The operating system 221 is used to manage and control the hardware devices on the electronic device 20 and the computer program 222, and can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of implementing the image quality assessment method disclosed in any of the aforementioned embodiments and executed by the electronic device 20, the computer program 222 can further include a computer program capable of performing other specific tasks.

[0115] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when executed by a processor, the computer program implements the aforementioned image quality assessment method. The specific steps of this method can be referred to the corresponding contents disclosed in the aforementioned embodiments and will not be repeated here.

[0116] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.

[0117] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0118] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0119] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0120] The above is a detailed introduction to the technical solution provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the ideas of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for evaluating image quality, characterized in that: include: Acquire a target image obtained by photographing the current scene, and determine the local gradient energy of pixels in the target image; Determining a target pixel from each pixel of the target image based on a preset gradient statistics method, and accumulating target local gradient energies corresponding to the target pixel to obtain image change energy of the target image; The effective grayscale range of the target image is determined by using a preset brightness statistics method, and the image change energy is normalized based on the effective grayscale range to determine the clarity of the target image.

2. The image quality evaluation method according to claim 1, wherein: Determining the local gradient energy of a pixel point in the target image includes: Determine a first horizontal neighborhood pixel point set and a second horizontal neighborhood pixel point set for any pixel point in the target image; wherein the first horizontal neighborhood pixel point set includes each first horizontal neighborhood pixel point within a preset horizontal neighborhood range of the any pixel point, and the second horizontal neighborhood pixel point set includes each second horizontal neighborhood pixel point within the preset horizontal neighborhood range of the any pixel point, and an interval between any two adjacent first horizontal neighborhood pixel points is a preset number of pixels, the preset number is a non-zero value, and an interval between any two adjacent second horizontal neighborhood pixel points is zero pixels; Determine a first brightness sum value of the any pixel point and each of the first horizontally neighboring pixel points, and a second brightness sum value of the any pixel point and each of the second horizontally neighboring pixel points; The local gradient energy of each pixel in the target image is determined based on a difference between the first brightness sum value and the second brightness sum value.

3. The image quality evaluation method according to claim 1, wherein: The step of determining a target pixel from each pixel of the target image based on a preset gradient statistics method, and accumulating target local gradient energies corresponding to the target pixel to obtain image change energy of the target image, includes: Determining a target gradient histogram corresponding to the absolute value of the local gradient energy of each pixel in the target image based on a preset gradient histogram statistical method; The target pixel points whose absolute values ​​of the local gradient energies are within a preset target range are determined from the target gradient histogram, the target local gradient energies corresponding to the target pixel points are determined, and the target local gradient energies are accumulated and calculated to obtain the image change energy of the target image.

4. The image quality evaluation method according to claim 1, wherein: The determining the effective grayscale range of the target image by using a preset brightness statistics method includes: Determining a target brightness histogram corresponding to the number of pixels of the target image and the brightness of the target image using a preset brightness statistical method, and performing a clipping process on the target brightness histogram based on a preset clipping ratio; A brightness clipping maximum value and a brightness clipping minimum value of the target brightness histogram are determined based on the clipping result, and the effective grayscale range of the target image is determined based on the difference between the brightness clipping maximum value and the brightness clipping minimum value.

5. The image quality evaluation method according to claim 1, wherein: The normalizing the image change energy based on the effective grayscale range includes: Determining an ambient light component and a background light component corresponding to the current target image; wherein the ambient light component is determined based on the ambient light intensity of the current scene under preset lighting conditions, and the background light component is determined based on the background light intensity of the current scene under the preset lighting conditions; determining a target brightness of the target image under the preset lighting conditions based on the ambient light component and the background light component according to the original brightness of the target image, and determining a local gradient energy of the target image under the preset lighting conditions based on the target brightness; Based on the effective grayscale range, the local gradient energy under the preset lighting conditions is normalized to obtain a corresponding normalization result, so that based on the normalization result, the image change energy of the target image under the preset lighting conditions is correspondingly normalized.

6. The image quality evaluation method according to any one of claims 1 to 5, characterized in that: Also includes: Acquire a target image sequence group obtained by photographing the current scene based on a preset focal length transformation method, and determine the clarity corresponding to each target image in the target image sequence group; A corresponding image quality evaluation curve is constructed using each of the target images in the target image sequence group and the clarity corresponding to each of the target images in the target image sequence group.

7. The image quality evaluation method according to claim 6, wherein: After acquiring a target image sequence group obtained by photographing the current scene based on a preset focal length transformation method and determining the clarity corresponding to each target image in the target image sequence group, the method further includes: Determining the maximum definition of the definitions corresponding to the target images in the target image sequence group as a target definition; A target focal length position corresponding to the target clarity is determined, so as to control a stepper motor to move the lens based on the target focal length position to complete a corresponding automatic focusing operation.

8. An image quality evaluation device, characterized in that: include: A local gradient energy determination module is used to obtain a target image obtained by photographing the current scene and determine the local gradient energy of pixel points in the target image; a local gradient energy accumulation module, configured to determine a target pixel from each pixel of the target image based on a preset gradient statistics method, and accumulate and calculate the target local gradient energy corresponding to the target pixel to obtain the image change energy of the target image; The clarity determination module is used to determine the effective grayscale range of the target image using a preset brightness statistics method, and to normalize the image change energy based on the effective grayscale range to determine the clarity of the target image.

9. An electronic device, characterized in that: The electronic device includes a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the image quality assessment method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that Used to store a computer program, which, when executed by a processor, implements the image quality assessment method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Defocus blurred image definition detecting method based on edge strength weight

    CN104637064A

  • Image definition evaluation method and device, equipment and storage medium

    CN113888509A