No-reference image definition evaluation method, electronic equipment and readable storage medium

By identifying pixel points with significant brightness changes in grayscale images and counting their number, the problem of image clarity evaluation in complex backgrounds and low-contrast scenes is solved, and efficient and real-time clarity evaluation is achieved.

CN119941639APending Publication Date: 2025-05-06SHICHEN INFORMATION TECH SHANGHAI CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411912281.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

In complex backgrounds or low contrast scenarios, deep learning-based models have limited generalization capabilities and poor real-time performance.

Method used

By acquiring the grayscale image of the image to be evaluated, pixel points whose horizontal brightness changes exceed a preset threshold are identified, and the sharpness of the image is determined based on the number of these pixel points.

Benefits of technology

It realizes efficient and real-time evaluation of image clarity in complex backgrounds and low-contrast images, and is suitable for multi-scene applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119941639A_ABST
    Figure CN119941639A_ABST
Patent Text Reader

Abstract

The invention provides a no-reference image definition evaluation method, electronic equipment and a readable storage medium, and belongs to the technical field of image processing. The no-reference image definition evaluation method comprises the following steps: firstly, acquiring a gray level image of a to-be-evaluated image; secondly, identifying a first pixel point and a second pixel point according to the gray value of each pixel point in the gray image, so as to accurately extract the edge and contour features of the gray image and effectively filter the noise in the low-brightness change area; meanwhile, a third pixel point and a fourth pixel point are recognized, so that clear and remarkable edge features in the gray level image can be recognized, and particularly, regions with high brightness change and low sharpness are removed; finally, based on the number of the first pixel points, the number of the second pixel points, the number of the third pixel points and the number of the fourth pixel points, the definition of the to-be-evaluated image is quantitatively evaluated, and the method is suitable for complex background and low-contrast images and has high real-time performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method for evaluating the clarity of a reference-free image, an electronic device, and a readable storage medium. Background Art

[0002] With the rapid development of digital image processing and computer vision technology, the importance of image clarity evaluation in fields such as 3D reconstruction, augmented reality, and virtual reality has become increasingly prominent. However, in practical applications, due to dynamic environments or low light conditions, it is often impossible to obtain original clear images as references. Therefore, how to accurately evaluate image clarity without reference images has gradually become a research hotspot in the field of computer vision.

[0003] In the related technologies, the methods for evaluating the clarity of images without reference mainly use traditional algorithms based on frequency domain analysis and models based on deep learning. Traditional algorithms (such as Laplace variance and Brenner gradient) evaluate clarity by analyzing image gradients or frequency characteristics. These methods perform well in simple scenes (such as images with uniform illumination and clear textures), but their clarity evaluation results are often not accurate enough in complex backgrounds (such as dynamic environments, low-light conditions) or low-contrast scenes. Although the models based on deep learning can automatically learn image features and show high evaluation accuracy in specific tasks, their generalization ability is limited, and they perform poorly on images outside the training data set. At the same time, the computational complexity is high, making it difficult to meet real-time requirements.

[0004] Therefore, in complex backgrounds or low-contrast scenes, the limited generalization ability and poor real-time performance of deep learning-based models have become problems that need to be urgently addressed. Summary of the invention

[0005] The present application provides a reference-free image clarity evaluation method, an electronic device, and a readable storage medium to solve the problems in the prior art of limited generalization ability and poor real-time performance of deep learning-based models under complex backgrounds or low-contrast scenes.

[0006] In a first aspect, the present application provides a method for evaluating image clarity without reference, comprising:

[0007] Obtain a grayscale image of the image to be evaluated;

[0008] According to the grayscale data of each pixel in the grayscale image, determine a first pixel whose horizontal brightness change exceeds a first preset threshold, a second pixel whose vertical brightness change exceeds a second preset threshold, a third pixel whose horizontal brightness change exceeds the first preset threshold and whose horizontal sharpness change exceeds a third preset threshold, and a fourth pixel whose vertical brightness change exceeds the second preset threshold and whose vertical sharpness change exceeds a fourth preset threshold;

[0009] The clarity of the image to be evaluated is determined according to the number of the first pixel points, the number of the second pixel points, the number of the third pixel points, and the number of the fourth pixel points.

[0010] In a possible design, determining the clarity of the image to be evaluated according to the number of the first pixels, the number of the second pixels, the number of the third pixels, and the number of the fourth pixels includes:

[0011] Determine a ratio of the number of the third pixel points to the number of the first pixel points as a first ratio;

[0012] Determine a ratio of the number of the fourth pixel points to the number of the second pixel points as a second ratio;

[0013] The clarity of the image to be evaluated is determined according to the first ratio and the second ratio.

[0014] In a possible design, determining the clarity of the image to be evaluated according to the first ratio and the second ratio includes:

[0015] calculating a square root of the first ratio and the second ratio;

[0016] The arithmetic root mean square is determined as the clarity of the image to be evaluated.

[0017] In a possible design, determining, according to the grayscale data of each pixel in the grayscale image, a first pixel whose horizontal brightness change exceeds a first preset threshold, a second pixel whose vertical brightness change exceeds a second preset threshold, a third pixel whose horizontal brightness change exceeds the first preset threshold and whose horizontal sharpness change exceeds a third preset threshold, and a fourth pixel whose vertical brightness change exceeds the second preset threshold and whose vertical sharpness change exceeds a fourth preset threshold, includes:

[0018] For each pixel in the grayscale image, determine a first horizontal gradient and a first vertical gradient of the pixel, and determine a pixel whose first horizontal gradient exceeds the first preset threshold as the first pixel, and determine a pixel whose first vertical gradient exceeds the second preset threshold as the second pixel;

[0019] For each pixel in the grayscale image, determine the horizontal sharpness and vertical sharpness of the pixel, and determine the first pixel whose horizontal sharpness exceeds the third preset threshold as the third pixel, and determine the second pixel whose vertical sharpness exceeds the fourth preset threshold as the fourth pixel.

[0020] In a possible design, determining, for each pixel in the grayscale image, a first horizontal gradient and a first vertical gradient of the pixel includes:

[0021] For each pixel in the grayscale image, determining an absolute value of a grayscale difference between a first target pixel and a second target pixel in the grayscale image as a first horizontal gradient of the pixel; wherein the first target pixel and the second target pixel are both adjacent to the pixel in a horizontal direction, and the first target pixel is located on the right side of the pixel, and the second target pixel is located on the left side of the pixel;

[0022] For each pixel in the grayscale image, the absolute value of the grayscale difference between the third target pixel and the fourth target pixel in the grayscale image is determined as the first vertical gradient of the pixel; wherein the third target pixel and the fourth target pixel are both adjacent to the pixel in the vertical direction, and the third target pixel is located above the pixel, and the fourth target pixel is located below the pixel.

[0023] In a possible design, determining, for each pixel in the grayscale image, the horizontal sharpness and the vertical sharpness of the pixel includes:

[0024] For each pixel in the grayscale image, determine the horizontal contrast, vertical contrast, second horizontal gradient and second vertical gradient of the pixel; wherein the second horizontal gradient is the second-order horizontal gradient of the pixel, and the second vertical gradient is the second-order vertical gradient of the pixel;

[0025] Determining the horizontal sharpness of the pixel point according to the horizontal contrast and the second horizontal gradient;

[0026] The vertical sharpness of the pixel is determined according to the vertical contrast and the second vertical gradient.

[0027] In a possible design, determining, for each pixel in the grayscale image, a horizontal contrast, a vertical contrast, a second horizontal gradient, and a second vertical gradient of the pixel includes:

