Image quality evaluation method and device

By meshing and frequency domain transformation of pet images, combining the weight matrix to calculate clarity and take quantile values, the misjudgment problem caused by background interference and solid-color pet texture in the existing technology is solved, and more accurate judging image clarity.

CN113902706BActive Publication Date: 2025-02-11泰康保险集团股份有限公司 +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111179952.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-11
Publication Date
2025-02-11
Estimated Expiration
2041-10-11

AI Technical Summary

Technical Problem

The prior art is prone to background interference when judging the clarity of pet images and misjudged as blurred images, especially for the texture of solid-color pets, resulting in a high misjudgment rate.

Method used

By meshing the target image and performing frequency domain transformation, the clarity of each grid image is calculated using the weight matrix, the influence of high-frequency components is increased, and the clarity of the whole image is taken into consideration is characterized by quantile values.

Benefits of technology

It improves the accuracy of the sharpness characterization of image uneven texture distribution, reduces the rate of misjudgment, and can more accurately judge the clarity of pet images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113902706B_ABST
    Figure CN113902706B_ABST
Patent Text Reader

Abstract

The present invention discloses an image quality evaluation method and device, and relates to the field of computer technology. A specific implementation of the method includes: gridding a target image according to a set first number of pixels to obtain a plurality of grid images, and then performing frequency domain transformation on the plurality of grid images to obtain corresponding frequency domain spectra; weighted averaging the plurality of frequency domain spectra with a set weight matrix to obtain the clarity of the corresponding grid image; wherein the weight elements on the sub-diagonal line of the weight matrix and above the sub-diagonal line are 0, and the weight elements below the sub-diagonal line are greater than 0 and increase in the direction of the lower right corner; according to the set quantile, the quantile values ​​of the clarity of the plurality of grid images are calculated, and the quantile values ​​are used as the quality score of the target image to complete the quality evaluation of the target image. This implementation improves the accuracy of the clarity characterization of images with uneven texture distribution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] During the pet insurance application and claims process, it's necessary to determine the clarity of the pet image uploaded by the user when applying for insurance or filing a claim. The typical method for determining clarity is to calculate the clarity of the entire image and use this as the clarity of the pet itself. However, the pet itself usually only occupies a portion of the image, making this method susceptible to interference from background clarity and prone to misjudgment. Furthermore, since solid-colored pets lack patterns, textures are difficult to clearly show, making them prone to being misjudged as unclear.

[0003] For example, during the image capture process, some images may have large areas of background blur, but the pet itself is sufficiently clear. In this case, the above method will mistakenly judge the image as blurry. For another example, during the image capture process, due to a focus error, the pet's face is not captured clearly, but other areas are clear. In this case, the above method will mistakenly judge the image as clear. Moreover, due to the special nature of pets, the texture of solid-color pets is difficult to clearly display. If different parts of the pet's body are at different distances from the lens, the out-of-focus parts will easily appear as solid colors lacking detailed textures, thus interfering with the judgment of the pet image's clarity. Summary of the Invention

[0004] In view of this, an embodiment of the present invention provides an image quality evaluation method and device. The method divides the target image into grids and then performs frequency domain transformation to calculate the clarity of each grid image using a weight matrix, thereby increasing the influence of high-frequency components on the final clarity. The percentile values ​​of the clarity of all grid images are then taken to characterize the clarity of the entire image, thereby improving the accuracy of the clarity characterization of images with uneven texture distribution.

[0005] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for evaluating image quality is provided.

[0006] An image quality assessment method according to an embodiment of the present invention includes: dividing a target image into grids according to a set first number of pixels to obtain multiple grid images, and then performing frequency domain transformation on the multiple grid images to obtain corresponding frequency domain spectra; performing weighted averaging on the multiple frequency domain spectra and a set weight matrix to obtain the clarity of the corresponding grid images; wherein the weight elements on the sub-diagonal line and above the sub-diagonal line of the weight matrix are 0, and the weight elements below the sub-diagonal line are greater than 0 and increase toward the lower right corner; according to the set quantile, calculating the quantile values ​​of the clarity of the multiple grid images, using the quantile values ​​as the quality scores of the target image, and completing the quality assessment of the target image.

[0007] Optionally, the target image includes a pure color area and a non-pure color area; the method further includes: receiving the set quantile; wherein the quantile is used to filter out the clarity belonging to the pure color area from the clarity of the multiple grid images, and retain the clarity belonging to the non-pure color area.

