WO2019173954A1 - Method and apparatus for detecting resolution of image - Google Patents

Method and apparatus for detecting resolution of image Download PDF

Info

Publication number
WO2019173954A1
WO2019173954A1 PCT/CN2018/078751 CN2018078751W WO2019173954A1 WO 2019173954 A1 WO2019173954 A1 WO 2019173954A1 CN 2018078751 W CN2018078751 W CN 2018078751W WO 2019173954 A1 WO2019173954 A1 WO 2019173954A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
threshold
metric value
determining
detection result
Prior art date
Application number
PCT/CN2018/078751
Other languages
French (fr)
Chinese (zh)
Inventor
丁欣
董辰
郜文美
姜永涛
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201880077809.0A priority Critical patent/CN111417981A/en
Priority to PCT/CN2018/078751 priority patent/WO2019173954A1/en
Publication of WO2019173954A1 publication Critical patent/WO2019173954A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis

Definitions

  • the present application relates to the field of computer technologies, and in particular, to a method and device for detecting image sharpness.
  • Blurred images can cause many image-like application functions to fail, such as face recognition, video surveillance, and so on.
  • a commonly used method for detecting image sharpness is a machine learning based sharpness detection method.
  • the method establishes an image sample library, wherein the image sample library includes a large number of clear images and a large number of blurred images, and then establishes a deep learning model, and uses the clear image in the image sample library and the blurred image to train the deep learning model. .
  • the image depth detection is performed by the trained deep learning model.
  • This kind of machine learning-based sharpness detection method needs to collect a large number of clear images and a large number of blurred images when constructing the image sample library, which has a large workload and high algorithm complexity.
  • the embodiment of the present application provides a method and a device for detecting image sharpness, which are used to solve the problem that the workload of the image sharpness detection is large and the algorithm complexity is high.
  • an embodiment of the present application provides an image sharpness detecting method, which may be applied to an electronic device, including: scaling a first image of a first size to obtain a second image of a second scale, and Determining a first metric value of the first image and a second metric value of the second image, the first metric value being used to characterize a sharpness of the first image, and the second metric value Characterizing the sharpness of the second image. And then performing operations on the first metric value and the second metric value, obtaining an operation result, comparing the operation result with a first threshold, and determining, according to the obtained comparison result, whether the first image is Clear image.
  • the embodiment of the present application after the blurred image and the clear image are scaled, the phenomenon that the degree of clarity changes is different. For example, if the blurred image is reduced, the change of the degree of clarity is small, and the clear image is reduced, and the degree of clarity changes greatly.
  • the embodiment of the present application can accurately determine the sharpness of an image, and the workload is small, and the algorithm complexity is small.
  • determining the first metric value of the first image includes: detecting a target area in the first image, and performing mask processing on the target area in the first image to obtain a a mask image, determining a metric value of the first mask image to obtain a metric value of the first image.
  • Determining the second metric value of the second image comprising: detecting a target area in the second image, performing mask processing on the target area in the second image, obtaining a second mask image, determining The metric value of the second mask image is obtained as the metric value of the second image.
  • the first metric value and the second metric value are operated to obtain an operation result, which is implemented by: determining the first metric value and the second metric value The ratio. Comparing the operation result with the first threshold, and determining whether the first image is a clear image according to the obtained comparison result, by implementing, if the ratio is greater than the first threshold, determining the first image Is a clear image or, if the ratio is less than or equal to the first threshold, determining that the first image is a blurred image.
  • the ratio of the first metric value and the second metric value determines a change of the metric value before and after performing the scaling process on the first image, and determining the metric value before and after performing the scaling process according to the first image.
  • the change of the condition determines the sharpness of the first image, and the purpose of accurately determining the sharpness of the first image can be achieved with a small amount of work.
  • the first detection result is that the first image is a clear image or a blurred image according to a comparison result of the operation result and the first threshold. If the first detection result is inaccurate, the first threshold is adjusted. In the above design, by determining whether the detection result is accurate, and adjusting the first threshold when determining that the detection result is inaccurate, the more accurate detection result is determined according to the adjusted first threshold, thereby improving the accuracy of the image sharpness detection. Sex.
  • the second metric value is compared with the second threshold and the third threshold before the first metric value and the second metric value are operated to obtain the operation result. And the comparison result obtained is that the second metric value is smaller than the second threshold value, and is greater than the third threshold value, and the second threshold value is greater than the third threshold value.
  • the image can be effectively reduced. The complexity of clarity detection.
  • the detection result can be obtained by comparing the second metric value with the second threshold and the third threshold, thereby reducing the complexity of image sharpness detection.
  • the second metric value is greater than or equal to the second threshold, after determining that the detection result of the first image is a clear image, determining whether the second detection result is accurate, The second detection result is that the first image is a clear image according to the second metric value and the second threshold. If the second detection result is inaccurate, the second threshold is adjusted. If the second metric is less than or equal to the third threshold, after determining that the first image is a blurred image, determining whether the third detection result is accurate, the third detection result is according to the second metric The value and the third threshold determine that the first image is a blurred image. If the third detection result is inaccurate, the third threshold is adjusted.
  • comparing the first metric value and the second metric value to obtain the operation result comparing the first metric value with the fourth threshold value and the fifth threshold value And obtaining a comparison result that the first metric value is smaller than the fourth threshold value, and is greater than the fifth threshold value, where the fourth threshold value is greater than the fifth threshold value.
  • the detection result can be obtained by comparing the first metric value with the fourth threshold value and the fifth threshold value for the image that is particularly clear or particularly blurred, so that the complexity of image sharpness detection can be reduced.
  • the fourth threshold determines whether the fourth detection result is accurate after determining that the first image is a clear image; the fourth detection The result is that the first image is a clear image based on the first metric value and the fourth threshold. If the fourth detection result is inaccurate, the fourth threshold is adjusted. If the first metric value is less than or equal to the fifth threshold, determining whether the fifth detection result is accurate after determining that the first image is a blurred image; the fifth detection result is according to the first degree The magnitude and the fifth threshold determine that the first image is a blurred image, and if the fifth detection result is not accurate, the fifth threshold is adjusted.
  • an embodiment of the present application provides an image sharpness detecting apparatus, including: a scaling module, configured to perform a scaling process on a first image of a first size to obtain a second image of a second size.
  • a determining module configured to determine a first metric value of the first image and a second metric value of the second image obtained by the scaling module, the first metric value being used to represent the first image The clarity of the second metric is used to characterize the sharpness of the second image.
  • an operation module configured to perform operations on the first metric value and the second metric value determined by the determining module, to obtain an operation result.
  • a comparison module configured to compare the operation result obtained by the operation module with a first threshold, and obtain a comparison result.
  • a determining module configured to determine, according to the comparison result obtained by the comparing module, whether the first image is a clear image.
  • the operation module is specifically configured to: determine a ratio of the first metric value and the second metric value.
  • the comparing module is specifically configured to: compare the ratio with a first threshold.
  • the determining module is configured to: if the ratio is greater than the first threshold, determine that the first image is a clear image, or if the ratio is less than or equal to the first threshold, determine the first The image is a blurred image.
  • the determining module is further configured to: after comparing the operation result with a first threshold, and determining whether the first image is a clear image according to the obtained comparison result, determining Whether the detection result is accurate; the first detection result is that the first image is a clear image or a blurred image according to a comparison result of the operation result and the first threshold.
  • the device further includes an adjustment module, where the adjustment module is configured to adjust the first threshold when the first detection result is inaccurate.
  • the comparing module is further configured to: before calculating the first metric value and the second metric value, obtaining the second metric value and the first The second threshold and the third threshold are compared, and the obtained comparison result is that the second metric is smaller than the second threshold and greater than the third threshold, and the second threshold is greater than the third threshold.
  • the determining module is further configured to: when the second metric value is greater than or equal to the second threshold, determine that the first image is a clear image; or, in the When the second metric is less than or equal to the third threshold, it is determined that the first image is a blurred image.
  • the determining module is further configured to: after determining that the detection result of the first image is a clear image, determining Whether the second test result is accurate.
  • the second detection result is that the first image is a clear image according to the second metric value and the second threshold.
  • the device further includes an adjustment module, where the adjustment module is configured to adjust the second threshold when the second detection result determined by the determining module is inaccurate.
  • the determining module is further configured to: after determining that the first image is a blurred image, determine whether the third detection result is accurate.
  • the third detection result is that the first image is a blurred image according to the second metric value and the third threshold.
  • the adjusting module is further configured to: when the third detection result is inaccurate, adjust the third threshold.
  • the comparing module is further configured to: before the operation of the first metric value and the second metric value, obtain the operation result, and compare the first metric value with The fourth threshold and the fifth threshold are compared, and the obtained comparison result is that the first metric value is smaller than the fourth threshold and greater than the fifth threshold, and the fourth threshold is greater than the fifth threshold.
  • the determining module is further configured to: when the first metric value is greater than or equal to the fourth threshold, determine that the first image is a clear image, or When the first metric value is less than or equal to the fifth threshold, it is determined that the first image is a blurred image.
  • the determining module is further configured to: after determining that the first image is a clear image, determine the fourth Whether the test results are accurate.
  • the fourth detection result is that the first image is a clear image according to the first metric value and the fourth threshold.
  • the device further includes an adjustment module, where the adjustment module is configured to adjust the fourth threshold when the fourth detection result is inaccurate.
  • the determining module is further configured to: after determining that the first image is a blurred image, determine whether the fifth detection result is accurate.
  • the fifth detection result is that the first image is a blurred image according to the first metric value and the fifth threshold.
  • the adjusting module is further configured to: when the fifth detection result is inaccurate, adjust the fifth threshold.
  • the determining module when determining the first metric value of the first image, is specifically configured to: detect a target area in the first image, in the first image The target area is masked to obtain a first mask image, and the metric value of the first mask image is determined.
  • determining the second metric value of the second image specifically, detecting: a target area in the second image, performing mask processing on the target area in the second image, to obtain a second mask image And determining a metric value of the second mask image.
  • an embodiment of the present application further provides a terminal, where the terminal includes a processor and a memory, where the memory is used to store a software program, and the processor is configured to read a software program stored in the memory and implement the first
  • the electronic device can be a mobile terminal, a computer, or the like.
  • the embodiment of the present application further provides a computer storage medium, where the software program stores a software program, where the software program can implement the first aspect or the first one when being read and executed by one or more processors Any of the aspects provided by the design.
  • the embodiment of the present application provides a computer program product comprising instructions, when executed on a computer, causing a computer to perform the method described in any one of the above first aspect or the first aspect, or The method provided by the second aspect or any one of the above second aspects.
  • FIG. 1A is a clear image provided by an embodiment of the present application.
  • FIG. 1B is a blurred image provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a change in sharpness of a blurred image and a clear image before and after a reduction process according to an embodiment of the present application;
  • FIG. 3 is a schematic flowchart of a method for detecting image sharpness according to an embodiment of the present application
  • FIG. 4 is a schematic view of an elliptical mask provided by an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of a first determination provided by an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of a second determination provided by an embodiment of the present application.
  • FIG. 7 is a schematic flowchart of adjusting a threshold according to an embodiment of the present application.
  • FIG. 8 is a schematic flowchart of a method for detecting a sharpness of a face image according to an embodiment of the present application
  • FIG. 9 is a schematic structural diagram of an image sharpness detecting apparatus according to an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of an image sharpness detecting apparatus according to an embodiment of the present application.
  • an image-like application function is to detect a skin condition of a face according to a facial image of the user, such as detecting and analyzing a plurality of skin features such as a pore, a blackhead, a fine line, a stain, and a subcutaneous red area of the face.
  • the implementation of the application function has high requirements on the definition of the face photo, and the problems such as jitter and unclear focus when photographing, all affect the stability and reliability of the skin detection.
  • a large number of pores can be seen in the higher-resolution facial image, and the pore boundary is relatively clear, and the blackhead is also clearly visible, as shown in FIG. 1A, and the lower-resolution facial image can only see a larger one.
  • this difference in sharpness will result in a large difference in the results of two skin tests by the same user.
  • the first method is a sharpness detection method based on a reference image.
  • the method generally needs to obtain a clear image of the same scene or content as the image to be detected as a reference image, and determines the sharpness to be detected by comparing the reference image and the gradient, frequency and the like of the image to be detected.
  • this method can only detect the sharpness of the image with the same or the same content as the reference image scene, and has certain limitations and poor adaptability.
  • the second method is a non-reference sharpness detection method.
  • the method analyzes the frequency domain information of the image to be detected, such as frequency domain information obtained by Fourier transforming the image to be detected, frequency domain information obtained by wavelet transforming the image to be detected, or the like, or analyzing the edge of the image to be detected.
  • the width peak information and the gradient peak information are used to calculate an index for characterizing the sharpness, and then the sharpness is determined based on the comparison result of the index with the threshold.
  • the thresholds used in determining the definition may be different. Therefore, the same threshold is used for all images for determination, resulting in poor accuracy of the results of the determination.
  • this method has a large amount of computation, high computational complexity, and poor real-time performance.
  • the third method is a machine learning based sharpness detection method.
  • the method establishes an image sample library, wherein the image sample library includes a large number of clear images and a large number of blurred images, and then establishes a deep learning model, and uses the clear image in the image sample library and the blurred image to train the deep learning model. .
  • the image depth detection is performed by the trained deep learning model.
  • This kind of machine learning-based sharpness detection method needs to collect a large number of clear images and a large number of blurred images when constructing the image sample library, which has a large workload and high algorithm complexity.
  • the blurred image has a small change in the degree of clarity; and the sharp image is sharpened with a clear degree. big change.
  • the first personal face map is an image before the reduction processing is performed on the blurred image
  • the second personal face image is an image after the reduction processing is performed on the blurred image
  • the first personal face image and the second personal face The Laplacian variance ratio between the graphs is 1.8050.
  • the third personal face image is an image before the reduction process is performed for the clear image
  • the fourth personal face image is the image after the reduction image is reduced
  • the Laplacian variance ratio between the third personal face image and the fourth personal face image is As for 5.5153, it can be seen that compared with the clear image, the blurred image has a large visual difference before and after the reduction processing, and the ratio of the Laplacian variance is also large.
  • the embodiment of the present application provides a method and device for detecting image sharpness, which is used to solve the problem that the workload is large and the algorithm complexity is high when the image sharpness detection is more accurately determined.
  • the method and the device are based on the same inventive concept. Since the principles of the method and the device for solving the problem are similar, the implementation of the device and the method can be referred to each other, and the repeated description is not repeated.
  • the embodiments of the present application may be applied to an electronic device, such as a computer, a tablet, a notebook, a smart phone, a server, etc.
  • the electronic device may be, but not limited to, an element including a camera/camera, an image processor, a central processing unit, a storage medium, and the like.
  • the camera/camera can be used to collect images to be detected
  • the image processor can be used for scaling processing, mask processing, etc.
  • the central processing unit can be used for detecting the image to be detected, etc.
  • the storage medium can be used. For storing image data, software programs, and so on.
  • the fields of application of the embodiments of the present application include, but are not limited to, a face image field, a vehicle image field, a plant image field, or other types of image fields.
  • the embodiments of the present application may be, but are not limited to, applied to the following scenarios: face recognition, identity information collection, facial skin detection, video tracking, and the like.
  • the embodiments of the present application may be, but are not limited to, applied to the following scenarios: automatic picture screening, photo blurred reminders, and the like.
  • Multiple means two or more.
  • the method includes:
  • the scaling process includes a reduction process or an enlargement process. If the first image of the first scale is reduced, a second image of the second scale is obtained, and the second scale may be smaller than the first scale, such as the second scale being 1/4 of the first scale, and the like. If the first image of the first scale is processed by the method to obtain a second image of the second scale, the second scale may be greater than the first scale, such as the second scale being 4 times of the first scale, and the like.
  • the first metric value may be, but is not limited to, a Laplacian variance, a Sobel variance, a grayscale variance, and the like, which are pixel values of the first image.
  • the second metric value may be, but is not limited to, a Laplacian variance, a Sobel variance, a grayscale variance, or the like, which is a pixel value of the second image.
  • the embodiment of the present application after the blurred image and the clear image are scaled, the phenomenon that the degree of clarity changes is different. For example, if the blurred image is reduced, the change of the degree of clarity is small, and the clear image is reduced, and the degree of clarity changes greatly.
  • the embodiment of the present application can accurately determine the sharpness of an image, and the workload is small, and the algorithm complexity is small.
  • the first image may be acquired first.
  • the manner of acquiring the first image includes, but is not limited to, acquiring a first image by a sensor such as a camera, acquiring a first image in a database, and the like.
  • attention is often paid only to the image definition of the target area.
  • attention is often paid to the definition of the face area. Therefore, the complex and varied background will affect the accuracy of the detection.
  • the background in the image sharpness detection can be reduced by filtering the background in the image.
  • the method when acquiring the first metric value of the first image, the method may be implemented as follows:
  • A1 Filter the background in the first image to obtain a target area of the first image.
  • the filtering of the background in the first image may be, but is not limited to, being implemented as follows:
  • Method 1 detecting a target area in the second image.
  • an detection algorithm based on an iterative algorithm (AdaBoost) algorithm, a convolutional neural network (CNN) based detection algorithm, a support vector machine (SVM) based detection algorithm, and a principal component can be used.
  • Analysis English: Principle Component Analysis, PCA
  • PCA Principle Component Analysis
  • other methods may be used for the detection of the target area.
  • a masking process is performed on the target area in the second image to obtain a mask image of the second image.
  • an elliptical mask covering the target area may be generated according to the size and position of the target area. Taking the target area as the face area as an example, the elliptical mask is shown in FIG.
  • Method two filtering the background in the second image by using the neural network model.
  • A2. Determine a metric value of a target area of the first image.
  • the method when acquiring the second metric value of the second image, the method may be implemented as follows:
  • the first metric value or the second metric may be first based on The value is used for the sharpness detection of the first image, so that the detection result can be obtained according to the first metric value or the second metric value for a particularly clear or particularly blurred image, for an intermediate state that is not particularly clear or particularly blurred.
  • the image is further processed by calculating the first metric value and the second metric value, and then comparing the operation result with the first threshold value, so that the image can be based on the first degree only for a particularly clear or particularly blurred image.
  • the magnitude or the second metric obtains the detection result without the need to operate the first and second metric values, thereby reducing the computational complexity and complexity of the sharpness detection algorithm.
  • performing the step S303, performing operations on the first metric value and the second metric value, before obtaining the operation result may be based on the second
  • the metric value makes the first determination of the sharpness of the first image.
  • the process of the first determination can be implemented as follows, as shown in FIG. 5:
  • step S503 Determine whether the second metric value is less than a third threshold; if yes, perform step S504; if not, perform a second determination on the sharpness of the first image based on the first metric value.
  • the second threshold is greater than the third threshold.
  • the process of the second determination can be implemented by the following process, as shown in FIG. 6:
  • step S601 Determine whether the first metric value is greater than a fourth threshold; if yes, execute step S602; if no, perform step S603.
  • step S603. Determine whether the first metric value is less than a fifth threshold; if yes, perform step S604; if not, perform a second determination on the resolution of the first image based on the first metric value.
  • the second threshold is greater than the third threshold.
  • the first threshold, the second threshold, the third threshold, the fourth threshold, and the fifth threshold in the embodiment of the present application may be determined based on an empirical value, or determined by a large number of experiments, for example, a second threshold: A certain clear image is scaled to obtain the processed image, and the processed metric value of the image is determined, and the second threshold may be the processed metric value of the image.
  • the third threshold is determined by scaling a particular blurred image to obtain the processed image, and determining the processed metric value of the image, and the third threshold may be the processed metric value of the image. Determination process of the fourth threshold: determining the metric value of a particularly clear image, then the fourth threshold may be the metric value of the image.
  • the fifth threshold determination process determining the metric value of a particular blurred image, then the fifth threshold may be the metric value of the image.
  • the first threshold is determined by determining the first threshold based on the ratio of the most acceptable blurred image.
  • the first threshold, the second threshold, the third threshold, the fourth threshold, and the fifth threshold may be adjusted based on the feedback mechanism. Specifically, as shown in FIG. 7 :
  • the second metric value is greater than the second threshold
  • determining that the first image is a clear image determining that the first image is a clear image
  • the feedback information is the first image.
  • adjust the second threshold adjust the second threshold. The adjusted second threshold can then be used when image sharpness detection is performed.
  • the process of adjusting the first threshold, or the third threshold, or the fourth threshold, or the fifth threshold based on the feedback mechanism may refer to the process of adjusting the second threshold, and details are not repeatedly described herein.
  • the first threshold value after the adjustment, or the second threshold value, or the third threshold value, or the fourth threshold value, or the fifth threshold value is used as a threshold value for the next image sharpness detection.
  • the method of adjusting the threshold based on the feedback mechanism may enable more accurate detection results to be determined according to the first threshold, the second threshold, the third threshold, the fourth threshold, and the fifth threshold, thereby improving the accuracy of image sharpness detection.
  • FIG. 8 is a schematic diagram for detecting the sharpness process of the face image.
  • Step S801. Acquire an image of a face to be detected. Step S802 is performed.
  • Step S802 Perform a reduction process on the face image to be detected to obtain a thumbnail image.
  • the scale of the thumbnail image may be 1/4 of the scale of the image to be detected.
  • Step S803 is performed.
  • Step S803 performing face detection and positioning on the reduced image. Step S804 is performed.
  • Step S804 generating a mask covering the face region according to the face detection and the size and position of the face region obtained by the positioning, to obtain a first mask region.
  • the first mask may be elliptical.
  • Step S805. Calculate a metric value of the first mask area.
  • the metric value may be a Laplacian variance, a Sobel variance, a gray scale variance, and the like of pixel values of the first mask region.
  • Step S806 is performed.
  • Step S810 performing face detection and positioning on the detected face image. Step S811 is performed.
  • Step S811 generating a mask covering the face region according to the face detection and the size and position of the face region obtained by the positioning, to obtain a second mask region.
  • the second mask may be elliptical.
  • Step S812 calculating a metric value of the second mask area.
  • the metric value may be a Laplacian variance, a Sobel variance, a gray scale variance, and the like of the pixel values of the second mask region. Step S813 is performed.
  • Step S815. Determine a ratio between a metric value of the second mask region and a metric value of the first mask region. Step S816 is performed.
  • the feedback information may be acquired, and determining, according to the feedback information, whether the first image is a clear image according to the second threshold is accurate, and if so, the second threshold is not adjusted. If not, adjust the second threshold.
  • the feedback information may be acquired, and determining, according to the feedback information, whether the first image is a clear image according to the fourth threshold is accurate, and if so, the fourth threshold is not adjusted. If not, adjust the fourth threshold.
  • the feedback information may be acquired, and determining, according to the feedback information, whether the first image is a clear image according to the first threshold, and if so, the first threshold is not adjusted. If not, adjust the first threshold.
  • the feedback information may be acquired, and determining, according to the feedback information, whether the first image is a blurred image according to the third threshold is accurate, and if so, the third threshold is not adjusted. If not, adjust the third threshold.
  • the feedback information may be acquired, and determining, according to the feedback information, whether the first image is a blurred image according to the fifth threshold is accurate, and if so, the fifth threshold is not adjusted. If not, adjust the fifth threshold.
  • the feedback information may be acquired, and determining, according to the feedback information, whether the first image is a blurred image according to the first threshold, and if so, the first threshold is not adjusted. If not, adjust the first threshold.
  • the embodiment of the present application provides a terminal device, specifically for implementing the method described in the embodiments described in FIG. 3 to FIG. 8.
  • the structure of the device is as shown in FIG.
  • the scaling module 901 is configured to perform scaling processing on the first image of the first size to obtain a second image of the second size.
  • a determining module 902 configured to determine a first metric value of the first image and a second metric value of the second image obtained by the scaling module 901, where the first metric value is used to represent the first The sharpness of an image used to characterize the sharpness of the second image.
  • the operation module 903 is configured to perform operations on the first metric value and the second metric value determined by the determining module 902 to obtain an operation result. And comparing the operation result obtained by the operation module 903 with a first threshold to obtain a comparison result.
  • the determining module 905 is configured to determine, according to the comparison result obtained by the comparing module 904, whether the first image is a clear image.
  • the operation module 903 is specifically configured to: determine a ratio of the first metric value and the second metric value.
  • the comparison module 904 is specifically configured to: compare the ratio with a first threshold.
  • the determining module 905 is specifically configured to: if the ratio is greater than the first threshold, determine that the first image is a clear image, or if the ratio is less than or equal to the first threshold, determine the first An image is a blurred image.
  • the determining module 902 is further configured to: after comparing the operation result with a first threshold, and determining, according to the obtained comparison result, whether the first image is a clear image, Determining whether the first detection result is accurate; the first detection result is determining that the first image is a clear image or a blurred image according to a comparison result of the operation result and the first threshold.
  • the device further includes an adjustment module 906, configured to adjust the first threshold when the first detection result is inaccurate.
  • the comparing module 904 is further configured to: before the operation of the first metric value and the second metric value, obtain the second metric value and the second threshold and the third threshold The comparison is performed, and the obtained comparison result is that the second metric value is smaller than the second threshold value and greater than the third threshold value, and the second threshold value is greater than the third threshold value.
  • the determining module 905 is further configured to: when the second metric value is greater than or equal to the second threshold, determine that the first image is a clear image; or, when the second metric value is less than or equal to The third threshold is determined to be a blurred image.
  • the determining module 902 is further configured to: determine, after the detection result of the first image is a clear image, whether the second detection result is accurate .
  • the second detection result is that the first image is a clear image according to the second metric value and the second threshold.
  • the adjusting module 906 is configured to adjust the second threshold when the second detection result determined by the determining module 902 is inaccurate.
  • the determining module 902 is further configured to: after determining that the first image is a blurred image, determine whether the third detection result is accurate.
  • the third detection result is that the first image is a blurred image according to the second metric value and the third threshold.
  • the adjusting module 906 is further configured to: when the third detection result is inaccurate, adjust the third threshold.
  • the comparing module 904 is further configured to: before the operation of the first metric value and the second metric value, obtain the operation result, and use the first metric value and the fourth The threshold and the fifth threshold are compared, and the obtained comparison result is that the first metric value is smaller than the fourth threshold and greater than the fifth threshold, and the fourth threshold is greater than the fifth threshold.
  • the determining module 905 is further configured to: when the first metric value is greater than or equal to the fourth threshold, determine that the first image is a clear image, or When the first metric value is less than or equal to the fifth threshold, it is determined that the first image is a blurred image.
  • the determining module 902 is further configured to: determine whether the fourth detection result is accurate after determining that the first image is a clear image, if the first metric is greater than or equal to the fourth threshold.
  • the fourth detection result is that the first image is a clear image according to the first metric value and the fourth threshold.
  • the adjusting module 906 is configured to adjust the fourth threshold when the fourth detection result is inaccurate.
  • the determining module 902 is further configured to: after determining that the first image is a blurred image, determine whether the fifth detection result is accurate.
  • the fifth detection result is that the first image is a blurred image according to the first metric value and the fifth threshold.
  • the adjusting module 906 is further configured to: when the fifth detection result is inaccurate, adjust the fifth threshold.
  • the determining module 902 when determining the first metric value of the first image, is specifically configured to: detect a target area in the first image, and target a target area in the first image Performing a mask process to obtain a first mask image, and determining a metric value of the first mask image.
  • determining the second metric value of the second image specifically, detecting: a target area in the second image, performing mask processing on the target area in the second image, to obtain a second mask image And determining a metric value of the second mask image.
  • each functional module in each embodiment of the present application may be integrated into one processing. In the device, it can also be physically existed alone, or two or more modules can be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
  • the terminal device may include the processor 1002.
  • the hardware of the entity corresponding to the above module may be the processor 1002.
  • the processor 1002 can be a central processing unit (CPU), or a digital processing module or the like.
  • the terminal device may further include a collector 1001, and the processor 1002 collects an image through the collector 1001.
  • the apparatus also includes a memory 1003 for storing a program executed by the processor 1002.
  • the memory 1003 may be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), or a volatile memory such as a random access memory (random). -access memory, RAM).
  • Memory 1003 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
  • the processor 1002 is configured to execute the program code stored in the memory 1003, specifically for performing any one of the methods described in the embodiments shown in FIG. 3 to FIG. For the methods described in the embodiments shown in FIG. 3 to FIG. 8 , the application will not be repeated herein.
  • connection medium between the collector 1001, the processor 1002, and the memory 1003 is not limited in the embodiment of the present application.
  • the memory 1003, the processor 1002, and the collector 1001 are connected by a bus 1004 in FIG. 10, and the bus is indicated by a thick line in FIG. 10, and the connection manner between other components is only schematically illustrated. , not limited to.
  • the bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in FIG. 10, but it does not mean that there is only one bus or one type of bus.
  • the embodiment of the present invention further provides a chip, where the chip includes the foregoing collector and the processor, and is configured to support the first relay device to implement any one of the methods described in the embodiments shown in FIG. 3 to FIG. .
  • the embodiment of the present application further provides a computer readable storage medium for storing computer software instructions required to execute the foregoing processor, which includes a program for executing the above-mentioned processor.
  • embodiments of the present application can be provided as a method, system, or computer program product.
  • the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment in combination of software and hardware.
  • the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