[0028] For each pixel in the grayscale image, determining the absolute value of the grayscale difference between the pixel and a fifth target pixel in the grayscale image as the horizontal contrast of the pixel; wherein the fifth target pixel is adjacent to the pixel in the horizontal direction and is located on the left side of the pixel;

[0029] Determine the absolute value of the grayscale difference between the pixel point and a sixth target pixel point in the grayscale image as the vertical contrast of the pixel point; wherein the sixth target pixel point is adjacent to the pixel point in the vertical direction and the sixth target pixel point is located below the pixel point;

[0030] Determine a second horizontal gradient of the pixel point according to the grayscale value of the pixel point, the grayscale value of a seventh target pixel point in the grayscale image, and the grayscale value of an eighth target pixel point; wherein the seventh target pixel point and the eighth target pixel point are both spaced one pixel apart from the pixel point in the horizontal direction, and the seventh target pixel point is located on the right side of the pixel point, and the eighth target pixel point is located on the left side of the pixel point;

[0031] The second vertical gradient of the pixel point is determined according to the grayscale value of the pixel point, the grayscale value of the ninth target pixel point in the grayscale image, and the grayscale value of the tenth target pixel point; wherein the ninth target pixel point and the tenth target pixel point are both spaced one pixel apart from the pixel point in the vertical direction, and the ninth target pixel point is located above the pixel point, and the tenth target pixel point is located below the pixel point.

[0032] In a possible design, determining the horizontal sharpness of the pixel point according to the horizontal contrast and the second horizontal gradient includes:

[0033] For each pixel point in the grayscale image, a sum of second horizontal gradients of a plurality of eleventh pixel points corresponding to the pixel point and a sum of horizontal contrasts are obtained; wherein the eleventh pixel point is located within a first range corresponding to the pixel point;

[0034] The ratio of the sum of the second horizontal gradients to the sum of the horizontal contrasts is determined as the horizontal sharpness of the pixel.

[0035] In a second aspect, the present application provides a device for evaluating clarity of a reference-free image, comprising: a module for executing the method embodiment of the first aspect described above.

[0036] In a third aspect, the present application provides an electronic device, including: a memory and at least one processor;

[0037] The memory stores computer-executable instructions;

[0038] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method described in the first aspect or various possible designs of the first aspect.

[0039] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When the computer execution instructions are executed, the method described in the first aspect or various possible designs of the first aspect is implemented.

[0040] In a fifth aspect, the present application provides a computer program product, which includes a computer program code. When the computer program code runs on a computer, the computer implements the method described in the first aspect or various possible designs of the first aspect.

[0041] The embodiment of the present application provides a method for evaluating the clarity of a reference-free image, an electronic device, and a readable storage medium. In the method for evaluating the clarity of a reference-free image, first, a grayscale image of the image to be evaluated is obtained to retain the brightness information of the image and remove the interference of color, so that the subsequent feature extraction process is more stable and efficient; secondly, according to the grayscale value of each pixel in the grayscale image, a first pixel whose horizontal brightness change exceeds a first preset threshold and a second pixel whose vertical brightness change exceeds a second preset threshold are identified, so as to accurately extract the edge and contour features of the grayscale image and effectively filter the noise in the low brightness change area; at the same time, a third pixel whose horizontal brightness change exceeds the first preset threshold and the horizontal sharpness change exceeds the third preset threshold and a fourth pixel whose vertical brightness change exceeds the second preset threshold and the vertical sharpness change exceeds the fourth preset threshold are further identified, so as to identify clear and significant edge features in the grayscale image, especially to eliminate those areas with high brightness change but low sharpness; finally, based on the number of the first pixel, the number of the second pixel, the number of the third pixel, and the number of the fourth pixel, the distribution of these characteristic pixel points is comprehensively counted to quantitatively evaluate the clarity of the image to be evaluated. Through the method of the present application, the clarity of the image to be evaluated can be evaluated efficiently and in real time, which is especially suitable for complex backgrounds and low-contrast images. At the same time, with the help of simple and efficient statistics and proportional calculations, it has high real-time performance and is suitable for multi-scenario applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 A flowchart of a method for evaluating image clarity without reference provided by an embodiment of the present application;

[0043] Figure 2 A schematic flow chart of another method for evaluating image clarity without reference provided in an embodiment of the present application;

[0044] Figure 3 A schematic flow chart of another method for evaluating image clarity without reference provided in an embodiment of the present application;

[0045] Figure 4A flowchart of another method for evaluating image clarity without reference provided in an embodiment of the present application;

[0046] Figure 5 A schematic diagram of the structure of a device for evaluating image clarity without reference provided in an embodiment of the present application;

[0047] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0049] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs; the terms used in the specification of the application are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification, claims and drawings of this application are intended to cover non-exclusive inclusions.

[0050] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase "embodiments" in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0051] The term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists, A and B can exist at the same time, and B exists. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0052] In addition, the terms "first", "second", etc. in the specification and claims of this application or the above-mentioned drawings are used to distinguish different objects rather than to describe a specific order, and may explicitly or implicitly include one or more of the features.

[0053] In the description of this application, unless otherwise specified, "multiple" and "at least two" mean more than two (including two). Similarly, "multiple groups" and "at least two groups" mean more than two groups (including two).

[0054] In the description of this application, it should be noted that, unless otherwise clearly specified and limited, the terms "connected" and "connection" should be understood in a broad sense. For example, "connected" or "connection" can refer to not only physical connection, but also electrical connection or signal connection. For example, it can be directly connected, that is, physically connected, or indirectly connected through at least one intermediate element, as long as the circuit is connected, or it can be the internal connection of two elements; signal connection can refer to signal connection through a circuit or through a media medium, such as radio waves. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0055] In order to make those skilled in the art better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the accompanying drawings. It should be noted that different technical features in the present application can be combined with each other without conflict.

[0056] Next, some specific embodiments and drawings are used to describe in detail how the present application solves the problems in the prior art of limited generalization ability and poor real-time performance of deep learning-based models in complex backgrounds or low-contrast scenes.

[0057] Figure 1 The following is a flow chart of a method for evaluating image clarity without reference provided by an embodiment of the present application. Figure 1 As shown, the no-reference image clarity evaluation method provided in the embodiment of the present application specifically includes S101 to S103, and S101 to S103 are described in detail below.

[0058] It should be noted that the execution subject of the non-reference image clarity assessment method provided in the embodiment of the present application may be a non-reference image clarity assessment device.

[0059] S101: Obtain a grayscale image of an image to be evaluated.

[0060] The image to be evaluated may be a color image or a grayscale image, which is not specifically limited in this embodiment.

[0061] A color image refers to an RGB image in which each pixel includes color information of three channels: red, green, and blue, while a grayscale image refers to an image in which each pixel includes only one brightness value (i.e., grayscale value) used to represent the grayscale intensity.

[0062] The evaluation of image clarity mainly focuses on and analyzes the brightness information of the image, such as the edge, texture, and details, while the color information of the image is relatively redundant and may interfere with the evaluation process. Therefore, using grayscale images as evaluation objects can retain key brightness information, reduce redundant data, help reduce computational complexity, and accelerate image processing algorithms.

[0063] In one embodiment of the present application, when the image to be evaluated is a grayscale image, subsequent clarity evaluation is performed directly on the basis of the image to be evaluated.

[0064] In another embodiment of the present application, when the image to be evaluated is a color image, a suitable grayscale method can be selected to remove color information in the image to be evaluated and convert it into a grayscale image.

[0065] It should be noted that the method of graying a color image includes but is not limited to the existing weighted average method, brightness method, average method, etc. In actual operation, a suitable graying method can be selected according to task requirements and image characteristics, and this embodiment does not make specific limitations for comparison.