[0008] Optionally, the method further includes: receiving the defined weight matrix; wherein the weight elements of the weight matrix are equal with respect to the main diagonal as the axis of symmetry.

[0009] Optionally, performing frequency domain transformation on the multiple grid images respectively to obtain corresponding frequency domain spectra includes: performing discrete cosine transformation on the multiple grid images respectively, and then taking absolute values ​​of the transformation results to obtain corresponding frequency domain spectra.

[0010] Optionally, the method further includes: inputting the original image into a pre-trained neural network model, and having the neural network model cut out a set target area from the original image to obtain an intermediate image; scaling the intermediate image to a set second number of pixels to generate the target image; wherein the width and height of the target image are divisible by the corresponding width and height of the grid image.

[0011] Optionally, the target area includes a facial area and a whole body area; the target area set by the neural network model is intercepted from the original image, including: using the neural network model to preferentially detect whether the original image contains the facial area, if the original image contains the facial area, determining that the facial area is at a first position of the original image, and intercepting the facial area according to the first position; if the original image does not contain the facial area, further detecting whether the original image contains the whole body area, and if the original image contains the whole body area, determining that the whole body area is at a second position of the original image, and intercepting the whole body area according to the second position.

[0012] Optionally, the method further includes: comparing the quality score with a set clarity threshold; if the quality score is greater than or equal to the clarity threshold, determining that the target image is a clear image; if the quality score is less than the clarity threshold, determining that the target image is a blurred image; returning the determination result of the target image, and returning a retransmission prompt message if the target image is determined to be a blurred image.

[0013] To achieve the above objective, according to another aspect of an embodiment of the present invention, an image quality evaluation device is provided.

[0014] An image quality evaluation device according to an embodiment of the present invention includes: a frequency domain transformation module, which is used to grid the target image according to a set number of pixels to obtain multiple grid images, and then perform frequency domain transformation on the multiple grid images to obtain corresponding frequency domain spectra; a weighted averaging module, which is used to weighted average the multiple frequency domain spectra with a set weight matrix to obtain the clarity of the corresponding grid images; wherein the weight elements on the sub-diagonal line of the weight matrix and above the sub-diagonal line are 0, and the weight elements below the sub-diagonal line are greater than 0 and increase toward the lower right corner; a quality evaluation module, which is used to calculate the percentile values ​​of the clarity of the multiple grid images according to the set percentile, and use the percentile values ​​as the quality scores of the target image to complete the quality evaluation of the target image.

[0015] Optionally, the target image includes a pure color area and a non-pure color area; the device also includes: a first receiving module, used to receive the set quantile; wherein the quantile is used to filter out the clarity belonging to the pure color area from the clarity of the multiple grid images, and retain the clarity belonging to the non-pure color area.

[0016] Optionally, the device further includes: a second receiving module, configured to receive the defined weight matrix; wherein the weight elements of the weight matrix are equal with respect to the main diagonal as the axis of symmetry.

[0017] Optionally, the frequency domain transformation module is further configured to perform discrete cosine transformation on each of the plurality of grid images, and then take the absolute value of the transformation result to obtain a corresponding frequency domain spectrum.

[0018] Optionally, the device further includes: a preprocessing module, configured to input the original image into a pretrained neural network model, and have the neural network model intercept a set target area from the original image to obtain an intermediate image; scaling the intermediate image to a set second number of pixels to generate the target image; wherein the width and height of the target image are divisible by the corresponding width and height of the grid image.

[0019] Optionally, the target area includes a facial area and a whole body area; the preprocessing module is further used to use the neural network model to preferentially detect whether the original image contains the facial area, and if the original image contains the facial area, determine that the facial area is at a first position of the original image, and intercept the facial area according to the first position; if the original image does not contain the facial area, further detect whether the original image contains the whole body area, and if the original image contains the whole body area, determine that the whole body area is at a second position of the original image, and intercept the whole body area according to the second position.

[0020] Optionally, the device also includes: a judgment feedback module, used to compare the quality score with a set clarity threshold; if the quality score is greater than or equal to the clarity threshold, the target image is judged to be a clear image; if the quality score is less than the clarity threshold, the target image is judged to be a blurred image; return the judgment result of the target image, and return a retransmission prompt message if the target image is judged to be a blurred image.

[0021] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device is provided.

[0022] An electronic device according to an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement an image quality evaluation method according to an embodiment of the present invention.

[0023] To achieve the above objective, according to another aspect of the embodiments of the present invention, a computer-readable medium is provided.