A method and apparatus for detecting the resolution of an image, used for solving the problems of a large workload and high algorithm complexity when the resolution of an image is detected. The method comprises: scaling a first image of a first size to obtain a second image of a second size, and determining a first metric value of the first image and a second metric value of the second image, wherein the first metric value is used to characterize the resolution of the first image, and the second metric value is used to characterize the resolution of the second image; then, performing an operation on the first metric value and second metric value to obtain an operation result, comparing the operation result to a first threshold, and determining whether the first image is a clear image according to the obtained comparison result.

Description

一种图像清晰度检测方法及装置Image sharpness detecting method and device 技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种图像清晰度检测方法及装置。The present application relates to the field of computer technologies, and in particular, to a method and device for detecting image sharpness.
背景技术Background technique
随着数据量大、实时性要求高的图像类应用场景越来越多,对图像清晰度的自动检测变得越来越不可或缺。模糊的图像会导致很多图像类的应用功能无法正常运作,如人脸识别、视频监控等。With more and more image-based application scenarios with high data volume and high real-time requirements, automatic detection of image sharpness becomes more and more indispensable. Blurred images can cause many image-like application functions to fail, such as face recognition, video surveillance, and so on.
目前常用的检测图像清晰度的方法为基于机器学习的清晰度检测方法。该方法通过建立图像样本库,其中,图像样本库中包括大量的清晰图像以及大量的模糊图像,然后建立深度学习模型,并采用图像样本库中的清晰图像以及模糊图像对该深度学习模型进行训练。在该深度学习模型训练完成后,通过训练好的深度学习模型进行图像清晰度检测。A commonly used method for detecting image sharpness is a machine learning based sharpness detection method. The method establishes an image sample library, wherein the image sample library includes a large number of clear images and a large number of blurred images, and then establishes a deep learning model, and uses the clear image in the image sample library and the blurred image to train the deep learning model. . After the deep learning model is completed, the image depth detection is performed by the trained deep learning model.
这种基于机器学习的清晰度检测方法在构建图像样本库时,需要搜集大量的清晰图像以及大量的模糊图像,工作量较大,并且算法复杂度较高。This kind of machine learning-based sharpness detection method needs to collect a large number of clear images and a large number of blurred images when constructing the image sample library, which has a large workload and high algorithm complexity.
发明内容Summary of the invention
本申请实施例提供了一种图像清晰度检测方法及装置,用于解决图像清晰度检测时工作量较大,并且算法复杂度较高的问题。The embodiment of the present application provides a method and a device for detecting image sharpness, which are used to solve the problem that the workload of the image sharpness detection is large and the algorithm complexity is high.
第一方面,本申请实施例提供了一种图像清晰度检测方法,该方法可以应用于电子设备,包括:将第一尺度的第一图像进行缩放处理,得到第二尺度的第二图像,并确定所述第一图像的第一度量值和所述第二图像的第二度量值,所述第一度量值用于表征所述第一图像的清晰度,所述第二度量值用于表征所述第二图像的清晰度。之后对所述第一度量值和所述第二度量值进行运算,获得运算结果,并将所述运算结果与第一阈值进行比较,并根据获得的比较结果确定所述第一图像是否为清晰图像。本申请实施例中利用对模糊图像与清晰图像进行缩放后,其清晰程度变化不同的现象,如缩小模糊图像,其清晰程度的变化较小,而缩小清晰图像,其清晰程度的变化较大,在检测图像清晰度时,通过结合第一图像在进行缩放处理前后的度量值的变化情况,可以快速且准确的判断图像是否清晰。相比于现有技术中基于机器学习的清晰度检测方法,本申请实施例可以准确的判定图像的清晰度,并且工作量较小,并且算法复杂度较小。In a first aspect, an embodiment of the present application provides an image sharpness detecting method, which may be applied to an electronic device, including: scaling a first image of a first size to obtain a second image of a second scale, and Determining a first metric value of the first image and a second metric value of the second image, the first metric value being used to characterize a sharpness of the first image, and the second metric value Characterizing the sharpness of the second image. And then performing operations on the first metric value and the second metric value, obtaining an operation result, comparing the operation result with a first threshold, and determining, according to the obtained comparison result, whether the first image is Clear image. In the embodiment of the present application, after the blurred image and the clear image are scaled, the phenomenon that the degree of clarity changes is different. For example, if the blurred image is reduced, the change of the degree of clarity is small, and the clear image is reduced, and the degree of clarity changes greatly. When detecting the sharpness of the image, it is possible to quickly and accurately determine whether the image is clear by combining the change of the metric value before and after the scaling process of the first image. Compared with the prior art machine learning-based sharpness detection method, the embodiment of the present application can accurately determine the sharpness of an image, and the workload is small, and the algorithm complexity is small.
在一种可能的设计,确定所述第一图像的第一度量值,包括:检测所述第一图像中的目标区域,并所述第一图像中的目标区域进行掩膜处理,得到第一掩膜图像,确定所述第一掩膜图像的度量值,得到第一图像的度量值。确定所述第二图像的第二度量值,包括:检测所述第二图像中的目标区域,并在所述第二图像中的目标区域进行掩膜处理,得到第二掩膜图像,确定所述第二掩膜图像的度量值得到,第二图像的度量值。在检测图像清晰度时,通常仅关注目标区域的图像清晰度,如检测人脸图像的清晰度时主要关注人脸区域的清晰度。而复杂多变的背景会影响检测的精度,因此,上述设计通过设置目标区域椭圆形掩膜,可以屏蔽不同背景对清晰度检测的干扰,从而提高图像清晰度检测的准确性。In a possible design, determining the first metric value of the first image includes: detecting a target area in the first image, and performing mask processing on the target area in the first image to obtain a a mask image, determining a metric value of the first mask image to obtain a metric value of the first image. Determining the second metric value of the second image, comprising: detecting a target area in the second image, performing mask processing on the target area in the second image, obtaining a second mask image, determining The metric value of the second mask image is obtained as the metric value of the second image. When detecting the sharpness of an image, it is usually only concerned with the image sharpness of the target area, such as the sharpness of the face area when detecting the sharpness of the face image. The complex and varied background will affect the accuracy of the detection. Therefore, by setting the elliptical mask of the target area, the above design can shield the interference of different backgrounds from the sharpness detection, thereby improving the accuracy of image sharpness detection.
在一种可能的设计中,对所述第一度量值和所述第二度量值进行运算,获得运算结果, 通过如下过程实现:确定所述第一度量值以及所述第二度量值的比值。将所述运算结果与第一阈值进行比较,并根据获得的比较结果确定所述第一图像是否为清晰图像,通过如下过程实现:若所述比值大于第一阈值,则确定所述第一图像是清晰图像,或者,若所述比值小于或等于所述第一阈值,则确定所述第一图像是模糊图像。上述设计中,通过确定所述第一度量值以及所述第二度量值的比值来判断第一图像在进行缩放处理前后度量值的变化情况,并根据第一图像在进行缩放处理前后度量值的变化情况判断第一图像的清晰度,可以以较少的工作量来实现准确判断第一图像的清晰度的目的。In a possible design, the first metric value and the second metric value are operated to obtain an operation result, which is implemented by: determining the first metric value and the second metric value The ratio. Comparing the operation result with the first threshold, and determining whether the first image is a clear image according to the obtained comparison result, by implementing, if the ratio is greater than the first threshold, determining the first image Is a clear image or, if the ratio is less than or equal to the first threshold, determining that the first image is a blurred image. In the above design, by determining the ratio of the first metric value and the second metric value, determining a change of the metric value before and after performing the scaling process on the first image, and determining the metric value before and after performing the scaling process according to the first image. The change of the condition determines the sharpness of the first image, and the purpose of accurately determining the sharpness of the first image can be achieved with a small amount of work.
在一种可能的设计中,在将所述运算结果与第一阈值进行比较,并根据获得的比较结果确定所述第一图像是否为清晰图像之后,还确定第一检测结果是否准确。所述第一检测结果为根据所述运算结果与第一阈值的比较结果确定所述第一图像是清晰图像或者模糊图像。若所述第一检测结果不准确,则调整所述第一阈值。上述设计中,通过对检测结果判定是否准确,并在确定检测结果不准确时调整第一阈值,使得根据调整后的第一阈值判定出更准确的检测结果,从而可以提高图像清晰度检测的准确性。In a possible design, after comparing the operation result with the first threshold and determining whether the first image is a clear image according to the obtained comparison result, it is further determined whether the first detection result is accurate. The first detection result is that the first image is a clear image or a blurred image according to a comparison result of the operation result and the first threshold. If the first detection result is inaccurate, the first threshold is adjusted. In the above design, by determining whether the detection result is accurate, and adjusting the first threshold when determining that the detection result is inaccurate, the more accurate detection result is determined according to the adjusted first threshold, thereby improving the accuracy of the image sharpness detection. Sex.
在一种可能的设计中,在对所述第一度量值和所述第二度量值进行运算,获得运算结果之前,将所述第二度量值与第二阈值以及第三阈值进行比较,且获得的比较结果为所述第二度量值小于所述第二阈值,且大于所述第三阈值,所述第二阈值大于所述第三阈值。上述设计中,通过在第二度量值小于所述第二阈值,且大于所述第三阈值时根据第一图像进行缩放前后的度量值变化情况判定第一图像的清晰度,可以有效的降低图像清晰度检测的复杂度。In a possible design, the second metric value is compared with the second threshold and the third threshold before the first metric value and the second metric value are operated to obtain the operation result. And the comparison result obtained is that the second metric value is smaller than the second threshold value, and is greater than the third threshold value, and the second threshold value is greater than the third threshold value. In the above design, by determining the sharpness of the first image according to the change of the metric value before and after the scaling according to the first image when the second metric value is smaller than the second threshold value and greater than the third threshold value, the image can be effectively reduced. The complexity of clarity detection.
在一种可能的设计中,若所述第二度量值大于或等于所述第二阈值,则确定所述第一图像是清晰图像,或者,若所述第二度量值小于或等于所述第三阈值,则确定所述第一图像是模糊图像。上述设计中,针对特别清晰或者特别模糊的图像可以通过将第二度量值与第二阈值以及第三阈值进行比较而得到检测结果,从而可以降低图像清晰度检测的复杂度。In a possible design, if the second metric value is greater than or equal to the second threshold, determining that the first image is a clear image, or if the second metric value is less than or equal to the first The third threshold determines that the first image is a blurred image. In the above design, for a particularly clear or particularly blurred image, the detection result can be obtained by comparing the second metric value with the second threshold and the third threshold, thereby reducing the complexity of image sharpness detection.
在一种可能的设计中,若所述第二度量值大于或等于所述第二阈值,则在确定所述第一图像的检测结果为清晰图像之后,还确定第二检测结果是否准确,所述第二检测结果为根据所述第二度量值与所述第二阈值确定所述第一图像是清晰图像。若所述第二检测结果不准确,则调整所述第二阈值。若所述第二度量值小于或等于所述第三阈值,在确定所述第一图像是模糊图像之后,还确定第三检测结果是否准确,所述第三检测结果为根据所述第二度量值与所述第三阈值确定所述第一图像是模糊图像。若所述第三检测结果不准确,则调整所述第三阈值。上述设计中,通过对检测结果判定是否准确,并在确定检测结果不准确时调整第二阈值或者第三阈值,使得根据调整后的第二阈值或第三阈值判定出更准确的检测结果,从而可以提高图像清晰度检测的准确性。In a possible design, if the second metric value is greater than or equal to the second threshold, after determining that the detection result of the first image is a clear image, determining whether the second detection result is accurate, The second detection result is that the first image is a clear image according to the second metric value and the second threshold. If the second detection result is inaccurate, the second threshold is adjusted. If the second metric is less than or equal to the third threshold, after determining that the first image is a blurred image, determining whether the third detection result is accurate, the third detection result is according to the second metric The value and the third threshold determine that the first image is a blurred image. If the third detection result is inaccurate, the third threshold is adjusted. In the above design, by determining whether the detection result is accurate, and adjusting the second threshold or the third threshold when determining that the detection result is inaccurate, determining a more accurate detection result according to the adjusted second threshold or the third threshold, thereby Can improve the accuracy of image sharpness detection.
在一种可能的设计中,在对所述第一度量值和所述第二度量值进行运算,获得运算结果之前,将所述第一度量值与第四阈值以及第五阈值进行比较,且获得的比较结果为所述第一度量值小于所述第四阈值,且大于所述第五阈值,所述第四阈值大于所述第五阈值。上述设计中,通过在第一度量值小于所述第四阈值,且大于所述第五阈值时根据第一图像进行缩放前后的度量值变化情况判定第一图像的清晰度,可以有效的降低图像清晰度检测的复杂度。In a possible design, comparing the first metric value and the second metric value to obtain the operation result, comparing the first metric value with the fourth threshold value and the fifth threshold value And obtaining a comparison result that the first metric value is smaller than the fourth threshold value, and is greater than the fifth threshold value, where the fourth threshold value is greater than the fifth threshold value. In the above design, by determining the sharpness of the first image according to the change of the metric value before and after the scaling according to the first image when the first metric value is smaller than the fourth threshold value and greater than the fifth threshold value, the image may be effectively reduced. The complexity of image sharpness detection.
在一种可能的设计中,若所述第一度量值大于或等于所述第四阈值,则确定所述第一 图像是清晰图像,或者,若所述第一度量值小于或等于所述第五阈值,则确定所述第一图像是模糊图像。上述设计中,针对特别清晰或者特别模糊的图像可以通过将第一度量值与第四阈值以及第五阈值进行比较而得到检测结果,从而可以降低图像清晰度检测的复杂度。In a possible design, if the first metric value is greater than or equal to the fourth threshold, determining that the first image is a clear image, or if the first metric value is less than or equal to The fifth threshold is determined to determine that the first image is a blurred image. In the above design, the detection result can be obtained by comparing the first metric value with the fourth threshold value and the fifth threshold value for the image that is particularly clear or particularly blurred, so that the complexity of image sharpness detection can be reduced.
在一种可能的设计中,若所述第一度量值大于或等于所述第四阈值,在确定所述第一图像是清晰图像之后,确定第四检测结果是否准确;所述第四检测结果为根据所述第一度量值与所述第四阈值确定所述第一图像是清晰图像。若所述第四检测结果不准确,则调整所述第四阈值。若所述第一度量值小于或等于所述第五阈值,在确定所述第一图像是模糊图像之后,确定第五检测结果是否准确;所述第五检测结果为根据所述第一度量值与所述第五阈值确定所述第一图像是模糊图像,若所述第五检测结果不准确,则调整所述第五阈值。上述设计中,通过对检测结果判定是否准确,并在确定检测结果不准确时调整第四阈值或者第五阈值,使得根据调整后的第四阈值或第五阈值判定出更准确的检测结果,从而可以提高图像清晰度检测的准确性。In a possible design, if the first metric value is greater than or equal to the fourth threshold, determining whether the fourth detection result is accurate after determining that the first image is a clear image; the fourth detection The result is that the first image is a clear image based on the first metric value and the fourth threshold. If the fourth detection result is inaccurate, the fourth threshold is adjusted. If the first metric value is less than or equal to the fifth threshold, determining whether the fifth detection result is accurate after determining that the first image is a blurred image; the fifth detection result is according to the first degree The magnitude and the fifth threshold determine that the first image is a blurred image, and if the fifth detection result is not accurate, the fifth threshold is adjusted. In the above design, by determining whether the detection result is accurate, and adjusting the fourth threshold or the fifth threshold when determining that the detection result is inaccurate, determining a more accurate detection result according to the adjusted fourth threshold or the fifth threshold, thereby Can improve the accuracy of image sharpness detection.
第二方面,本申请实施例提供了一种图像清晰度检测装置,包括:缩放模块,用于将第一尺度的第一图像进行缩放处理,得到第二尺度的第二图像。确定模块,用于确定所述第一图像的第一度量值和所述缩放模块得到的所述第二图像的第二度量值,所述第一度量值用于表征所述第一图像的清晰度,所述第二度量值用于表征所述第二图像的清晰度。运算模块,用于对所述确定模块确定的所述第一度量值和所述第二度量值进行运算,获得运算结果。比较模块,用于将所述运算模块得到的所述运算结果与第一阈值进行比较,获取比较结果。判定模块,用于根据所述比较模块获得的比较结果确定所述第一图像是否为清晰图像。In a second aspect, an embodiment of the present application provides an image sharpness detecting apparatus, including: a scaling module, configured to perform a scaling process on a first image of a first size to obtain a second image of a second size. a determining module, configured to determine a first metric value of the first image and a second metric value of the second image obtained by the scaling module, the first metric value being used to represent the first image The clarity of the second metric is used to characterize the sharpness of the second image. And an operation module, configured to perform operations on the first metric value and the second metric value determined by the determining module, to obtain an operation result. And a comparison module, configured to compare the operation result obtained by the operation module with a first threshold, and obtain a comparison result. And a determining module, configured to determine, according to the comparison result obtained by the comparing module, whether the first image is a clear image.
在一种可能的设计中,所述运算模块,具体用于:确定所述第一度量值以及所述第二度量值的比值。所述比较模块,具体用于:将所述比值与第一阈值进行比较。所述判定模块,具体用于:若所述比值大于第一阈值,则确定所述第一图像是清晰图像,或者,若所述比值小于或等于所述第一阈值,则确定所述第一图像是模糊图像。In a possible design, the operation module is specifically configured to: determine a ratio of the first metric value and the second metric value. The comparing module is specifically configured to: compare the ratio with a first threshold. The determining module is configured to: if the ratio is greater than the first threshold, determine that the first image is a clear image, or if the ratio is less than or equal to the first threshold, determine the first The image is a blurred image.
在一种可能的设计中,所述确定模块,还用于:在将所述运算结果与第一阈值进行比较,并根据获得的比较结果确定所述第一图像是否为清晰图像之后,确定第一检测结果是否准确;所述第一检测结果为根据所述运算结果与第一阈值的比较结果确定所述第一图像是清晰图像或者模糊图像。所述装置还包括调整模块,所述调整模块,用于在所述第一检测结果不准确时,调整所述第一阈值。In a possible design, the determining module is further configured to: after comparing the operation result with a first threshold, and determining whether the first image is a clear image according to the obtained comparison result, determining Whether the detection result is accurate; the first detection result is that the first image is a clear image or a blurred image according to a comparison result of the operation result and the first threshold. The device further includes an adjustment module, where the adjustment module is configured to adjust the first threshold when the first detection result is inaccurate.
在一种可能的设计中,所述比较模块,还用于:在对所述第一度量值和所述第二度量值进行运算,获得运算结果之前,将所述第二度量值与第二阈值以及第三阈值进行比较,且获得的比较结果为所述第二度量值小于所述第二阈值,且大于所述第三阈值,所述第二阈值大于所述第三阈值。In a possible design, the comparing module is further configured to: before calculating the first metric value and the second metric value, obtaining the second metric value and the first The second threshold and the third threshold are compared, and the obtained comparison result is that the second metric is smaller than the second threshold and greater than the third threshold, and the second threshold is greater than the third threshold.
在一种可能的设计中,所述判定模块,还用于:在所述第二度量值大于或等于所述第二阈时,确定所述第一图像是清晰图像;或者,在所述第二度量值小于或等于所述第三阈值时,确定所述第一图像是模糊图像。In a possible design, the determining module is further configured to: when the second metric value is greater than or equal to the second threshold, determine that the first image is a clear image; or, in the When the second metric is less than or equal to the third threshold, it is determined that the first image is a blurred image.
在一种可能的设计中,若所述第二度量值大于或等于所述第二阈值,则所述确定模块,还用于:在确定所述第一图像的检测结果为清晰图像之后,确定第二检测结果是否准确。所述第二检测结果为根据所述第二度量值与所述第二阈值确定所述第一图像是清晰图像。 所述装置还包括调整模块,所述调整模块,用于在所述确定模块确定的所述第二检测结果不准确时,调整所述第二阈值。或者,若所述第二度量值小于或等于所述第三阈值,则所述确定模块,还用于:在确定所述第一图像是模糊图像之后,确定第三检测结果是否准确。所述第三检测结果为根据所述第二度量值与所述第三阈值确定所述第一图像是模糊图像。所述调整模块,还用于:在所述第三检测结果不准确时,调整所述第三阈值。In a possible design, if the second metric is greater than or equal to the second threshold, the determining module is further configured to: after determining that the detection result of the first image is a clear image, determining Whether the second test result is accurate. The second detection result is that the first image is a clear image according to the second metric value and the second threshold. The device further includes an adjustment module, where the adjustment module is configured to adjust the second threshold when the second detection result determined by the determining module is inaccurate. Or, if the second metric is less than or equal to the third threshold, the determining module is further configured to: after determining that the first image is a blurred image, determine whether the third detection result is accurate. The third detection result is that the first image is a blurred image according to the second metric value and the third threshold. The adjusting module is further configured to: when the third detection result is inaccurate, adjust the third threshold.
在一种可能的设计中,所述比较模块,还用于:在对所述第一度量值和所述第二度量值进行运算,获得运算结果之前,将所述第一度量值与第四阈值以及第五阈值进行比较,且获得的比较结果为所述第一度量值小于所述第四阈值,且大于所述第五阈值,所述第四阈值大于所述第五阈值。In a possible design, the comparing module is further configured to: before the operation of the first metric value and the second metric value, obtain the operation result, and compare the first metric value with The fourth threshold and the fifth threshold are compared, and the obtained comparison result is that the first metric value is smaller than the fourth threshold and greater than the fifth threshold, and the fourth threshold is greater than the fifth threshold.
在一种可能的设计中,所述判定模块,还用于:在所述第一度量值大于或等于所述第四阈值时,确定所述第一图像是清晰图像,或者,在所述第一度量值小于或等于所述第五阈值时,确定所述第一图像是模糊图像。In a possible design, the determining module is further configured to: when the first metric value is greater than or equal to the fourth threshold, determine that the first image is a clear image, or When the first metric value is less than or equal to the fifth threshold, it is determined that the first image is a blurred image.
在一种可能的设计中,若所述第一度量值大于或等于所述第四阈值,则所述确定模块,还用于:在确定所述第一图像是清晰图像之后,确定第四检测结果是否准确。所述第四检测结果为根据所述第一度量值与所述第四阈值确定所述第一图像是清晰图像。所述装置还包括调整模块,所述调整模块,用于在所述第四检测结果不准确时,调整所述第四阈值。或者,若所述第一度量值小于或等于所述第五阈值,则所述确定模块,还用于:在确定所述第一图像是模糊图像之后,确定第五检测结果是否准确。所述第五检测结果为根据所述第一度量值与所述第五阈值确定所述第一图像是模糊图像。所述调整模块,还用于:在所述第五检测结果不准确时,调整所述第五阈值。In a possible design, if the first metric value is greater than or equal to the fourth threshold, the determining module is further configured to: after determining that the first image is a clear image, determine the fourth Whether the test results are accurate. The fourth detection result is that the first image is a clear image according to the first metric value and the fourth threshold. The device further includes an adjustment module, where the adjustment module is configured to adjust the fourth threshold when the fourth detection result is inaccurate. Or, if the first metric value is less than or equal to the fifth threshold, the determining module is further configured to: after determining that the first image is a blurred image, determine whether the fifth detection result is accurate. The fifth detection result is that the first image is a blurred image according to the first metric value and the fifth threshold. The adjusting module is further configured to: when the fifth detection result is inaccurate, adjust the fifth threshold.
在一种可能的设计中,所述确定模块,在确定所述第一图像的第一度量值时,具体用于:检测所述第一图像中的目标区域,在所述第一图像中的目标区域进行掩膜处理,得到第一掩膜图像,确定所述第一掩膜图像的度量值。在确定所述第二图像的第二度量值时,具体用于:检测所述第二图像中的目标区域,在所述第二图像中的目标区域进行掩膜处理,得到第二掩膜图像,确定所述第二掩膜图像的度量值。In a possible design, the determining module, when determining the first metric value of the first image, is specifically configured to: detect a target area in the first image, in the first image The target area is masked to obtain a first mask image, and the metric value of the first mask image is determined. When determining the second metric value of the second image, specifically, detecting: a target area in the second image, performing mask processing on the target area in the second image, to obtain a second mask image And determining a metric value of the second mask image.
第三方面,本申请实施例还提供了一种终端,该终端包括处理器和存储器,所述存储器用于存储软件程序,所述处理器用于读取所述存储器中存储的软件程序并实现第一方面或上述第一方面的任意一种设计提供的方法。该电子设备可以是移动终端、计算机等等。In a third aspect, an embodiment of the present application further provides a terminal, where the terminal includes a processor and a memory, where the memory is used to store a software program, and the processor is configured to read a software program stored in the memory and implement the first The method provided by one aspect or any of the above first aspects of the design. The electronic device can be a mobile terminal, a computer, or the like.
第四方面,本申请实施例中还提供一种计算机存储介质,该存储介质中存储软件程序,该软件程序在被一个或多个处理器读取并执行时可实现第一方面或上述第一方面的任意一种设计提供的方法。In a fourth aspect, the embodiment of the present application further provides a computer storage medium, where the software program stores a software program, where the software program can implement the first aspect or the first one when being read and executed by one or more processors Any of the aspects provided by the design.
第五方面,本申请实施例提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面或上述第一方面的任意一种设计所述的方法,或者第二方面或上述第二方面的任意一种设计提供的方法。In a fifth aspect, the embodiment of the present application provides a computer program product comprising instructions, when executed on a computer, causing a computer to perform the method described in any one of the above first aspect or the first aspect, or The method provided by the second aspect or any one of the above second aspects.
附图说明DRAWINGS
图1A为本申请实施例提供的清晰图像;FIG. 1A is a clear image provided by an embodiment of the present application;
图1B为本申请实施例提供的模糊图像;FIG. 1B is a blurred image provided by an embodiment of the present application;
图2为本申请实施例提供的模糊图像、清晰图像进行缩小处理前后清晰度变化情况的示意图;2 is a schematic diagram of a change in sharpness of a blurred image and a clear image before and after a reduction process according to an embodiment of the present application;
图3为本申请实施例提供的图像清晰度检测方法的流程示意图;3 is a schematic flowchart of a method for detecting image sharpness according to an embodiment of the present application;
图4为本申请实施例提供的椭圆形掩膜的示意图;4 is a schematic view of an elliptical mask provided by an embodiment of the present application;
图5为本申请实施例提供的第一次判定的流程示意图;FIG. 5 is a schematic flowchart of a first determination provided by an embodiment of the present application;
图6为本申请实施例提供的第二次判定的流程示意图;FIG. 6 is a schematic flowchart of a second determination provided by an embodiment of the present application;
图7为本申请实施例提供的调整阈值的流程示意图;FIG. 7 is a schematic flowchart of adjusting a threshold according to an embodiment of the present application;
图8为本申请实施例提供的人脸图像清晰度检测方法的流程示意图;FIG. 8 is a schematic flowchart of a method for detecting a sharpness of a face image according to an embodiment of the present application;
图9为本申请实施例提供的图像清晰度检测装置的结构示意图;FIG. 9 is a schematic structural diagram of an image sharpness detecting apparatus according to an embodiment of the present application;
图10为本申请实施例提供的图像清晰度检测装置的结构示意图。FIG. 10 is a schematic structural diagram of an image sharpness detecting apparatus according to an embodiment of the present application.
具体实施方式detailed description
下面将结合附图对本申请实施例作进一步地详细描述。The embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
随着数据量大、实时性要求高的图像类应用场景越来越多,对图像清晰度的自动快速检测变得越来越不可或缺。模糊的图像会导致很多图像类的应用功能无法正常运作,如人脸识别、视频监控等,此外,图像的清晰度检测在自动对焦、照片自动筛选等领域中也起着至关重要的作用。例如,一种图像类应用功能为根据用户的面部图片,对面部的皮肤状态进行检测,比如对面部的毛孔、黑头、细纹、色斑、皮下红区等多个皮肤特征进行检测和分析。而该应用功能的实现对人脸照片的清晰度要求很高,拍照时的抖动、对焦不清晰等问题,均会影响皮肤检测的稳定性及可靠性。如清晰度较高的面部图像中可以看到数量较多的毛孔,并且毛孔边界比较清晰,黑头也清晰可见,如图1A所示,而清晰度较低的面部图像仅可以看到比较大的毛孔,而较小的毛孔则看不到,并且毛孔边界比较模糊,黑头也比较模糊,如图1B所示,这种清晰度的不同将导致同一个用户两次皮肤检测的结果差别较大。With more and more image-based application scenarios with high data volume and high real-time requirements, automatic and rapid detection of image sharpness becomes more and more indispensable. Blurred images can cause many image-like application functions to fail, such as face recognition, video surveillance, etc. In addition, image sharpness detection plays a crucial role in the fields of autofocus and photo auto-screening. For example, an image-like application function is to detect a skin condition of a face according to a facial image of the user, such as detecting and analyzing a plurality of skin features such as a pore, a blackhead, a fine line, a stain, and a subcutaneous red area of the face. The implementation of the application function has high requirements on the definition of the face photo, and the problems such as jitter and unclear focus when photographing, all affect the stability and reliability of the skin detection. For example, a large number of pores can be seen in the higher-resolution facial image, and the pore boundary is relatively clear, and the blackhead is also clearly visible, as shown in FIG. 1A, and the lower-resolution facial image can only see a larger one. The pores, while the smaller pores are invisible, and the pore boundaries are blurred, and the blackheads are also blurred. As shown in Fig. 1B, this difference in sharpness will result in a large difference in the results of two skin tests by the same user.
目前常用的图像清晰度检测方法有三种,其中,第一种方法为基于参考图像的清晰度检测方法。该方法通常需要获取与待检测图像同样场景或者内容的清晰图像作为参考图像,通过对比参考图像及待检测图像的梯度、频率等特征,判定待检测清晰度。然而这种方法仅能检测与参考图像场景相同或者内容相同的图像的清晰度,存在一定的局限性,适应性比较差。At present, there are three commonly used methods for image sharpness detection, and the first method is a sharpness detection method based on a reference image. The method generally needs to obtain a clear image of the same scene or content as the image to be detected as a reference image, and determines the sharpness to be detected by comparing the reference image and the gradient, frequency and the like of the image to be detected. However, this method can only detect the sharpness of the image with the same or the same content as the reference image scene, and has certain limitations and poor adaptability.
第二种方法为无参考的清晰度检测方法。该方法通过分析待检测图像的频域信息,如将待检测图像进行傅里叶变换后得到的频域信息、将待检测图像进行小波变换后得到的频域信息等,或分析待检测图像边缘的宽度峰值信息、梯度峰值信息,进而计算出用于表征清晰度的指标,然后根据该指标与阈值的比较结果判定清晰度。然而对于不同场景或者不同内容的图像,在判定清晰度时采用的阈值可能不同。因此,针对所有图像均采用相同的阈值进行判定,导致判定的结果准确性较差。此外,这种方法运算量较大、运算复杂度高,实时性较差。The second method is a non-reference sharpness detection method. The method analyzes the frequency domain information of the image to be detected, such as frequency domain information obtained by Fourier transforming the image to be detected, frequency domain information obtained by wavelet transforming the image to be detected, or the like, or analyzing the edge of the image to be detected. The width peak information and the gradient peak information are used to calculate an index for characterizing the sharpness, and then the sharpness is determined based on the comparison result of the index with the threshold. However, for images of different scenes or different contents, the thresholds used in determining the definition may be different. Therefore, the same threshold is used for all images for determination, resulting in poor accuracy of the results of the determination. In addition, this method has a large amount of computation, high computational complexity, and poor real-time performance.
第三种方法为基于机器学习的清晰度检测方法。该方法通过建立图像样本库,其中,图像样本库中包括大量的清晰图像以及大量的模糊图像,然后建立深度学习模型,并采用图像样本库中的清晰图像以及模糊图像对该深度学习模型进行训练。在该深度学习模型训练完成后,通过训练好的深度学习模型进行图像清晰度检测。这种基于机器学习的清晰度检测方法在构建图像样本库时,需要搜集大量的清晰图像以及大量的模糊图像,工作量较大,并且算法复杂度较高。The third method is a machine learning based sharpness detection method. The method establishes an image sample library, wherein the image sample library includes a large number of clear images and a large number of blurred images, and then establishes a deep learning model, and uses the clear image in the image sample library and the blurred image to train the deep learning model. . After the deep learning model is completed, the image depth detection is performed by the trained deep learning model. This kind of machine learning-based sharpness detection method needs to collect a large number of clear images and a large number of blurred images when constructing the image sample library, which has a large workload and high algorithm complexity.
经过申请人大量的测试观察,发现对模糊图像与清晰图像进行缩放处理后,其清晰程度的变化是不同的:缩放模糊图像,其清晰程度的变化较小;而缩放清晰图像,其清晰程度的变化较大。例如,如图2所示,第一个人脸图为模糊图像进行缩小处理之前的图像,第二个人脸图为模糊图像进行缩小处理之后的图像,第一个人脸图与第二个人脸图之间的拉普拉斯方差比值为1.8050。第三个人脸图为清晰图像进行缩小处理之前的图像,第四个人脸图为清晰图像进行缩小处理之后的图像,第三个人脸图与第四个人脸图之间的拉普拉斯方差比值为5.5153,可以看出,与清晰图像相比,模糊图像进行缩小处理前后视觉差异较大,其拉普拉斯方差的比值也较大。基于此,本申请实施例提供了一种图像清晰度检测方法及装置,用于解决在更准确的判定图像清晰度检测时工作量较大,并且算法复杂度较高的问题。其中,方法和装置是基于同一发明构思的,由于方法及装置解决问题的原理相似,因此装置与方法的实施可以相互参见,重复之处不再赘述。After a large number of test observations by the applicant, it is found that the brightness of the blurred image and the clear image are different: the blurred image has a small change in the degree of clarity; and the sharp image is sharpened with a clear degree. big change. For example, as shown in FIG. 2, the first personal face map is an image before the reduction processing is performed on the blurred image, and the second personal face image is an image after the reduction processing is performed on the blurred image, the first personal face image and the second personal face The Laplacian variance ratio between the graphs is 1.8050. The third personal face image is an image before the reduction process is performed for the clear image, the fourth personal face image is the image after the reduction image is reduced, and the Laplacian variance ratio between the third personal face image and the fourth personal face image is As for 5.5153, it can be seen that compared with the clear image, the blurred image has a large visual difference before and after the reduction processing, and the ratio of the Laplacian variance is also large. Based on this, the embodiment of the present application provides a method and device for detecting image sharpness, which is used to solve the problem that the workload is large and the algorithm complexity is high when the image sharpness detection is more accurately determined. The method and the device are based on the same inventive concept. Since the principles of the method and the device for solving the problem are similar, the implementation of the device and the method can be referred to each other, and the repeated description is not repeated.
本申请实施例可以应用于电子设备中,比如计算机,平板电脑、笔记本、智能手机、服务器等,该电子设备可以但不限于包括相机/摄像头、图像处理器、中央处理器、存储介质等元件。其中,相机/摄像头可以用于采集待检测图像,图像处理器可以用于对待检测图像进行缩放处理、掩膜处理等,中央处理器可以用于对待检测图像进行清晰度检测等,存储介质可以用于存储图像数据、以及软件程序等等。The embodiments of the present application may be applied to an electronic device, such as a computer, a tablet, a notebook, a smart phone, a server, etc., and the electronic device may be, but not limited to, an element including a camera/camera, an image processor, a central processing unit, a storage medium, and the like. The camera/camera can be used to collect images to be detected, the image processor can be used for scaling processing, mask processing, etc., and the central processing unit can be used for detecting the image to be detected, etc., and the storage medium can be used. For storing image data, software programs, and so on.
本申请实施例的应用领域包括但不限定于:人脸图像领域、车辆图像领域、植物图像领域、或是其他类型的图像领域。本申请实施例在应用于人脸图像领域时,可以但不限于应用在如下场景中:人脸识别、身份信息采集、面部皮肤检测、视频跟踪等。本申请实施例在应用于非人脸图像领域时,可以但不限于应用在如下场景中:图片自动筛选、拍照模糊提醒等。The fields of application of the embodiments of the present application include, but are not limited to, a face image field, a vehicle image field, a plant image field, or other types of image fields. When applied to the field of face images, the embodiments of the present application may be, but are not limited to, applied to the following scenarios: face recognition, identity information collection, facial skin detection, video tracking, and the like. When applied to the field of non-face images, the embodiments of the present application may be, but are not limited to, applied to the following scenarios: automatic picture screening, photo blurred reminders, and the like.
以下,对本申请中的部分用语进行解释说明,以便与本领域技术人员理解。Hereinafter, some of the terms in the present application will be explained to be understood by those skilled in the art.
多个,是指两个或两个以上。Multiple means two or more.
另外,需要理解的是,在本申请的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。In addition, it should be understood that in the description of the present application, the terms "first", "second" and the like are used only to distinguish the purpose of description, and are not to be understood as indicating or implying relative importance, nor as an indication. Or suggest the order.
参见图3,为本申请提供的图像清晰度检测方法的方法流程图。该方法包括:Referring to FIG. 3, a flowchart of a method for detecting image sharpness provided by the present application is provided. The method includes:
S301,将第一尺度的第一图像进行缩放处理,得到第二尺度的第二图像。其中,缩放处理包括缩小处理,或者放大处理。如将第一尺度的第一图像进行缩小处理,得到第二尺度的第二图像,第二尺度可以小于第一尺度,如第二尺度为第一尺度的1/4等等。如将第一尺度的第一图像进行方法处理,得到第二尺度的第二图像,第二尺度可以大于第一尺度,如第二尺度为第一尺度的4倍等等。S301. Perform scaling processing on the first image of the first size to obtain a second image of the second size. Wherein, the scaling process includes a reduction process or an enlargement process. If the first image of the first scale is reduced, a second image of the second scale is obtained, and the second scale may be smaller than the first scale, such as the second scale being 1/4 of the first scale, and the like. If the first image of the first scale is processed by the method to obtain a second image of the second scale, the second scale may be greater than the first scale, such as the second scale being 4 times of the first scale, and the like.
S302,确定所述第一图像的第一度量值和所述第二图像的第二度量值,所述第一度量值用于表征所述第一图像的清晰度,所述第二度量值用于表征所述第二图像的清晰度。其中,所述第一度量值可以但不限于为第一图像的像素值的拉普拉斯方差、索贝尔方差、灰度方差等。所述第二度量值可以但不限于为第二图像的像素值的拉普拉斯方差、索贝尔方差、灰度方差等。S302. Determine a first metric value of the first image and a second metric value of the second image, where the first metric value is used to represent a resolution of the first image, and the second metric The value is used to characterize the sharpness of the second image. The first metric value may be, but is not limited to, a Laplacian variance, a Sobel variance, a grayscale variance, and the like, which are pixel values of the first image. The second metric value may be, but is not limited to, a Laplacian variance, a Sobel variance, a grayscale variance, or the like, which is a pixel value of the second image.
S303,对所述第一度量值和所述第二度量值进行运算,获得运算结果。S303. Perform operations on the first metric value and the second metric value to obtain an operation result.
S304,将所述运算结果与第一阈值进行比较,并根据获得的比较结果确定所述第一图像是否为清晰图像。S304. Compare the operation result with a first threshold, and determine whether the first image is a clear image according to the obtained comparison result.
本申请实施例中利用对模糊图像与清晰图像进行缩放后,其清晰程度变化不同的现 象,如缩小模糊图像,其清晰程度的变化较小,而缩小清晰图像,其清晰程度的变化较大,在检测图像清晰度时,通过结合第一图像在进行缩放处理前后的度量值的变化情况,可以快速且准确的判断图像是否清晰。相比于现有技术中基于机器学习的清晰度检测方法,本申请实施例可以准确的判定图像的清晰度,并且工作量较小,并且算法复杂度较小。In the embodiment of the present application, after the blurred image and the clear image are scaled, the phenomenon that the degree of clarity changes is different. For example, if the blurred image is reduced, the change of the degree of clarity is small, and the clear image is reduced, and the degree of clarity changes greatly. When detecting the sharpness of the image, it is possible to quickly and accurately determine whether the image is clear by combining the change of the metric value before and after the scaling process of the first image. Compared with the prior art machine learning-based sharpness detection method, the embodiment of the present application can accurately determine the sharpness of an image, and the workload is small, and the algorithm complexity is small.
可选的,在执行步骤S301之前,可以先获取第一图像。其中,获取第一图像的方式包括但不限于:通过摄像头等传感器采集第一图像、在数据库中获取第一图像等。Optionally, before performing step S301, the first image may be acquired first. The manner of acquiring the first image includes, but is not limited to, acquiring a first image by a sensor such as a camera, acquiring a first image in a database, and the like.
在某些应用场景中,往往仅关注目标区域的图像清晰度,如在与人脸相关的应用场景中,往往关注人脸区域的清晰度。因此,复杂多变的背景会影响检测的精度。对此,可以通过将图像中的背景进行过滤,以降低背景对图像清晰度检测的干扰。In some application scenarios, attention is often paid only to the image definition of the target area. For example, in an application scene related to a face, attention is often paid to the definition of the face area. Therefore, the complex and varied background will affect the accuracy of the detection. In this regard, the background in the image sharpness detection can be reduced by filtering the background in the image.
在一种可能的实施方式中,在获取所述第一图像的第一度量值时,可以通过如下方式实现:In a possible implementation manner, when acquiring the first metric value of the first image, the method may be implemented as follows:
A1,对所述第一图像中的背景进行过滤,得到第一图像的目标区域。A1. Filter the background in the first image to obtain a target area of the first image.
其中,对所述第一图像中的背景进行过滤,可以但不限于通过如下方式实现:The filtering of the background in the first image may be, but is not limited to, being implemented as follows:
方法一:检测所述第二图像中的目标区域。这里可以采用基于一种迭代算法(AdaBoost)算法的检测算法、基于卷积神经网络(convolutional neural network,CNN)的检测算法、基于支持向量机(support vector machine,SVM)的检测算法、基于主成分分析(英文:Principle Component Analysis,简称:PCA)算法的检测算法等。当然,也可以采用其他方法进行目标区域检测,本申请实施例在这里不做具体限定。然后在所述第二图像中的目标区域进行掩膜处理,得到第二图像的掩膜图像。具体的,可以根据目标区域的大小及位置,生成大致覆盖目标区域的椭圆形掩膜。以目标区域为人脸区域为例,椭圆形掩膜如图4所示。Method 1: detecting a target area in the second image. Here, an detection algorithm based on an iterative algorithm (AdaBoost) algorithm, a convolutional neural network (CNN) based detection algorithm, a support vector machine (SVM) based detection algorithm, and a principal component can be used. Analysis (English: Principle Component Analysis, PCA) algorithm detection algorithm. Of course, other methods may be used for the detection of the target area. The embodiments of the present application are not specifically limited herein. Then, a masking process is performed on the target area in the second image to obtain a mask image of the second image. Specifically, an elliptical mask covering the target area may be generated according to the size and position of the target area. Taking the target area as the face area as an example, the elliptical mask is shown in FIG.
方法二,通过用于神经网络模型过滤第二图像中的背景。Method two, filtering the background in the second image by using the neural network model.
A2,确定第一图像的目标区域的度量值。A2. Determine a metric value of a target area of the first image.
在一种可能的实施方式中,在获取所述第二图像的第二度量值时,可以通过如下方式实现:In a possible implementation manner, when acquiring the second metric value of the second image, the method may be implemented as follows:
B1,对所述第二图像中的背景进行过滤,得到第二图像的目标区域。B1. Filter the background in the second image to obtain a target area of the second image.
其中,对所述第二图像中的背景进行过滤的方法,可以参阅步骤A1对所述第二图像中的背景进行过滤的方法,本申请实施例在这里不再重复赘述。For the method of filtering the background in the second image, refer to the method for filtering the background in the second image in step A1.
B2,确定第二图像的目标区域的度量值。B2. Determine a metric value of a target area of the second image.
此外,在通过将第一度量值与第二度量值进行运算,然后将运算结果与第一阈值进行比较来判定第一图像的清晰度之前,可以先基于第一度量值或者第二度量值对第一图像进行清晰度检测,这样可以对于特别清晰或者特别模糊的图像可以根据第一度量值或者第二度量值得到检测结果,对于处于不是特别清晰,也不是特别模糊的中间状态的图像采用将第一度量值与第二度量值进行运算,然后将运算结果与第一阈值进行比较的方法来进一步进行清晰度检测,这样对于特别清晰或者特别模糊的图像可以仅根据第一度量值或者第二度量值得到检测结果而不需要将第一与第二度量值进行运算,从而可以降低清晰度检测算法的运算量以及复杂度。In addition, before determining the sharpness of the first image by calculating the first metric value and the second metric value and then comparing the operation result with the first threshold value, the first metric value or the second metric may be first based on The value is used for the sharpness detection of the first image, so that the detection result can be obtained according to the first metric value or the second metric value for a particularly clear or particularly blurred image, for an intermediate state that is not particularly clear or particularly blurred. The image is further processed by calculating the first metric value and the second metric value, and then comparing the operation result with the first threshold value, so that the image can be based on the first degree only for a particularly clear or particularly blurred image. The magnitude or the second metric obtains the detection result without the need to operate the first and second metric values, thereby reducing the computational complexity and complexity of the sharpness detection algorithm.
具体的,在确定了第二图像的第二度量值之后,可以在执行步骤S303,对所述第一度量值和所述第二度量值进行运算,获得运算结果之前,可以先基于第二度量值对第一图像的清晰度进行第一次判定。具体的,第一次判定的过程可以如下过程实现,如图5所示:Specifically, after determining the second metric value of the second image, performing the step S303, performing operations on the first metric value and the second metric value, before obtaining the operation result, may be based on the second The metric value makes the first determination of the sharpness of the first image. Specifically, the process of the first determination can be implemented as follows, as shown in FIG. 5:
S501,判断第二度量值是否大于第二阈值;若是,执行步骤S502;若否,执行步骤S503。S501: Determine whether the second metric value is greater than the second threshold; if yes, go to step S502; if no, go to step S503.
S502,确定所述第一图像为清晰图像。S502. Determine that the first image is a clear image.
S503,确定第二度量值是否小于第三阈值;若是,执行步骤S504;若否,可以基于第一度量值对第一图像的清晰度进行第二次判定。其中,第二阈值大于第三阈值。S503. Determine whether the second metric value is less than a third threshold; if yes, perform step S504; if not, perform a second determination on the sharpness of the first image based on the first metric value. The second threshold is greater than the third threshold.
S504,确定第一图像为模糊图像。S504. Determine that the first image is a blurred image.
具体的,第二次判定的过程可以通过如下过程实现,如图6所示:Specifically, the process of the second determination can be implemented by the following process, as shown in FIG. 6:
S601,判断第一度量值是否大于第四阈值;若是,执行步骤S602;若否,执行步骤S603。S601: Determine whether the first metric value is greater than a fourth threshold; if yes, execute step S602; if no, perform step S603.
S602,确定所述第一图像为清晰图像。S602. Determine that the first image is a clear image.
S603,确定第一度量值是否小于第五阈值;若是,执行步骤S604;若否,可以基于第一度量值对第一图像的清晰度进行第二次判定。其中,第二阈值大于第三阈值。S603. Determine whether the first metric value is less than a fifth threshold; if yes, perform step S604; if not, perform a second determination on the resolution of the first image based on the first metric value. The second threshold is greater than the third threshold.
S604,确定第一图像为模糊图像。S604. Determine that the first image is a blurred image.
本申请实施例中的第一阈值、第二阈值、第三阈值、第四阈值以及第五阈值,可以是基于经验值,或者经过大量的实验所确定的,例如,第二阈值的确定过程:将某张特别清晰的图像进行缩放处理,得到处理后的该图像,确定处理后的该图像的度量值,则第二阈值可以为处理后的该图像的度量值。第三阈值的确定过程:将某张特别模糊的图像进行缩放处理,得到处理后的该图像,确定处理后的该图像的度量值,则第三阈值可以为处理后的该图像的度量值。第四阈值的确定过程:确定某张特别清晰的图像的度量值,则第四阈值可以为该图像的度量值。第五阈值的确定过程:确定某张特别模糊的图像的度量值,则第五阈值可以为该图像的度量值。第一阈值的确定过程:根据可接受的最模糊图像的该比值决定第一阈值。The first threshold, the second threshold, the third threshold, the fourth threshold, and the fifth threshold in the embodiment of the present application may be determined based on an empirical value, or determined by a large number of experiments, for example, a second threshold: A certain clear image is scaled to obtain the processed image, and the processed metric value of the image is determined, and the second threshold may be the processed metric value of the image. The third threshold is determined by scaling a particular blurred image to obtain the processed image, and determining the processed metric value of the image, and the third threshold may be the processed metric value of the image. Determination process of the fourth threshold: determining the metric value of a particularly clear image, then the fourth threshold may be the metric value of the image. The fifth threshold determination process: determining the metric value of a particular blurred image, then the fifth threshold may be the metric value of the image. The first threshold is determined by determining the first threshold based on the ratio of the most acceptable blurred image.
本申请实施例为了提高图像清晰度检测的准确性,还可以基于反馈机制调整第一阈值、第二阈值、第三阈值、第四阈值以及第五阈值,具体的,可以如图7所示:In the embodiment of the present application, in order to improve the accuracy of the image sharpness detection, the first threshold, the second threshold, the third threshold, the fourth threshold, and the fifth threshold may be adjusted based on the feedback mechanism. Specifically, as shown in FIG. 7 :
S701,设置第一阈值、第二阈值、第三阈值、第四阈值以及第五阈值。S701. Set a first threshold, a second threshold, a third threshold, a fourth threshold, and a fifth threshold.
S702,根据第一阈值、或者第二阈值、或者第三阈值、或者第四阈值、或者第五阈值确定检测结果。S702. Determine a detection result according to the first threshold, or the second threshold, or the third threshold, or the fourth threshold, or the fifth threshold.
S703,获取该检测结果的反馈信息。S703. Acquire feedback information of the detection result.
S704,根据该反馈信息调整第一阈值、或者第二阈值、或者第三阈值、或者第四阈值、或者第五阈值。S704. Adjust a first threshold, or a second threshold, or a third threshold, or a fourth threshold, or a fifth threshold according to the feedback information.
例如,在第一次判定过程中,确定第二度量值大于第二阈值,则确定第一图像为清晰图像,若在输出第一图像为清晰图像的检测结果后得到的反馈信息为第一图像为模糊图像,则调整第二阈值。之后进行图像清晰度检测时可以采用调整后的第二阈值。For example, in the first determination process, determining that the second metric value is greater than the second threshold, determining that the first image is a clear image, and if the output information of the first image is a clear image, the feedback information is the first image. To blur the image, adjust the second threshold. The adjusted second threshold can then be used when image sharpness detection is performed.
基于反馈机制调整第一阈值、或者第三阈值、或者第四阈值、或者第五阈值的过程可以参阅调整第二阈值的过程,本申请实施例在这里不再重复赘述。The process of adjusting the first threshold, or the third threshold, or the fourth threshold, or the fifth threshold based on the feedback mechanism may refer to the process of adjusting the second threshold, and details are not repeatedly described herein.
S705,将调整之后的第一阈值、或者第二阈值、或者第三阈值、或者第四阈值、或者第五阈值作为下一次图像清晰度检测的阈值。S705. The first threshold value after the adjustment, or the second threshold value, or the third threshold value, or the fourth threshold value, or the fifth threshold value is used as a threshold value for the next image sharpness detection.
基于反馈机制调整阈值的方法可以使得根据第一阈值、第二阈值、第三阈值、第四阈值以及第五阈值确定出更准确的检测结果,从而提高图像清晰度检测的准确性。The method of adjusting the threshold based on the feedback mechanism may enable more accurate detection results to be determined according to the first threshold, the second threshold, the third threshold, the fourth threshold, and the fifth threshold, thereby improving the accuracy of image sharpness detection.
为了更好地理解本申请实施例,下面以检测人脸图像的清晰度为例,对图像清晰度检 测的过程进行具体详细描述,如图8所示,为检测人脸图像清晰度过程的示意图。In order to better understand the embodiment of the present application, the process of detecting the image sharpness is described in detail below by taking the sharpness of the face image as an example, as shown in FIG. 8 , which is a schematic diagram for detecting the sharpness process of the face image. .
S801,获取待检测人脸图像。执行步骤S802。S801. Acquire an image of a face to be detected. Step S802 is performed.
S802,将待检测人脸图像进行缩小处理,得到缩小图。其中,缩小图的尺度可以为待检测人脸图像的尺度的1/4。执行步骤S803。S802: Perform a reduction process on the face image to be detected to obtain a thumbnail image. The scale of the thumbnail image may be 1/4 of the scale of the image to be detected. Step S803 is performed.
S803,对缩小图进行人脸检测以及定位。执行步骤S804。S803, performing face detection and positioning on the reduced image. Step S804 is performed.
S804,根据人脸检测以及定位得到的人脸区域的大小以及位置,生成覆盖人脸区域的掩膜,得到第一掩膜区域。其中,第一掩膜可以为椭圆形的。执行步骤S805。S804, generating a mask covering the face region according to the face detection and the size and position of the face region obtained by the positioning, to obtain a first mask region. Wherein, the first mask may be elliptical. Step S805 is performed.
S805,计算第一掩膜区域的度量值。其中,度量值可以为第一掩膜区域的像素值的拉普拉斯方差、索贝尔方差、灰度方差等等。执行步骤S806。S805. Calculate a metric value of the first mask area. Wherein, the metric value may be a Laplacian variance, a Sobel variance, a gray scale variance, and the like of pixel values of the first mask region. Step S806 is performed.
S806,确定第一掩膜区域的度量值是否大于第二阈值;若是,执行步骤S807;若否,执行步骤S808。S806, determining whether the metric value of the first mask area is greater than a second threshold; if yes, executing step S807; if not, executing step S808.
S807,确定第一图像为清晰图像。S807, determining that the first image is a clear image.
S808,确定第一掩膜区域的度量值是否小于第三阈值;若是,执行步骤S809;若否,执行步骤S810。S808, determining whether the metric value of the first mask area is less than a third threshold; if yes, executing step S809; if not, executing step S810.
S809,确定第一图像为模糊图像。S809, determining that the first image is a blurred image.
S810,对待检测人脸图像进行人脸检测以及定位。执行步骤S811。S810, performing face detection and positioning on the detected face image. Step S811 is performed.
S811,根据人脸检测以及定位得到的人脸区域的大小以及位置,生成覆盖人脸区域的掩膜,得到第二掩膜区域。其中,第二掩膜可以为椭圆形的。执行步骤S812。S811, generating a mask covering the face region according to the face detection and the size and position of the face region obtained by the positioning, to obtain a second mask region. Wherein, the second mask may be elliptical. Step S812 is performed.
S812,计算第二掩膜区域的度量值。其中,度量值可以为第二掩膜区域的像素值的拉普拉斯方差、索贝尔方差、灰度方差等等。执行步骤S813。S812, calculating a metric value of the second mask area. Wherein, the metric value may be a Laplacian variance, a Sobel variance, a gray scale variance, and the like of the pixel values of the second mask region. Step S813 is performed.
S813,确定第二掩膜区域的度量值是否大于第四阈值;若是,执行步骤S807;若否,执行步骤S814。S813, determining whether the metric value of the second mask area is greater than a fourth threshold; if yes, executing step S807; if not, executing step S814.
S814,确定第二掩膜区域的度量值是否小于第五阈值;若是,执行步骤S809;若否,执行步骤S815。S814, determining whether the metric value of the second mask area is less than a fifth threshold; if yes, executing step S809; if not, executing step S815.
S815,确定第二掩膜区域的度量值与第一掩膜区域的度量值之间的比值。执行步骤S816。S815. Determine a ratio between a metric value of the second mask region and a metric value of the first mask region. Step S816 is performed.
S816,确定比值是否大于第一阈值;若是,执行步骤S807;若否,执行步骤S809。S816, determining whether the ratio is greater than the first threshold; if yes, executing step S807; if not, executing step S809.
在根据第二阈值确定第一图像为清晰图像之后,可以获取反馈信息,并根据反馈信息确定根据第二阈值判定第一图像为清晰图像是否准确,若是,不调整第二阈值。若否,调整第二阈值。在根据第四阈值确定第一图像为清晰图像之后,可以获取反馈信息,并根据反馈信息确定根据第四阈值判定第一图像为清晰图像是否准确,若是,不调整第四阈值。若否,调整第四阈值。在根据第一阈值确定第一图像为清晰图像之后,可以获取反馈信息,并根据反馈信息确定根据第一阈值判定第一图像为清晰图像是否准确,若是,不调整第一阈值。若否,调整第一阈值。After determining that the first image is a clear image according to the second threshold, the feedback information may be acquired, and determining, according to the feedback information, whether the first image is a clear image according to the second threshold is accurate, and if so, the second threshold is not adjusted. If not, adjust the second threshold. After determining that the first image is a clear image according to the fourth threshold, the feedback information may be acquired, and determining, according to the feedback information, whether the first image is a clear image according to the fourth threshold is accurate, and if so, the fourth threshold is not adjusted. If not, adjust the fourth threshold. After determining that the first image is a clear image according to the first threshold, the feedback information may be acquired, and determining, according to the feedback information, whether the first image is a clear image according to the first threshold, and if so, the first threshold is not adjusted. If not, adjust the first threshold.
在根据第三阈值确定第一图像为模糊图像之后,可以获取反馈信息,并根据反馈信息确定根据第三阈值判定第一图像为模糊图像是否准确,若是,不调整第三阈值。若否,调整第三阈值。在根据第五阈值确定第一图像为模糊图像之后,可以获取反馈信息,并根据反馈信息确定根据第五阈值判定第一图像为模糊图像是否准确,若是,不调整第五阈值。若否,调整第五阈值。在根据第一阈值确定第一图像为模糊图像之后,可以获取反馈信息,并根据反馈信息确定根据第一阈值判定第一图像为模糊图像是否准确,若是,不调整第一 阈值。若否,调整第一阈值。After determining that the first image is a blurred image according to the third threshold, the feedback information may be acquired, and determining, according to the feedback information, whether the first image is a blurred image according to the third threshold is accurate, and if so, the third threshold is not adjusted. If not, adjust the third threshold. After determining that the first image is a blurred image according to the fifth threshold, the feedback information may be acquired, and determining, according to the feedback information, whether the first image is a blurred image according to the fifth threshold is accurate, and if so, the fifth threshold is not adjusted. If not, adjust the fifth threshold. After determining that the first image is a blurred image according to the first threshold, the feedback information may be acquired, and determining, according to the feedback information, whether the first image is a blurred image according to the first threshold, and if so, the first threshold is not adjusted. If not, adjust the first threshold.
基于与方法实施例的同一发明构思,本申请实施例提供一种终端设备,具体用于实现图3至图8所述的实施例描述的方法,该装置的结构如图9所示,包括缩放模块901、确定模块902、运算模块903、比较模块904以及判定模块905。其中,缩放模块901,用于将第一尺度的第一图像进行缩放处理,得到第二尺度的第二图像。确定模块902,用于确定所述第一图像的第一度量值和所述缩放模块901得到的所述第二图像的第二度量值,所述第一度量值用于表征所述第一图像的清晰度,所述第二度量值用于表征所述第二图像的清晰度。运算模块903,用于对所述确定模块902确定的所述第一度量值和所述第二度量值进行运算,获得运算结果。,用于将所述运算模块903得到的所述运算结果与第一阈值进行比较,获取比较结果。判定模块905,用于根据所述比较模块904获得的比较结果确定所述第一图像是否为清晰图像。Based on the same inventive concept as the method embodiment, the embodiment of the present application provides a terminal device, specifically for implementing the method described in the embodiments described in FIG. 3 to FIG. 8. The structure of the device is as shown in FIG. The module 901, the determining module 902, the computing module 903, the comparing module 904, and the determining module 905. The scaling module 901 is configured to perform scaling processing on the first image of the first size to obtain a second image of the second size. a determining module 902, configured to determine a first metric value of the first image and a second metric value of the second image obtained by the scaling module 901, where the first metric value is used to represent the first The sharpness of an image used to characterize the sharpness of the second image. The operation module 903 is configured to perform operations on the first metric value and the second metric value determined by the determining module 902 to obtain an operation result. And comparing the operation result obtained by the operation module 903 with a first threshold to obtain a comparison result. The determining module 905 is configured to determine, according to the comparison result obtained by the comparing module 904, whether the first image is a clear image.
可选的,所述运算模块903,具体用于:确定所述第一度量值以及所述第二度量值的比值。所述比较模块904,具体用于:将所述比值与第一阈值进行比较。所述判定模块905,具体用于:若所述比值大于第一阈值,则确定所述第一图像是清晰图像,或者,若所述比值小于或等于所述第一阈值,则确定所述第一图像是模糊图像。Optionally, the operation module 903 is specifically configured to: determine a ratio of the first metric value and the second metric value. The comparison module 904 is specifically configured to: compare the ratio with a first threshold. The determining module 905 is specifically configured to: if the ratio is greater than the first threshold, determine that the first image is a clear image, or if the ratio is less than or equal to the first threshold, determine the first An image is a blurred image.
在一种可能的实施方式中,所述确定模块902,还用于:在将所述运算结果与第一阈值进行比较,并根据获得的比较结果确定所述第一图像是否为清晰图像之后,确定第一检测结果是否准确;所述第一检测结果为根据所述运算结果与第一阈值的比较结果确定所述第一图像是清晰图像或者模糊图像。所述装置还包括调整模块906,所述调整模块906,用于在所述第一检测结果不准确时,调整所述第一阈值。In a possible implementation manner, the determining module 902 is further configured to: after comparing the operation result with a first threshold, and determining, according to the obtained comparison result, whether the first image is a clear image, Determining whether the first detection result is accurate; the first detection result is determining that the first image is a clear image or a blurred image according to a comparison result of the operation result and the first threshold. The device further includes an adjustment module 906, configured to adjust the first threshold when the first detection result is inaccurate.
所述比较模块904,还可以用于:在对所述第一度量值和所述第二度量值进行运算,获得运算结果之前,将所述第二度量值与第二阈值以及第三阈值进行比较,且获得的比较结果为所述第二度量值小于所述第二阈值,且大于所述第三阈值,所述第二阈值大于所述第三阈值。The comparing module 904 is further configured to: before the operation of the first metric value and the second metric value, obtain the second metric value and the second threshold and the third threshold The comparison is performed, and the obtained comparison result is that the second metric value is smaller than the second threshold value and greater than the third threshold value, and the second threshold value is greater than the third threshold value.
所述判定模块905,还可以用于:在所述第二度量值大于或等于所述第二阈时,确定所述第一图像是清晰图像;或者,在所述第二度量值小于或等于所述第三阈值时,确定所述第一图像是模糊图像。The determining module 905 is further configured to: when the second metric value is greater than or equal to the second threshold, determine that the first image is a clear image; or, when the second metric value is less than or equal to The third threshold is determined to be a blurred image.
若所述第二度量值大于或等于所述第二阈值,则所述确定模块902,还可以用于:在确定所述第一图像的检测结果为清晰图像之后,确定第二检测结果是否准确。所述第二检测结果为根据所述第二度量值与所述第二阈值确定所述第一图像是清晰图像。所述调整模块906,用于在所述确定模块902确定的所述第二检测结果不准确时,调整所述第二阈值。或者,若所述第二度量值小于或等于所述第三阈值,则所述确定模块902,还用于:在确定所述第一图像是模糊图像之后,确定第三检测结果是否准确。所述第三检测结果为根据所述第二度量值与所述第三阈值确定所述第一图像是模糊图像。所述调整模块906,还用于:在所述第三检测结果不准确时,调整所述第三阈值。If the second metric is greater than or equal to the second threshold, the determining module 902 is further configured to: determine, after the detection result of the first image is a clear image, whether the second detection result is accurate . The second detection result is that the first image is a clear image according to the second metric value and the second threshold. The adjusting module 906 is configured to adjust the second threshold when the second detection result determined by the determining module 902 is inaccurate. Or, if the second metric is less than or equal to the third threshold, the determining module 902 is further configured to: after determining that the first image is a blurred image, determine whether the third detection result is accurate. The third detection result is that the first image is a blurred image according to the second metric value and the third threshold. The adjusting module 906 is further configured to: when the third detection result is inaccurate, adjust the third threshold.
可选的,所述比较模块904,还可以用于:在对所述第一度量值和所述第二度量值进行运算,获得运算结果之前,将所述第一度量值与第四阈值以及第五阈值进行比较,且获得的比较结果为所述第一度量值小于所述第四阈值,且大于所述第五阈值,所述第四阈值大于所述第五阈值。Optionally, the comparing module 904 is further configured to: before the operation of the first metric value and the second metric value, obtain the operation result, and use the first metric value and the fourth The threshold and the fifth threshold are compared, and the obtained comparison result is that the first metric value is smaller than the fourth threshold and greater than the fifth threshold, and the fourth threshold is greater than the fifth threshold.
在一种可能的实现方式中,所述判定模块905,还可以用于:在所述第一度量值大于 或等于所述第四阈值时,确定所述第一图像是清晰图像,或者,在所述第一度量值小于或等于所述第五阈值时,确定所述第一图像是模糊图像。In a possible implementation manner, the determining module 905 is further configured to: when the first metric value is greater than or equal to the fourth threshold, determine that the first image is a clear image, or When the first metric value is less than or equal to the fifth threshold, it is determined that the first image is a blurred image.
若所述第一度量值大于或等于所述第四阈值,则所述确定模块902,还可以用于:在确定所述第一图像是清晰图像之后,确定第四检测结果是否准确。所述第四检测结果为根据所述第一度量值与所述第四阈值确定所述第一图像是清晰图像。所述调整模块906,用于在所述第四检测结果不准确时,调整所述第四阈值。或者,若所述第一度量值小于或等于所述第五阈值,则所述确定模块902,还用于:在确定所述第一图像是模糊图像之后,确定第五检测结果是否准确。所述第五检测结果为根据所述第一度量值与所述第五阈值确定所述第一图像是模糊图像。所述调整模块906,还用于:在所述第五检测结果不准确时,调整所述第五阈值。The determining module 902 is further configured to: determine whether the fourth detection result is accurate after determining that the first image is a clear image, if the first metric is greater than or equal to the fourth threshold. The fourth detection result is that the first image is a clear image according to the first metric value and the fourth threshold. The adjusting module 906 is configured to adjust the fourth threshold when the fourth detection result is inaccurate. Or, if the first metric is less than or equal to the fifth threshold, the determining module 902 is further configured to: after determining that the first image is a blurred image, determine whether the fifth detection result is accurate. The fifth detection result is that the first image is a blurred image according to the first metric value and the fifth threshold. The adjusting module 906 is further configured to: when the fifth detection result is inaccurate, adjust the fifth threshold.
可选的,所述确定模块902,在确定所述第一图像的第一度量值时,具体用于:检测所述第一图像中的目标区域,在所述第一图像中的目标区域进行掩膜处理,得到第一掩膜图像,确定所述第一掩膜图像的度量值。在确定所述第二图像的第二度量值时,具体用于:检测所述第二图像中的目标区域,在所述第二图像中的目标区域进行掩膜处理,得到第二掩膜图像,确定所述第二掩膜图像的度量值。Optionally, the determining module 902, when determining the first metric value of the first image, is specifically configured to: detect a target area in the first image, and target a target area in the first image Performing a mask process to obtain a first mask image, and determining a metric value of the first mask image. When determining the second metric value of the second image, specifically, detecting: a target area in the second image, performing mask processing on the target area in the second image, to obtain a second mask image And determining a metric value of the second mask image.
本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,另外,在本申请各个实施例中的各功能模块可以集成在一个处理器中,也可以是单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。The division of the modules in the embodiment of the present application is schematic, and is only a logical function division. In actual implementation, there may be another division manner. In addition, each functional module in each embodiment of the present application may be integrated into one processing. In the device, it can also be physically existed alone, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
其中,集成的模块既可以采用硬件的形式实现时,如图10所示,终端设备设备可以包括处理器1002。上述模块对应的实体的硬件可以为处理器1002。处理器1002,可以是一个中央处理模块(central processing unit,CPU),或者为数字处理模块等等。终端设备还可以包括采集器1001,处理器1002通过采集器1001采集图像。该装置还包括:存储器1003,用于存储处理器1002执行的程序。存储器1003可以是非易失性存储器,比如硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD)等,还可以是易失性存储器(volatile memory),例如随机存取存储器(random-access memory,RAM)。存储器1003是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。Wherein, when the integrated module can be implemented in the form of hardware, as shown in FIG. 10, the terminal device may include the processor 1002. The hardware of the entity corresponding to the above module may be the processor 1002. The processor 1002 can be a central processing unit (CPU), or a digital processing module or the like. The terminal device may further include a collector 1001, and the processor 1002 collects an image through the collector 1001. The apparatus also includes a memory 1003 for storing a program executed by the processor 1002. The memory 1003 may be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), or a volatile memory such as a random access memory (random). -access memory, RAM). Memory 1003 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
处理器1002用于执行存储器1003存储的程序代码,具体用于执行图3至图8所示实施例所述的方法的任一种方法。可以参见图3至图8所示实施例所述的方法,本申请在此不再赘述。The processor 1002 is configured to execute the program code stored in the memory 1003, specifically for performing any one of the methods described in the embodiments shown in FIG. 3 to FIG. For the methods described in the embodiments shown in FIG. 3 to FIG. 8 , the application will not be repeated herein.
本申请实施例中不限定上述采集器1001、处理器1002以及存储器1003之间的具体连接介质。本申请实施例在图10中以存储器1003、处理器1002以及采集器1001之间通过总线1004连接,总线在图10中以粗线表示,其它部件之间的连接方式,仅是进行示意性说明,并不引以为限。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图10中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The specific connection medium between the collector 1001, the processor 1002, and the memory 1003 is not limited in the embodiment of the present application. In the embodiment of the present application, the memory 1003, the processor 1002, and the collector 1001 are connected by a bus 1004 in FIG. 10, and the bus is indicated by a thick line in FIG. 10, and the connection manner between other components is only schematically illustrated. , not limited to. The bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in FIG. 10, but it does not mean that there is only one bus or one type of bus.
本发明实施例还提供了一种芯片,该芯片包括上述采集器和上述处理器,用于支持第一中继设备实现图3至图8所示实施例所述的方法中的任一种方法。The embodiment of the present invention further provides a chip, where the chip includes the foregoing collector and the processor, and is configured to support the first relay device to implement any one of the methods described in the embodiments shown in FIG. 3 to FIG. .
本申请实施例还提供了一种计算机可读存储介质,用于存储为执行上述处理器所需执行的计算机软件指令,其包含用于执行上述处理器所需执行的程序。The embodiment of the present application further provides a computer readable storage medium for storing computer software instructions required to execute the foregoing processor, which includes a program for executing the above-mentioned processor.
本领域内的技术人员应明白,本申请的实施例可提供为方法、***、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present application can be provided as a method, system, or computer program product. Thus, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment in combination of software and hardware. Moreover, the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
本申请是参照根据本申请实施例的方法、设备(***)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the present application. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
显然,本领域的技术人员可以对本申请实施例进行各种改动和变型而不脱离本申请实施例的精神和范围。这样,倘若本申请实施例的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。It is apparent that those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. Thus, it is intended that the present invention cover the modifications and variations of the embodiments of the present invention.