[0066] In another embodiment of the present application, after obtaining the grayscale image of the image to be evaluated, a suitable denoising method can be selected to denoise the grayscale image of the image to be evaluated to obtain the denoised grayscale image, and subsequent clarity evaluation can be performed based on the denoised grayscale image.

[0067] It should be noted that the methods for denoising grayscale images include but are not limited to existing median filtering methods, Gaussian filtering methods, bilateral filtering methods, etc. In actual operations, a suitable denoising method can be selected according to task requirements and image characteristics, and this embodiment does not make specific limitations for comparison.

[0068] In this embodiment, by performing denoising on the grayscale image, the interference of noise on the subsequent calculation results of the first horizontal gradient, the first vertical gradient, the horizontal sharpness and the vertical sharpness is reduced, thereby making the clarity evaluation result of the image to be evaluated more accurate.

[0069] S102. Based on the grayscale data of each pixel in the grayscale image, determine a first pixel whose horizontal brightness change exceeds a first preset threshold, a second pixel whose vertical brightness change exceeds a second preset threshold, a third pixel whose horizontal brightness change exceeds the first preset threshold and whose horizontal sharpness change exceeds a third preset threshold, and a fourth pixel whose vertical brightness change exceeds the second preset threshold and whose vertical sharpness change exceeds a fourth preset threshold.

[0070] The first preset threshold is used to indicate the preset horizontal gradient. The first preset threshold can be set by the user according to actual needs, and this embodiment does not specifically limit this.

[0071] For example, the first preset threshold is 50.

[0072] It should be noted that, for any pixel in the grayscale image, when the horizontal brightness change of the pixel exceeds the first preset threshold, it means that the pixel has a significant brightness change in the horizontal direction and belongs to the edge area of ​​the grayscale image. Therefore, the pixel is determined as the first pixel.

[0073] The second preset threshold is used to indicate a preset vertical gradient. The second preset threshold can be set by the user according to actual needs, and this embodiment does not specifically limit this.

[0074] For example, the second preset threshold is 50.

[0075] It should be noted that, for any pixel in the grayscale image, when the vertical brightness change of the pixel exceeds the second preset threshold, it means that the pixel has a significant brightness change in the vertical direction and belongs to the edge area of ​​the grayscale image. Therefore, the pixel is determined as the second pixel.

[0076] The third preset threshold is used to indicate a preset horizontal sharpness. The third preset threshold can be set by the user according to actual needs, and this embodiment does not specifically limit this.

[0077] For example, the third preset threshold is 3.

[0078] It should be noted that, for any first pixel in a grayscale image, when the horizontal sharpness change of the first pixel exceeds the third preset threshold, it means that the first pixel has a significant brightness change and a large sharpness change in the horizontal direction, which is a clear and significant edge feature in the grayscale image. Therefore, the first pixel is determined as the third pixel.

[0079] In this embodiment, the third pixel point is part or all of the first pixel points.

[0080] The fourth preset threshold is used to indicate a preset vertical sharpness. The fourth preset threshold can be set by the user according to actual needs, and this embodiment does not specifically limit this.

[0081] For example, the fourth preset threshold is 3.

[0082] It should be noted that, for any second pixel in the grayscale image, when the vertical sharpness change of the second pixel exceeds the fourth preset threshold, it means that the second pixel has a significant brightness change and a large sharpness change in the vertical direction, which is a clear and significant edge feature in the grayscale image. Therefore, the second pixel is determined as the fourth pixel.

[0083] In this embodiment, the fourth pixel point is part or all of the second pixel points.

[0084] S103 . Determine the clarity of the image to be evaluated according to the number of the first pixel points, the number of the second pixel points, the number of the third pixel points, and the number of the fourth pixel points.

[0085] Among them, the number of the first pixel points is M1, the number of the second pixel points is M2, the number of the third pixel points is M3, and the number of the fourth pixel points is M4. By quantitatively evaluating M1, M2, M3 and M4, the clarity S of the image to be evaluated can be obtained.

[0086] It should be noted that the size of the clarity S reflects the clarity of the image to be evaluated. The larger the S is, the more clear and significant edge features there are in the image to be evaluated, and the higher the overall clarity of the image to be evaluated; the smaller the S is, the fewer clear and significant edge features there are in the image to be evaluated, and the lower the overall clarity of the image to be evaluated.

[0087] The embodiment of the present application provides a method for evaluating the clarity of a reference-free image. First, a grayscale image of an image to be evaluated is obtained to retain the brightness information of the image and remove the interference of color, so that the subsequent feature extraction process is more stable and efficient. Secondly, according to the grayscale value of each pixel in the grayscale image, a first pixel whose horizontal brightness change exceeds a first preset threshold and a second pixel whose vertical brightness change exceeds a second preset threshold are identified, so as to accurately extract the edge and contour features of the grayscale image and effectively filter the noise in the low brightness change area. At the same time, a third pixel whose horizontal brightness change exceeds the first preset threshold and the horizontal sharpness change exceeds the third preset threshold and a fourth pixel whose vertical brightness change exceeds the second preset threshold and the vertical sharpness change exceeds the fourth preset threshold are further identified, so as to identify clear and significant edge features in the grayscale image, especially to eliminate those areas with high brightness changes but low sharpness. Finally, based on the number of the first pixel, the number of the second pixel, the number of the third pixel and the number of the fourth pixel, the distribution of these characteristic pixel points is comprehensively counted to quantitatively evaluate the clarity of the image to be evaluated. Through the method of the present application, the clarity of the image to be evaluated can be evaluated efficiently and in real time, which is especially suitable for complex backgrounds and low-contrast images. At the same time, with the help of simple and efficient statistics and proportional calculations, it has high real-time performance and is suitable for multi-scenario applications.

[0088] In the above embodiment, it is necessary to determine the clarity S of the image to be evaluated according to the number M1 of the first pixel points, the number M2 of the second pixel points, the number M3 of the third pixel points, and the number M4 of the fourth pixel points. Next, the specific process of determining the clarity S of the image to be evaluated according to the number M1 of the first pixel points, the number M2 of the second pixel points, the number M3 of the third pixel points, and the number M4 of the fourth pixel points is described in detail.

[0089] Figure 2 A flowchart of another method for evaluating image clarity without reference provided by an embodiment of the present application is shown below. Figure 2 As shown, in a possible embodiment, the method steps shown in S103 above can be implemented through S1031 to S1033, and S1031 to S1033 are described in detail below.

[0090] S1031. Determine a ratio of the number of third pixel points to the number of first pixel points as a first ratio.

[0091] It should be noted that according to the formula The first ratio Rx can be calculated.

[0092] In this embodiment, the first ratio Rx is used to indicate the proportion of pixel points having clear and significant edge features (sharp edge features) to the total edge pixel points in the horizontal direction of the grayscale image.

[0093] S1032: Determine a ratio of the number of fourth pixel points to the number of second pixel points as a second ratio.

[0094] It should be noted that according to the formula The second ratio Ry can be calculated.

[0095] In this embodiment, the second ratio Ry is used to indicate the proportion of pixel points having clear and significant edge features (sharp edge features) to the total edge pixel points in the vertical direction of the grayscale image.

[0096] S1033. Determine the clarity of the image to be evaluated according to the first ratio and the second ratio.

[0097] In the embodiment of the present application, by calculating the first ratio Rx and the second ratio Ry, the proportion of sharp edges in the grayscale image in the total edges is quantified, thereby accurately reflecting the clarity of the grayscale image and ensuring that the clarity evaluation result of the grayscale image is more comprehensive and consistent.

[0098] In the above embodiment, the clarity S of the image to be evaluated needs to be determined according to the first ratio Rx and the second ratio Ry. Next, the specific process of determining the clarity S of the image to be evaluated according to the first ratio Rx and the second ratio Ry is described in detail.

