Image quality evaluation method and device, equipment and storage medium

By calculating the local gradient energy and image change energy of the target image and standardizing it, the traditional image quality evaluation method has solved the accuracy and stability shortcomings, and achieved more efficient and accurate image quality evaluation.

CN119649199AActive Publication Date: 2025-03-18CHANGCHUN INST OF OPTICS FINE MECHANICS & PHYSICS CHINESE ACAD OF SCI
View PDF 8 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Traditional image quality evaluation methods are difficult to meet the properties of unimodality, unbiasedness, stability, high sensitivity and small calculations at the same time, and are easily disturbed by noise and background light, resulting in low accuracy.

Method used

By acquiring the local gradient energy of the target image, determining the target pixel points based on the preset gradient statistics method and cumulatively calculating the image change energy, the effective grayscale range is determined using the preset brightness statistics method and the image change energy is standardized to determine the sharpness of the image.

Benefits of technology

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

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119649199A_ABST
    Figure CN119649199A_ABST
Patent Text Reader

Abstract

The invention discloses an image quality evaluation 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 target image obtained by photographing a current scene, and determining the local gradient energy of pixel points in the target image; determining a target pixel point from the pixel points of the target image based on a preset gradient statistical mode, and performing accumulation calculation on target local gradient energy corresponding to the target pixel point to obtain image change energy of the target image; and determining an effective gray scale range of the target image by using a preset brightness statistical mode, and performing standardization processing on the image change energy based on the effective gray scale range to determine the definition of the target image. Therefore, the influence of noise on image quality evaluation is reduced by using the local gradient, and the influence of illumination variation on image quality evaluation is reduced by using the effective gray scale range standardization, so that the image quality evaluation is accurately carried out.
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 disturbed by various external factors, such as temperature and air pressure changes, shock and vibration, which can cause the system to defocus and produce defocus blur. Therefore, defocus is one of the common situations in which the image quality of optical imaging systems deteriorates. The impact it brings cannot be ignored and is a problem that must be solved in optical imaging systems. The automatic focusing technology is to keep the image plane of the target always on the focal plane of the image sensor. According to the optical transmission characteristics of the optical device, the optical system automatically adjusts the position of the target image plane along the optical axis to ensure the optical system's ability to observe and capture the target, and improve the quality of the image captured by the image sensor. 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.

[0003] Traditional image quality evaluation methods perform automatic focusing of cameras, but it is 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 evaluation method, device, equipment and storage medium, which can accurately evaluate the quality of the image. The specific scheme 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 pixel points in the target image;

[0008] Determine a target pixel from each pixel of the target image based on a preset gradient statistics method, and perform cumulative calculation on the target local gradient energy corresponding to the target pixel to obtain the 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 standardized 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 of 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, 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;

[0012] Determine a first brightness sum value of the any pixel point and each of the first transverse neighboring pixel points, and a second brightness sum value of the any pixel point and each of the second transverse 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, the 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 includes:

[0015] Determine a target gradient histogram corresponding to the absolute value of the local gradient energy of each pixel point 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] 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 perform interception processing on the target brightness histogram based on a preset interception 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] Determine the ambient light component and the 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 preset lighting conditions, and the background light component is determined according to the background light intensity of the current scene under the preset lighting conditions;

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

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

