Image quality identification method and device and related equipment
By calculating the overall sharpness and clarity scores of an image and dividing the image into regions to determine the clarity of the central region, the problem of image quality recognition accuracy and resource consumption in existing technologies is solved, and efficient image quality recognition is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-23
- Publication Date
- 2026-04-07
AI Technical Summary
Existing image quality recognition solutions cannot balance accuracy and resource consumption. Traditional methods have poor adaptability and are prone to misjudgment, while deep learning models rely on large data resources.
By calculating the overall sharpness and clarity scores of the image to be identified, and determining whether the preset conditions are met, the image is divided into multiple regions. The differences in sharpness scores between regions are calculated, and it is determined whether the sharpness score of the central region is the lowest, in order to judge the image quality.
It improves the accuracy of image quality recognition, reduces system resource consumption, avoids the training of deep learning models and high computing power consumption, and simplifies the calculation process.
Smart Images

Figure CN121811222A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of image processing and computer vision technology, and in particular to an image quality recognition method, apparatus and related equipment. Background Technology
[0002] In the fields of image processing and intelligent vision, automatic image quality recognition is a critical task in many scenarios. Existing technologies for image quality recognition mainly include traditional evaluation methods based on image features and predictive evaluation methods based on deep learning models. The former relies on a single threshold, has poor adaptability, and is prone to misjudgment, while the latter, although more accurate, is highly data-dependent and resource-intensive. There is an urgent need for an image quality recognition solution that balances accuracy and resource consumption. Summary of the Invention
[0003] This application provides an image quality recognition method, apparatus, and related equipment to address the problem that existing image quality recognition schemes cannot balance accuracy and resource consumption.
[0004] To solve the above problems, this application is implemented as follows: In a first aspect, embodiments of this application provide an image quality recognition method, including: Acquire the image to be recognized; Calculate a preliminary quality score for the image to be identified, which includes the overall sharpness score of the image to be identified; Determine whether the preliminary quality score meets the preset conditions; If the preliminary quality score is determined to meet the preset conditions, the image to be identified is divided into multiple regions, including a central region, which is located at the center of the image to be identified. Calculate the sharpness score for each region across multiple regions; Determine whether the difference in sharpness scores among the multiple regions is greater than a preset difference condition, and whether the sharpness score of the central region is the lowest among the sharpness scores of the multiple regions. If not, then determine that the image to be identified is a sharp image.
[0005] Secondly, embodiments of this application provide an image quality recognition device, comprising: The image acquisition module is used to acquire the image to be recognized; The calculation module is used to calculate the preliminary quality score of the image to be identified, which includes the overall sharpness score of the image to be identified. The preliminary judgment module is used to determine whether the preliminary quality score meets the preset conditions; The region segmentation module is used to divide the image to be recognized into multiple regions when the judgment result of the preliminary judgment module is yes. The multiple regions include a central region, which is located at the center of the image to be recognized. The region calculation module is used to calculate the sharpness score of each region in multiple regions; The secondary judgment module is used to determine whether the difference in sharpness scores among the various regions in the multiple regions is greater than a preset difference condition, and whether the sharpness score of the central region is the lowest among the sharpness scores of the various regions in the multiple regions; The quality determination module is used to determine that the image to be identified is a clear image when the result of the secondary judgment module is negative.
[0006] Thirdly, embodiments of this application also provide an electronic device, including: a memory, a processor, and a program stored in the memory and executable on the processor; the processor is configured to read the program in the memory to implement the steps of the method disclosed in the first aspect above.
[0007] Fourthly, embodiments of this application also provide a readable storage medium for storing a program that, when executed by a processor, implements the steps of the method disclosed in the first aspect above.
[0008] Fifthly, embodiments of this application also provide a computer program product, including computer instructions, which, when executed by a processor, implement the steps of the method disclosed in the first aspect above. Attached Figure Description
[0009] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 This is one of the flowcharts of the image quality recognition method provided in the embodiments of this application; Figure 2A This is the second flowchart of the image quality recognition method provided in the embodiments of this application; Figure 2B This is the third flowchart of the image quality recognition method provided in the embodiments of this application; Figure 2C This is the fourth flowchart of the image quality recognition method provided in the embodiments of this application; Figure 2D This is the fifth flowchart of the image quality recognition method provided in the embodiments of this application; Figure 2E This is the sixth flowchart of the image quality recognition method provided in the embodiments of this application; Figure 2F This is the seventh flowchart of the image quality recognition method provided in the embodiments of this application; Figure 3 This is the tenth flowchart of the image quality recognition method provided in the embodiments of this application; Figure 4 This is a schematic diagram of the image quality recognition device provided in the embodiments of this application; Figure 5 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0011] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0012] The terms "first," "second," etc., used in the embodiments of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices. Additionally, the use of "and / or" in this application indicates at least one of the connected objects, such as A and / or B and / or C, representing seven possibilities: including A alone, B alone, C alone, and the presence of both A and B, both B and C, both A and C, and the presence of A, B, and C.
[0013] Please see Figure 1 , Figure 1 This is a schematic flowchart of the image quality recognition method provided in the embodiments of this application. Figure 1 The image quality recognition method shown can be performed by an electronic device.
[0014] like Figure 1 As shown, the image quality recognition method may include the following steps: Step 200: Obtain the image to be recognized.
[0015] The application scenario of the image to be recognized is not limited here. Optionally, the application scenario of the image to be recognized may include various scenarios such as industrial camera acquisition, short video review, optical character recognition (OCR) preprocessing, vehicle monitoring, and medical image quality control. Since the application scenario of the image to be recognized is different, the content of the image to be recognized is also different. The specific content of the image to be recognized is not limited here. Optionally, the content of the image to be recognized may include a face; alternatively, the content of the image to be recognized may include vehicles, pedestrians, etc.
[0016] The specific method of acquiring the image to be identified is not limited here. Optionally, the image to be identified can be an image directly acquired by the electronic device in this application embodiment. For example, the electronic device in this application embodiment can acquire an image through a camera to obtain the above-mentioned image to be identified. Alternatively, the image to be identified can also be an image acquired by the electronic device in this application embodiment from other electronic devices. The specific type of other electronic devices is not limited here. For example, other electronic devices can be vehicle terminals, mobile phones, or servers, and the above-mentioned servers can be referred to as cloud servers.
[0017] Step 400: Calculate the preliminary quality score of the image to be identified. The preliminary quality score includes the overall sharpness score of the image to be identified.
[0018] Optionally, the preliminary quality score may include the overall sharpness score of the image to be identified, and the specific method for calculating the preliminary quality score of the image to be identified is not specifically limited here.
[0019] Alternatively, the overall sharpness score can be calculated by: directly calculating the overall sharpness score of the image to be recognized; or, first calculating the overall blurriness score of the image to be recognized, and then calculating the overall sharpness score based on the overall blurriness score, where the overall blurriness score and the overall sharpness score can correspond one-to-one. For example, if the sum of the overall blurriness score and the overall sharpness score is a fixed value (e.g., 10 points), then when the blurriness score is 3, the overall sharpness score is 7; when the blurriness score is 6, the overall sharpness score is 4.
[0020] Step 600: Determine whether the preliminary quality score meets the preset conditions.
[0021] It should be noted that the overall blur score mentioned above can be understood as measuring the degree of loss of high-frequency information such as details, edges and textures in the image to be identified, and is often used to determine whether the quality of the image to be identified meets the standard. On the other hand, the overall sharpness score mentioned above can be understood as measuring the richness of high-frequency information such as details, edges and textures in the image to be identified, and can also be used to determine whether the quality of the image to be identified meets the standard.
[0022] Step 800: If the preliminary quality score meets the preset conditions, the image to be identified is divided into multiple regions, including a central region, which is located at the center of the image to be identified.
[0023] The specific setting of the preset conditions is not limited here. Optionally, the preset conditions may refer to the initial quality score being greater than the preset threshold, or alternatively, the preset conditions may refer to the initial quality score being within the preset range.
[0024] The specific method of dividing the image to be recognized into multiple regions is not limited here. Optionally, the image to be recognized can be divided into multiple regions on an average basis, so that the area of each region can be the same. Alternatively, the image to be recognized can be randomly divided into multiple regions, and the areas of any two regions can be different.
[0025] The number of regions is not limited here; optionally, it can be 5 or 9 regions, etc. It should be noted that the more regions there are, the higher the accuracy of the recognition result of the image to be recognized.
[0026] Step 1000: Calculate the sharpness score of each region in multiple regions.
[0027] The specific method for calculating the sharpness score of each region can be found in the description of the overall sharpness score above. That is, you can directly calculate the sharpness score of each region, or you can first calculate the blur score of each region, and then calculate the sharpness score of each region based on the blur score of each region.
[0028] Step 1200: Determine whether the difference in sharpness scores among the multiple regions is greater than the preset difference condition, and whether the sharpness score of the central region is the lowest among the sharpness scores of the multiple regions.
[0029] It's important to note that directly judging the overall sharpness of an image can easily lead to misjudgments. For example, if the surrounding areas of an image are blurred using a frosted glass effect or border processing, while the central area remains sharp, judging the overall sharpness might easily result in a misclassification as a blurry image. Similarly, if the surrounding areas of an image use a solid color background, and the content in the central area is blurred, judging the overall sharpness might also easily result in a misclassification as a sharp image. Therefore, it's advisable to divide the image into multiple regions, calculate the sharpness score for each region, and then determine whether the image is sharp based on the sharpness score of each region. This approach can improve the accuracy of the recognition results.
[0030] Step 1400: If not, then the image to be identified is determined to be a clear image.
[0031] Specifically, if the difference in sharpness scores among different regions exceeds a preset difference condition, it indicates that the sharpness distribution of different regions in the image to be identified is uneven, which may result in some regions being relatively sharp and others being relatively blurry. If the sharpness score of the central region is the lowest among all the sharpness scores of the different regions, it indicates that the content of the central region of the image to be identified has the lowest sharpness compared to other regions. When the difference in sharpness scores among different regions does not meet the preset difference condition, and the sharpness score of the central region is the lowest among all the sharpness scores of the different regions, the image to be identified can be determined as a sharp image.
[0032] In this embodiment, through steps 200 to 1400, if the preliminary quality score of the image to be identified meets the preset conditions, the image to be identified can be divided into multiple regions. It can be determined whether the difference in sharpness scores among the regions exceeds the preset difference condition, and whether the sharpness score of the central region is the lowest among the sharpness scores of the multiple regions. If not, the image to be identified is determined to be a sharp image. This effectively reduces the recognition error of sharp images and improves recognition accuracy. Furthermore, the entire process uses simplified statistical feature calculation and geometric partitioning logic, eliminating the need for deep learning model training and inference, thus avoiding resource consumption such as model storage and high computing power. Rapid image screening through preliminary quality scoring further reduces unnecessary fine-grained calculations, significantly reducing system resource consumption while ensuring recognition accuracy.
[0033] For example, the image to be recognized is divided into five regions (the top left, top right, center, bottom left, and bottom right regions, each region being 1 / 4 of the original image size, and each resulting region having 1 / 2 the width and height of the image to be recognized). Each region is independently scored for sharpness, forming a region score list. The overall sharpness of the image is then judged according to the following rules: if the difference between the scores of the five regions is large (i.e., greater than a preset difference condition), and the center region has the lowest score, then the image is considered "sharp" overall.
[0034] As an optional implementation, the preliminary quality score also includes an overall sharpness score of the image to be identified; See Figure 2A Step 400, calculating the preliminary quality score of the image to be identified includes: Step 410: Calculate the overall sharpness score of the image to be recognized; and, Step 420: Calculate the overall sharpness score of the image to be identified; Therefore, step 600, determining whether the preliminary quality score meets the preset conditions, includes: Step 610: Determine whether the overall sharpness score is greater than the first threshold and whether the overall clarity score is greater than the second threshold; Step 620: If yes, then determine that the preliminary quality score meets the preset conditions; Step 630: If not, then determine that the image to be identified is a blurry image.
[0035] Specifically, when the overall sharpness score of the image to be identified is greater than the first threshold and the overall clarity score is greater than the second threshold, it can be determined that the preliminary quality score meets the preset conditions.
[0036] When the overall sharpness score is less than or equal to the first threshold, the image to be identified can be determined to be a blurry image; when the overall sharpness score is less than or equal to the second threshold, the image to be identified can also be determined to be a blurry image.
[0037] The specific values of the first threshold and the second threshold are not limited here. Optionally, the value range of the first threshold can be greater than or equal to 0.15 and less than or equal to 0.35. For example, the first threshold can be any one of 0.2, 0.25, and 0.3. The value range of the second threshold can be greater than or equal to 2.5 and less than or equal to 4.5. For example, the value of the second threshold can be any one of 3, 3.5, and 4.
[0038] In this embodiment, since the overall sharpness score and the overall clarity score of the image to be identified can be calculated, and then the image to be identified is determined to be a clear image or a blurry image based on the overall sharpness score and the overall clarity score, the multi-dimensional indicators of the image to be identified can be considered, thereby further improving the accuracy of the recognition result of the image to be identified.
[0039] As an optional implementation, if step 1200, determining that the difference in sharpness scores among the multiple regions is greater than a preset difference condition, and the sharpness score of the central region is the lowest among the sharpness scores of the multiple regions, is considered "yes," see [link to relevant documentation]. Figure 2B The methods also include: Step 1610: Determine whether the sharpness score of the central region is greater than the third threshold; Step 1620: If yes, then determine that the image to be identified is a clear image; Step 1630: If not, then the image to be identified is determined to be a blurry image.
[0040] Optionally, the third threshold can be the same as the second threshold, or alternatively, the third threshold can be different from the second threshold; no specific restrictions are imposed here.
[0041] It should be noted that, optionally, the first threshold, the second threshold, and the third threshold mentioned above can be adaptive values. Adaptive values can be understood as values that are adjusted according to the application scenario, rather than fixed values. This makes the first threshold, the second threshold, and the third threshold more adaptable.
[0042] Optionally, the above-mentioned adaptive value adjustment method may include at least one of the following: Otsu's method adjustment, local adaptive threshold adjustment, image content-based adjustment, and sharpness score-based adaptive threshold adjustment. The above-mentioned Otsu's method adjustment can be understood as calculating the adaptive threshold by maximizing the inter-class variance. The above-mentioned local adaptive threshold adjustment can be understood as dynamically adjusting the threshold according to the statistical characteristics of the local region. The above-mentioned image content-based adjustment can be understood as calculating the dynamic threshold using the statistical characteristics of the image (such as mean, standard deviation, etc.). The above-mentioned sharpness score-based adaptive threshold adjustment can be understood as adjusting the threshold according to the sharpness score (such as Laplacian variance) of the image to be recognized.
[0043] In this embodiment, when the difference in sharpness scores among multiple regions is greater than a preset difference condition, and the sharpness score of the central region is the lowest among the sharpness scores of multiple regions, it can be further determined whether the sharpness score of the central region is greater than a third threshold. If the sharpness score of the central region is greater than the third threshold, the image to be identified can be determined to be a sharp image; if the sharpness score of the central region is less than or equal to the third threshold, the image to be identified can be determined to be a blurry image. In this way, the accuracy of the recognition result of the image to be identified can be further improved, and the occurrence of misidentification of the image to be identified can be reduced.
[0044] As an optional implementation, determining whether the difference in sharpness scores among multiple regions exceeds a preset difference condition includes: Determine whether the variance between the sharpness scores of each region in multiple regions is greater than a preset difference condition.
[0045] In this embodiment, by determining whether the variance between the sharpness scores of each region in multiple regions is greater than a preset difference condition, it is determined whether the degree of difference in the sharpness scores of each region in multiple regions is greater than the preset difference condition. In this way, the accuracy of the determined degree of difference in the sharpness scores of each region can be further improved, and the method of determining the degree of difference in the sharpness scores of each region can be simplified.
[0046] As an optional implementation method, see [link to implementation details]. Figure 2C Step 410: Calculate the overall sharpness score of the image to be recognized, including: Step 411: Construct a pixel difference map of the image to be identified; Step 412: Perform weighted pooling on the pixel difference map to obtain the overall sharpness score of the image to be identified. The weights corresponding to the weighted pooling are constructed according to the generalized Gaussian distribution.
[0047] Optionally, a pixel difference map of the image to be identified can be constructed using the pixel differences in eight directions of the image to be identified, and the eight directions may include the top, bottom, left, right and four diagonal directions of the image to be identified.
[0048] In this embodiment, a pixel difference map is constructed by combining pixel differences in eight directions, and weights corresponding to weighted pooling are constructed based on a generalized Gaussian distribution. Then, the pixel difference map is subjected to weighted pooling to obtain the overall sharpness score of the image to be recognized. This can more effectively capture the structural information in the image to be recognized, especially the structural information of the edge parts of the image to be recognized. At the same time, the use of a generalized Gaussian distribution introduces nonlinear features into the pooling process, which makes the detail and edge processing performance of the image to be recognized better, thereby enhancing the recognition performance of the image to be recognized and improving the accuracy of the quality recognition result of the image to be recognized.
[0049] It should be noted that, in order to more fully illustrate the process of constructing the pixel difference map, a specific implementation method will be used as an example below: For example: the image to be recognized can be a grayscale image, and the image to be recognized can be represented by I, and the size of the image to be recognized is M. ,in The location in the image to be identified The pixel value at that location. The displacement in eight directions is set as follows: See Figure 2D The method for constructing a pixel difference map includes the following steps: Step 2200: For each direction The image to be identified is translated in this direction to obtain ; .
[0050] Step 2400: Calculate the pixel difference between the translated image and the original image in this direction; .
[0051] Step 2600: Find the maximum difference in all directions; .
[0052] Step 2800: Calculate the average difference in all directions; .
[0053] Step 3000: Obtain the final maximum and minimum difference map (i.e., pixel difference map). for: .
[0054] Optionally, see Figure 2FThe method of obtaining the overall sharpness score of the image to be recognized by weighted pooling of pixel difference maps can be understood as follows: weighted pooling is performed on the maximum and minimum difference maps. The weights (i.e., the weights corresponding to the weighted pooling process) are constructed based on a generalized Gaussian distribution, emphasizing the contribution of edge structure regions. That is, the weighted pooling process relies on the generalized Gaussian distribution to weight the difference maps. Specifically, it may include the following steps: Step 3200: For the maximum and minimum difference plot... It is then processed to one dimension and weighted according to the generalized Gaussian distribution.
[0055] The probability density function (PDF) of the generalized Gaussian distribution is defined as: ; in, It is the average of the positions. It is a scale parameter. Control the tail of the distribution. Typically, It was chosen as the average value because in image processing, the focus is usually on pixel differences in strong edge regions.
[0056] Step 3400: When calculating the weighted pooling value, the generalized Gaussian distribution described above is used for weighting; ; Step 3600: For the maximum and minimum difference plot... Weighted pooling is performed, and the pooling formula is as follows: ; in Based on difference value The calculated weights result in a final pooling result P, which is a weighted sum of the difference maps. In this way, edge regions (i.e., regions with greater differences) will receive higher weights, thus occupying a more important position in the pooling process.
[0057] Step 3800: Output the overall image sharpness score (i.e., the overall sharpness score). The final pooling result P is the overall image sharpness score, which can be used as an indicator to measure the clarity of image structure. Image clarity requires a sharpness score greater than 0.2 (selectable range [0.15, 0.35]).
[0058] As an optional implementation method, see [link to implementation details]. Figure 2E Step 420: Calculate the overall sharpness score of the image to be identified, including: Step 421: Use the target operator to calculate the edge response map of the image to be recognized; Step 422: Calculate the variance of the edge response map and determine the variance as the overall sharpness score of the image to be identified.
[0059] The specific type of the target operator is not limited here. Optionally, the target operator may include the Laplace operator, which can also be called the Laplace transform operator. Alternatively, the target operator may also include the Tenengrad operator.
[0060] The variance value represents the overall sharpness score of the image to be recognized. The larger the variance value, the higher the sharpness of the image to be recognized; the smaller the variance value, the lower the sharpness of the image to be recognized.
[0061] In this embodiment, an edge response map is calculated using a target operator on the image to be recognized, and the variance of the edge response map is calculated. The variance is then determined as the overall sharpness score of the image to be recognized, which improves the accuracy of the calculated overall sharpness score.
[0062] As an optional implementation method, see [link to implementation details]. Figure 2F Step 200: Obtain the image to be recognized, including: Step 210: Obtain the Red, Green, Blue (RGB) image; Step 220: Convert the RGB image to grayscale to obtain the grayscale-converted RGB image; Step 230: Normalize the grayscale RGB image to obtain the image to be recognized.
[0063] The process of converting an RGB image to grayscale to obtain a grayscale-converted RGB image can be described as follows: Each pixel in the RGB image can be converted to grayscale according to a conversion formula, thereby obtaining the grayscale-converted RGB image. The conversion formula may include: In this context, Y represents the grayscale value of the pixel after grayscale processing, and R, G, and B represent the red, green, and blue channel values of each pixel in the RGB image, respectively.
[0064] The normalization process can include normalizing the display size of the grayscale RGB image. This normalization process can include enlarging or reducing the display size, specifically enlarging or reducing each pixel in the grayscale RGB image. This ensures that the sharpness score calculation of the image to be identified remains consistent and comparable under different resolutions, and enhances the robustness and universal adaptability of the algorithm for determining whether the image to be identified is a sharp image in this embodiment to changes in image size.
[0065] It should be noted that normalization processing can also include other processing, such as normalizing parameters such as resolution of the grayscale RGB image.
[0066] In this embodiment, the RGB image is converted to grayscale to obtain a grayscale RGB image. The grayscale RGB image is then normalized to obtain the image to be identified. This improves the recognition effect of the image to be identified and further enhances the accuracy of determining whether the image to be identified is a clear image.
[0067] To more fully illustrate the above embodiments, a specific embodiment is given below as an example. For details, please refer to [link / reference needed]. Figure 3 , Figure 3 Includes the following steps: Step 4200: Input the image to be recognized; Step 4400: Image grayscale conversion and normalization processing, then steps 4600 and 4800 are executed respectively; Step 4600: Calculate the overall sharpness score of the image to be recognized; Step 4800: Calculate the overall sharpness score of the image to be identified; Step 5000: Determine whether the overall sharpness score is greater than the first threshold and whether the overall clarity score is greater than the second threshold. If yes, proceed to step 5400; otherwise, proceed to step 5200. Step 5200: Determine that the image to be identified is a blurred image; Step 5400: Divide the image to be recognized into multiple regions; Step 5600: Calculate the sharpness score for each region; Step 5800: Determine whether the difference in sharpness scores among the various regions is greater than the preset difference condition, and whether the sharpness score of the central region is the lowest among the sharpness scores of the various regions. If yes, proceed to step 6000; otherwise, proceed to step 6200. Step 6000: Determine whether the sharpness score of the central region is greater than the third threshold. If yes, proceed to step 6200; otherwise, proceed to step 5200. Step 6200: Determine that the image to be identified is a clear image.
[0068] See Figure 4 , Figure 4 This is a structural diagram of the image quality recognition device provided in the embodiments of this application, as shown below. Figure 4 As shown, the image quality recognition device 40 includes: Image acquisition module 41 is used to acquire the image to be recognized; The calculation module 42 is used to calculate the preliminary quality score of the image to be identified, which includes the overall sharpness score of the image to be identified. The preliminary judgment module 43 is used to determine whether the preliminary quality score meets the preset conditions. The region division module 44 is used to divide the image to be identified into multiple regions when the judgment result of the preliminary judgment module is yes. The multiple regions include a central region, which is located at the center of the image to be identified. The region calculation module 45 is used to calculate the sharpness score of each region in multiple regions; The secondary judgment module 46 is used to determine whether the difference in sharpness scores among the various regions in the multiple regions is greater than a preset difference condition, and whether the sharpness score of the central region is the lowest among the sharpness scores of the various regions in the multiple regions; The quality determination module 47 is used to determine that the image to be identified is a clear image when the judgment result of the secondary judgment module is negative.
[0069] The image quality recognition device provided in this application, when the preliminary quality score of the image to be recognized meets preset conditions, can divide the image into multiple regions. It can also determine whether the difference in sharpness scores among the regions exceeds a preset difference condition, and whether the sharpness score of the central region is the lowest among the sharpness scores of the multiple regions. If not, the image to be recognized is determined to be a sharp image. This effectively reduces the recognition error of sharp images and improves recognition accuracy. Furthermore, the entire process uses simplified statistical feature calculation and geometric partitioning logic, eliminating the need for deep learning model training and inference, thus avoiding resource consumption such as model storage and high computing power. Rapid image screening through preliminary quality scoring further reduces unnecessary fine-grained calculations, significantly reducing system resource consumption while ensuring recognition accuracy.
[0070] As an optional implementation, the preliminary quality score also includes an overall sharpness score of the image to be identified; therefore, the calculation module 42 includes: The first calculation submodule is used to calculate the overall sharpness score of the image to be recognized; and... The second calculation submodule is used to calculate the overall sharpness score of the image to be recognized; The preliminary judgment module 43 also includes: The preliminary judgment submodule is used to determine whether the overall sharpness score is greater than the first threshold and whether the overall clarity score is greater than the second threshold. The first determining submodule is used to determine that the preliminary quality score meets the preset conditions when the judgment result of the preliminary judgment submodule is yes; The second determining submodule is used to determine that the image to be identified is a blurred image when the judgment result of the preliminary judgment submodule is negative.
[0071] As an optional implementation, when the judgment result of the secondary judgment module 46 is yes, the image quality recognition device 40 further includes: The second judgment module is used to determine whether the sharpness score of the central region is greater than the third threshold. The image determination module is used to determine the image to be recognized as a clear image if the judgment result of the second judgment module is yes; and to determine the image to be recognized as a blurry image if the judgment result of the second judgment module is no.
[0072] The quality determination module, the second determination sub-module, and the image determination module can be implemented by the same module or by different modules.
[0073] As an optional implementation, the secondary judgment module 46 includes: The secondary judgment submodule is used to determine whether the variance between the sharpness scores of each region in multiple regions is greater than a preset difference condition.
[0074] As an optional implementation, the first computing submodule includes: Construction unit, used to construct a pixel difference map of the image to be identified; The weighted pooling processing unit is used to perform weighted pooling processing on the pixel difference map to obtain the overall sharpness score of the image to be recognized. The weights corresponding to the weighted pooling processing are constructed according to the generalized Gaussian distribution.
[0075] As an optional implementation, the second computing submodule includes: The edge response calculation unit is used to calculate the edge response map of the image to be recognized using the target operator. The variance calculation unit is used to calculate the variance of the edge response map and determine the variance as the overall sharpness score of the image to be recognized.
[0076] As an optional implementation, the image acquisition module 41 includes: The `get` submodule is used to acquire RGB images (red, green, blue). The grayscale processing submodule is used to perform grayscale processing on the RGB image to obtain the grayscale processed RGB image; The normalization processing submodule is used to normalize the RGB image after grayscale processing to obtain the image to be recognized.
[0077] This application also provides an electronic device. Please refer to... Figure 5The electronic device may include a processor 501, a memory 502, and a program 5021 stored in the memory 502 and executable on the processor 501. When the program 5021 is executed by the processor 501, it can achieve... Figure 1 Any steps in the corresponding method embodiments and the achievement of the same beneficial effects will not be repeated here.
[0078] Those skilled in the art will understand that all or part of the steps of the methods described in the above embodiments can be implemented by hardware related to program instructions, and the program described above can be stored in a readable medium.
[0079] This application embodiment also provides a readable storage medium storing a computer program, which, when executed by a processor, can perform the above-mentioned functions. Figure 1 Any step in the corresponding method embodiment can achieve the same technical effect, and will not be repeated here to avoid repetition.
[0080] The aforementioned storage media include read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0081] This application also provides a computer program product, including computer instructions, which, when executed by a processor, can achieve the above-mentioned functions. Figure 1 Any step in the corresponding method embodiment can achieve the same technical effect, and will not be repeated here to avoid repetition.
[0082] The above disclosure is a preferred embodiment of the present application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principles disclosed in this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. An image quality recognition method, characterized in that, include: Acquire the image to be recognized; Calculate a preliminary quality score for the image to be identified, the preliminary quality score including the overall sharpness score of the image to be identified; Determine whether the preliminary quality score meets the preset conditions; If the preliminary quality score is determined to meet the preset conditions, the image to be identified is divided into multiple regions, including a central region, which is located at the center of the image to be identified. Calculate the sharpness score for each of the multiple regions; Determine whether the difference in sharpness scores among the multiple regions is greater than a preset difference condition, and whether the sharpness score of the central region is the lowest among the sharpness scores of the multiple regions; If not, then the image to be identified is determined to be a clear image.
2. The method according to claim 1, characterized in that, The preliminary quality score also includes the overall sharpness score of the image to be identified; The calculation of the preliminary quality score of the image to be identified includes: Calculate the overall sharpness score of the image to be identified; and, Calculate the overall sharpness score of the image to be identified; The step of determining whether the preliminary quality score meets the preset conditions includes: Determine whether the overall sharpness score is greater than a first threshold and whether the overall clarity score is greater than a second threshold; If yes, the preliminary quality score is determined to meet the preset conditions; otherwise, the image to be identified is determined to be a blurry image.
3. The method according to claim 1, characterized in that, If it is determined that the difference in sharpness scores among the multiple regions is greater than a preset difference condition, and the sharpness score of the central region is the lowest among the sharpness scores of the multiple regions, the method further includes: Determine whether the sharpness score of the central region is greater than the third threshold; If so, then the image to be identified is determined to be a clear image; If not, then the image to be identified is determined to be a blurred image.
4. The method according to claim 1, characterized in that, The step of determining whether the difference in sharpness scores among the multiple regions is greater than a preset difference condition includes: Determine whether the variance between the sharpness scores of each region in the multiple regions is greater than a preset difference condition.
5. The method according to claim 2, characterized in that, The calculation of the overall sharpness score of the image to be identified includes: Construct a pixel difference map of the image to be identified; The pixel difference map is subjected to weighted pooling to obtain the overall sharpness score of the image to be identified. The weights corresponding to the weighted pooling are constructed according to the generalized Gaussian distribution.
6. The method according to claim 2, characterized in that, The calculation of the overall sharpness score of the image to be identified includes: An edge response map is calculated using the target operator on the image to be identified; The variance of the edge response map is calculated, and the variance is determined as the overall sharpness score of the image to be identified.
7. The method according to claim 1, characterized in that, The acquisition of the image to be identified includes: Obtain the RGB image (red, green, blue). The RGB image is converted to grayscale to obtain a grayscale-processed RGB image. The grayscale-processed RGB image is normalized to obtain the image to be identified.
8. An image quality recognition device, characterized in that, include: The image acquisition module is used to acquire the image to be recognized; A calculation module is used to calculate a preliminary quality score for the image to be identified, the preliminary quality score including the overall sharpness score of the image to be identified; The preliminary judgment module is used to determine whether the preliminary quality score meets preset conditions; The region division module is used to divide the image to be identified into multiple regions when the judgment result of the preliminary judgment module is yes. The multiple regions include a central region, which is located at the center of the image to be identified. The region calculation module is used to calculate the sharpness score of each region in the plurality of regions; The secondary judgment module is used to determine whether the difference in sharpness scores among the multiple regions is greater than a preset difference condition, and whether the sharpness score of the central region is the lowest among the sharpness scores of the multiple regions. The quality determination module is used to determine that the image to be identified is a clear image when the determination result of the secondary judgment module is negative.
9. An electronic device, comprising: A memory, a processor, and a program stored in the memory and executable on the processor; characterized in that the processor is configured to read the program in the memory to implement the steps of the image quality recognition method as described in any one of claims 1 to 7.
10. A readable storage medium for storing a program, characterized in that, When the program is executed by the processor, it implements the steps in the image quality recognition method as described in any one of claims 1 to 7.