[0099] Figure 3 A flowchart of another method for evaluating image clarity without reference provided by an embodiment of the present application is shown below. Figure 3 As shown, in a possible embodiment, the method steps shown in the above S1033 can be implemented by Sa1 and Sa2, and Sa1 and Sa2 are described in detail below.

[0100] Sa1. Calculate the arithmetic root mean square of the first ratio and the second ratio.

[0101] It should be noted that according to the formula The arithmetic root mean square of the first ratio Rx and the second ratio Ry can be calculated.

[0102] Sa2. Determine the arithmetic root mean square as the clarity of the image to be evaluated.

[0103] It should be noted that the clarity S of the image to be evaluated is the arithmetic mean square root of the first ratio and the second ratio, that is,

[0104] In the embodiment of the present application, by performing an arithmetic root mean square operation on the first ratio Rx and the second ratio Ry, the clarity S of the image to be evaluated is obtained, which can ensure that the clarity of the image to be evaluated covers both the clarity features in the horizontal direction and the clarity features in the vertical direction, thereby achieving a comprehensive evaluation of the clarity of the image to be evaluated, effectively offsetting the deviation of the data in a single direction, and improving the accuracy and stability of the clarity evaluation.

[0105] In the above embodiment, the first pixel point, the second pixel point, the third pixel point and the fourth pixel point need to be determined according to the grayscale data of each pixel point in the grayscale image. Next, the specific process of determining the first pixel point, the second pixel point, the third pixel point and the fourth pixel point is described in detail.

[0106] Figure 4 A flowchart of another method for evaluating image clarity without reference provided by an embodiment of the present application is shown below. Figure 4 As shown, in a possible embodiment, the method steps shown in S102 above can be implemented by S1021 and S1022, and S1021 and S1022 are described in detail below.

[0107] S1021. For each pixel in the grayscale image, determine the first horizontal gradient and the first vertical gradient of the pixel, and determine the pixel whose first horizontal gradient exceeds the first preset threshold as the first pixel, and determine the pixel whose first vertical gradient exceeds the second preset threshold as the second pixel.

[0108] Among them, the gray gradient is a vector used to indicate the magnitude and direction of the change in gray value in an image.

[0109] The size of the gradient can be represented by the gradient amplitude. Specifically, the gradient amplitude can represent the degree of change of the grayscale values ​​between adjacent pixels in the image.

[0110] This application mainly uses the size of the grayscale gradient (i.e., the gradient amplitude) to evaluate the clarity of the image, without paying attention to the direction of the grayscale gradient. Compared with the clarity evaluation scheme that considers both the size and direction of the gradient, this scheme has higher analysis efficiency due to its simple calculation and is more suitable for resource-constrained scenarios; in addition, in the case where some gradient directions are greatly affected by noise, this scheme may be more robust to noise and more robust to small changes in the image because it only pays attention to the gradient size.

[0111] The horizontal gradient is the grayscale gradient in the horizontal direction, that is, the degree of change of the image in the horizontal direction.

[0112] The vertical gradient is the grayscale gradient in the vertical direction, that is, the degree of change of the image in the vertical direction.

[0113] It should be noted that after obtaining the grayscale image of the image to be evaluated, the first horizontal gradient and the first vertical gradient of each pixel in the grayscale image are determined. For each pixel in the grayscale image, the first horizontal gradient of the pixel refers to the amplitude of the first-order gradient of the pixel in the horizontal direction, and the first vertical gradient of the pixel refers to the amplitude of the first-order gradient of the pixel in the vertical direction.

[0114] After calculating the first horizontal gradient and the first vertical gradient of each pixel in the grayscale image, the first horizontal gradients of all the pixels in the grayscale image are combined to obtain the first horizontal gradient image Gx corresponding to the grayscale image; the first vertical gradients of all the pixels in the grayscale image are combined to obtain the first vertical gradient image Gy corresponding to the grayscale image. The size of the first horizontal gradient image Gx and the size of the first vertical gradient image Gy are the same as the size of the grayscale image, and the multiple pixels in the first horizontal gradient image Gx, the multiple pixels in the first vertical gradient image Gy, and the multiple pixels in the grayscale image correspond to each other one by one.

[0115] In this embodiment, the first pixel point is a pixel point in the first horizontal gradient image Gx whose first horizontal gradient is greater than a first preset threshold; the second pixel point is a pixel point in the first vertical gradient image Gy whose first vertical gradient is greater than a second preset threshold.

[0116] In the embodiment of the present application, by setting the first preset threshold and the second preset threshold, the first pixel and the second pixel with a large gradient amplitude in the first horizontal gradient image and the first vertical gradient image can be screened out, thereby accurately extracting the edge and contour features in the grayscale image, effectively improving the adaptability of the method to low-contrast and complex background images, and at the same time, by eliminating pixels with low gradient values, the robustness to noise is enhanced. In addition, the statistical results are concise and the calculation is efficient, providing a reliable basic support for subsequent clarity evaluation.

[0117] S1022. For each pixel in the grayscale image, determine the horizontal sharpness and vertical sharpness of the pixel, and determine the first pixel whose horizontal sharpness exceeds a third preset threshold as the third pixel, and determine the second pixel whose vertical sharpness exceeds a fourth preset threshold as the fourth pixel.

[0118] Among them, sharpness is a scalar used to indicate the drastic degree of brightness change of pixels in an image.

[0119] Sharpness is an important indicator to measure whether the edge details of an image are clear. Compared with the clarity evaluation method that only considers the gradient size, this scheme can more effectively describe the edge information of the image by introducing the calculation of sharpness, especially in complex scenes or high-contrast images, where sharpness can more intuitively reflect the clarity of the edge.

[0120] Horizontal sharpness is the sharpness in the horizontal direction, and vertical sharpness is the sharpness in the vertical direction.

[0121] It should be noted that after calculating the horizontal sharpness and vertical sharpness of each pixel in the grayscale image, the horizontal sharpness of all pixels in the grayscale image is combined to obtain the horizontal sharpness image Sx corresponding to the grayscale image; the vertical sharpness of all pixels in the grayscale image is combined to obtain the vertical sharpness image Sy corresponding to the grayscale image. The size of the horizontal sharpness image Sx and the size of the vertical sharpness image Sy are the same as the size of the grayscale image, and the multiple pixels in the horizontal sharpness image Sx, the multiple pixels in the vertical sharpness image Sy, and the multiple pixels in the grayscale image correspond to each other one by one.

[0122] In this embodiment, the third pixel point is a pixel point in the horizontal sharpness image Sx whose horizontal sharpness is greater than a third preset threshold; the fourth pixel point is a pixel point in the vertical sharpness image Sy whose vertical sharpness is greater than a fourth preset threshold.

[0123] In the embodiment of the present application, by setting the third preset threshold and the fourth preset threshold, the third pixel and the fourth pixel with higher sharpness in the horizontal sharpness image and the vertical sharpness image are screened out, so as to further extract the clear and significant edge features in the grayscale image, and describe the edge details of the grayscale image more carefully. In addition, after determining the third pixel and the fourth pixel, noise interference can be further eliminated, the robustness of the method to complex scenes is improved, and more reliable data support is provided for the calculation of the final clarity evaluation index.

[0124] It should be noted that in the method provided in the present application, the method steps shown in S1021 can be executed first, and then the method steps shown in S1022 can be executed; the method steps shown in S1022 can be executed first, and then the method steps shown in S1021 can be executed; the method steps shown in S1021 and S1022 can also be executed at the same time, and this embodiment does not make any specific limitations on this.