[0024] A computer-readable medium according to an embodiment of the present invention stores a computer program, which, when executed by a processor, implements an image quality evaluation method according to an embodiment of the present invention.

[0025] One embodiment of the above invention has the following advantages or beneficial effects: by dividing the target image into grids and then performing frequency domain transformation, the clarity of each grid image is calculated using a set weight matrix, thereby increasing the influence of high-frequency components on the final clarity, and then taking the percentile values ​​of the clarity of all grid images to represent the clarity of the entire image, thereby improving the accuracy of the clarity representation of images with uneven texture distribution.

[0026] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The accompanying drawings are provided for a better understanding of the present invention and are not intended to limit the present invention.

[0028] Figure 1 is a schematic diagram of the main steps of the image quality evaluation method according to an embodiment of the present invention;

[0029] Figure 2 is a schematic diagram of the main flow of the image quality evaluation method according to an embodiment of the present invention;

[0030] Figure 3 2 is a schematic diagram of the principle of original image preprocessing according to an embodiment of the present invention;

[0031] Figure 4 1 is a schematic diagram of the principle of the clarity calculation process of an embodiment of the present invention;

[0032] Figure 5 1 is a schematic diagram of the implementation process of target area interception according to an embodiment of the present invention;

[0033] Figure 6 is a schematic diagram of main modules of an image quality evaluation device according to an embodiment of the present invention;

[0034] Figure 7 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;

[0035] Figure 8 It is a schematic structural diagram of a computer device suitable for implementing an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0036] The following description of exemplary embodiments of the present invention is made in conjunction with the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding. These details should be considered as merely exemplary. Therefore, it should be appreciated by those skilled in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0037] Figure 1 FIG. 1 is a schematic diagram of the main steps of the image quality evaluation method according to an embodiment of the present invention. Figure 1 As shown, the image quality evaluation method according to the embodiment of the present invention mainly includes the following steps:

[0038] Step S101: Divide the target image into grids according to the set first number of pixels to obtain multiple grid images, and then perform frequency domain transformation on the multiple grid images to obtain corresponding frequency domain spectra. Divide the target image into several grids according to the set first number of pixels, such as K×K, to obtain several K×K grid images. Then perform frequency domain transformation on each grid image to obtain a frequency domain spectrum of each grid image, which contains high-frequency components and low-frequency components. Wherein, K is an integer, such as 8. The target image contains objects of business concern, such as animals, people, etc.

[0039] Step S102: Perform a weighted average of the multiple frequency domain spectra with a set weight matrix to obtain the clarity of the corresponding grid image. The weight matrix is ​​equal to the first number of pixels, and the weight elements on and above the subdiagonal are 0, while the weight elements below the subdiagonal are greater than 0 and increase toward the lower right corner. The subdiagonal is a diagonal line running from the upper right corner to the lower left corner. This weight matrix is ​​used to perform a weighted average of the high-frequency components of the frequency domain spectra.

[0040] This step takes a weighted average of the frequency domain spectrum of each grid image and the weight matrix to determine the clarity of each grid image. For example, to calculate the clarity of any grid image, the frequency domain spectrum (in matrix form) of the grid image is weighted and summed with the corresponding weight elements of the weight matrix. This weighted summation is then compared to the sum of all weight elements in the weight matrix. The resulting ratio represents the clarity of the grid image.

[0041] Step S103: Calculate the clarity percentile values ​​of the multiple grid images based on the set percentiles, and use the percentile values ​​as the quality scores of the target image to complete the quality assessment of the target image. Quantiles refer to numerical points that divide the probability distribution range of a random variable into equal parts. For example, percentiles sort a set of data from smallest to largest and calculate the corresponding cumulative percentiles. The data value corresponding to a particular percentile is called the percentile of that percentile.

[0042] In this step, the clarity of all grid images obtained in step S102 is sorted according to the level of clarity, and then the corresponding percentile value of the clarity of all grid images is taken according to the set percentile, and the percentile value is used as the quality score of the entire target image. This completes the quality evaluation of the target image and improves the accuracy of the clarity characterization of images with uneven texture distribution. In this embodiment, the percentile is greater than 50%, such as 80%, 90%, or 95%. Taking the percentile of 90% as an example, this step uses the 90% percentile of the clarity of all grid images as the quality score of the entire target image.