Claims (22)

  1. 一种图像清晰度检测方法,其特征在于,包括:An image sharpness detecting method, comprising:
    将第一尺度的第一图像进行缩放处理,得到第二尺度的第二图像;Performing a scaling process on the first image of the first size to obtain a second image of the second size;
    确定所述第一图像的第一度量值和所述第二图像的第二度量值,所述第一度量值用于表征所述第一图像的清晰度,所述第二度量值用于表征所述第二图像的清晰度;Determining a first metric value of the first image and a second metric value of the second image, the first metric value being used to characterize a sharpness of the first image, and the second metric value Characterizing the sharpness of the second image;
    对所述第一度量值和所述第二度量值进行运算,获得运算结果;Performing operations on the first metric value and the second metric value to obtain an operation result;
    将所述运算结果与第一阈值进行比较,并根据获得的比较结果确定所述第一图像是否为清晰图像。The operation result is compared with a first threshold, and it is determined whether the first image is a clear image based on the obtained comparison result.
  2. 如权利要求1所述的方法,其特征在于,对所述第一度量值和所述第二度量值进行运算,获得运算结果,包括:The method of claim 1, wherein the first metric value and the second metric value are operated to obtain an operation result, including:
    确定所述第一度量值以及所述第二度量值的比值;Determining a ratio of the first metric value and the second metric value;
    将所述运算结果与第一阈值进行比较,并根据获得的比较结果确定所述第一图像是否为清晰图像,包括:Comparing the operation result with the first threshold, and determining whether the first image is a clear image according to the obtained comparison result, including:
    若所述比值大于第一阈值,则确定所述第一图像是清晰图像;或者,If the ratio is greater than the first threshold, determining that the first image is a clear image; or
    若所述比值小于或等于所述第一阈值,则确定所述第一图像是模糊图像。If the ratio is less than or equal to the first threshold, it is determined that the first image is a blurred image.
  3. 如权利要求2所述的方法,其特征在于,在将所述运算结果与第一阈值进行比较,并根据获得的比较结果确定所述第一图像是否为清晰图像之后,还包括:The method according to claim 2, wherein after comparing the operation result with the first threshold and determining whether the first image is a clear image according to the obtained comparison result, the method further comprises:
    确定第一检测结果是否准确;所述第一检测结果为根据所述运算结果与第一阈值的比较结果确定所述第一图像是清晰图像或者模糊图像;Determining whether the first detection result is accurate; the first detection result is determining that the first image is a clear image or a blurred image according to a comparison result of the operation result and the first threshold;
    若所述第一检测结果不准确,则调整所述第一阈值。If the first detection result is inaccurate, the first threshold is adjusted.
  4. 如权利要求1至3任一项所述的方法,其特征在于,在对所述第一度量值和所述第二度量值进行运算,获得运算结果之前,还包括:The method according to any one of claims 1 to 3, further comprising: performing operations on the first metric value and the second metric value to obtain an operation result, further comprising:
    将所述第二度量值与第二阈值以及第三阈值进行比较,且获得的比较结果为所述第二度量值小于所述第二阈值,且大于所述第三阈值,所述第二阈值大于所述第三阈值。Comparing the second metric value with the second threshold value and the third threshold value, and obtaining a comparison result that the second metric value is smaller than the second threshold value, and is greater than the third threshold value, the second threshold value Greater than the third threshold.
  5. 如权利要求4所述的方法,其特征在于,所述方法还包括:The method of claim 4, wherein the method further comprises:
    若所述第二度量值大于或等于所述第二阈值,则确定所述第一图像是清晰图像;或者,Determining that the first image is a clear image if the second metric value is greater than or equal to the second threshold; or
    若所述第二度量值小于或等于所述第三阈值,则确定所述第一图像是模糊图像。If the second metric value is less than or equal to the third threshold, determining that the first image is a blurred image.
  6. 如权利要求5所述的方法,其特征在于,若所述第二度量值大于或等于所述第二阈值,则在确定所述第一图像的检测结果为清晰图像之后,还包括:The method according to claim 5, wherein, after the second metric value is greater than or equal to the second threshold, after determining that the detection result of the first image is a clear image, the method further comprises:
    确定第二检测结果是否准确;所述第二检测结果为根据所述第二度量值与所述第二阈值确定所述第一图像是清晰图像;Determining whether the second detection result is accurate; the second detection result is determining that the first image is a clear image according to the second metric value and the second threshold;
    若所述第二检测结果不准确,则调整所述第二阈值;If the second detection result is inaccurate, adjusting the second threshold;
    若所述第二度量值小于或等于所述第三阈值,在确定所述第一图像是模糊图像之后,还包括:If the second metric is less than or equal to the third threshold, after determining that the first image is a blurred image, the method further includes:
    确定第三检测结果是否准确;所述第三检测结果为根据所述第二度量值与所述第三阈值确定所述第一图像是模糊图像;Determining whether the third detection result is accurate; the third detection result is determining that the first image is a blurred image according to the second metric value and the third threshold;
    若所述第三检测结果不准确,则调整所述第三阈值。If the third detection result is inaccurate, the third threshold is adjusted.
  7. 如权利要求1至6任一项所述的方法,其特征在于,在对所述第一度量值和所述第二度量值进行运算,获得运算结果之前,还包括:The method according to any one of claims 1 to 6, wherein before the operation of the first metric value and the second metric value to obtain an operation result, the method further comprises:
    将所述第一度量值与第四阈值以及第五阈值进行比较,且获得的比较结果为所述第一度量值小于所述第四阈值,且大于所述第五阈值,所述第四阈值大于所述第五阈值。Comparing the first metric value with the fourth threshold and the fifth threshold, and obtaining a comparison result that the first metric value is smaller than the fourth threshold, and is greater than the fifth threshold, where The four threshold is greater than the fifth threshold.
  8. 如权利要求7所述的方法,其特征在于,所述方法还包括:The method of claim 7 wherein the method further comprises:
    若所述第一度量值大于或等于所述第四阈值,则确定所述第一图像是清晰图像;或者,Determining that the first image is a clear image if the first metric value is greater than or equal to the fourth threshold; or
    若所述第一度量值小于或等于所述第五阈值,则确定所述第一图像是模糊图像。If the first metric value is less than or equal to the fifth threshold, determining that the first image is a blurred image.
  9. 如权利要求8所述的方法,其特征在于,若所述第一度量值大于或等于所述第四阈值,在确定所述第一图像是清晰图像之后,还包括:The method of claim 8, wherein if the first metric value is greater than or equal to the fourth threshold, after determining that the first image is a clear image, the method further comprises:
    确定第四检测结果是否准确;所述第四检测结果为根据所述第一度量值与所述第四阈值确定所述第一图像是清晰图像;Determining whether the fourth detection result is accurate; the fourth detection result is determining that the first image is a clear image according to the first metric value and the fourth threshold;
    若所述第四检测结果不准确,则调整所述第四阈值;If the fourth detection result is inaccurate, adjusting the fourth threshold;
    若所述第一度量值小于或等于所述第五阈值,在确定所述第一图像是模糊图像之后,还包括:If the first metric is less than or equal to the fifth threshold, after determining that the first image is a blurred image, the method further includes:
    确定第五检测结果是否准确;所述第五检测结果为根据所述第一度量值与所述第五阈值确定所述第一图像是模糊图像;Determining whether the fifth detection result is accurate; the fifth detection result is determining that the first image is a blurred image according to the first metric value and the fifth threshold;
    若所述第五检测结果不准确,则调整所述第五阈值。If the fifth detection result is inaccurate, the fifth threshold is adjusted.
  10. 如权利要求1至9任一项所述的方法,其特征在于,确定所述第一图像的第一度量值,包括:The method according to any one of claims 1 to 9, wherein determining the first metric value of the first image comprises:
    检测所述第一图像中的目标区域;Detecting a target area in the first image;
    在所述第一图像中的目标区域进行掩膜处理,得到第一掩膜图像;Performing a mask process on the target area in the first image to obtain a first mask image;
    确定所述第一掩膜图像的度量值;Determining a metric value of the first mask image;
    确定所述第二图像的第二度量值,包括:Determining a second metric value of the second image, comprising:
    检测所述第二图像中的目标区域;Detecting a target area in the second image;
    在所述第二图像中的目标区域进行掩膜处理,得到第二掩膜图像;Performing a mask process on the target area in the second image to obtain a second mask image;
    确定所述第二掩膜图像的度量值。A metric value of the second mask image is determined.
  11. 一种图像清晰度检测装置,其特征在于,包括:An image sharpness detecting device, comprising:
    缩放模块,用于将第一尺度的第一图像进行缩放处理,得到第二尺度的第二图像;a scaling module, configured to perform scaling processing on the first image of the first size to obtain a second image of the second size;
    确定模块,用于确定所述第一图像的第一度量值和所述缩放模块得到的所述第二图像的第二度量值,所述第一度量值用于表征所述第一图像的清晰度,所述第二度量值用于表征所述第二图像的清晰度;a determining module, configured to determine a first metric value of the first image and a second metric value of the second image obtained by the scaling module, the first metric value being used to represent the first image Sharpness, the second metric is used to characterize the sharpness of the second image;
    运算模块,用于对所述确定模块确定的所述第一度量值和所述第二度量值进行运算,获得运算结果;An operation module, configured to perform operations on the first metric value and the second metric value determined by the determining module, to obtain an operation result;
    比较模块,用于将所述运算模块得到的所述运算结果与第一阈值进行比较,获取比较结果;a comparison module, configured to compare the operation result obtained by the operation module with a first threshold, to obtain a comparison result;
    判定模块,用于根据所述比较模块获得的比较结果确定所述第一图像是否为清晰图像。And a determining module, configured to determine, according to the comparison result obtained by the comparing module, whether the first image is a clear image.
  12. 如权利要求11所述的装置,其特征在于,所述运算模块,具体用于:确定所述第一度量值以及所述第二度量值的比值;The apparatus according to claim 11, wherein the operation module is specifically configured to: determine a ratio of the first metric value and the second metric value;
    所述比较模块,具体用于:将所述比值与第一阈值进行比较;The comparing module is specifically configured to: compare the ratio with a first threshold;
    所述判定模块,具体用于:若所述比值大于第一阈值,则确定所述第一图像是清晰图像;或者,若所述比值小于或等于所述第一阈值,则确定所述第一图像是模糊图像。The determining module is configured to: if the ratio is greater than the first threshold, determine that the first image is a clear image; or, if the ratio is less than or equal to the first threshold, determine the first The image is a blurred image.
  13. 如权利要求12所述的装置,其特征在于,所述确定模块,还用于:The device of claim 12, wherein the determining module is further configured to:
    在将所述运算结果与第一阈值进行比较,并根据获得的比较结果确定所述第一图像是否为清晰图像之后,确定第一检测结果是否准确;所述第一检测结果为根据所述运算结果与第一阈值的比较结果确定所述第一图像是清晰图像或者模糊图像;After comparing the operation result with the first threshold, and determining whether the first image is a clear image according to the obtained comparison result, determining whether the first detection result is accurate; the first detection result is according to the operation A result of comparing the result with the first threshold determines that the first image is a sharp image or a blurred image;
    所述装置还包括调整模块,所述调整模块,用于在所述第一检测结果不准确时,调整所述第一阈值。The device further includes an adjustment module, where the adjustment module is configured to adjust the first threshold when the first detection result is inaccurate.
  14. 如权利要求11至13任一项所述的装置,其特征在于,所述比较模块,还用于:The device according to any one of claims 11 to 13, wherein the comparison module is further configured to:
    在对所述第一度量值和所述第二度量值进行运算,获得运算结果之前,将所述第二度量值与第二阈值以及第三阈值进行比较,且获得的比较结果为所述第二度量值小于所述第二阈值,且大于所述第三阈值,所述第二阈值大于所述第三阈值。Comparing the first metric value and the second metric value to obtain the operation result, comparing the second metric value with the second threshold value and the third threshold value, and obtaining the comparison result as The second metric value is smaller than the second threshold value and greater than the third threshold value, and the second threshold value is greater than the third threshold value.
  15. 如权利要求14所述的装置,其特征在于,所述判定模块,还用于:在所述第二度量值大于或等于所述第二阈时,确定所述第一图像是清晰图像;或者,在所述第二度量值小于或等于所述第三阈值时,确定所述第一图像是模糊图像。The apparatus according to claim 14, wherein the determining module is further configured to: determine that the first image is a clear image when the second metric value is greater than or equal to the second threshold; or And determining, when the second metric value is less than or equal to the third threshold, that the first image is a blurred image.
  16. 如权利要求15所述的装置,其特征在于,若所述第二度量值大于或等于所述第二阈值,则所述确定模块,还用于:在确定所述第一图像的检测结果为清晰图像之后,确定第二检测结果是否准确;所述第二检测结果为根据所述第二度量值与所述第二阈值确定所述第一图像是清晰图像;所述装置还包括调整模块,所述调整模块,用于在所述确定模块确定的所述第二检测结果不准确时,调整所述第二阈值;或者,The apparatus according to claim 15, wherein the determining module is further configured to: when determining that the second image is greater than or equal to the second threshold, After the image is clear, determining whether the second detection result is accurate; the second detection result is that the first image is a clear image according to the second metric value and the second threshold; the device further includes an adjustment module, The adjusting module is configured to adjust the second threshold when the second detection result determined by the determining module is inaccurate; or
    若所述第二度量值小于或等于所述第三阈值,则所述确定模块,还用于:在确定所述第一图像是模糊图像之后,确定第三检测结果是否准确;所述第三检测结果为根据所述第二度量值与所述第三阈值确定所述第一图像是模糊图像;所述调整模块,还用于:在所述第三检测结果不准确时,调整所述第三阈值。If the second metric is less than or equal to the third threshold, the determining module is further configured to: after determining that the first image is a blurred image, determine whether the third detection result is accurate; The detection result is that the first image is a blurred image according to the second metric value and the third threshold; the adjusting module is further configured to: when the third detection result is inaccurate, adjust the first Three thresholds.
  17. 如权利要求11至16任一项所述的装置,其特征在于,所述比较模块。还用于:在对所述第一度量值和所述第二度量值进行运算,获得运算结果之前,将所述第一度量值与第四阈值以及第五阈值进行比较,且获得的比较结果为所述第一度量值小于所述第四阈值,且大于所述第五阈值,所述第四阈值大于所述第五阈值。Apparatus according to any one of claims 11 to 16, wherein said comparison module. The method further includes: performing operations on the first metric value and the second metric value to obtain the operation result, comparing the first metric value with the fourth threshold value and the fifth threshold value, and obtaining the obtained The comparison result is that the first metric value is smaller than the fourth threshold value and greater than the fifth threshold value, and the fourth threshold value is greater than the fifth threshold value.
  18. 如权利要求17所述的装置,其特征在于,所述判定模块,还用于:在所述第一度量值大于或等于所述第四阈值时,确定所述第一图像是清晰图像;或者,在所述第一度量值小于或等于所述第五阈值时,确定所述第一图像是模糊图像。The device according to claim 17, wherein the determining module is further configured to: when the first metric value is greater than or equal to the fourth threshold, determine that the first image is a clear image; Alternatively, when the first metric value is less than or equal to the fifth threshold, determining that the first image is a blurred image.
  19. 如权利要求18所述的装置,其特征在于,若所述第一度量值大于或等于所述第四阈值,则所述确定模块,还用于:在确定所述第一图像是清晰图像之后,确定第四检测结果是否准确;所述第四检测结果为根据所述第一度量值与所述第四阈值确定所述第一图像是清晰图像;所述装置还包括调整模块,所述调整模块,用于在所述第四检测结果不准确时,调整所述第四阈值;或者,The apparatus according to claim 18, wherein the determining module is further configured to: determine that the first image is a clear image, if the first metric value is greater than or equal to the fourth threshold Determining whether the fourth detection result is accurate; the fourth detection result is that the first image is a clear image according to the first metric value and the fourth threshold value; the device further includes an adjustment module, The adjusting module is configured to adjust the fourth threshold when the fourth detection result is inaccurate; or
    若所述第一度量值小于或等于所述第五阈值,则所述确定模块,还用于:在确定所述第一图像是模糊图像之后,确定第五检测结果是否准确;所述第五检测结果为根据所述第一度量值与所述第五阈值确定所述第一图像是模糊图像;所述调整模块,还用于:在所述第五检测结果不准确时,调整所述第五阈值。If the first metric is less than or equal to the fifth threshold, the determining module is further configured to: after determining that the first image is a blurred image, determining whether the fifth detection result is accurate; The detection result is that the first image is a blurred image according to the first metric value and the fifth threshold value; and the adjusting module is further configured to: when the fifth detection result is inaccurate, adjust the location The fifth threshold is described.
  20. 如权利要求11至19任一项所述的装置,其特征在于,所述确定模块,在确定所述第一图像的第一度量值时,具体用于:The device according to any one of claims 11 to 19, wherein the determining module, when determining the first metric value of the first image, is specifically used for:
    检测所述第一图像中的目标区域;Detecting a target area in the first image;
    在所述第一图像中的目标区域进行掩膜处理,得到第一掩膜图像;Performing a mask process on the target area in the first image to obtain a first mask image;
    确定所述第一掩膜图像的度量值;Determining a metric value of the first mask image;
    在确定所述第二图像的第二度量值时,具体用于:When determining the second metric value of the second image, specifically for:
    检测所述第二图像中的目标区域;Detecting a target area in the second image;
    在所述第二图像中的目标区域进行掩膜处理,得到第二掩膜图像;Performing a mask process on the target area in the second image to obtain a second mask image;
    确定所述第二掩膜图像的度量值。A metric value of the second mask image is determined.
  21. 一种图像清晰度检测装置,其特征在于,包括存储器以及处理器;An image sharpness detecting device, comprising: a memory and a processor;
    存储器,用于存储所述处理器执行的程序;a memory for storing a program executed by the processor;
    处理器,用于基于第一图像执行所述存储器存储的程序,以执行权利要求1至10任一项所述的方法。A processor for executing the program of the memory storage based on the first image to perform the method of any one of claims 1 to 10.
  22. 一种计算机存储介质,其特征在于,所述计算机可读存储介质存储有计算机可执行指令,所述计算机可执行指令用于使所述计算机执行权利要求1至10任一项所述的方法。A computer storage medium, characterized in that the computer readable storage medium stores computer executable instructions for causing the computer to perform the method of any one of claims 1 to 10.