[0125] The edge and contour features in the grayscale image can be accurately extracted through the method steps shown in S1021, and the clear and significant edge features in the grayscale image can be extracted through the method steps shown in S1022. The edge and contour features in the grayscale image mainly reflect the distribution of the edge position and edge strength of the grayscale image, while the clear and significant edge features in the grayscale image not only consider the edge position and edge strength of the grayscale image, but also further consider the clarity of the edge of the grayscale image.

[0126] In the method step shown in S1021 above, it is necessary to determine the first horizontal gradient and the first vertical gradient of each pixel in the grayscale image. Next, the specific process of determining the first horizontal gradient and the first vertical gradient of each pixel in the grayscale image is described in detail.

[0127] In a possible embodiment, the method steps shown in S1021 may be implemented by Sc1 and Sc2, which are described in detail below.

[0128] It should be noted that in the grayscale image, the coordinates of each pixel can be expressed as (x, y), (x, y) represents the pixel at the xth row and yth column in the grayscale image, and the grayscale value of the pixel (x, y) can be expressed as g(x, y). Wherein, 1≤x≤I, I represents the total number of rows of pixels in the grayscale image, and I is a positive integer; 1≤y≤J, J represents the total number of columns of pixels in the grayscale image, and J is a positive integer;

[0129] Sc1. For each pixel in the grayscale image, determine the absolute value of the grayscale difference between the first target pixel and the second target pixel in the grayscale image as the first horizontal gradient of the pixel.

[0130] The first target pixel point and the second target pixel point are both adjacent to the pixel point in the horizontal direction, and the first target pixel point is located on the right side of the pixel point, and the second target pixel point is located on the left side of the pixel point.

[0131] It should be noted that when calculating the first horizontal gradient of the pixel point (x, y) at the xth row and yth column in the grayscale image, the pixel point (x, y+1) at the xth row and y+1th column in the grayscale image is the first target pixel point, and the pixel point (x, y-1) at the xth row and y-1th column in the grayscale image is the second target pixel point.

[0132] The first horizontal gradient of the pixel point (x, y) is |g(x, y+1)-g(x, y-1)|, where g(x, y+1) represents the grayscale value of the first target pixel point (x, y+1), and g(x, y-1) represents the grayscale value of the second target pixel point (x, y-1).

[0133] It should be noted that when the pixel point (x, y) is located at the edge of the grayscale image and there is no first target pixel point (x, y+1) or second target pixel point (x, y-1) corresponding to the pixel point (x, y), the grayscale value of the non-existent first target pixel point (x, y+1) or second target pixel point (x, y-1) can be set to 0, other default values ​​or the grayscale value of the pixel point. This embodiment does not specifically limit this.

[0134] For example, when the pixel point (x, y) is (0, 0), the first target pixel point (x, y+1) is (0, 1), and the second target pixel point (x, y-1) does not exist. At this time, the grayscale value g(x, y-1) of the second target pixel point (x, y-1) can be set to 0, or g(x, y-1) can be set to g(x, y).

[0135] Sc2. For each pixel in the grayscale image, determine the absolute value of the grayscale difference between the third target pixel and the fourth target pixel in the grayscale image as the first vertical gradient of the pixel.

[0136] The third target pixel point and the fourth target pixel point are both adjacent to the pixel point in a vertical direction, and the third target pixel point is located above the pixel point, and the fourth target pixel point is located below the pixel point.

[0137] It should be noted that when calculating the first vertical gradient of the pixel point (x, y) at the xth row and yth column in the grayscale image, the pixel point (x+1, y) at the x+1th row and yth column in the grayscale image is the third target pixel point, and the pixel point (x-1, y) at the x-1th row and yth column in the grayscale image is the fourth target pixel point.

[0138] The first vertical gradient of the pixel point (x, y) is |g(x+1, y)-g(x-1, y)|, g(x+1, y) represents the grayscale value of the third target pixel point (x+1, y), and g(x-1, y) represents the grayscale value of the fourth target pixel point (x-1, y).

[0139] It should be noted that when the pixel point (x, y) is located at the edge of the grayscale image and there is no third target pixel point (x+1, y) or fourth target pixel point (x-1, y) corresponding to the pixel point (x, y), the grayscale value of the non-existent third target pixel point (x+1, y) or fourth target pixel point (x-1, y) can be set to 0, other default values ​​or the grayscale value of the pixel point, and this embodiment does not specifically limit this.

[0140] In an embodiment of the present application, by calculating the first horizontal gradient and the first vertical gradient of each pixel in the grayscale image, the first horizontal gradient image and the first vertical gradient image corresponding to the grayscale image are accurately constructed. The first horizontal gradient image and the first vertical gradient image can fully cover the edge distribution information of the grayscale image, and provide basic support for further extraction of edge and contour features in the grayscale image, thereby providing accurate and reliable feature data support for the clarity evaluation of the image to be evaluated, which is particularly suitable for the clarity analysis needs of complex backgrounds and diverse image scenes.

[0141] In the method step shown in S1022 above, the horizontal sharpness and vertical sharpness of each pixel in the grayscale image need to be determined. Next, the specific process of determining the horizontal sharpness and vertical sharpness of each pixel in the grayscale image is described in detail.

[0142] In a possible embodiment, the method steps shown in S1022 may be implemented by Sd1 to Sd3, which are described in detail below.

[0143] Sd1. For each pixel in the grayscale image, determine the horizontal contrast, vertical contrast, second horizontal gradient, and second vertical gradient of the pixel.

[0144] The calculation of contrast is based on the grayscale difference of pixels, which can reflect the intensity of brightness change in the local area of ​​the grayscale image.

[0145] It should be noted that the horizontal contrast is the contrast in the horizontal direction, and is used to indicate the degree of brightness change of a pixel in the horizontal direction.

[0146] Vertical contrast is the contrast in the vertical direction, which is used to indicate the degree of brightness change of a pixel in the vertical direction.

[0147] It should be noted that after calculating the horizontal contrast and vertical contrast of each pixel in the grayscale image, the horizontal contrast of all pixels in the grayscale image is combined to obtain the horizontal contrast image Cx corresponding to the grayscale image; the vertical contrast of all pixels in the grayscale image is combined to obtain the vertical contrast image Cy corresponding to the grayscale image. The size of the horizontal contrast image Cx and the size of the vertical contrast image Cy are the same as the size of the grayscale image, and the multiple pixels in the horizontal contrast image Cx, the multiple pixels in the vertical contrast image Cy, and the multiple pixels in the grayscale image correspond to each other one by one.

[0148] The second horizontal gradient is the second-order horizontal gradient of the pixel point, and the second vertical gradient is the second-order vertical gradient of the pixel point.

[0149] The second horizontal gradient refers to the rate of change of the horizontal gradient of a pixel in a grayscale image, and is used to reflect the severity of brightness changes in the horizontal direction.

[0150] The second vertical gradient refers to the rate of change of the vertical gradient of a pixel in a grayscale image, and is used to reflect the severity of brightness changes in the vertical direction.

[0151] It should be noted that after calculating the second horizontal gradient and the second vertical gradient of each pixel in the grayscale image, the second horizontal gradients of all pixels in the grayscale image are combined to obtain the second horizontal gradient image Dx corresponding to the grayscale image; the second vertical gradients of all pixels in the grayscale image are combined to obtain the second vertical gradient image Dy corresponding to the grayscale image. The size of the second horizontal gradient image Dx and the size of the second vertical gradient image Dy are the same as the size of the grayscale image, and the multiple pixels in the second horizontal gradient image Dx, the multiple pixels in the second vertical gradient image Dy, and the multiple pixels in the grayscale image correspond to each other one by one.

[0152] Sd2: Determine the horizontal sharpness of the pixel based on the horizontal contrast and the second horizontal gradient.