[0043] Pet insurance requires users to upload pet images as a basis for identifying the pet. If the uploaded pet images are unclear, the pet's identity may be unclear, leading to denial of insurance or claim processing. To promptly determine the clarity of uploaded pet images and promptly inform users whether the pet images meet insurance or claim processing requirements, this embodiment provides an image quality assessment method for pet images. This method performs real-time quality assessment on uploaded pet images, reducing the number of blurry images entering the insurance and claim processing stages, improving pet insurance efficiency, and increasing users' insurance success rates. The details are as follows.

[0044] Figure 2 FIG. 1 is a schematic diagram of the main flow of the image quality evaluation method according to an embodiment of the present invention. Figure 2 As shown, the image quality evaluation method according to the embodiment of the present invention mainly includes the following steps:

[0045] Step S201: The original image is input into a pre-trained neural network model, which then extracts the target region from the original image to produce an intermediate image. A training set of images containing the target object of interest, along with annotated data, is collected in advance. This training set is then fed into the neural network algorithm for training, enabling the trained neural network model to detect and extract the target region from these images. The specific method for detecting the target region is well-established and will not be detailed here.

[0046] In one embodiment, to serve the pet insurance business, the images in the training set may be pet images, including facial and full-body images. When training the neural network model, it is necessary to pre-collect several pet images and annotated data of the pet types covered by the pet insurance business as the training set. This training set is then fed into the neural network algorithm for training, enabling the trained neural network model to detect and capture target regions in these images. Examples of target regions include facial and full-body regions.

[0047] For the original image to be evaluated, the original image is input into the trained neural network model, and the model cuts out the target area from the original image to obtain the intermediate image. Figure 5 Related description. It is understandable that, in order to serve the pet insurance business, the original image must be a pet image of the pet type covered by the pet insurance business, and the original image can be uploaded by the user.

[0048] Step S202: Scale the intermediate image to a set second pixel number to generate a target image. Scale the intermediate image to the set second pixel number, for example, S×S, to obtain an S×S target image, i.e., the target image has a width of S and a height of S.

[0049] Figure 3 FIG. 1 is a schematic diagram showing the principle of original image preprocessing according to an embodiment of the present invention. Figure 3 As shown, the preprocessing process includes using a neural network model to detect the target area in the original image, intercepting the target area, and scaling the image, namely steps S201-S202. After the above processing, the intercepted original image can be scaled to a fixed size. The original image is an image of a pet, including pure color areas (such as the body) and non-pure color areas (such as the ears and eyes).

[0050] Step S203: Divide the target image into a grid according to the set first pixel number, to obtain a plurality of grid images. Divide the target image into a plurality of grids according to the set first pixel number, for example, K×K, to obtain a plurality of K×K grid images, i.e., the width of the grid image is K and the height is K.

[0051] In a preferred embodiment, when setting the second number of pixels, it is necessary to ensure that the width and height of the generated target image are divisible by the corresponding width and height of the grid image. For example, when K is 8, S is divisible by 8, such as S is 240.

[0052] Step S204: Perform frequency domain transformation on each of the multiple grid images to obtain corresponding frequency domain spectra. Frequency domain transformation can be implemented by discrete cosine transform (DCT), Fourier transform (FT), discrete Fourier transform (DFT), etc.

[0053] Taking the DCT transform as an example, this step performs a DCT transform on all mesh images obtained by mesh division. The absolute value of the DCT transform result is then taken to obtain the frequency domain spectrum corresponding to each mesh image. This absolute value operation facilitates subsequent plotting.

[0054] Step S205: Perform a weighted average of the multiple frequency domain spectra and the set weight matrix to obtain the clarity of the corresponding grid image. The user predefines the weight matrix W through the interactive interface. When defining the weight matrix W, the following principle must be followed: the weight elements on and above the subdiagonal of the weight matrix W are 0, the weight elements below the subdiagonal are greater than 0, and the weight increases towards the lower right corner. The weight matrix W defined under this principle can increase the influence of high-frequency components when calculating clarity.

[0055] The specific values ​​of the weight elements of the weight matrix W can be defined by yourself while satisfying the above principles, such as Figure 4 An example of a weight matrix is ​​shown in . After receiving the defined weight matrix W and obtaining the frequency domain spectrum of the grid image, the frequency domain spectrum of each grid image is weighted averaged with the weight matrix. The weighted average is the clarity of the corresponding grid image. The clarity representation of each grid image is obtained, which can be recorded as C = {C1, C2, ..., C n}, where n is the number of grid images, C n is the resolution of the nth grid image.