[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 by using each of the target images in the target image sequence group and the definition 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 definition corresponding to each target image in the target image sequence group, the method further includes:

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

[0029] The target focal length position corresponding to the target definition is determined, 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.

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

[0031] A local gradient energy determination module, 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, used for 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;

[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 standardize 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, including:

[0035] Memory, used to store computer programs;

[0036] The processor is used to execute the computer program to implement the aforementioned image quality assessment 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 assessment method is implemented.

[0038] In the present application, firstly, 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 standardized 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 standardized using the effective grayscale range. In this way, the local gradient energy is used to calculate the image change 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 used to standardize the image, which reduces 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 drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying 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 for this application;

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

[0043] Figure 4 A specific image quality evaluation method flow chart provided for this application;

[0044] Figure 5 A specific image quality evaluation method flow chart provided for this application;

[0045] Figure 6 A schematic diagram of 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 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. 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 creative work 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 amount of calculation for automatic focusing of the camera. At the same time, the results of image quality evaluation are often interfered by noise and background stray 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 the image.

[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 the pixel points 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 pixels of the digital image 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 the 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 used 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 preprocessing 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 sum of the lateral neighborhood of , complete the calculation of gradient energy.

[0055] It should be noted that, in order to reduce the influence 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 value of any pixel point and each first horizontal neighborhood pixel point, and the second brightness sum value 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 value and the second brightness sum value. Specifically, the image clarity evaluation function improved by using the local gradient energy can be expressed as:

[0056] , ;

[0057] Among them, step represents the interval between pixels in the target image. Indicates the preset lateral neighborhood range, Represents the first lateral neighboring pixel set of any pixel point, represents the second horizontal neighboring pixel set of any pixel. In this embodiment, step=4 can be set, that is, the brightness 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 the smooth area in the natural image usually accounts for a large proportion, that is, the gradient energy of most areas is small, and the main component of the local gradient energy in the natural image 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 determination of the target pixel from each pixel of the target image based on the preset gradient statistics method, and the cumulative calculation of the target local gradient energy 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 the preset target range from the target gradient histogram, and determining the target local gradient energy corresponding to the target pixel, and accumulating the target local gradient energy 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 according to 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 point within the preset target range can be selected for cumulative calculation. In a specific implementation, 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 cumulatively calculated. Specifically, the image clarity evaluation function determined by the target local gradient energy can be expressed as:

[0060] , ;

[0061] in, Indicates that all Sort from large to small, and the top 5% of local gradient energies are the target local gradient energies. By statistically analyzing the local gradient energy histogram, the target local gradient energy can be quickly determined without the need to sort the local gradient energy. The image clarity evaluation function is determined by the target local gradient energy, which avoids the interference of noise in the smooth area on the overall image clarity evaluation function, and reduces the impact of noise in the edge and detail areas on the gradient calculation, without excessively increasing the computational complexity of the algorithm.

[0062] Step S13: Determine the effective grayscale range of the target image by using a preset brightness statistics method, and standardize 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 by using a preset brightness statistical method may include: determining a target brightness histogram corresponding to the number of pixels of the target image and the brightness of the target image by using a preset brightness statistical method, and performing a clipping process on the target brightness histogram based on a preset clipping ratio; determining the brightness clipping maximum value and the brightness clipping minimum value 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 brightness clipping maximum value and the brightness clipping minimum value. See 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 interception ratio, the number of pixels with a small number and a large number of grayscale levels at both ends of the target brightness histogram is intercepted. Specifically, it can be set to intercept pixels at both ends that account for 1% of the total number of pixels; finally, the intercepted values ​​at the left and right ends, that is, the maximum intercepted brightness value and the minimum intercepted brightness value, are used as the effective maximum brightness value and the 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 the 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; determining the target brightness of the target image under the preset illumination conditions based on the ambient light component and the background light component according to the original brightness of the target image, 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 can be understood that illumination affects the brightness amplitude of each pixel in the target image. Therefore, according to the Retinex theory (Retinex, 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 follows:

[0065] ;

[0066] in, Indicates the target brightness of the target image under 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 the 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] Afterwards, the image change energy of the target image under the preset lighting conditions can be correspondingly standardized based on the standardized processing result of the local gradient energy of the target image under the preset lighting conditions. By standardizing the image change energy of the target image under the preset lighting conditions, the influence of ambient light and background light caused by lighting changes can be eliminated, thereby reducing the influence of lighting on image quality evaluation.

[0076] See also Figure 4 As shown, in a specific implementation, 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, the target pixel point is determined from each pixel point of the target image based on a preset gradient statistical 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 statistical method, and the image change energy is standardized 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 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 standardized using the effective grayscale range. In this way, the local gradient energy is used to calculate the image change 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 used to standardize the image, which reduces 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 influence of noise on image quality evaluation, and uses effective grayscale range standardization to reduce the influence of illumination change on image quality evaluation, thereby accurately evaluating the image quality. Next, the image quality evaluation method will be tested in this embodiment. 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, and 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, the exposure, white balance and other parameters of the camera can be adjusted according to the current scene light and shooting requirements. At the same time, ensure that the camera is stable to avoid shaking during shooting. After that, the focal length of the camera can be continuously changed from far to near to shoot the current scene to obtain a set of clear target images with smooth focal length changes. In order to test the performance of the image quality evaluation method, the image clarity evaluation function and the improved grayscale difference focusing method (SMD2, Gray-scale Difference Product Method) can be used to determine the clarity of each target image in the target image sequence group, and the image quality evaluation curve is determined respectively. It can be understood that the image quality evaluation curve corresponding to the target image sequence group determined by the image clarity evaluation function has obvious unimodality and consistency compared with the image quality evaluation curve corresponding to the target image sequence group determined by the grayscale difference focusing method, and the grayscale difference focusing method cannot determine the clarity of the target image under the condition of changing illumination.

[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 definition of each target image in the target image sequence group is determined by using an image definition evaluation function. The definition values ​​of all target images are compared to find the maximum definition, and the maximum definition found is set as the target definition. The target definition represents the highest definition level that can be achieved in the entire target image sequence group. Figure 6 As shown, sub-images (a)-(f) are the 3rd, 48th, 90th, 142nd, 190th, and 252nd images in the target image sequence group, respectively. It can be seen that it is a process of partially clear, blurred, clear, and then blurred again, which contains obvious changes in illumination and the influence of noise. Visually, it can be determined that the 142nd image is the best focus position.

[0083] Step S23: determining a target focal length position corresponding to the target definition, so as to control a stepper motor to move a 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 group based on the target definition, and a target focal position corresponding to the target image is determined. Then, parameters such as the step angle and the maximum rotation speed of the stepper motor need to be determined. According to the difference between the target focal position and the focal position of the current stepper motor, the number and frequency of pulses to be sent to the stepper motor are calculated, and a corresponding control signal is generated, wherein the control signal includes a pulse signal and a direction signal. Then, the generated control signal is sent to the stepper motor driver, and the driver then drives the stepper motor to rotate a specified angle in a set direction. In the process of the stepper motor moving the lens, the definition of the image can be collected in real time for feedback. If it is found that the definition of the image does not meet expectations or deviates from the target definition, the control signal of the stepper motor can be adjusted in time for fine-tuning. After the automatic focusing operation is completed, the stability of the focal length of the optical device can be maintained by locking the position of the stepper motor or reducing the rotation speed of the stepper motor.

[0085] As can be seen from the above, in this embodiment, the target image sequence group corresponding to the current scene is first obtained, and the clarity corresponding to each target image in the target image sequence group is determined, and the corresponding image quality evaluation curve is constructed. In this way, the performance test results of the image quality evaluation method of this embodiment can be obtained. At the same time, in this embodiment, the target clarity is determined from the clarity corresponding to each target image, and the target focal position is determined according to the target clarity, so that the automatic focusing operation of the optical device can be completed according to the target focal position. In this way, the optical device can be prevented from producing out-of-focus blur, the optical device can ensure the ability to observe and capture the target, and improve the quality of the image captured by the image sensor.

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

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

[0088] A local gradient energy accumulation module 12 is used to determine a target pixel from each pixel of the target image based on a preset gradient statistics method, and to 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 used to determine the effective grayscale range of the target image by 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, firstly, 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 standardized 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 standardized using the effective grayscale range. In this way, the local gradient energy is used to calculate the image change 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 used to standardize the image, which reduces 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, used to determine a first horizontal neighborhood pixel point set and a 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 a preset horizontal neighborhood range of the any pixel point, 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;

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

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

[0095] In some specific implementations, 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 point in the target image based on a preset gradient histogram statistical method;

[0097] A local gradient energy accumulation unit is used to determine the target pixel point whose absolute value of the local gradient energy is within a preset target range from the target gradient histogram, determine the target local gradient energy corresponding to the target pixel point, and accumulate the target local gradient energy 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, used to determine a target brightness histogram corresponding to the number of pixels of the target image and the brightness of the target image by using a preset brightness statistics method, and intercept the target brightness histogram based on a preset interception ratio;

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

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

[0102] An ambient light component determination unit, used to determine 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 preset lighting conditions, and the background light component is determined according to the background light intensity of the current scene under the preset lighting conditions;

[0103] a target brightness determination unit, configured to determine the 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 the local gradient energy of the target image under the preset lighting conditions based on the target brightness;

[0104] The 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 is used 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 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.

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

[0109] a target definition determination unit, configured to determine the maximum definition of the definitions corresponding to the target images in the target image sequence group as the 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 present application also discloses an electronic device. Figure 8 : is a structural diagram of an electronic device 20 according to an exemplary embodiment, and the content in the figure cannot be regarded as any limitation on the scope of use of this application. The electronic device 20 may specifically 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 in the image quality evaluation method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0112] In this embodiment, the power supply 23 is used to provide working 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, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present 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, and 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 storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, 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 and computer program 222 on the electronic device 20, and can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the image quality evaluation method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.

[0115] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the image quality evaluation method disclosed above. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the above embodiments, and no further description will be given here.

[0116] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[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 composition and steps of each example have been generally described in the above description according to function. 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 to be beyond the scope of this application.

[0118] The steps of the method or algorithm 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 a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, 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 article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0120] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article 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 general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method 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 pixel points in the target image; Determine a target pixel from each pixel of the target image based on a preset gradient statistics method, and perform cumulative calculation on the target local gradient energy corresponding to the target pixel to obtain the 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 standardized based on the effective grayscale range to determine the clarity of the target image.

2. The image quality evaluation method according to claim 1, characterized in that: The determining the local gradient energy of the pixel points in the target image includes: Determine a first horizontal neighborhood pixel point set and a 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 a preset horizontal neighborhood range of the any pixel point, 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; Determine a first brightness sum value of the any pixel point and each of the first transverse neighboring pixel points, and a second brightness sum value of the any pixel point and each of the second transverse 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, characterized in that: The step of 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 includes: Determine a target gradient histogram corresponding to the absolute value of the local gradient energy of each pixel point 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, characterized in that: The determining the effective grayscale range of the target image by using a preset brightness statistics method includes: 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 perform interception processing on the target brightness histogram based on a preset interception ratio; The maximum brightness clipping value and the minimum brightness clipping 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 maximum brightness clipping value and the minimum brightness clipping value.

5. The image quality evaluation method according to claim 1, characterized in that: The normalizing process of the image change energy based on the effective grayscale range includes: Determine the ambient light component and the 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 preset lighting conditions, and the background light component is determined according to the background light intensity of the current scene under the preset lighting conditions; Determine the target brightness of the target image under the preset lighting condition based on the ambient light component and the background light component according to the original brightness of the target image, and determine the local gradient energy of the target image under the preset lighting condition based on the target brightness; Based on the effective grayscale range, the local gradient energy under the preset lighting condition is normalized to obtain a corresponding normalization result, so as to perform corresponding normalization on the image change energy of the target image under the preset lighting condition based on the normalization result.

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 by using each of the target images in the target image sequence group and the definition corresponding to each of the target images in the target image sequence group.

7. The image quality evaluation method according to claim 6, characterized in that: 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: Determine the maximum definition of the definitions corresponding to the target images in the target image sequence group as the target definition; The target focal length position corresponding to the target definition is determined, 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.

8. An image quality evaluation device, characterized in that: include: A local gradient energy determination module, 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, used for 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; The clarity determination module is used to determine the effective grayscale range of the target image using a preset brightness statistics method, and to standardize 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 comprises 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

  • Image processing method and device, storage medium and electronic device

    CN114187193A

  • Image type determination method and device, storage medium and electronic device

    CN114820614A

  • Space environment high dynamic range imaging method based on local area brightness adjustment

    CN114998173A