[0153] The horizontal sharpness is used to quantify the clarity of the edge in the horizontal direction in the grayscale image, and is calculated based on the relationship between the second horizontal gradient and the horizontal contrast.

[0154] It should be noted that for any pixel in a grayscale image, the higher the horizontal sharpness value of the pixel, the higher the horizontal edge clarity of the pixel, which means that the pixel not only has a larger gradient change rate in the horizontal direction (high edge intensity), but also has a larger contrast (significant difference in brightness of the edge).

[0155] Sd3, determine the vertical sharpness of the pixel based on the vertical contrast and the second vertical gradient.

[0156] The vertical sharpness is used to quantify the clarity of the edge in the vertical direction of the grayscale image, and is calculated based on the relationship between the second vertical gradient and the vertical contrast.

[0157] It should be noted that, for any pixel in a grayscale image, the higher the vertical sharpness value of the pixel, the higher the vertical edge clarity of the pixel, which means that the pixel not only has a larger gradient change rate in the vertical direction, but also has a larger contrast.

[0158] In an embodiment of the present application, by calculating the horizontal contrast and the second horizontal gradient of each pixel, the horizontal sharpness of each pixel in the horizontal direction is accurately quantified; at the same time, the vertical contrast and the second vertical gradient of each pixel are calculated to accurately quantify the vertical sharpness of each pixel in the vertical direction, so as to more comprehensively characterize the sharp features of the edges of the grayscale image, provide more reliable and efficient basic data support for subsequent clarity evaluation, and can be widely used in image quality assessment, edge detection, visual scene analysis and other fields.

[0159] In the method steps shown in Sd1 above, the horizontal contrast, vertical contrast, second horizontal gradient and second vertical gradient of each pixel need to be determined. Next, the specific process of determining the horizontal contrast, vertical contrast, second horizontal gradient and second vertical gradient of each pixel is described in detail.

[0160] In a possible embodiment, the method steps shown in Sd1 can be implemented by Sd11 to Sd14, and Sd11 to Sd14 are described in detail below.

[0161] Sd11. For each pixel in the grayscale image, determine the absolute value of the grayscale difference between the pixel and a fifth target pixel in the grayscale image as the horizontal contrast of the pixel.

[0162] The fifth target pixel point is adjacent to the pixel point in the horizontal direction, and the fifth target pixel point is located on the left side of the pixel point.

[0163] It should be noted that when calculating the horizontal contrast of the pixel point (x, y) at the xth row and yth column in the grayscale image, the pixel point (x, y-1) at the xth row and y-1th column in the grayscale image is the fifth target pixel point. The fifth target pixel point is the same pixel point as the second target pixel point in the embodiment shown in S1021 above.

[0164] The horizontal contrast of the pixel point (x, y) is |g(x, y)-g(x, y-1)|, where g(x, y-1) represents the grayscale value of the fifth target pixel point (x, y-1).

[0165] It should be noted that when the pixel point (x, y) is located at the edge of the grayscale image and there is no fifth target pixel point (x, y-1) corresponding to the pixel point (x, y), the grayscale value of the non-existent fifth target pixel point (x, y-1) can be set to 0, other default values ​​or the grayscale value of the pixel point. This embodiment does not make any specific limitations on this.

[0166] Sd12: Determine the absolute value of the grayscale difference between the pixel and the sixth target pixel in the grayscale image as the vertical contrast of the pixel.

[0167] The sixth target pixel point is adjacent to the pixel point in a vertical direction, and the sixth target pixel point is located below the pixel point.

[0168] It should be noted that when calculating the vertical contrast of the pixel point (x, y) at the xth row and yth column in the grayscale image, the pixel point (x-1, y) at the x-1th row and yth column in the grayscale image is the sixth target pixel point. The sixth target pixel point is the same pixel point as the fourth target pixel point in the embodiment shown in S10212 above.

[0169] The vertical contrast of the pixel point (x, y) is |g(x, y)-g(x-1, y)|, where g(x-1, y) represents the grayscale value of the sixth target pixel point (x-1, y).

[0170] It should be noted that when the pixel point (x, y) is located at the edge of the grayscale image and there is no sixth target pixel point (x-1, y) corresponding to the pixel point (x, y), the grayscale value of the non-existent sixth target pixel point (x-1, y) can be set to 0, other default values ​​or the grayscale value of the pixel point. This embodiment does not make any specific limitations on this.

[0171] Sd13, determining a second horizontal gradient of the pixel point according to the grayscale value of the pixel point, the grayscale value of the seventh target pixel point in the grayscale image, and the grayscale value of the eighth target pixel point.

[0172] The seventh target pixel point and the eighth target pixel point are both spaced one pixel apart from the pixel point in the horizontal direction, and the seventh target pixel point is located on the right side of the pixel point, and the eighth target pixel point is located on the left side of the pixel point.

[0173] It should be noted that when calculating the second horizontal gradient of the pixel point (x, y) at the xth row and yth column in the grayscale image, the pixel point (x, y+2) at the xth row and y+2 column in the grayscale image is the seventh target pixel, and the pixel point (x, y-2) at the xth row and y-2 column in the grayscale image is the eighth target pixel.

[0174] The second horizontal gradient of the pixel point (x, y) is |g(x, y+2)+g(x, y-2)-2×g(x, y)|, where g(x, y+2) represents the grayscale value of the seventh target pixel point (x, y+2), and g(x, y-2) represents the grayscale value of the eighth target pixel point (x, y-2).

[0175] It should be noted that when the pixel point (x, y) is located at the edge of the grayscale image and there is no seventh target pixel point (x, y+2) or eighth target pixel point (x, y-2) corresponding to the pixel point (x, y), the grayscale value of the non-existent seventh target pixel point (x, y+2) or eighth target pixel point (x, y-2) can be set to 0, other default values ​​or the grayscale value of the pixel point, and this embodiment does not make any specific limitations on this.

[0176] Sd14, determining a second vertical gradient of the pixel point according to the grayscale value of the pixel point, the grayscale value of the ninth target pixel point in the grayscale image, and the grayscale value of the tenth target pixel point.

[0177] The ninth target pixel point and the tenth target pixel point are both spaced one pixel apart from the pixel point in the vertical direction, and the ninth target pixel point is located above the pixel point, and the tenth target pixel point is located below the pixel point.

[0178] It should be noted that when calculating the second vertical gradient of the pixel point (x, y) at the xth row and yth column in the grayscale image, the pixel point (x+2, y) at the x+2th row and yth column in the grayscale image is the ninth target pixel point, and the pixel point (x-2, y) at the x-2th row and yth column in the grayscale image is the tenth target pixel point.

[0179] The second vertical gradient of the pixel point (x, y) is |g(x+2, y)+g(x-2, y)-2×g(x, y)|, where g(x+2, y) represents the grayscale value of the ninth target pixel point (x+2, y), and g(x-2, y) represents the grayscale value of the tenth target pixel point (x-2, y).

[0180] It should be noted that when the pixel point (x, y) is located at the edge of the grayscale image and there is no ninth target pixel point (x+2, y) or tenth target pixel point (x-2, y) corresponding to the pixel point (x, y), the grayscale value of the non-existent ninth target pixel point (x+2, y) or tenth target pixel point (x-2, y) can be set to 0, other default values ​​or the grayscale value of the pixel point, and this embodiment does not make any specific limitations on this.