[0056] In a preferred embodiment, to ensure that both horizontal and vertical dimensions of the frequency domain spectrum are treated equally, the following principle must be adhered to when defining the weight matrix: the weight elements of the weight matrix are equal with respect to the main diagonal as the axis of symmetry. The main diagonal is a diagonal line running from the upper left corner to the lower right corner.

[0057] Figure 4 FIG. 1 is a schematic diagram showing the principle of the clarity calculation process according to an embodiment of the present invention. Figure 4As shown, the clarity calculation process of this embodiment of the present invention includes grid division, DCT transformation, absolute value calculation, and weighted averaging, namely steps S203 to S205. After this processing, a frequency domain spectrum of a grid image belonging to the ear region of the pet image is obtained, and the clarity of this grid image is calculated to be 0.489. The upper left corner of the frequency domain spectrum is displayed as 20.0 for convenience, but the actual value is much greater than 20.0.

[0058] Step S206: Calculate the clarity percentile values ​​of the multiple grid images based on the set percentiles. This percentile value is used as the quality score of the target image, completing the quality assessment of the original image. The target image may contain both pure and non-pure color areas. Texture in pure color areas is difficult to clearly visualize, which can interfere with the accuracy of the image quality assessment.

[0059] In this embodiment, the user sets a quantile through an interactive interface. This quantile is used to filter out the clarity of pure color areas from the clarity of multiple grid images, while retaining the clarity of non-pure color areas. This adaptively focuses on the high-definition non-pure color areas in the image, thereby preventing the pure color areas from affecting the image quality assessment. In this embodiment, the quantile can be adjusted according to actual needs, for example, to 90%.

[0060] After receiving the set quantile and obtaining the clarity set C of the grid image, the clarity in the clarity set C is sorted in order from low to high, and then the set quantile of the clarity set C is calculated, such as the 90% quantile, and the calculated quantile value is used as the quality score of the target image. The quality score of the target image is the quality score of the entire original image, and the quality evaluation of the original image is completed.

[0061] Combine Figure 4 It can be seen that the clarity of most pure color areas is low, while the clarity of non-pure color areas (such as the area from the eyes to the ears) is high. Pure color areas contain less information due to the lack of sufficient texture, but the clarity of the area from the eyes to the ears is enough to show that the image is clear. Therefore, this embodiment uses the 90% quantile to characterize the overall clarity of the image, distinguishing the pure color areas with less information from the non-pure color areas with more information in the image, and adaptively focusing on the non-pure color areas with high clarity in the image, effectively avoiding the influence of the pure color areas on the clarity judgment.

[0062] In a preferred embodiment, after calculating the quality score of the target image, the quality score can be compared with a set clarity threshold to determine whether the original image corresponding to the target image is sharp or blurred. Specifically, if the quality score is greater than or equal to the clarity threshold, the target image is determined to be sharp; if the quality score is less than the clarity threshold, the target image is determined to be blurred. The clarity threshold can be customized as needed.

[0063] Since the quality score of the target image is the same as the quality score of the original image, determining whether the target image is sharp is equivalent to determining whether the original image is sharp. Assuming the quality score of the target image is 0.257 and the clarity threshold is 0.2, the quality score of the original image is also 0.257. 0.257 is greater than 0.2, indicating that the original image is sharp.

[0064] In order to promptly provide feedback to the user on the determination result, prompt the user to re-upload unclear images, and improve the user experience, in another preferred embodiment, the determination result of the target image can also be returned, and if the target image is determined to be blurry, a re-upload prompt can be returned. That is, if the target image is determined to be clear, the user can be fed back a message indicating that the image is clear; if the target image is determined to be blurry, the user can be fed back a message indicating that the image is blurry and be reminded to re-upload a clear image.

[0065] Figure 5 FIG. 1 is a schematic diagram of the implementation process of target area interception according to an embodiment of the present invention. Figure 5 As shown, the implementation process of the target area interception of the embodiment of the present invention (i.e., in step S201, the neural network model intercepts the set target area from the original image to obtain the intermediate image) includes the following steps:

[0066] Step S501: Use a neural network model to detect whether the original image contains a facial region. If so, proceed to step S502; otherwise, proceed to step S503. For example, if the original image is a pet image, the pet image is prioritized for detection of whether the pet's facial region is present. In a preferred embodiment, the facial region is a frontal face region.

[0067] Step S502: Determine the first position of the facial region in the original image, capture the facial region based on the first position, and use the captured facial region as the intermediate image, ending the process. After detecting the facial region, the neural network model determines the position of the facial region in the pet image, and then prioritizes the facial region based on that position.

