Image quality detection method and device, electronic equipment and storage medium
By generating grayscale images and histograms, the brightness distribution feature values are determined. Combined with scene type and scale factor, the subjectivity and flexibility issues of image quality detection for electronic devices are resolved, achieving higher accuracy and convenience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-21
- Publication Date
- 2026-03-27
AI Technical Summary
In existing technologies, the image quality detection results of electronic devices are highly subjective, resulting in low accuracy. Furthermore, they cannot flexibly process batch images, lacking convenience and flexibility.
By generating grayscale images from images and producing multiple histograms, the brightness distribution feature values are determined. Image quality detection is then performed based on these feature values. Furthermore, scene type and scale factors are combined for segmentation and comparison, thereby improving the accuracy and flexibility of the detection.
It improves the flexibility and accuracy of image quality detection, reduces reliance on image preview, can easily process any number of images, and enhances the objectivity of device image quality detection.
Smart Images

Figure CN116012278B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of image processing, and particularly relates to an image quality detection method and device, an electronic device and a storage medium. BACKGROUND
[0002] The image quality of an electronic device is mainly determined by AEC (Automatic Exposure Control) and sensitivity. The automatic exposure duration and sensitivity determine the dynamic range, definition and contrast of the collected image. The image quality of the device is determined by evaluating the collected image.
[0003] In a related scenario, a specific region is manually selected from a preview image, color and brightness of the specific region are sampled, a score of the specific region is determined according to the sampled color and brightness, and finally, the image quality detection result of the device is determined according to the scores of the specific regions. Since the selection of the specific region is highly subjective, the subjectivity of the image quality detection result is relatively high, which leads to low accuracy of the debugging of the electronic device. SUMMARY
[0004] The present disclosure provides an image quality detection method, device, electronic device and storage medium. The brightness distribution feature value of the image captured by the first device is determined, and the detection result of the image quality of the first device is determined according to the brightness distribution feature value, thereby improving the accuracy of the image quality detection of the device.
[0005] According to a first aspect of an embodiment of the present disclosure, an image quality detection method is provided, comprising:
[0006] generating a gray-scale image of an image captured by a first device for a target object;
[0007] generating a plurality of histograms according to the gray-scale image;
[0008] determining a brightness distribution feature value of the gray-scale image according to the plurality of histograms;
[0009] determining a detection result of the image quality of the first device according to the brightness distribution feature value.
[0010] According to a second aspect of an embodiment of the present disclosure, an image quality detection device is provided, comprising:
[0011] a first generation module configured to generate a gray-scale image of an image captured by a first device for a target object;
[0012] a second generation module configured to generate a plurality of histograms according to the gray-scale image;
[0013] a first determining module, configured to determine a luminance distribution feature value of the grayscale image according to the plurality of histograms;
[0014] a first determining module, configured to determine a detection result of image quality of the first device according to the luminance distribution feature value.
[0015] According to a third aspect of embodiments of the present disclosure, an electronic device is provided, comprising:
[0016] a processor; and a memory for storing processor-executable instructions;
[0017] wherein the processor is configured to:
[0018] generate a grayscale image of an image obtained by photographing a target object by a first device;
[0019] generate a plurality of histograms according to the grayscale image;
[0020] determine a luminance distribution feature value of the grayscale image according to the plurality of histograms;
[0021] determine a detection result of image quality of the first device according to the luminance distribution feature value.
[0022] According to a fourth aspect of embodiments of the present disclosure, a computer-readable storage medium is provided, having stored thereon computer program instructions, which, when executed by a processor, implement the steps of the method of any one of the first aspect.
[0023] The technical solutions provided by the embodiments of the present disclosure can have the following beneficial effects: by generating a grayscale image of an image obtained by photographing a target object by a first device, generating a plurality of histograms according to the grayscale image, determining a luminance distribution feature value of the grayscale image according to the plurality of histograms, and determining a detection result of image quality of the first device according to the luminance distribution feature value, the flexibility and accuracy of device image quality detection are improved by determining the luminance distribution feature value of the image photographed by the first device and determining the detection result of image quality of the first device according to the luminance distribution feature value.
[0024] It should be understood that the general description above and the detailed description below are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0025] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present disclosure and, together with the specification, serve to explain the principles of the present disclosure.
[0026] Figure 1is a flowchart of an image quality detection method according to an exemplary embodiment.
[0027] Figure 2 is an image photographed by a first device according to an exemplary embodiment.
[0028] Figure 3 is a gray scale according to an exemplary embodiment.
[0029] Figure 4 is a flowchart of an implementation of step S12 in Figure 1
[0030] Figure 5 is a diagram of a number of pixel points corresponding to a gray scale value of an image photographed by a first device according to an exemplary embodiment.
[0031] Figure 6 is a diagram of a cumulative probability distribution of pixel points corresponding to a gray scale value of an image photographed by a first device according to an exemplary embodiment.
[0032] Figure 7 is a diagram of a cumulative probability distribution of pixel points corresponding to a gray scale value of a foreground image and a background image according to an exemplary embodiment.
[0033] Figure 8 is a flowchart of a method of pre-calibrating a scale factor according to an exemplary embodiment.
[0034] Figure 9 is a diagram of a cumulative probability distribution of pixel points corresponding to a gray scale value in a sub-gray scale according to an exemplary embodiment.
[0035] Figure 10 is a flowchart of an implementation of step S14 in Figure 1
[0036] Figure 11 is a flowchart of an implementation of step S13 in Figure 1
[0037] Figure 12 is a flowchart of an implementation of step S134 in Figure 11
[0038] Figure 13 is a flowchart of an implementation of step S141 in Figure 10
[0039] Figure 14 is a flowchart of another image quality detection method according to an example embodiment.
[0040] Figure 15 is a block diagram of an image quality detection device according to an example embodiment.
[0041] Figure 16 is a block diagram of a device for image quality detection according to an example embodiment. DETAILED DESCRIPTION
[0042] The example embodiments will be described in detail herein with reference to the accompanying drawings. In the following description, unless otherwise indicated, like numbers in the different drawings represent the same or similar elements. The following example embodiments described in the following description are not meant to represent all embodiments consistent with the present disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0043] The inventor found that the image quality detection result of the device is determined by the absolute value of the difference between the actual value and the ideal value of the gray scale, peak value and area of the specific area of the preview image, which needs to be used in combination with image preview, has low convenience, and the method is only based on the image collected by the device to obtain the evaluation score, without comparison and analysis, and has low accuracy. In addition, the method cannot compare the quality of a batch of images, and has low flexibility.
[0044] Therefore, the present disclosure provides an image quality detection method, Figure 1 is a flowchart of an image quality detection method according to an example embodiment, as Figure 1 shown, the method can be applied to a first device, or a third-party device outside the first device, and the method comprises the following steps.
[0045] In step S11, a gray scale image of an image obtained by photographing a target object by a first device is generated.
[0046] The first device is configured with an image acquisition sensor, such as a front camera and a rear camera, and each front camera and rear camera can be a fixed optical lens system or have a focal length and optical zoom capability.
[0047] Optionally, in the case of a third-party device as the subject of the method, the step of generating a gray scale image of an image can be performed on the first device, and the third-party device obtains the gray scale image generated by the first device; or the third-party device can obtain the image obtained by photographing the target object by the first device, and perform the step of generating a gray scale image of the image.
[0048] For example, an image of the target object is captured by the image acquisition sensor of the first device, and a third-party device exports the image of the target object captured by the image sensor camera of the first device, and then processes the image to generate a grayscale image.
[0049] In one implementation, see Figure 2 The first device captures an image of the target object. The average grayscale value of all pixels in the image's pixel matrix is calculated. Pixels with grayscale values less than or equal to the average are set to 0 (black pixels), while pixels with grayscale values greater than the average are set to 255 (white pixels), generating a pixel like... Figure 3 The grayscale image shown.
[0050] In one implementation, to reduce the complexity of the algorithm, a third-party device can downsample the exported image, for example, by using interlaced downsampling to reduce the image size to a fraction of the original image. Where T is the number of intervals between rows or columns during downsampling.
[0051] In step S12, multiple histograms are generated based on the grayscale image.
[0052] For any two histograms, there exists a condition where the maximum gray value in one histogram is less than the minimum gray value in the other histogram.
[0053] For example, if an image is divided into four histograms with grayscale value ranges of [0, 40], (40, 160], (160, 220], and (220, 255], it can be seen that the maximum grayscale value in one histogram is less than the minimum grayscale value in the other histogram. For instance, the maximum grayscale value in [0, 40] is 40, while the minimum grayscale values in the other three sub-histograms are all greater than 40.
[0054] In one implementation, the grayscale image is divided into multiple sub-grayscale images, and a histogram of each sub-grayscale image is generated.
[0055] For example, the gray scale image of the first device is segmented to obtain a foreground image gray scale image and a background image gray scale image, the foreground image gray scale image is segmented to obtain a plurality of sub-gray scale images corresponding to the foreground image gray scale image, and the background image gray scale image is segmented to obtain a plurality of sub-gray scale images corresponding to the background image gray scale image. The cumulative probability distribution of the gray scale value of the pixel point in each sub-gray scale image corresponding to the foreground image is obtained to obtain a histogram corresponding to each sub-gray scale image in the foreground image, and the cumulative probability distribution of the gray scale value of the pixel point in each sub-gray scale image corresponding to the background image is obtained to obtain a histogram corresponding to each sub-gray scale image in the background image, thereby obtaining a plurality of histograms corresponding to the gray scale image.
[0056] In step S13, the brightness distribution feature value of the gray scale image is determined according to the plurality of histograms.
[0057] The occurrence probability of the pixel point corresponding to the gray scale value in the gray scale image corresponding to each histogram is calculated, and the cumulative probability distribution of each gray scale value is calculated according to the occurrence probability of the pixel point corresponding to the gray scale value, and the brightness distribution feature value of the sub-gray scale image is determined according to the cumulative probability distribution.
[0058] In step S14, the detection result of the image quality of the first device is determined according to the brightness distribution feature value.
[0059] In an embodiment, the brightness distribution feature value of the contrast image is obtained by the image generation model, the brightness distribution feature value of the contrast device is compared with the brightness distribution feature value of the first device, and the detection result of the image quality of the first device is obtained.
[0060] In another embodiment, the image of the target object obtained by photographing the target object by the contrast device is obtained, the brightness distribution feature value of the contrast device photographing image is obtained, the brightness distribution feature value of the contrast device is compared with the brightness distribution feature value of the first device, and the detection result of the image quality of the first device is obtained. The contrast device is a device whose image quality detection result meets the detection requirement.
[0061] The technical solution is characterized in that: an image of a target object captured by a first device is obtained, a grayscale image of the image is generated, a plurality of histograms are generated according to the grayscale image, a luminance distribution feature value of the grayscale image is determined according to the plurality of histograms, and a detection result of image quality of the first device is determined according to the luminance distribution feature value. The luminance distribution feature value of the image captured by the first device is determined, and the detection result of image quality of the first device is determined according to the luminance distribution feature value, thereby improving the flexibility and accuracy of device image quality detection. In addition, the image can be processed directly without previewing, thereby improving the convenience of image quality detection.
[0062] The grayscale image includes a grayscale image of a foreground image and a grayscale image of a background image, and the foreground image and the background image are obtained by segmenting the image according to a grayscale segmentation value. Figure 4 As shown in FIG. 12, the step of generating a plurality of corresponding histograms according to the grayscale image includes:
[0063] In step S121, a histogram of the foreground image is generated according to the grayscale image of the foreground image, and a histogram of the background image is generated according to the grayscale image of the background image.
[0064] For example, a grayscale segmentation value for segmenting the image is determined, and the image is segmented into a foreground image and a background image according to the grayscale segmentation value. The grayscale image of the foreground image and the grayscale image of the background image are generated. The grayscale segmentation value is a critical segmentation value of a pixel point of the foreground image and the background image. For example, a pixel point with a grayscale value less than or equal to the grayscale segmentation value is a pixel point in the foreground image, and a pixel point with a grayscale value greater than the grayscale segmentation value is a pixel point in the background image.
[0065] The grayscale image of the foreground image and the grayscale image of the background image both perform the steps of segmenting the grayscale image into a plurality of sub-grayscale images and generating a histogram of each sub-grayscale image, and the steps of determining the luminance distribution feature value of the grayscale image according to the histogram.
[0066] In some possible implementations, the number of pixel points corresponding to each grayscale value in the image is calculated to obtain a grayscale histogram, as shown in FIG. 5. Figure 5 As shown in FIG. 6, and the cumulative probability distribution of the pixel points corresponding to each grayscale value in the image is calculated to obtain a grayscale histogram, as shown in FIG. 7. Figure 6The cumulative probability distribution histogram is shown. The maximum inter-class variance method is used to determine the gray scale segmentation value for segmenting the image. For example, on the gray scale histogram of the image taken by the first device, the foreground and background form a high peak, and the minimum value between the two peaks is taken as the gray scale segmentation value Th. The image is then segmented into a foreground image with a gray scale value of [0, 167] and a background image with a gray scale value of [167, 255]. The cumulative probability distribution of the pixel points in the foreground image and the cumulative probability distribution of the pixel points in the background image can be calculated according to the gray scale values of the pixel points in the foreground image and the background image, and the histogram shown in Figure 7 is obtained.
[0067] In step S122, the target scale factor is determined according to the scene type in which the target object is located and a preset corresponding relationship between the scene type and the scale factor.
[0068] The scene type refers to the lighting condition and / or sensitive condition of the scene in which the target object is located. The scene type can include a backlit scene, a frontlit scene, an indoor scene, a night scene, and the like. Each scene type corresponds to one scale factor. The scale factor of the scene type can be determined as the target scale factor according to the corresponding relationship according to the scene type in which the target object is located.
[0069] For example, in the case where the scene type in which the target object is located is a backlit scene, the scale factor calibrated for the backlit scene is taken as the target scale factor according to the preset corresponding relationship between the backlit scene and the scale factor.
[0070] In this embodiment, a flowchart of a method for pre-calibrating a scale factor is shown in Figure 8 The calibration method includes the following steps:
[0071] In step S31, a gray card image taken under a scene type is obtained.
[0072] The third-party device can obtain the gray card image under the scene type from the device that takes the gray card image.
[0073] In step S32, the cumulative probability distribution of the gray scale value in the gray card image that is the same as each gray card gray scale value is determined for the gray card gray scale values of a plurality of predetermined gray scales on the gray card.
[0074] It should be noted that the gray card gray scale values of a plurality of adjacent predetermined gray scales can be selected, for example, the gray card gray scale values of the first, second, and third predetermined gray scales are selected. However, adjacent gray scales will result in a low contrast, and therefore, in order to improve the contrast, the gray card gray scale values of a plurality of predetermined gray scales can be selected at intervals, for example, the gray card gray scale values of the first, third, and fifth predetermined gray scales can be selected, or the gray card gray scale values of the second, fourth, and sixth predetermined gray scales can be selected.
[0075] Of course, the number of the plurality of predetermined gray scales can be determined according to the scene type, for example, the number of the plurality of predetermined gray scales in the back light scene can be three, and the number of the plurality of predetermined gray scales in the back light scene can be five.
[0076] Firstly, the probability p(i) of the pixel point of each gray scale value i in the gray card image is calculated, and then the cumulative probability distribution of the gray scale value same as each gray card gray scale value in the gray card image is determined according to the probability p(i) of the pixel point of each gray scale value.
[0077] For example, the cumulative probability distribution cdf(i) of the gray scale value same as each gray card gray scale value in the gray card image is calculated by the following formula:
[0078]
[0079]
[0080] Wherein, n _i represents the number of pixel points of the gray scale value i, and n is the total number of pixel points in the gray card image.
[0081] In step S33, the target gray scale value corresponding to each gray card gray scale value on the gray card image is determined according to each cumulative probability distribution and the preset target value of the cumulative probability distribution of the gray scale value in the gray card image.
[0082] Wherein, the preset target value is used to represent the distribution range of the cumulative probability distribution characteristic of the gray scale value in the gray card image, and in one possible implementation, the preset target value can be the maximum value and the minimum value of the cumulative probability distribution. For example, the target gray scale value gray out on the gray card image corresponding to each gray card gray scale value is determined by the following formula:
[0083]
[0084] Wherein, cdf(input) is the cumulative probability distribution of the gray scale value same as each gray card gray scale value in the gray card image, cdf min and cdf max respectively represent the maximum value and the minimum value of the cumulative probability distribution of the gray scale value in the gray card image. Generally, cdf min is 0, and cdf max is 1.
[0085] In step S34, the scale factor corresponding to the scene type is determined according to each target gray scale value.
[0086] For example, a first scale factor is calculated based on the minimum target gray value, the second minimum target gray value, and the minimum gray value of a pixel in the gray card image; a second scale factor is calculated based on the second minimum target gray value, the maximum target gray value, and the maximum gray value of a pixel in the gray card image.
[0087] For example, the scale factor for the corresponding scene type is determined by the following formula:
[0088]
[0089]
[0090] Where σ1 is the first scale factor, σ2 is the second scale factor, high is the maximum gray value of a pixel in the gray card image, low is the minimum gray value of a pixel in the gray card image, and gray... out [1] is the minimum value among the target grayscale values, gray out [2] is the second smallest value among the target grayscale values, gray out [3] is the maximum value among the target gray values.
[0091] The following example uses a backlit scene as an example. A gray card image is captured in a backlit scene. A third-party device acquires the gray card image captured in the backlit scene and determines that the gray values of the first, third, and fifth predetermined gray levels on the gray card are 51, 130, and 183, respectively.
[0092] Furthermore, for the first gray value 51 on the gray card, the cumulative probability distribution cdf(51) of the gray values in the gray card image that are the same as the gray value 51 is determined; similarly, for the first gray value 130 on the gray card, the cumulative probability distribution cdf(130) of the gray values in the gray card image that are the same as the gray value 130 is determined; for the first gray value 183 on the gray card, the cumulative probability distribution cdf(183) of the gray values in the gray card image that are the same as the gray value 183 is determined.
[0093] Furthermore, substituting cdf(51), cdf(130), and cdf(183) into the calculation of gray out The formula yields the target gray values (gray) corresponding to the gray values 51, 130, and 183 on the gray card image. out (51) gray out (130) and gray out (183):
[0094]
[0095]
[0096]
[0097] Furthermore, the target grayscale value is... out (51) gray out (130) and gray out (183) Substitute into the formula for calculating the scale factor to calculate the scale factor.
[0098]
[0099]
[0100] In step S123, based on the target scale factor and the grayscale segmentation value used for foreground and background segmentation of the image, a first segmentation threshold between the minimum grayscale value and the grayscale segmentation value of the image is determined, and a second segmentation threshold between the maximum grayscale value and the grayscale segmentation value of the image is determined.
[0101] The first segmentation threshold can be one or more, used to segment the grayscale image of the foreground image according to the grayscale value of the foreground pixel; similarly, the second segmentation threshold can be one or more, used to segment the grayscale image of the background image according to the grayscale value of the background pixel.
[0102] This example illustrates the concept by using one first segmentation threshold and one second segmentation threshold. The first segmentation threshold Thre1 and the second segmentation threshold Thre2 are calculated using the following formula:
[0103] Thre1 = Low + (Thre - Low) * σ1
[0104] Thre2 = Thre + (High - Thre) * σ2
[0105] Following the above Figure 7 The grayscale segmentation value Thre is 167 for calculation.
[0106] Thre1=Low+(Thre-Low)*σ1=0+(167-0)*0.23=38
[0107] Thre2=Thre+(High-Thre)*σ2=167+(255-167)*0.5185=212
[0108] In step S124, the histogram of the foreground image is segmented according to the first segmentation threshold, and the histogram of the background image is segmented according to the second segmentation threshold to obtain multiple histograms of the grayscale image.
[0109] The image captured by the first device is segmented into four sub-gray scale images with gray scale values of [0, 38], (38, 167], (167, 212] and (212, 255] using the first segmentation threshold Thre1 and the second segmentation threshold Thre2 in the above embodiment, and the cumulative probability distribution of the pixel points corresponding to the gray scale values in each sub-gray scale image is calculated to obtain a histogram as shown in FIG. 8. The image captured by the second device can be segmented into four sub-gray scale images in the same way. Figure 9
[0110] In a possible implementation manner, the method further includes:
[0111] obtaining a reference luminance distribution feature value of the target object.
[0112] The second image can be obtained by capturing the target object by the second device, that is, the first image is captured by the first device, the second image is captured by the second device, and the reference luminance distribution feature value is obtained based on the second image by using, for example, a machine learning manner. The second device is a device whose detection result of image quality meets the detection requirement.
[0113] In a possible implementation manner, the gray scale image of the first image is generated, a plurality of histograms are generated according to the gray scale image of the first image, and the luminance distribution feature value of the gray scale image of the first image is determined according to the plurality of histograms corresponding to the first image. Similarly, the gray scale image of the second image is generated, a plurality of histograms are generated according to the gray scale image of the second image, and the reference luminance distribution feature value is determined according to the plurality of histograms corresponding to the second image. The number of histograms of the first device and the second device can be the same.
[0114] By using the above technical solution, the luminance distribution feature value is determined in the same way for the same target object by different devices, the accuracy of determining the AEC performance and the sensitivity performance of the first device is further improved by the targeted comparison of the image quality, and the accuracy of the image quality detection of the first device is improved.
[0115] Figure 10 is a flowchart for implementing step S14 in FIG. 14 according to an example embodiment, as shown in FIG. 15. Figure 1 Figure 10 In step S14, the detection result of the image quality of the first device according to the luminance distribution feature value includes:
[0116] In step S141, the luminance distribution feature value of the gray scale image is compared with the reference luminance distribution feature value.
[0117] In one possible implementation, the minimum luminance distribution characteristic value in the image corresponding gray scale graph of the first device is compared with the minimum luminance distribution characteristic value in the reference luminance distribution characteristic value, the second minimum luminance distribution characteristic value in the image corresponding gray scale graph of the first device is compared with the second minimum luminance distribution characteristic value in the reference luminance distribution characteristic value, and so on.
[0118] In step S142, the detection result of the image quality of the first device is determined according to the comparison result.
[0119] For example, each comparison result is scored, the weighted sum of each scored comparison result is obtained to obtain a detection parameter value, and in a case where the detection parameter value is in a preset range, it is determined that the detection result of the image quality of the first device meets the detection requirement, that is, the first device and the second device have the same AEC performance and sensitivity performance.
[0120] On the basis of the above embodiment, the luminance distribution characteristic value includes an equalized luminance value and a luminance dynamic range characteristic value, Figure 11 is a flowchart of step S13 in Figure 1 S13, as shown in the figure, in step S13, the luminance distribution characteristic value of the gray scale graph is determined according to the plurality of histograms, including: Figure 11
[0121] In step S131, the cumulative probability distribution corresponding to each gray scale value in each histogram is calculated. As shown in the figure. Figure 9
[0122] In step S132, the target cumulative probability distribution for equalizing the gray scale graph of each histogram is determined.
[0123] Optionally, the preset luminance value is determined as the target luminance value for equalizing the gray scale graph of each histogram, and the target luminance value for equalizing the gray scale graph of each histogram is the same.
[0124] In step S133, the mapping gray scale value corresponding to the target cumulative probability distribution in each histogram is determined according to the cumulative probability distribution of each gray scale value in each gray scale graph.
[0125] The mapping gray scale value refers to the gray scale value corresponding to the target cumulative probability distribution in the gray scale graph of the histogram. For example, in a case where the target luminance value is 0.5, the gray scale value corresponding to the cumulative probability distribution of 0.5 in the gray scale graph of each histogram of the first device is determined. As used Figure 8 The histogram is shown to illustrate that in the image taken by the first device, the mapping gray value corresponding to the target cumulative probability distribution 0.5 in the sub-gray scale [0, 38] is 22, the mapping gray value corresponding to the target cumulative probability distribution 0.5 in the sub-gray scale (38, 167] is 90, the mapping gray value corresponding to the target cumulative probability distribution 0.5 in the sub-gray scale (167, 212] is 187, and the mapping gray value corresponding to the target cumulative probability distribution 0.5 in the sub-gray scale (212, 255] is 224. Similarly, the mapping gray value corresponding to the target cumulative probability distribution 0.5 in the gray scale of each histogram of the second device can be determined.
[0126] In step S134, the mapping gray value is taken as the equalized brightness value of the corresponding histogram, and a brightness dynamic range characteristic value corresponding to the histogram is calculated according to each equalized brightness value.
[0127] According to the embodiment in step S133, for the image taken by the first device, the mapping gray value 22 is taken as the equalized brightness value a1 of the histogram [0, 38]; similarly, the mapping gray value 90 is taken as the equalized brightness value a2 of the histogram (38, 167], the mapping gray value 187 is taken as the equalized brightness value a3 of the histogram (167, 212], and the mapping gray value 224 is taken as the equalized brightness value a4 of the histogram (212, 255]. Similarly, the equalized brightness values A1, A2, A3, and A4 of each histogram in the image taken by the second device are calculated.
[0128] In Figure 11 Based on the embodiment, Figure 12 is a flowchart of implementing Figure 11 In step S134, the flowchart of step S134 is shown as follows: Figure 12 In step S134, the brightness dynamic range characteristic value corresponding to the histogram is calculated according to each equalized brightness value, including:
[0129] In step S1341, the square difference between each equalized brightness value and each gray value is calculated between the minimum and maximum gray values of the gray scale of the histogram according to the equalized brightness value of each histogram and the total number of pixel points in the gray scale corresponding to the histogram.
[0130] In step S1342, the product of each square difference and the total number of gray values of the pixel points in the gray scale is calculated, and the sum of the products is obtained to obtain the gray characteristic value.
[0131] In step S1343, the quotient of the gray characteristic value and the total number of pixel points in the gray scale is calculated to obtain the brightness dynamic range characteristic value corresponding to the histogram of the gray scale.
[0132] For example, the luminance dynamic range characteristic value u1 of the sub-gray scale graph [0, 38] of the image taken by the first device is calculated as follows: k :
[0133]
[0134] wherein start is the minimum value of the gray scale of the gray scale graph corresponding to the histogram, end is the maximum value of the gray scale of the gray scale graph corresponding to the histogram, a k is the equalized luminance value of the gray scale graph corresponding to the histogram, m is the total number of gray scale values of the pixel points in the gray scale graph corresponding to the histogram, n k is the total number of pixel points in the gray scale graph corresponding to the histogram. i is any gray scale value in the gray scale graph corresponding to the histogram.
[0135] For example, the luminance dynamic range characteristic value u1 of the sub-gray scale graph [0, 38] of the image taken by the first device is calculated as follows:
[0136]
[0137] Similarly, the luminance dynamic range characteristic values u2, u3 and u4 of the other three sub-gray scale graphs of the image taken by the first device can be calculated, and the luminance dynamic range characteristic values U1, U2, U3 and U4 of the four sub-gray scale graphs of the image taken by the second device can be calculated.
[0138] Figure 13 is a flowchart for implementing Figure 10 step S141 according to an example embodiment, as shown in Figure 13 step S141, the luminance distribution characteristic value of the gray scale graph of the first device is compared with the luminance distribution characteristic value of the gray scale graph of the second device, including:
[0139] In step S1411, for each histogram, the squared difference between the equalized luminance value corresponding to the first device and the equalized luminance value in the reference luminance distribution characteristic value, and the squared difference between the luminance dynamic range characteristic value corresponding to the first device and the luminance dynamic range characteristic value in the reference luminance distribution characteristic value are calculated.
[0140] In step S1412, the squared differences of the equalized luminance values are summed to obtain the equalized luminance difference value, and the squared differences of the luminance dynamic range characteristic values are summed to obtain the luminance dynamic range characteristic difference value.
[0141] For example, the equalized luminance difference value res A is calculated by the following formula:
[0142]
[0143] The luminance dynamic range characteristic difference value res u is calculated by the following formula:
[0144]
[0145] wherein k corresponds to the sub-gray scale, for example, when k is 1, it is the square difference of the equalized brightness value corresponding to the gray scale with the minimum gray value and the square difference of the brightness dynamic range characteristic value. Similarly, when k is 4, it is the square difference of the equalized brightness value corresponding to the gray scale with the maximum gray value and the square difference of the brightness dynamic range characteristic value.
[0146] It can be explained that the value of k is determined by the number of segmented sub-gray scales, for example, in the embodiment of the present disclosure, the image photographed by the first device and the second device is segmented into 4 sub-gray scales, and therefore the equalized brightness difference value res A and the brightness dynamic range characteristic difference value res u is calculated. When k is 1 to 4, if more sub-gray scales are segmented, the value of k is the same as the number of sub-gray scales.
[0147] On the basis of the embodiment, in step S142, the detection result of the image quality of the first device is determined according to the comparison result, including: Figure 13 In the case that the equalized brightness difference value and the brightness dynamic range characteristic difference value are both in the preset range, it is determined that the detection result of the image quality of the first device meets the detection requirement. In the case that the equalized brightness difference value is not in the preset range and / or the brightness dynamic range characteristic difference value is not in the preset range, it is determined that the detection result of the image quality of the first device does not meet the detection requirement.
[0148] Optionally, the preset range has a one-to-one correspondence with the scene type, that is, the preset range corresponding to the scene type is used to determine the detection result of the image quality of the first device under different scene types.
[0149] In a possible implementation, the preset ranges corresponding to the equalized brightness difference value and the brightness dynamic range characteristic difference value can be different, that is, in the case that the equalized brightness difference value is in the preset brightness difference value range and the brightness dynamic range characteristic difference value is in the preset characteristic difference value range, it is determined that the detection result of the image quality of the first device meets the detection requirement.
[0150] The image quality detection method provided by the present disclosure will be described below through an embodiment. As shown in FIG. 1, the method includes the following steps.
[0151] Figure 14
[0152] The third-party device obtains original images obtained by the first device and the second device for shooting the target object, and downsamples the original images by the interlaced and intercolumnar manner to obtain images, and then determines gray segmentation values for segmenting the images based on the maximum inter-class variance method, and segments the images according to the gray segmentation values to obtain foreground images and background images, that is, the images shot by the first device are segmented into foreground images and background images according to two gray segmentation values, and the images shot by the second device are segmented into foreground images and background images according to two gray segmentation values.
[0153] Optionally, according to a scene type in which the target object is located, a target scale factor is determined from pre-calibrated scale factors, a segmentation threshold is determined according to the target scale factor and the gray segmentation value, and the foreground images and the background images are segmented according to the segmentation threshold to obtain sub-gray images. That is, the foreground images of the first device are segmented into sub-gray images and sub-gray images according to a first segmentation threshold corresponding to the first device. Figure 1 and sub-gray Figure 2 images of the first device are segmented into sub-gray Figure 1 images and sub-gray Figure 1 images according to a second segmentation threshold corresponding to the first device. Figure 2 The cumulative probability distribution of the pixel points in the sub-gray Figure 2 images is calculated to obtain sub-histograms Figure 3 , and the cumulative probability distribution of the pixel points in the sub-gray Figure 4 images is calculated to obtain sub-histograms Figure 3 . Similarly, the images of the second device are segmented and the cumulative probability distribution is calculated to obtain four sub-histograms corresponding to the images shot by the second device. Figure 3 Figure 4 Figure 4
[0154] Further, for the images shot by the first device, a mapping gray value is determined according to the target cumulative probability distribution to obtain equalized brightness values and brightness dynamic range characteristic values corresponding to each sub-histogram. Similarly, for the images shot by the second device, equalized brightness values and brightness dynamic range characteristic values corresponding to each sub-histogram can also be calculated.
[0155] Further, the brightness distribution characteristic values of each sub-gray image of the first device are compared with the brightness distribution characteristic values of each sub-gray image of the second device, and the shooting performance of the first device is determined according to the comparison result.
[0156] Based on the same inventive concept, the disclosure also provides an image quality detection device, which can realize all or part of the steps of the image quality detection method in the form of software, hardware or a combination of both. Figure 15 is a block diagram of an image quality detection apparatus 100 according to an exemplary embodiment, as shown in Figure 15 The apparatus 100 includes a first generation module 110, a second generation module 120, a first determination module 130, and a second determination module 140.
[0157] The first generation module 110 is configured to generate a gray scale image of an image captured by a first device for a target object.
[0158] The second generation module 120 is configured to generate a plurality of histograms according to the gray scale image.
[0159] The first determination module 130 is configured to determine a luminance distribution feature value of the gray scale image according to the plurality of histograms.
[0160] The second determination module 140 is configured to determine a detection result of image quality of the first device according to the luminance distribution feature value.
[0161] The apparatus determines a luminance distribution feature value of an image captured by a first device, and determines a detection result of image quality of the first device according to the luminance distribution feature value, thereby improving flexibility and accuracy of device image quality detection.
[0162] Optionally, the gray scale image includes a gray scale image of a foreground image and a gray scale image of a background image, and the second generation module 120 is configured to:
[0163] generate a histogram of the foreground image according to the gray scale image of the foreground image, and generate a histogram of the background image according to the gray scale image of the background image.
[0164] determine a target scale factor according to a scene type in which the target object is located and a preset corresponding relationship between scene types and scale factors;
[0165] determine a first segmentation threshold value between a minimum gray scale value of the image and a gray scale segmentation value used for foreground and background segmentation of the image, and determine a second segmentation threshold value between a maximum gray scale value of the image and the gray scale segmentation value, according to the target scale factor and the gray scale segmentation value;
[0166] segment the histogram of the foreground image according to the first segmentation threshold value, and segment the histogram of the background image according to the second segmentation threshold value, to obtain the plurality of histograms of the gray scale image.
[0167] Optionally, the second generation module 120 is configured to pre-calibrate the scale factor for any scene type by the following method:
[0168] acquiring a gray card image taken under the scene type;
[0169] determining, for a plurality of predetermined gray scale values of the gray card, a cumulative probability distribution of the same gray scale value in the gray card image;
[0170] determining, according to each of the cumulative probability distributions and a preset target value of the cumulative probability distribution of the gray scale value in the gray card image, a target gray scale value corresponding to each of the gray scale values of the gray card image;
[0171] determining, according to each of the target gray scale values, a scale factor corresponding to the scene type.
[0172] Optionally, the apparatus further comprises a module configured to:
[0173] acquiring a reference luminance distribution feature value for the target object;
[0174] The second determination module 140 comprises a comparison sub-module configured to compare the luminance distribution feature value of the gray scale image of the first device with the reference luminance distribution feature value;
[0175] a detection result sub-module configured to determine a detection result of the image quality of the first device according to the comparison result.
[0176] Optionally, the luminance distribution feature value comprises an equalized luminance value and a luminance dynamic range feature value, and the first determination module 130 comprises:
[0177] a first calculation sub-module configured to calculate a cumulative probability distribution corresponding to each gray scale value in each of the histograms;
[0178] a first determination sub-module configured to determine a target cumulative probability distribution for equalizing the gray scale image corresponding to each of the histograms;
[0179] a second determination sub-module configured to determine, according to the cumulative probability distribution of each gray scale value in each of the gray scale images, a mapping gray scale value in each of the histograms corresponding to the target cumulative probability distribution;
[0180] a second calculation sub-module configured to take the mapping gray scale value as an equalized luminance value of the gray scale image corresponding to the histogram, and calculate a luminance dynamic range feature value corresponding to the histogram according to each of the equalized luminance values.
[0181] Optionally, the second calculation submodule is configured to:
[0182] Based on the equalized brightness value of each histogram and the total number of pixels in the corresponding grayscale image, the squared difference between the equalized brightness value and each grayscale value is calculated between the minimum and maximum grayscale values of the grayscale image.
[0183] Calculate the product of each squared difference and the total number of gray values of the pixels in the grayscale image, and sum the products to obtain the grayscale feature value;
[0184] The quotient of the grayscale feature value and the total number of pixels in the grayscale image is used to obtain the brightness dynamic range feature value corresponding to the histogram of the grayscale image.
[0185] Optionally, the comparison submodule is configured to:
[0186] For each of the histograms, the squared difference between the equalized brightness value corresponding to the first device and the equalized brightness value in the reference brightness distribution feature value is calculated, as well as the squared difference between the brightness dynamic range feature value corresponding to the first device and the brightness dynamic range feature value in the reference brightness distribution feature value.
[0187] The summation of the squared differences of the equalized brightness values yields the equalized brightness difference value, and the summation of the squared differences of the brightness dynamic range characteristic values yields the brightness dynamic range characteristic difference value.
[0188] Optionally, the detection result submodule is configured to determine that the detection result of the image quality of the first device meets the detection requirements when both the equalized brightness difference and the brightness dynamic range feature difference are within a preset range.
[0189] Optionally, the reference brightness distribution feature value is obtained based on an image of the target object captured by the second device, wherein the second device is a device whose image quality detection result meets the detection requirements.
[0190] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0191] Furthermore, it is worth noting that the modules in the above embodiments can be independent devices or the same device in specific implementations. For example, the first generation module 110 and the second generation module 120 can be the same module or two modules. This disclosure does not limit this.
[0192] This disclosure also provides an electronic device, including:
[0193] a processor, and a memory for storing processor-executable instructions;
[0194] wherein the processor is configured to:
[0195] generate a gray scale image of the image according to the image of the target object taken by the first device;
[0196] generate a plurality of histograms according to the gray scale image;
[0197] determine a luminance distribution feature value of the gray scale image according to the plurality of histograms;
[0198] determine a detection result of image quality of the first device according to the luminance distribution feature value.
[0199] The present disclosure also provides a computer-readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the steps of the image quality detection method provided by the present disclosure.
[0200] Figure 16 is a block diagram of an apparatus 800 for image quality detection according to an exemplary embodiment. For example, the apparatus 800 can be a third-party electronic device other than the first device and the second device. Referring to Figure 16 , the apparatus 800 can include one or more of the following components: a processing component 802, a memory component 804, a power supply component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.
[0201] The processing component 802 usually controls overall operations of the apparatus 800, such as operations associated with displaying, data communication, and recording operations. The processing component 802 can include one or more processors 820 to execute instructions to complete all or part of the steps of the image quality detection method described above. In addition, the processing component 802 can include one or more modules to facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0202] The memory 804 is configured to store various types of data to support the operation of the device 800. Examples of these data include instructions for any application or method operating on the device 800. The memory 804 can be realized by any type of volatile or nonvolatile storage devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic or optical disk.
[0203] The power component 806 provides power to the various components of the device 800. The power component 806 can include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the device 800.
[0204] The multimedia component 808 includes a screen providing an output interface between the device 800 and a user. In some embodiments, the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes the touch panel, the screen can be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense a touch, a slide, and a gesture on the touch panel. The touch sensor can not only sense a boundary of a touching or a sliding action, but also detect duration and pressure related to the touching or sliding action.
[0205] The audio component 810 is configured to output and / or input an audio signal. For example, the audio component 810 includes a microphone (MIC) configured to receive an external audio signal when the device 800 is in an operational mode, such as a recording mode and a voice recognition mode. The received audio signal can be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting an audio signal.
[0206] The I / O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which can be a keyboard, a click wheel, a button, and the like. These buttons can include, but are not limited to, a home button, a volume button, a start button, and a lock button.
[0207] The sensor component 814 includes one or more sensors to provide status assessments for various aspects of the device 800. For example, the sensor component 814 can detect an open / closed position of the device 800, relative positioning of components, such as a display and keypad of the device 800, a change in position of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800, and a temperature change of the device 800. The sensor component 814 can include proximity sensor(s) configured to detect the presence of objects in a proximity without any physical contact. The sensor component 814 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 814 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0208] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and another device. For example, the device 800 communicates with a first device and a second device via the communication component 816 to obtain images of a target object captured by the first device and the second device. The device 800 can access a wireless network based on a communication standard, such as WiFi, 2G, or 3G, or a combination thereof. In an example embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an example embodiment, the communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra-WideBand (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0209] In an example embodiment, the device 800 can be implemented using one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic components, for performing the image quality detection method described above.
[0210] In an example embodiment, a non-transitory computer-readable storage medium including instructions, such as the memory 804 including instructions, is also provided. The instructions can be executable by the processor 820 of the device 800 to implement the image quality detection method described above. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disc, and an optical data storage device, and the like.
[0211] In another exemplary embodiment, there is also provided a computer program product comprising a computer program capable of being executed by a programmable apparatus, the computer program having code portions for performing the image quality detection method described above when executed by the programmable apparatus.
[0212] Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure. It is intended that the specification and examples be considered as exemplary only, with the true scope and spirit of the disclosure being indicated by the following claims.
[0213] It is to be understood that the disclosure is not limited to the precise construction described above and shown in the attached drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the disclosure is limited only by the claims that follow.
Claims
1. An image quality detection method, characterized in that, include: A grayscale image of the target object is generated from the image captured by the first device. Generate multiple corresponding histograms based on the grayscale image; The brightness distribution characteristic values of the grayscale image are determined based on the multiple histograms; The detection result of the image quality for the first device is determined based on the brightness distribution feature value; The grayscale image includes a grayscale image of the foreground image and a grayscale image of the background image. Generating multiple corresponding histograms based on the grayscale image includes: Generate a histogram of the foreground image based on the grayscale image of the foreground image, and generate a histogram of the background image based on the grayscale image of the background image; The target scale factor is determined based on the scene type in which the target object is located and the preset correspondence between scene type and scale factor; Based on the target scale factor and the grayscale segmentation value used to segment the foreground and background of the image, a first segmentation threshold is determined between the minimum grayscale value of the image and the grayscale segmentation value, and a second segmentation threshold is determined between the maximum grayscale value of the image and the grayscale segmentation value. The foreground image is segmented according to the first segmentation threshold, and the background image is segmented according to the second segmentation threshold to obtain multiple histograms of the grayscale image.
2. The method according to claim 1, characterized in that, The scale factor for any scene type is pre-calibrated using the following method: Acquire a gray card image captured under the stated scene type; For grayscale values of multiple predetermined gray levels on a gray card, determine the cumulative probability distribution of grayscale values in the gray card image that are the same as each of the grayscale values of the gray card; Based on each of the cumulative probability distributions and the preset target value of the cumulative probability distribution of gray values in the gray card image, the target gray value corresponding to each gray card gray value on the gray card image is determined; The scale factor corresponding to the scene type is determined based on each of the target gray values.
3. The method according to any one of claims 1-2, characterized in that, The method further includes: Obtain reference brightness distribution feature values for the target object; Determining the image quality detection result for the first device based on the brightness distribution feature value includes: The brightness distribution feature value of the grayscale image is compared with the reference brightness distribution feature value; The image quality detection result for the first device is determined based on the comparison results.
4. The method according to claim 3, characterized in that, The brightness distribution feature values include equalized brightness values and brightness dynamic range feature values. Determining the brightness distribution feature values of the grayscale image based on the plurality of histograms includes: Calculate the cumulative probability distribution corresponding to each gray value in each of the aforementioned histograms; Determine the target cumulative probability distribution for equalizing the grayscale images corresponding to each histogram; Based on the cumulative probability distribution of each gray value in each of the grayscale images, determine the mapped gray value corresponding to the target cumulative probability distribution in each of the histograms; The mapped grayscale value is used as the equalized brightness value of the grayscale image corresponding to the histogram, and the brightness dynamic range feature value corresponding to the histogram is calculated based on each equalized brightness value.
5. The method according to claim 4, characterized in that, The step of calculating the brightness dynamic range feature value corresponding to the histogram based on each of the equalized brightness values includes: Based on the equalized brightness value of each histogram and the total number of pixels in the corresponding grayscale image, the squared difference between the equalized brightness value and each grayscale value is calculated between the minimum and maximum grayscale values of the grayscale image. Calculate the product of each squared difference and the total number of gray values of the pixels in the grayscale image, and sum the products to obtain the grayscale feature value; The quotient of the grayscale feature value and the total number of pixels in the grayscale image is used to obtain the brightness dynamic range feature value corresponding to the histogram of the grayscale image.
6. The method according to claim 4, characterized in that, The step of comparing the brightness distribution feature value of the grayscale image with the reference brightness distribution feature value includes: For each of the histograms, the squared difference between the equalized brightness value corresponding to the first device and the equalized brightness value in the reference brightness distribution feature value is calculated, as well as the squared difference between the brightness dynamic range feature value corresponding to the first device and the brightness dynamic range feature value in the reference brightness distribution feature value. The summation of the squared differences of the equalized brightness values yields the equalized brightness difference value, and the summation of the squared differences of the brightness dynamic range characteristic values yields the brightness dynamic range characteristic difference value.
7. The method according to claim 6, characterized in that, Determining the image quality detection result for the first device based on the comparison result includes: If both the equalization brightness difference and the brightness dynamic range feature difference are within a preset range, the image quality detection result of the first device is determined to meet the detection requirements.
8. The method according to claim 3, characterized in that, The reference brightness distribution feature value is obtained based on the image of the target object captured by the second device, wherein the second device is a device whose image quality detection result meets the detection requirements.
9. An image quality detection device, characterized in that, The device includes: The first generation module is configured to generate a grayscale image of an image obtained by the first device from capturing a target object. The second generation module is configured to generate multiple corresponding histograms based on the grayscale image. The first determining module is configured to determine the brightness distribution characteristic value of the grayscale image based on the plurality of histograms; The first determining module is configured to determine the detection result of the image quality for the first device based on the brightness distribution feature value; The grayscale image includes a grayscale image of the foreground image and a grayscale image of the background image. The second generation module is configured to: Generate a histogram of the foreground image based on the grayscale image of the foreground image, and generate a histogram of the background image based on the grayscale image of the background image; The target scale factor is determined based on the scene type in which the target object is located and the preset correspondence between scene type and scale factor; Based on the target scale factor and the grayscale segmentation value used to segment the foreground and background of the image, a first segmentation threshold is determined between the minimum grayscale value of the image and the grayscale segmentation value, and a second segmentation threshold is determined between the maximum grayscale value of the image and the grayscale segmentation value. The foreground image is segmented according to the first segmentation threshold, and the background image is segmented according to the second segmentation threshold to obtain multiple histograms of the grayscale image.
10. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured as follows: A grayscale image of the target object is generated from the image captured by the first device. Multiple histograms are generated based on the grayscale image; The brightness distribution characteristic values of the grayscale image are determined based on the multiple histograms; The detection result of the image quality for the first device is determined based on the brightness distribution feature value; The grayscale image includes a grayscale image of the foreground image and a grayscale image of the background image. Generating multiple corresponding histograms based on the grayscale image includes: Generate a histogram of the foreground image based on the grayscale image of the foreground image, and generate a histogram of the background image based on the grayscale image of the background image; The target scale factor is determined based on the scene type in which the target object is located and the preset correspondence between scene type and scale factor; Based on the target scale factor and the grayscale segmentation value used to segment the foreground and background of the image, a first segmentation threshold is determined between the minimum grayscale value of the image and the grayscale segmentation value, and a second segmentation threshold is determined between the maximum grayscale value of the image and the grayscale segmentation value. The foreground image is segmented according to the first segmentation threshold, and the background image is segmented according to the second segmentation threshold to obtain multiple histograms of the grayscale image.
11. A computer-readable storage medium storing computer program instructions thereon, characterized in that, When executed by a processor, the program instructions implement the steps of the method described in any one of claims 1-8.
Citation Information
Patent Citations
Image quality evaluation method and system
CN108447058A
Image detection method, device and equipment and computer storage medium
CN112312001A