[0181] In the embodiment of the present application, by calculating the horizontal contrast and vertical contrast of each pixel in the grayscale image, the brightness difference of the pixel in the grayscale image in the horizontal and vertical directions is effectively quantified. This contrast calculation based on the grayscale difference of adjacent pixels can accurately extract the characteristics of the light and dark change area in the grayscale image, especially in the edge area, the contrast information can better highlight the significance of the edge; at the same time, by calculating the second horizontal gradient and the second vertical gradient of each pixel in the grayscale image, the intensity of the grayscale change in the grayscale image is accurately reflected. By considering the grayscale value difference change rate of the pixel in the horizontal and vertical directions, the description of the edge sharpness is further enhanced, so as to better extract clear and significant edge features in the grayscale image. In addition, compared with the first-order gradient, the second-order gradient is more sensitive to edge changes, especially in the case of complex background and large noise interference, it can better highlight the real edge features, and provide higher precision support for subsequent image sharpness calculation and overall clarity evaluation.

[0182] In the method step shown in Sd2 above, the horizontal sharpness of the pixel needs to be determined according to the horizontal contrast and the second horizontal gradient. Next, the specific process of determining the horizontal sharpness of the pixel according to the horizontal contrast and the second horizontal gradient is described in detail.

[0183] In a possible embodiment, the method steps shown in Sd2 may be implemented by Sd21 and Sd22, which are described in detail below.

[0184] Sd21. For each pixel point in the grayscale image, obtain the sum of the second horizontal gradients of a plurality of eleventh pixel points corresponding to the pixel point and the sum of the horizontal contrasts.

[0185] Among them, the eleventh pixel point is located in the first range corresponding to the pixel point.

[0186] It should be noted that different pixels correspond to different first ranges. For the pixel point (x, y) at the xth row and yth column in the second horizontal gradient image, the first range of the pixel point (x, y) refers to the range formed by extending w pixels to the left and right in the horizontal direction with the pixel point (x, y) as the center in the second horizontal gradient image. The first range of the pixel point (x, y) includes 2w+1 pixels.

[0187] w can be set by the management personnel according to actual needs, and this embodiment does not make any specific limitation on this.

[0188] For example, w is 3 pixels. For another example, w is 5 pixels.

[0189] It should be noted that the sum of the second horizontal gradients of the plurality of eleventh pixel points corresponding to the pixel point is the first value Sum1, which can be obtained by the formula Calculated, where Dx(x,y) represents the second horizontal gradient of the pixel point (x,y) in the second horizontal gradient image, and Dx(x,y+k) represents the second horizontal gradient of the pixel point (x,y+k) in the second horizontal gradient image.

[0190] In this embodiment, the first value Sum1 corresponding to the pixel point (x, y) reflects the intensity of grayscale changes in the horizontal direction in the area around the pixel point (x, y).

[0191] It should be noted that the sum of the horizontal contrasts of the plurality of eleventh pixel points corresponding to the pixel point is the second value Sum2, which can be obtained by the formula Calculated, where Cx(x,y) represents the horizontal contrast of the pixel point (x,y) in the horizontal contrast image, and Cx(x,y+k) represents the horizontal contrast of the pixel point (x,y+k) in the horizontal contrast image.

[0192] In this embodiment, the second value Sum2 corresponding to the pixel point (x, y) reflects the intensity of brightness change in the vertical direction in the area around the pixel point (x, y).

[0193] Sd22: determine the ratio of the sum of the second horizontal gradients to the sum of the horizontal contrasts as the horizontal sharpness of the pixel.

[0194] It should be noted that the formula The horizontal sharpness Sx(x,y) of the pixel point (x,y) is calculated.

[0195] In an embodiment of the present application, the horizontal sharpness of each pixel is calculated by combining the second horizontal gradient and the horizontal contrast. The horizontal sharpness image can accurately measure the clarity of the edge of the grayscale image, effectively eliminate noise interference, and provide efficient and reliable support for the clarity quality assessment of the image to be evaluated.

[0196] In the above embodiment, it should be noted that, in the method steps shown in the above Sd3, the method for determining the vertical sharpness of the pixel point based on the vertical contrast and the second vertical gradient is similar to the method for determining the horizontal sharpness of the pixel point based on the horizontal contrast and the second horizontal gradient, and this embodiment will not go into details.

[0197] The present application provides a method for evaluating the clarity of a reference-free image, which uses the ratio of sharp edges to total edges in the image to be evaluated as a clarity index. It is intuitive and unified, and can be applied to images to be evaluated in low-texture and complex scenes. The calculation based on pixels and their neighborhoods has the advantage of parallelization, and can meet real-time requirements, providing an efficient and reliable method for evaluating clarity in fields such as three-dimensional reconstruction and augmented reality. In addition, the clarity calculated by the method provided by the present application is an absolute value, which is also fully applicable to the evaluation of two images with different contents. For example, a low-texture image has few edges, but a high proportion of sharp edges, and its clarity value is still higher than that of an image with very rich texture but blurred.

[0198] Figure 5 This is a schematic diagram of the structure of a non-reference image clarity evaluation device provided in an embodiment of the present application. Figure 2 As shown, the non-reference image clarity assessment device 500 provided in this embodiment can exist independently and be used to execute the non-reference image clarity assessment method shown in the above method embodiment.

[0199] The non-reference image definition evaluation device 500 may include: a transceiver module 501 and a processing module 502. The processing module 502 is used for data processing, and the transceiver module 501 may implement corresponding communication functions. The transceiver module 501 may also be called a communication interface or a communication unit.

[0200] Optionally, the non-reference image clarity assessment device 500 may further include a storage unit, which may be used to store instructions and / or data. The processing module 502 may read the instructions and / or data in the storage unit to execute the non-reference image clarity assessment method shown in the above method embodiment.

[0201] The transceiver module 501 is used to perform the reception-related operations in the foregoing method embodiment, and the processing module 502 is used to perform the processing-related operations in the foregoing method embodiment.

[0202] Optionally, the transceiver module 501 may include a sending module and a receiving module. The sending module is used to perform the sending operation in the above method embodiment. The receiving module is used to perform the receiving operation in the above method embodiment.

[0203] It should be noted that the non-reference image definition evaluation device 500 may include a sending module but not a receiving module. Alternatively, the non-reference image definition evaluation device 500 may include a receiving module but not a sending module. Specifically, it may depend on whether the above solution executed by the non-reference image definition evaluation device 500 includes a sending action and a receiving action.

[0204] As an example, the non-reference image clarity evaluation device 500 is used to perform the above Figure 1 The method embodiment shown.

[0205] The non-reference image clarity assessment device 500 may include: a transceiver module 501 and a processing module 502 .

[0206] The transceiver module 501 is used to obtain a grayscale image of an image to be evaluated.

[0207] The processing module 502 is used to determine, based on the grayscale data of each pixel in the grayscale image, a first pixel whose horizontal brightness change exceeds a first preset threshold, a second pixel whose vertical brightness change exceeds a second preset threshold, a third pixel whose horizontal brightness change exceeds the first preset threshold and whose horizontal sharpness change exceeds a third preset threshold, and a fourth pixel whose vertical brightness change exceeds the second preset threshold and whose vertical sharpness change exceeds a fourth preset threshold.

[0208] The processing module 502 is further configured to determine the clarity of the image to be evaluated according to the number of the first pixel points, the number of the second pixel points, the number of the third pixel points, and the number of the fourth pixel points.

[0209] It should be understood that the execution of the above corresponding processes by each module has been described in detail in the above method embodiment, and for the sake of brevity, it will not be repeated here.

[0210] The processing module 502 in the above embodiment can be implemented by at least one processor or processor-related circuit. The transceiver module 501 can be implemented by a transceiver or a transceiver-related circuit. The transceiver module 501 can also be called a communication unit or a communication interface. The storage unit can be implemented by at least one memory.

[0211] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 6 As shown, the electronic device 600 provided in this embodiment includes: a memory 601 and a processor 602 .