[0068] Step S503: Detect whether the original image contains the whole body area. If the original image contains the whole body area, execute step S504; otherwise, execute step S505. If no facial area is detected, further detect whether the pet image contains the whole body area of ​​the pet. Figure 3 ,The part of the pet image located in the thinner solid line frame is the facial area, and the part located in the thicker solid line frame is the whole body area.

[0069] Step S504: The whole body region is determined to be at a second position in the original image. The whole body region is captured based on the second position and used as the intermediate image, terminating the process. If the face region is not detected but the whole body region is detected, the neural network model determines the position of the whole body region in the pet image and the whole body region is captured based on that position.

[0070] Step S505: The original image is used as the intermediate image, and the process ends. If neither the facial region nor the whole body region is detected, the original image is not intercepted and is directly used as the intermediate image.

[0071] Due to focusing issues, non-target areas are often blurred. To eliminate interference from non-target near- and far-field blur on image clarity assessment, this embodiment adds target area detection to the image quality assessment process. This narrows the clarity assessment range while eliminating the influence of non-target clarity on the final clarity assessment. Furthermore, because facial areas typically contain more information than the whole body, this embodiment prioritizes detection and capture of the facial area. If the facial area cannot be detected, the whole body area is then detected. This facilitates the extraction of the more informative area for processing, further improving the accuracy of image quality assessment.

[0072] Figure 6 FIG. 1 is a schematic diagram of the main modules of the image quality evaluation device according to an embodiment of the present invention. Figure 6 As shown, the image quality evaluation device 600 according to the embodiment of the present invention mainly includes:

[0073] The frequency domain transformation module 601 is used to divide the target image into grids according to a set number of pixels to obtain multiple grid images, and then perform frequency domain transformation on the multiple grid images to obtain corresponding frequency domain spectra. According to a set first number of pixels, such as K×K, the target image is divided into several grids to obtain several K×K grid images. Thereafter, a frequency domain transformation is performed on each grid image to obtain a frequency domain spectrum of each grid image, in which high-frequency components and low-frequency components exist. Wherein, K is an integer, such as 8. The target image contains objects of business concern, such as animals, people, etc.

[0074] The weighted averaging module 602 is configured to perform a weighted average of the plurality of frequency domain spectra with a set weight matrix to obtain the clarity of the corresponding grid image. The weight matrix has a size equal to the first number of pixels, and the weight elements on and above the subdiagonal are 0, while the weight elements below the subdiagonal are greater than 0 and increase toward the lower right corner. The subdiagonal is a diagonal line running from the upper right corner to the lower left corner. The weight matrix is ​​used to perform a weighted average of the high-frequency components of the frequency domain spectra.

[0075] This module performs a weighted average of the frequency domain spectrum of each grid image and the weight matrix to obtain the clarity of each grid image. For example, to calculate the clarity of any grid image, the frequency domain spectrum of the grid image (in matrix form) is weighted and summed with the corresponding weight elements of the weight matrix. This weighted summation is then compared with the sum of all weight elements in the weight matrix. The resulting ratio is the clarity of the grid image.

[0076] The quality evaluation module 603 is used to calculate the percentile values ​​of the clarity of the multiple grid images according to the set percentiles, and use the percentile values ​​as the quality scores of the target image to complete the quality evaluation of the target image.

[0077] This module sorts the clarity of all grid images obtained by the weighted average module 602 according to the clarity level, and then takes the corresponding percentile value of the clarity of all grid images according to the set percentile, and uses this percentile value as the quality score of the entire target image. This completes the quality evaluation of the target image and improves the accuracy of the clarity representation of images with uneven texture distribution.