PCT/CN2018/078751 2018-03-12 2018-03-12 Method and apparatus for detecting resolution of image WO2019173954A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201880077809.0A CN111417981A (en) 2018-03-12 2018-03-12 Image definition detection method and device
PCT/CN2018/078751 WO2019173954A1 (en) 2018-03-12 2018-03-12 Method and apparatus for detecting resolution of image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/078751 WO2019173954A1 (en) 2018-03-12 2018-03-12 Method and apparatus for detecting resolution of image

Publications (1)

Publication Number Publication Date
WO2019173954A1 true WO2019173954A1 (en) 2019-09-19

Family

ID=67907281

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/078751 WO2019173954A1 (en) 2018-03-12 2018-03-12 Method and apparatus for detecting resolution of image

Country Status (2)

Country Link
CN (1) CN111417981A (en)
WO (1) WO2019173954A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111010556A (en) * 2019-12-27 2020-04-14 成都极米科技股份有限公司 Method and device for projection bi-directional defocus compensation and readable storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112346968B (en) * 2020-10-20 2024-04-19 北京达佳互联信息技术有限公司 Automatic detection method and device for definition of multimedia file

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050248655A1 (en) * 2004-04-21 2005-11-10 Fuji Photo Film Co. Ltd. Image processing method, image processing apparatus, and image processing program
CN104091340A (en) * 2014-07-18 2014-10-08 厦门美图之家科技有限公司 Blurred image rapid detection method
CN106548468A (en) * 2016-10-13 2017-03-29 广州酷狗计算机科技有限公司 The method of discrimination and device of image definition
CN106934806A (en) * 2017-03-09 2017-07-07 东南大学 It is a kind of based on text structure without with reference to figure fuzzy region dividing method out of focus

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6548800B2 (en) * 2001-04-09 2003-04-15 Microsoft Corporation Image blur detection methods and arrangements
JP2003067748A (en) * 2001-08-28 2003-03-07 Kddi Corp Animation image exrtractor
CN103093419B (en) * 2011-10-28 2016-03-02 浙江大华技术股份有限公司 A kind of method of detected image sharpness and device
CN102903098A (en) * 2012-08-28 2013-01-30 四川虹微技术有限公司 Depth estimation method based on image definition difference
CN105574857B (en) * 2015-12-11 2019-02-15 小米科技有限责任公司 Image analysis method and device
GB2549068B (en) * 2016-03-22 2021-09-29 Toshiba Europe Ltd Image adjustment
CN107784645A (en) * 2016-08-26 2018-03-09 广州康昕瑞基因健康科技有限公司 Measurement for Digital Image Definition and system, auto focusing method
CN107481238A (en) * 2017-09-20 2017-12-15 众安信息技术服务有限公司 Image quality measure method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050248655A1 (en) * 2004-04-21 2005-11-10 Fuji Photo Film Co. Ltd. Image processing method, image processing apparatus, and image processing program
CN104091340A (en) * 2014-07-18 2014-10-08 厦门美图之家科技有限公司 Blurred image rapid detection method
CN106548468A (en) * 2016-10-13 2017-03-29 广州酷狗计算机科技有限公司 The method of discrimination and device of image definition
CN106934806A (en) * 2017-03-09 2017-07-07 东南大学 It is a kind of based on text structure without with reference to figure fuzzy region dividing method out of focus

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111010556A (en) * 2019-12-27 2020-04-14 成都极米科技股份有限公司 Method and device for projection bi-directional defocus compensation and readable storage medium
US11934089B2 (en) 2019-12-27 2024-03-19 Chengdu Xgimi Technology Co., Ltd. Bidirectional compensation method and apparatus for projection thermal defocusing, and readable storage medium