[0212] The memory 601 may be an independent physical unit, and may be connected to the processor 602 via a bus 603. The memory 601 and the processor 602 may also be integrated together and implemented by hardware. The memory 601 is used to store program instructions, and the processor 602 calls the program instructions to execute the operations performed by the image clarity evaluation device without reference in any of the above method embodiments.

[0213] Optionally, when part or all of the methods of the above embodiments are implemented by software, the electronic device 600 may also include only a processor 602. The memory 601 for storing programs is located outside the electronic device 600, and the processor 602 is connected to the memory through circuits / wires for reading and executing the programs stored in the memory. The processor 602 may be a central processing unit (CPU), a network processor (NP) or a combination of a CPU and a NP. The processor 602 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.

[0214] The memory 601 may include a volatile memory, such as a random-access memory (RAM); the memory may also include a non-volatile memory, such as a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); the memory may also include a combination of the above types of memory.

[0215] Illustratively, the present application provides a chip, comprising: an interface circuit and a logic circuit, wherein the interface circuit is used to receive signals from other chips outside the chip and transmit them to the logic circuit, or to send signals from the logic circuit to other chips outside the chip, and the logic circuit is used to execute the operations performed by the non-reference image clarity evaluation device in the above method embodiment.

[0216] Illustratively, the present application provides a computer-readable storage medium having computer program instructions stored thereon, and the computer program instructions are executed by a processor of an electronic device so that the electronic device executes the operations performed by the non-reference image clarity evaluation device in the above method embodiment.

[0217] Illustratively, the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the operations performed by the non-reference image clarity evaluation device in the above method embodiment.

[0218] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for evaluating image clarity without reference, characterized in that: The method comprises: Obtain a grayscale image of the image to be evaluated; According to the grayscale data of each pixel in the grayscale image, determine a first pixel whose horizontal brightness change exceeds a first preset threshold, a second pixel whose vertical brightness change exceeds a second preset threshold, a third pixel whose horizontal brightness change exceeds the first preset threshold and whose horizontal sharpness change exceeds a third preset threshold, and a fourth pixel whose vertical brightness change exceeds the second preset threshold and whose vertical sharpness change exceeds a fourth preset threshold; The clarity of the image to be evaluated is determined according to the number of the first pixel points, the number of the second pixel points, the number of the third pixel points, and the number of the fourth pixel points.

2. The method according to claim 1, characterized in that The determining the clarity of the image to be evaluated according to the number of the first pixel points, the number of the second pixel points, the number of the third pixel points, and the number of the fourth pixel points includes: Determine a ratio of the number of the third pixel points to the number of the first pixel points as a first ratio; Determine a ratio of the number of the fourth pixel points to the number of the second pixel points as a second ratio; The clarity of the image to be evaluated is determined according to the first ratio and the second ratio.

3. The method according to claim 2, characterized in that Determining the clarity of the image to be evaluated according to the first ratio and the second ratio includes: calculating a square root of the first ratio and the second ratio; The arithmetic root mean square is determined as the clarity of the image to be evaluated.

4. The method according to claim 1, characterized in that: The method of determining, based on the grayscale data of each pixel in the grayscale image, a first pixel whose horizontal brightness change exceeds a first preset threshold, a second pixel whose vertical brightness change exceeds a second preset threshold, a third pixel whose horizontal brightness change exceeds the first preset threshold and whose horizontal sharpness change exceeds a third preset threshold, and a fourth pixel whose vertical brightness change exceeds the second preset threshold and whose vertical sharpness change exceeds a fourth preset threshold, comprises: For each pixel in the grayscale image, determine a first horizontal gradient and a first vertical gradient of the pixel, and determine a pixel whose first horizontal gradient exceeds the first preset threshold as the first pixel, and determine a pixel whose first vertical gradient exceeds the second preset threshold as the second pixel; For each pixel in the grayscale image, determine the horizontal sharpness and vertical sharpness of the pixel, and determine the first pixel whose horizontal sharpness exceeds the third preset threshold as the third pixel, and determine the second pixel whose vertical sharpness exceeds the fourth preset threshold as the fourth pixel.

5. The method according to claim 4, characterized in that The step of determining, for each pixel in the grayscale image, a first horizontal gradient and a first vertical gradient of the pixel comprises: For each pixel in the grayscale image, determining an absolute value of a grayscale difference between a first target pixel and a second target pixel in the grayscale image as a first horizontal gradient of the pixel; wherein the first target pixel and the second target pixel are both adjacent to the pixel in a horizontal direction, and the first target pixel is located on the right side of the pixel, and the second target pixel is located on the left side of the pixel; For each pixel in the grayscale image, the absolute value of the grayscale difference between the third target pixel and the fourth target pixel in the grayscale image is determined as the first vertical gradient of the pixel; wherein the third target pixel and the fourth target pixel are both adjacent to the pixel in the vertical direction, and the third target pixel is located above the pixel, and the fourth target pixel is located below the pixel.

6. The method according to claim 4, characterized in that The step of determining, for each pixel in the grayscale image, the horizontal sharpness and the vertical sharpness of the pixel comprises: For each pixel in the grayscale image, determine the horizontal contrast, vertical contrast, second horizontal gradient and second vertical gradient of the pixel; wherein the second horizontal gradient is the second-order horizontal gradient of the pixel, and the second vertical gradient is the second-order vertical gradient of the pixel; Determining the horizontal sharpness of the pixel point according to the horizontal contrast and the second horizontal gradient; The vertical sharpness of the pixel is determined according to the vertical contrast and the second vertical gradient.

7. The method according to claim 6, characterized in that The step of determining, for each pixel in the grayscale image, a horizontal contrast, a vertical contrast, a second horizontal gradient, and a second vertical gradient of the pixel comprises: For each pixel in the grayscale image, determining the absolute value of the grayscale difference between the pixel and a fifth target pixel in the grayscale image as the horizontal contrast of the pixel; wherein the fifth target pixel is adjacent to the pixel in the horizontal direction and is located on the left side of the pixel; Determine the absolute value of the grayscale difference between the pixel point and a sixth target pixel point in the grayscale image as the vertical contrast of the pixel point; wherein the sixth target pixel point is adjacent to the pixel point in the vertical direction and the sixth target pixel point is located below the pixel point; Determine a second horizontal gradient of the pixel point according to the grayscale value of the pixel point, the grayscale value of a seventh target pixel point in the grayscale image, and the grayscale value of an eighth target pixel point; wherein the seventh target pixel point and the eighth target pixel point are both spaced one pixel apart from the pixel point in the horizontal direction, and the seventh target pixel point is located on the right side of the pixel point, and the eighth target pixel point is located on the left side of the pixel point; The second vertical gradient of the pixel point is determined according to the grayscale value of the pixel point, the grayscale value of the ninth target pixel point in the grayscale image, and the grayscale value of the tenth target pixel point; wherein the ninth target pixel point and the tenth target pixel point are both spaced one pixel apart from the pixel point in the vertical direction, and the ninth target pixel point is located above the pixel point, and the tenth target pixel point is located below the pixel point.

8. The method according to claim 6, characterized in that The determining the horizontal sharpness of the pixel point according to the horizontal contrast and the second horizontal gradient includes: For each pixel point in the grayscale image, a sum of second horizontal gradients of a plurality of eleventh pixel points corresponding to the pixel point and a sum of horizontal contrasts are obtained; wherein the eleventh pixel point is located within a first range corresponding to the pixel point; The ratio of the sum of the second horizontal gradients to the sum of the horizontal contrasts is determined as the horizontal sharpness of the pixel.

9. An electronic device, characterized in that: include: memory and at least one processor; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method according to any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed, the method according to any one of claims 1 to 8 is implemented.