Image definition detection method and device, electronic equipment and storage medium
By calculating the hash value and gradient value of the image, automatically grouping and matching, the problem of low image clarity detection efficiency and accuracy in the prior art is solved, and efficient and accurate image clarity detection is achieved.
Patent Information
- Application Number
- CN202411803605.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-28
AI Technical Summary
The prior art has low efficiency and accuracy in image clarity detection, requiring manual intervention, and prone to problems such as naming errors and missing images.
By obtaining the hash value of the image to be tested, grouping similar images, calculating the image gradient value, and matching it with the sample scene gradient value, the image sharpness is automatically evaluated.
It improves the efficiency and accuracy of image clarity detection, reduces manual intervention, and avoids deviations caused by human error and fatigue.
Smart Images

Figure CN119722630A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method, device, electronic device and storage medium for detecting image clarity. Background Art
[0002] With the rapid development of the imaging industry and the improvement of the overall camera technology level, consumers have increasingly higher requirements for the imaging quality of terminal devices (such as smartphones). Especially in the field of mobile phone imaging, the film rate is a crucial parameter in the key indicators for measuring the performance of terminal cameras. Among them, the film rate refers to the proportion of images that users can capture that are usable rather than wasteful.
[0003] At present, a method commonly used in the industry to evaluate image quality is to test the camera under different lighting and scene conditions. Specifically, it includes using the terminal device to be tested to shoot images in a variety of typical scenes, at least 50 scenes, and at least 10 images for each scene; using the naked eye to check the images that are blurry compared with other images to be tested in the same scene, and mark them as unclear; finally, calculate the proportion of all unclear images to the total images.
[0004] However, the process of image clarity detection requires manual intervention, which makes the detection efficiency low. At the same time, problems such as naming errors and missing images are prone to occur, affecting the detection accuracy. Summary of the invention
[0005] The main technical problem solved by the present application is to provide a method, device, electronic device and storage medium for detecting image clarity, which can solve the technical problems of low efficiency and accuracy in detecting image clarity.
[0006] In order to solve the above technical problems, a technical solution adopted in this application is: the method comprises:
[0007] Get hash values of multiple images to be tested;
[0008] According to the hash value, each of the images to be tested is grouped to obtain a scene grouping under at least one scene;
[0009] Obtaining the gradient value of each image in the scene group, and matching the corresponding sample scene gradient value based on the gradient value of each image in the scene group;
[0010] Based on the gradient values of each image in the scene group under each scene and the corresponding gradient value of the sample scene, the filming results of the multiple images to be tested are obtained.
[0011] Optionally, grouping the images to be tested according to the hash values to obtain scene grouping under at least one scene includes:
[0012] For each of the images to be tested, the hash value of the current image to be tested is calculated with the hash values of other images to be tested to obtain the Hamming distance between the current image to be tested and the other images to be tested;
[0013] The other images to be tested corresponding to the Hamming distances smaller than a preset first threshold are determined as the scene group belonging to the same scene as the current image to be tested.
[0014] Optionally, for each of the images to be tested, respectively calculating the hash value of the current image to be tested and the hash values of other images to be tested to obtain the Hamming distance between the current image to be tested and the other images to be tested, includes:
[0015] Sorting the images to be tested according to the shooting time of each of the images to be tested;
[0016] Taking the current image to be tested as a reference, searching for the other images to be tested whose time difference with the image to be tested is less than a preset second threshold;
[0017] The hash values of the current image to be tested and the other images to be tested are calculated respectively to obtain the Hamming distance between the current image to be tested and the other images to be tested.
[0018] Optionally, the acquiring the gradient value of each image in the scene group, and matching the corresponding sample scene gradient value based on the gradient value of each image in the scene group, includes:
[0019] Obtaining the gradient value of each image in the scene group, and averaging the gradient values of each image in the scene group to obtain an average scene gradient value of the scene group;
[0020] From a preset scene gradient database, sample scene gradient values whose difference with the average scene gradient value is less than a preset third threshold are screened.
[0021] Optionally, obtaining the filming results of the plurality of images to be tested based on the gradient values of each image in the scene group under each scene and the corresponding gradient value of the sample scene includes:
[0022] Comparing the difference between the gradient value of each image in the scene group and the gradient value of the sample scene;
[0023] When the difference is less than a preset fourth threshold, determining the image corresponding to the image gradient value as the target image;
[0024] The filming result is obtained according to each target image in each scene and each image in the scene group.
[0025] Optionally, when the difference is less than a preset fourth threshold, after determining that the image corresponding to the image gradient value is the target image, the method further comprises:
[0026] When the scene group of the next scene is identified, returning to the step of obtaining the gradient values of each image in the scene group, and matching the corresponding sample scene gradient values based on the gradient values of each image in the scene group;
[0027] When it is identified that the scene group does not have a next scene, the target images under each scene and the images in the scene group are executed to obtain the filming result.
[0028] Optionally, the step of obtaining hash values of multiple images to be tested includes:
[0029] Detecting whether the image to be tested meets a preset fifth threshold; the fifth threshold is the sum of the number of all images in each scene group;
[0030] In response to the image to be tested meeting the fifth threshold, the step of obtaining hash values of the plurality of images to be tested is performed; or in response to the image to be tested not meeting the fifth threshold, a prompt for reshooting is generated.
[0031] In order to solve the above technical problems, another technical solution adopted by the present application is: a device for detecting image clarity, the detection device comprising:
[0032] An acquisition module, used to obtain hash values of multiple images to be tested;
[0033] A grouping module, used for grouping the images to be tested according to the hash value to obtain scene groups under at least one scene;
[0034] A matching module, used to obtain the gradient value of each image in the scene group, and match the corresponding sample scene gradient value based on the gradient value of each image in the scene group;
[0035] The calculation module is used to obtain the filming results of the multiple images to be tested based on the gradient values of each image in the scene group under each scene and the corresponding gradient value of the sample scene.
[0036] In order to solve the above technical problems, another technical solution adopted by the present application is: an electronic device, the electronic device comprising:
[0037] A memory for storing executable program codes;
[0038] The processor is used to call and run the executable program code from the memory, so that the electronic device executes the image clarity detection method as described in any one of the above.
[0039] To solve the above technical problems, another technical solution adopted in the present application is: a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the image clarity detection method as described in any one of the above items is implemented.
[0040] Different from the prior art, the embodiment of the present application provides a method for detecting image clarity, the method comprising: obtaining hash values of multiple images to be tested; grouping each of the images to be tested according to the hash values to obtain a scene grouping under at least one scene; obtaining the gradient value of each image in the scene grouping, and matching the corresponding sample scene gradient value based on the gradient value of each image in the scene grouping; obtaining the filming results of the multiple images to be tested based on the gradient value of each image in the scene grouping under each scene and the corresponding sample scene gradient value. The similarity between images is calculated using the hash value, and images with high similarity are classified into the same scene grouping. By calculating the gradient value of each image in the scene grouping, the clarity and detail performance of the image can be evaluated and matched with the pre-set sample scene gradient value; and then comparing the gradient value of each image in the scene grouping with the sample scene gradient value, it can be determined whether each image meets the expected quality standard, thereby obtaining the filming result. The detection efficiency and accuracy of image clarity can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is a flow chart of the first embodiment of the method for detecting image clarity of the present application;
[0042] Figure 2 It is a flow chart of the second embodiment of the method for detecting image clarity of the present application;
[0043] Figure 3 It is a schematic diagram of an exemplary process executed by the image sorting module of the image clarity detection method of the present application;
[0044] Figure 4 It is a schematic diagram of an exemplary process executed by the analysis module of the image clarity detection method of the present application;
[0045] Figure 5 It is an exemplary structural block diagram of an electronic device of the image clarity detection method of the present application;
[0046] Figure 6 It is an exemplary structural block diagram of a computer-readable storage medium of the image clarity detection method of the present application. DETAILED DESCRIPTION
[0047] The present application is described in detail below with reference to the accompanying drawings and implementation methods.
[0048] This embodiment takes into account that, with the overall development of camera technology in the imaging industry, mobile phone imaging has become a market orientation. In the imaging quality of terminal cameras, the film rate index is particularly important, which is related to whether the images taken by mobile phone consumers in their daily use of cameras are usable.
[0049] The common evaluation scheme on the market is to use the terminal device to take images in various scenes, including indoor, outdoor, with portraits, without portraits, dark environment, point light source, etc., and take at least 10 images for each scene. Then, manually count all unclear images, that is, compare the images in the same scene with each other. If there is blur in the comparison, the image is considered unclear.
[0050] However, existing solutions require manual intervention, and naming errors, missing images, and re-shooting often occur. At the same time, images need to be manually reviewed one by one, which can easily cause visual fatigue and affect the accuracy of the results. If we assume that there are 100 scenes and 10 images per scene, the overall manual review consumes a lot of time and energy.
[0051] See also Figure 1 , Figure 1 FIG. 1 is a flow chart of the first embodiment of the method for detecting image clarity of the present application. It should be noted that if there are substantially the same results, the method of the present application is not limited to the first embodiment. Figure 1 The process sequence shown is limited. Figure 1 As shown, the method includes:
[0052] Step S110, obtaining hash values of multiple images to be tested;
[0053] The images to be tested may be image samples for clarity evaluation. These images are usually taken by the same terminal device to be tested in different scenes, and are used to test the camera's filming rate and image clarity of the terminal device to be tested. Each image to be tested corresponds to a hash value, which may be a fixed-length string or value generated by the content of the image through a hash algorithm, and can be used to represent the features of the image, so as to quickly perform unique scene identification and fast scene comparison on the image to be tested.
[0054] Specifically, in order to reduce the processing time of redundant data, a unique hash value can be generated for each image using methods such as the perceptual hashing algorithm. The perceptual hashing algorithm can generate hash codes with similar hash values for similar images, so that when comparing images, similar images in the same scene can be quickly identified, reducing duplication of work.
[0055] Step S120, grouping the images to be tested according to the hash values to obtain scene groups under at least one scene;
[0056] Among them, scene grouping can group images with similar features or the same scenes together.
[0057] Specifically, similar scenes can be grouped together based on the similarity of hash values and a threshold can be set to determine whether the hash values are similar. In this way, images can be analyzed in batches in a more organized manner, ensuring that images under the same conditions are compared, thereby improving the reliability and accuracy of the results.
[0058] Step S130, obtaining the gradient value of each image in the scene group, and matching the corresponding sample scene gradient value based on the gradient value of each image in the scene group;
[0059] Among them, each image corresponds to an image gradient value, which can be used to measure the degree of image brightness change in each scene grouping, and then used to measure image clarity. The sample scene gradient value refers to the reference standard of image gradient values pre-defined or calculated in a specific shooting scene. These gradient values usually reflect the clarity level of an ideal or standard image in the scene. The gradient value is used to quantify the intensity and direction of pixel brightness changes in an image, which can intuitively reflect the edge sharpness and detail richness of the image.
[0060] Specifically, image processing algorithms such as Sobel operator or Canny edge detection can be used to calculate the image gradient value of each image to be tested under each scene group. Then, the image gradient value is compared with the preset sample scene gradient value to determine whether the image meets the clarity requirements, and whether the image is blurred, thereby screening out clear images.
[0061] Step S140, obtaining the filming results of the plurality of images to be tested based on the gradient values of the images in the scene group under each scene and the corresponding gradient values of the sample scene.
[0062] Among them, the film results can evaluate the performance of the terminal device under test in terms of image clarity in different scenarios, thereby evaluating the performance of the camera under various shooting conditions and providing clear quality feedback.
[0063] Specifically, the clarity can be calculated for each scene group corresponding to each scene, and the filming rate can be calculated based on the sample scene gradient value and the actual calculated gradient value. For different scenes, the filming rate is calculated and output separately, and an evaluation report is automatically generated. In this way, the need for manual intervention can be reduced, the efficiency and accuracy of the evaluation can be improved, and deviations caused by human errors and fatigue can be avoided.
[0064] In an exemplary embodiment, the terminal device to be tested is pre-installed with an application for uploading images to a server; then multiple scenes are selected, and shooting is performed using the terminal device in different scenes, and 10 images to be tested are taken in the same scene; shooting is stopped until 10 images to be tested are taken in all scenes, and the application uploads these images to be tested to the server; data of these images to be tested are sorted through the image sorting module of the server, including obtaining hash values of each image to be tested using a perceptual hash algorithm, and then grouping these images to be tested according to the hash values; then, through the analysis module of the server, using an image processing algorithm, gradient values of each image in the grouped scene group are calculated to obtain image gradient values corresponding to each image to be tested, so as to match the sample scene gradient values of the corresponding scene; then, the sample scene gradient values and the image gradient values corresponding to each image to be tested are statistically analyzed to obtain the film formation rate of the terminal device to be tested.
[0065] In this embodiment, hash values are used to calculate the similarity between images, and images with high similarity are classified into the same scene group. By calculating the gradient value of each image in the scene group, the clarity and detail of the image can be evaluated and matched with the pre-set sample scene gradient value; then the gradient value of each image in the scene group is compared with the sample scene gradient value to determine whether each image meets the expected quality standard, thereby obtaining a film result. The detection efficiency and accuracy of image clarity can be improved.
[0066] See also Figure 2 , Figure 2 1 is a flow chart of a second embodiment of the method for detecting image clarity of the present application. In this embodiment, the method comprises the following steps:
[0067] Step S210, obtaining hash values of multiple images to be tested;
[0068] Specifically, in preparation for subsequent image similarity comparison and grouping, the perceptual hashing algorithm can be used to perform the hashing algorithm on each image to be tested to generate a corresponding hash value. Each image to be tested will be converted into a simplified binary string to represent its content characteristics.
[0069] Step S220, for each of the images to be tested, respectively calculating the hash value of the current image to be tested and the hash values of other images to be tested, to obtain the Hamming distance between the current image to be tested and the other images to be tested;
[0070] The Hamming distance may be the Hamming distance between the hash values corresponding to two images to be tested in the same scene, that is, the number of different characters between two strings of the same length.
[0071] Specifically, in order to evaluate the similarity between the images to be tested, the Hamming distance between each image to be tested and the other images to be tested can be calculated. For the hash values of each pair of images, the Hamming distance between their binary strings (i.e., the number of different bits) can be calculated. The smaller the Hamming distance, the more similar the images are. For example, the Hamming distance between 101010 and 100110 is 2.
[0072] Step S230: Determine the other images to be tested corresponding to the Hamming distances less than a preset first threshold as the scene group belonging to the same scene as the current image to be tested.
[0073] Specifically, the first threshold can be used to measure the threshold of similarity between images, which is used to determine whether two images are in the same or similar scenes, and can filter out images that are not similar enough to the current image. A Hamming distance below this threshold indicates that the similarity between images is high, so that truly similar images are grouped together, improving the calculation accuracy of the resulting image.
[0074] Furthermore, before step S210, it includes: obtaining hash values of multiple images to be tested, which includes:
[0075] Detecting whether the image to be tested meets a preset fifth threshold; the fifth threshold is the sum of the number of all images in each scene group;
[0076] In response to the image to be tested meeting the fifth threshold, the step of obtaining hash values of the plurality of images to be tested is performed; or in response to the image to be tested not meeting the fifth threshold, a prompt for reshooting is generated.
[0077] The fifth threshold represents the total number of images that should be captured in all scenes. The fifth threshold can be set according to test requirements to ensure that each scene has a sufficient number of images for evaluation.
[0078] Specifically, in order to detect whether the number of images to be tested reaches the predetermined total number requirement, so as to ensure that there are enough images in each scene for subsequent quality analysis, an overall image number threshold is set according to the test requirements. For example, if there are 10 scenes and 10 images need to be taken for each scene, the fifth threshold is 100 images.
[0079] If the number of all images to be tested meets the fifth threshold, it means that the number of all predetermined scene images has been reached, and the server automatically starts the image clarity detection step. If the number of images currently captured does not reach the fifth threshold, the server will generate a prompt and return it to the terminal device to be tested to prompt the user to continue shooting to make up the required number of images. This can effectively realize the automated management of the image acquisition process and reduce manual intervention and errors.
[0080] Further, step S220 includes:
[0081] The images to be tested are sorted according to the shooting time of each of the images to be tested; taking the current image to be tested as a reference, searching for the other images to be tested whose time difference with the image to be tested is less than a preset second threshold; calculating the hash value of the current image to be tested and the hash value of the other images to be tested respectively, to obtain the Hamming distance between the current image to be tested and the other images to be tested.
[0082] The second threshold may be a time interval, which is used to filter a time difference limit value of the images to be tested that are shot at similar times.
[0083] Specifically, in order to arrange the images to be tested in time sequence, so that images shot at a similar time can be effectively identified, the sorted adjacent images to be tested are more likely to belong to the same scene or have similar environmental conditions, so as to improve the efficiency of subsequent similarity analysis. Then, by setting the second threshold, other images to be tested that are shot at a similar time to the current image to be tested are screened out.
[0084] In an exemplary embodiment, see Figure 3 First, the server scans whether the number of images uploaded by the terminal device to be tested meets the number of scenes*10; if it is detected that the total number of images to be tested is insufficient, the server generates a reshoot prompt, the prompt content includes the number of images that need to be shot; wherein the prompt information is displayed through the user interface or sent to the user device to remind the user that the reshoot operation is required; if it is detected that the total number of images to be tested meets the number of scenes*10, the server extracts the shooting time of each image from the metadata (such as EXIF information) of the image to be tested; the server sorts all the images to be tested according to the extracted shooting time and generates a time-ordered image list; from the sorted image list, a current image to be tested is selected, and then in the image list, other images to be tested whose shooting time difference with the current image is less than a preset second threshold can be sequentially searched, and the hash values of the current image to be tested and other images to be tested that meet the second threshold are compared bit by bit, and the number of different bits is counted to obtain the Hamming distance. The other images to be tested corresponding to the Hamming distance less than the preset first threshold are determined as scene groups belonging to the same scene as the current image to be tested. And so on, until each image to be tested is grouped, at least one group of scene groups after grouping is obtained.
[0085] Step S240, obtaining the gradient value of each image in the scene group, and averaging the gradient values of each image in the scene group to obtain the average scene gradient value of the scene group;
[0086] Specifically, all image gradient values in the scene group are averaged to obtain an average gradient value of the group of images. The average gradient value can represent the overall clarity level of each image in the corresponding scene group.
[0087] Step S250: Filter, from a preset scene gradient database, sample scene gradient values whose difference with the average scene gradient value is less than a preset third threshold.
[0088] Specifically, the third threshold value can be a difference threshold value for determining the sample scene gradient value, and a maximum difference allowed between the average scene gradient value of the image to be tested and the preset sample scene gradient value. By setting the third threshold value, the accuracy of sample selection can be controlled to ensure that the selected sample scene gradient value can accurately reflect the ideal image clarity of the current scene.
[0089] Step S260, comparing the difference between the gradient value of each image in the scene group and the gradient value of the sample scene;
[0090] Specifically, by calculating the difference between the gradient value of each image and the gradient value of the screened sample scene, it is possible to evaluate whether the clarity of each image meets the standard of the sample scene and determine whether the image is clear enough. If the difference is small, the image clarity is consistent with the sample scene.
[0091] Step S270, when the difference is less than a preset fourth threshold, determining the image corresponding to the image gradient value as a target image;
[0092] Among them, the fourth threshold can determine the difference between the gradient value of the image to be tested and the gradient value of the sample scene, which is used to finally determine whether the image clarity is qualified and the target image is a clear image.
[0093] Specifically, if the difference between the image gradient value of the image to be tested and the sample scene gradient value is smaller than the fourth threshold, it is determined that the image to be tested is clear and is further marked as a target image.
[0094] Furthermore, after step S270, it also includes: when it is identified that the scene grouping of the next scene exists, returning to execute step S130 and subsequent steps (or step S240 and subsequent steps); when it is identified that the scene grouping of the next scene does not exist, executing step S280.
[0095] Step S280, obtaining the filming result according to each of the target images in each scene and each of the images in the scene group.
[0096] Specifically, for all images in each scene group, the ratio of the number of clear target images to the total number of images is calculated to evaluate the image quality in different scenes, and finally obtain the filming result. The filming rate result is all unclear images / total number of all images*100%.
[0097] In an exemplary embodiment, see Figure 4 For each scene, the server calculates the image gradient value of each image to be tested under the same scene group; then, the average gradient value of all images to be tested under the same scene group is counted to match the corresponding sample scene gradient value according to the average gradient value; then, the gradient value of each image under the same scene group is compared with the sample scene gradient value to detect whether the difference between the image gradient value and the sample scene gradient value exceeds 15%; if the difference between the image gradient value and the sample scene gradient value exceeds 15%, it is determined to be a non-filmable image; if the difference between the image gradient value and the sample scene gradient value does not exceed 15%, the corresponding image to be tested is determined to be a target image; after the comparison of the gradient value of each image in the current scene group is completed, it is detected whether there is the next scene grouping; if there is a next scene grouping, the average gradient value of all images to be tested under the same scene grouping and the subsequent steps are re-executed; until the comparison of the gradient values of all images under each scene group is completed, the target images corresponding to all scene groups are obtained, and the filming rate is counted according to the number of these target images and the number of images to be tested to obtain the filming result.
[0098] This embodiment reduces the time and workload of manual operation through automated processes, avoiding inefficiency and errors caused by human fatigue or misoperation. By using hash values and Hamming distances, images can be quickly screened and grouped, greatly improving the image processing speed; at the same time, by using the hash values and gradient values of images to objectively evaluate image quality, subjective bias and errors caused by manual visual judgment are reduced.
[0099] See also Figure 5 , Figure 5 is an exemplary structural block diagram of an electronic device for the image clarity detection method of the present application. Figure 5 As shown, the electronic device 500 of the present application may include a processor 501 and a memory 502, wherein the processor 501 and the memory 502 communicate with each other via a bus. The memory 502 stores program instructions for detecting image clarity, and when the program instructions are executed by the processor 501, the method steps described in the foregoing text in conjunction with the accompanying drawings are implemented:
[0100] Get hash values of multiple images to be tested;
[0101] According to the hash value, each of the images to be tested is grouped to obtain a scene grouping under at least one scene;
[0102] Obtaining the gradient value of each image in the scene group, and matching the corresponding sample scene gradient value based on the gradient value of each image in the scene group;
[0103] Based on the gradient values of each image in the scene group under each scene and the corresponding gradient value of the sample scene, the filming results of the multiple images to be tested are obtained.
[0104] Optionally, the processor 501 performs the grouping of the images to be tested according to the hash value to obtain scene grouping under at least one scene, including:
[0105] For each of the images to be tested, the hash value of the current image to be tested is calculated with the hash values of other images to be tested to obtain the Hamming distance between the current image to be tested and the other images to be tested;
[0106] The other images to be tested corresponding to the Hamming distances smaller than a preset first threshold are determined as the scene group belonging to the same scene as the current image to be tested.
[0107] Optionally, the processor 501 performs the step of calculating the hash value of the current image to be tested with the hash values of other images to be tested for each of the images to be tested, to obtain the Hamming distance between the current image to be tested and the other images to be tested, including:
[0108] Sorting the images to be tested according to the shooting time of each of the images to be tested;
[0109] Taking the current image to be tested as a reference, searching for the other images to be tested whose time difference with the image to be tested is less than a preset second threshold;
[0110] The hash values of the current image to be tested and the other images to be tested are calculated respectively to obtain the Hamming distance between the current image to be tested and the other images to be tested.
[0111] Optionally, the processor 501 executes the step of acquiring the gradient value of each image in the scene group, and matching the corresponding sample scene gradient value based on the gradient value of each image in the scene group, including:
[0112] Obtaining the gradient value of each image in the scene group, and averaging the gradient values of each image in the scene group to obtain an average scene gradient value of the scene group;
[0113] From a preset scene gradient database, sample scene gradient values whose difference with the average scene gradient value is less than a preset third threshold are screened.
[0114] Optionally, the processor 501 executes the image gradient values in the scene grouping under each scene and the corresponding sample scene gradient values to obtain the filming results of the multiple images to be tested, including:
[0115] Comparing the difference between the gradient value of each image in the scene group and the gradient value of the sample scene;
[0116] When the difference is less than a preset fourth threshold, determining the image corresponding to the image gradient value as the target image;
[0117] The filming result is obtained according to each target image in each scene and each image in the scene group.
[0118] Optionally, after the processor 501 executes the step of determining that the image corresponding to the image gradient value is the target image when the difference value is less than a preset fourth threshold, the following steps may be performed:
[0119] When the scene group of the next scene is identified, returning to the step of obtaining the gradient values of each image in the scene group, and matching the corresponding sample scene gradient values based on the gradient values of each image in the scene group;
[0120] When it is identified that the scene group does not have a next scene, the target images under each scene and the images in the scene group are executed to obtain the filming result.
[0121] Optionally, the processor 501 executes the step of obtaining hash values of the plurality of images to be tested, which includes:
[0122] Detecting whether the image to be tested meets a preset fifth threshold; the fifth threshold is the sum of the number of all images in each scene group;
[0123] In response to the image to be tested meeting the fifth threshold, the step of obtaining hash values of the plurality of images to be tested is performed; or in response to the image to be tested not meeting the fifth threshold, a prompt for reshooting is generated.
[0124] In order to solve the above technical problems, another technical solution adopted by the present application is: a device for detecting image clarity, the detection device comprising:
[0125] An acquisition module, used to obtain hash values of multiple images to be tested;
[0126] A grouping module, used for grouping the images to be tested according to the hash value to obtain scene groups under at least one scene;
[0127] A matching module, used to obtain the gradient value of each image in the scene group, and match the corresponding sample scene gradient value based on the gradient value of each image in the scene group;
[0128] The calculation module is used to obtain the filming results of the multiple images to be tested based on the gradient values of each image in the scene group under each scene and the corresponding gradient value of the sample scene.
[0129] See also Figure 6 , Figure 6 is an exemplary structural block diagram of a computer-readable storage medium of the image clarity detection method of the present application. Figure 6 As shown, a computer program 601 is stored in the computer-readable storage medium 600. When the computer program 601 is executed by a processor on a computer, the computer executes the above-mentioned related method steps to implement an image clarity detection method in the above-mentioned embodiment.
[0130] The above scheme obtains hash values of multiple images to be tested; groups each of the images to be tested according to the hash values to obtain scene groups under at least one scene; obtains the gradient value of each image in the scene group, and matches the corresponding sample scene gradient value based on the gradient value of each image in the scene group; obtains the filming results of the multiple images to be tested based on the gradient value of each image in the scene group under each scene and the corresponding sample scene gradient value. The similarity between images is calculated using hash values, and images with high similarity are classified into the same scene group. By calculating the gradient value of each image in the scene group, the clarity and detail performance of the image can be evaluated and matched with the pre-set sample scene gradient value; and then the gradient value of each image in the scene group is compared with the sample scene gradient value to determine whether each image meets the expected quality standard, thereby obtaining the filming result. The detection efficiency and accuracy of image clarity can be improved.
[0131] In the several embodiments provided in the present application, it should be understood that the disclosed methods, electronic devices and storage media can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0132] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0133] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0134] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0135] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for detecting image clarity, characterized in that: The detection method comprises: Get hash values of multiple images to be tested; According to the hash value, each of the images to be tested is grouped to obtain a scene grouping under at least one scene; Obtaining the gradient value of each image in the scene group, and matching the corresponding sample scene gradient value based on the gradient value of each image in the scene group; Based on the gradient values of each image in the scene group under each scene and the corresponding gradient value of the sample scene, the filming results of the multiple images to be tested are obtained.
2. The detection method according to claim 1, characterized in that: The step of grouping the images to be tested according to the hash values to obtain scene groups under at least one scene includes: For each of the images to be tested, the hash value of the current image to be tested is calculated with the hash values of other images to be tested to obtain the Hamming distance between the current image to be tested and the other images to be tested; The other images to be tested corresponding to the Hamming distances smaller than a preset first threshold are determined as the scene group belonging to the same scene as the current image to be tested.
3. The detection method according to claim 2, characterized in that: For each of the images to be tested, respectively calculating the hash value of the current image to be tested and the hash values of other images to be tested to obtain the Hamming distance between the current image to be tested and the other images to be tested, including: Sorting the images to be tested according to the shooting time of each of the images to be tested; Taking the current image to be tested as a reference, searching for the other images to be tested whose time difference with the image to be tested is less than a preset second threshold; The hash values of the current image to be tested and the other images to be tested are calculated respectively to obtain the Hamming distance between the current image to be tested and the other images to be tested.
4. The detection method according to claim 1, characterized in that: The obtaining of the gradient values of each image in the scene group, and matching the corresponding sample scene gradient values based on the gradient values of each image in the scene group, includes: Obtaining the gradient value of each image in the scene group, and averaging the gradient values of each image in the scene group to obtain an average scene gradient value of the scene group; From a preset scene gradient database, sample scene gradient values whose difference with the average scene gradient value is less than a preset third threshold are screened.
5. The detection method according to claim 1, characterized in that: The step of obtaining the filming results of the plurality of images to be tested based on the gradient values of each image in the scene group under each scene and the corresponding gradient value of the sample scene comprises: Comparing the difference between the gradient value of each image in the scene group and the gradient value of the sample scene; When the difference is less than a preset fourth threshold, determining the image corresponding to the image gradient value as the target image; The filming result is obtained according to each target image in each scene and each image in the scene group.
6. The detection method according to claim 5, characterized in that: When the difference is less than a preset fourth threshold, after determining that the image corresponding to the image gradient value is the target image, the method includes: When the scene group of the next scene is identified, returning to the step of obtaining the gradient values of each image in the scene group, and matching the corresponding sample scene gradient values based on the gradient values of each image in the scene group; When it is identified that the scene group does not have a next scene, the target images under each scene and the images in the scene group are executed to obtain the filming result.
7. The detection method according to claim 1, characterized in that: The step of obtaining hash values of multiple images to be tested includes: Detecting whether the image to be tested meets a preset fifth threshold; the fifth threshold is the sum of the number of all images in each scene group; In response to the image to be tested meeting the fifth threshold, the step of obtaining hash values of the plurality of images to be tested is performed; or in response to the image to be tested not meeting the fifth threshold, a prompt for reshooting is generated.
8. A device for detecting image clarity, characterized in that: The detection device comprises: An acquisition module, used to obtain hash values of multiple images to be tested; A grouping module, used for grouping the images to be tested according to the hash value to obtain scene groups under at least one scene; A matching module, used to obtain the gradient value of each image in the scene group, and match the corresponding sample scene gradient value based on the gradient value of each image in the scene group; The calculation module is used to obtain the filming results of the multiple images to be tested based on the gradient values of each image in the scene group under each scene and the corresponding gradient value of the sample scene.
9. An electronic device, characterized in that: The electronic device comprises: A memory for storing executable program codes; A processor, configured to call and run the executable program code from the memory, so that the electronic device executes the image clarity detection method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the image clarity detection method according to any one of claims 1 to 7 is implemented.