[0078] In addition, the image quality evaluation device 600 of the embodiment of the present invention may further include: a first receiving module, a second receiving module, a pre-processing module and a decision feedback module ( Figure 6 (not shown). The first receiving module is configured to receive the set quantile; wherein the quantile is used to filter out the clarity belonging to the pure color region from the clarity of the multiple grid images, while retaining the clarity belonging to the non-pure color region. The second receiving module is configured to receive the defined weight matrix; wherein the weight elements of the weight matrix are equal with respect to the main diagonal as the axis of symmetry.

[0079] A preprocessing module is used to input the original image into a pre-trained neural network model, and the neural network model cuts out a set target area from the original image to obtain an intermediate image; the intermediate image is scaled to a set second number of pixels to generate the target image; wherein the width and height of the target image are divisible by the corresponding width and height of the grid image.

[0080] A judgment feedback module is used to compare the quality score with a set clarity threshold. If the quality score is greater than or equal to the clarity threshold, the target image is judged to be a clear image; if the quality score is less than the clarity threshold, the target image is judged to be a blurred image; and the judgment result of the target image is returned. If the target image is judged to be a blurred image, a retransmission prompt message is returned.

[0081] From the above description, it can be seen that by dividing the target image into grids and then performing frequency domain transformation, the clarity of each grid image is calculated using the set weight matrix, which increases the influence of high-frequency components on the final clarity. Then, the percentile values ​​of the clarity of all grid images are taken to represent the clarity of the entire image, thereby improving the accuracy of the clarity representation of images with uneven texture distribution.

[0082] Figure 7 An exemplary system architecture 700 is shown to which the image quality assessment method or image quality assessment apparatus according to the embodiment of the present invention can be applied.

[0083] like Figure 7 As shown, system architecture 700 may include terminal devices 701, 702, 703, a network 704, and a server 705. Network 704 is used to provide a medium for communication links between terminal devices 701, 702, 703 and server 705. Network 704 may include various connection types, such as wired or wireless communication links or fiber optic cables.

[0084] Users can use terminal devices 701, 702, and 703 to interact with server 705 via network 704 to receive or send messages, etc. Terminal devices 701, 702, and 703 can be various electronic devices with display screens and support web browsing, including but not limited to smartphones, tablet computers, laptop computers, and desktop computers, etc.

[0085] Server 705 can be a server that provides various services, such as a background management server that processes the original images sent by the administrator using terminal devices 701, 702, and 703. The background management server can capture the target area of ​​the original image and scale it to a target image of a specified size. The background management server can perform grid division, frequency domain transformation, weighted averaging, quantile calculation, and other processing, and feed back the processing results (such as the calculated quality score) to the terminal device.

[0086] It should be noted that the image quality evaluation method provided in the embodiment of the present application is generally executed by the server 705 , and accordingly, the image quality evaluation device is generally set in the server 705 .

[0087] It should be understood that Figure 7The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.

[0088] According to an embodiment of the present invention, the present invention further provides an electronic device and a computer-readable medium.

[0089] The electronic device of the present invention includes: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement an image quality evaluation method of an embodiment of the present invention.

[0090] The computer-readable medium of the present invention stores a computer program thereon, and when the program is executed by a processor, an image quality evaluation method according to an embodiment of the present invention is implemented.

[0091] Reference below Figure 8 , which shows a schematic structural diagram of a computer system 800 suitable for implementing an electronic device according to an embodiment of the present invention. Figure 8 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present invention.

[0092] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage unit 808 into a random access memory (RAM) 803. Various programs and data required for the operation of the computer system 800 are also stored in the RAM 803. The CPU 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0093] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, and the like; an output section 807 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 808 including a hard disk; and a communication section 809 including a network interface card such as a LAN card or a modem. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 810 as needed, so that computer programs read therefrom can be installed into the storage section 808 as needed.

[0094] In particular, according to the embodiments disclosed herein, the processes described in the main step diagrams above can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the methods shown in the main step diagrams. In such embodiments, the computer program can be downloaded and installed from a network via the communication section 809, and / or installed from a removable medium 811. When the computer program is executed by the central processing unit (CPU) 801, the above-mentioned functions defined in the system of the present invention are executed.

[0095] It should be noted that the computer-readable medium described in the present invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media can include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. This propagated data signal can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical fiber cable, RF, or any suitable combination thereof.

[0096] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0097] The modules involved in the embodiments of the present invention may be implemented in software or in hardware. The modules described may also be provided in a processor. For example, they may be described as follows: a processor including a frequency domain transformation module, a weighted average module, and a quality evaluation module. The names of these modules do not, in some cases, constitute limitations on the modules themselves. For example, the frequency domain transformation module may also be described as a module that "divides the target image into grids according to a set number of pixels to obtain a plurality of grid images, and then performs frequency domain transformation on the plurality of grid images to obtain corresponding frequency domain maps."

[0098] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by a device, the device includes: dividing the target image into grids according to a set first number of pixels to obtain multiple grid images, and then performing frequency domain transformation on the multiple grid images to obtain corresponding frequency domain spectra; performing weighted averaging on the multiple frequency domain spectra with a set weight matrix to obtain the clarity of the corresponding grid images; wherein the weight elements on the sub-diagonal line and above the sub-diagonal line of the weight matrix are 0, and the weight elements below the sub-diagonal line are greater than 0 and increase toward the lower right corner; according to the set quantile, calculating the quantile values ​​of the clarity of the multiple grid images, using the quantile values ​​as the quality scores of the target image, and completing the quality evaluation of the target image.