Also Published As

Publication number Publication date
CN111417981A (en) 2020-07-14

Similar Documents

Publication Publication Date Title
US20200160040A1 (en) Three-dimensional living-body face detection method, face authentication recognition method, and apparatuses
Kakar et al. Exposing digital image forgeries by detecting discrepancies in motion blur
US10453204B2 (en) Image alignment for burst mode images
US9305240B2 (en) Motion aligned distance calculations for image comparisons
US11682225B2 (en) Image processing to detect a rectangular object
WO2014074959A1 (en) Real-time face detection using pixel pairs
US11086977B2 (en) Certificate verification
CN112784750B (en) Fast video object segmentation method and device based on pixel and region feature matching
WO2019173954A1 (en) Method and apparatus for detecting resolution of image
US9940718B2 (en) Apparatus and method for extracting peak image from continuously photographed images
US11216961B2 (en) Aligning digital images by selectively applying pixel-adjusted-gyroscope alignment and feature-based alignment models
CN113592706A (en) Method and device for adjusting homography matrix parameters
JPWO2018179119A1 (en) Video analysis device, video analysis method, and program
WO2020244076A1 (en) Face recognition method and apparatus, and electronic device and storage medium
US20220122341A1 (en) Target detection method and apparatus, electronic device, and computer storage medium
CN114743150A (en) Target tracking method and device, electronic equipment and storage medium
KR20210087494A (en) Human body orientation detection method, apparatus, electronic device and computer storage medium
US10671881B2 (en) Image processing system with discriminative control
JP2017512398A (en) Method and apparatus for presenting video
KR20200017576A (en) Deep neural network based object detecting apparatus and method
US11741617B2 (en) Method and apparatus with object tracking
WO2023111674A1 (en) Target detection method and apparatus, electronic device, and computer storage medium
Zhang et al. Boolean Map Saliency: A Surprisingly Simple Method
TWI623889B (en) 3d hand gesture image recognition method and system thereof
Santos et al. Content-aware retargeting based on Information Theoretic Learning

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18910200

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18910200

Country of ref document: EP

Kind code of ref document: A1