[0099] According to the technical solution of the embodiment of the present invention, the target image is divided into grids and then subjected to frequency domain transformation, so that the clarity of each grid image is calculated using a set weight matrix, thereby increasing the influence of high-frequency components on the final clarity, and then taking the percentile values ​​of the clarity of all grid images to represent the clarity of the entire image, thereby improving the accuracy of the clarity representation of images with uneven texture distribution.

[0100] The above-mentioned product can execute the method provided by the embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided by the embodiment of the present invention.

[0101] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.

Claims

1. A method for evaluating image quality, characterized in that: include: Divide the target image into grids according to the set first number of pixels to obtain a plurality of grid images, and then perform frequency domain transformation on the plurality of grid images respectively to obtain corresponding frequency domain spectra; Performing weighted averaging on the plurality of frequency domain spectra and the set weight matrix respectively to obtain the clarity of the corresponding grid image; wherein the weight elements on the sub-diagonal line of the weight matrix and above the sub-diagonal line are 0, and the weight elements below the sub-diagonal line are greater than 0 and increase toward the lower right corner; According to the set quantile and the clarity of the sorted grid images, the quantile values ​​of the clarity of the multiple grid images are calculated, and the quantile values ​​are used as the quality scores of the target images to complete the quality evaluation of the target images.

2. The method according to claim 1, characterized in that: The target image includes a pure color area and a non-pure color area; the method further includes: Receive the set quantile; wherein the quantile is used to filter out the clarity belonging to the pure color area from the clarity of the multiple grid images, and retain the clarity belonging to the non-pure color area.

3. The method according to claim 1, characterized in that The method further comprises: The defined weight matrix is ​​received; wherein the weight elements of the weight matrix are equal with respect to the main diagonal as the axis of symmetry.

4. The method according to claim 1, characterized in that: The performing frequency domain transformation on the plurality of grid images respectively to obtain corresponding frequency domain spectra includes: Discrete cosine transform is performed on the multiple grid images respectively, and then the absolute value of the transform result is taken to obtain the corresponding frequency domain spectrum.

5. The method according to claim 1, characterized in that: The method further comprises: Inputting the original image into a pre-trained neural network model, and allowing the neural network model to intercept a set target area from the original image to obtain an intermediate image; The intermediate image is scaled to a set second number of pixels to generate the target image; wherein the width and height of the target image are divisible by the corresponding width and height of the grid image.

6. The method according to claim 5, characterized in that The target area includes a facial area and a whole body area; The neural network model intercepts a set target area from the original image, comprising: Using the neural network model to preferentially detect whether the original image contains the facial region, if the original image contains the facial region, determining that the facial region is at a first position of the original image, and intercepting the facial region according to the first position; If the original image does not contain the facial area, further detect whether the original image contains the whole body area, and if the original image contains the whole body area, determine that the whole body area is at a second position of the original image, and capture the whole body area according to the second position.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Comparing the quality score with a set clarity threshold, if the quality score is greater than or equal to the clarity threshold, determining that the target image is a clear image; if the quality score is less than the clarity threshold, determining that the target image is a blurred image; The determination result of the target image is returned, and when the target image is determined to be a blurred image, retransmission prompt information is returned.

8. An image quality evaluation device, characterized in that: include: A frequency domain transformation module is used to divide the target image into grids according to a set number of pixels to obtain a plurality of grid images, and then perform frequency domain transformation on the plurality of grid images respectively to obtain corresponding frequency domain spectra; A weighted averaging module is used to perform weighted averaging on the plurality of frequency domain spectra and the set weight matrix respectively to obtain the clarity of the corresponding grid image; wherein the weight elements on the sub-diagonal line of the weight matrix and above the sub-diagonal line are 0, and the weight elements below the sub-diagonal line are greater than 0 and increase toward the lower right corner; The quality evaluation module is used to calculate the percentile value of the clarity of the multiple grid images according to the set percentile and the clarity of the sorted grid images, and use the percentile value as the quality score of the target image to complete the quality evaluation of the target image.

9. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Reference-free noise image quality evaluation method based on gradient similarity

    CN104103064A

  • Non-reference image quality evaluation method based on multi-block wavelet transform

    CN111445435A