Image detection method and device
Through the image detection method, the blurring characteristics of the images captured by the imaging device are analyzed, and the blur caused by out-of-focus and equipment interference is distinguished, which solves the problem of indistinguishability of the device and achieves the effect of quickly filtering clear images.
Patent Information
- Application Number
- CN202411376558.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-07
AI Technical Summary
In the imaging device, images captured based on the special shooting mode are difficult to distinguish whether blur is caused by out-of-focus or by device interference factors, making it difficult to obtain clear images that meet users' expectations.
Through the image detection method, the blur analysis results of the image are obtained, including frequency domain feature map, outline feature parameters, pixel value variance and texture features, and the image is judged whether the image meets the blur requirements of the target shooting mode, and determine whether the image is affected by interference factors.
It can quickly filter out images that meet the target shooting mode, meet the user's image needs and improve the convenience of image quality.
Smart Images

Figure CN119277201A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of image technology, and in particular, relates to an image detection method and device. Background Art
[0002] In the field of photography, the process of adjusting the focus so that the subject is within the focal length of the lens is called focusing. If the focus is successful, the subject can be clearly displayed in the captured image. If the focus is unsuccessful, resulting in the subject being outside the focal length of the lens, the subject in the image will be blurred, and this phenomenon can be called out of focus or virtual focus.
[0003] Some photographing devices can shoot based on a special shooting mode. Among the images shot based on this mode, a part will appear blurred when out of focus, and the other part will appear clear when in focus.
[0004] When shooting images, the device may also capture blurred images due to interference factors such as device shaking, unreasonable exposure time, etc. Generally, the device needs to identify such blurred images affected by interference factors and delete them. However, when shooting images based on the above special mode, it is difficult for the device to identify whether the blur in the image meets the shooting requirements of the mode or is caused by interference factors. In other words, when shooting images based on the above mode, it is difficult for the device to obtain images that meet the user's expectations in the captured images. Summary of the invention
[0005] To this end, this application discloses the following technical solutions:
[0006] The first aspect of the present application provides an image detection method, comprising:
[0007] obtaining a first image;
[0008] Obtaining a fuzzy analysis result of the first image;
[0009] If the blur analysis result satisfies the target condition, determining that the first image is an image captured in a target shooting mode without being affected by interference factors;
[0010] The image captured in the target shooting mode includes a focused portion and an out-of-focus portion; the blur analysis result satisfies the target condition, indicating that the blur of the first image meets the blur requirement of the target shooting mode.
[0011] Optionally, obtaining the blur analysis result of the first image includes:
[0012] Acquire a frequency domain feature map of the first image as a fuzzy analysis result of the first image;
[0013] Among them, the blur analysis result meets the target condition, including that the frequency domain feature map matches a preset target frequency domain feature map, and the target frequency domain feature map is a frequency domain feature map of an image that has been determined to meet the blur requirement of the target shooting mode.
[0014] Optionally, obtaining the blur analysis result of the first image includes:
[0015] Detecting the contour of the target object in the first image to obtain characteristic parameters of the contour of the target object as a blur analysis result of the first image, wherein the characteristic parameters include at least one of clarity and smoothness;
[0016] The fuzzy analysis result satisfies a target condition, including that a characteristic parameter of the contour of the target object is greater than a corresponding characteristic parameter threshold.
[0017] Optionally, obtaining the blur analysis result of the first image includes:
[0018] Obtaining pixel value variances of a plurality of regions in the first image as a blur analysis result of the first image, the plurality of regions including a plurality of regions having different distances from a focus of the first image;
[0019] The fuzzy analysis result satisfies the target condition, including that the variation trend of the pixel value variance of the multiple regions with the distance from the multiple regions to the focus matches the target variation trend.
[0020] Optionally, obtaining the blur analysis result of the first image includes:
[0021] Acquiring a texture feature of the first image as a fuzzy analysis result of the first image;
[0022] The blur analysis result satisfies the target condition, including that the texture feature of the first image matches the target texture feature, and the target texture feature is the texture feature of the image that has been determined to meet the blur requirement of the target shooting mode.
[0023] Optionally, the number of the first images is multiple frames;
[0024] The obtaining of the blur analysis result of the first image includes:
[0025] Obtaining statistical parameters of blurriness of multiple frames of the first image, wherein the statistical parameters include blurriness mean and blurriness variance of the multiple frames of the first image;
[0026] The statistical parameters and the blurriness of the first image are used as blur analysis results of the first image.
[0027] Optionally, the fuzzy analysis result of the first image satisfies a target condition, including at least one of the following:
[0028] When the blur variance is greater than a first variance threshold, the blur of the first image is less than a blur reference value, and the blur reference value is determined at least according to the blur mean value;
[0029] The ambiguity variance is less than the first variance threshold, and the ambiguity mean is less than or equal to the reference ambiguity mean;
[0030] The blur analysis result of the first image does not meet the target condition, including at least one of the following:
[0031] When the blur variance is greater than a first variance threshold, the blur of the first image is greater than or equal to the blur reference value;
[0032] The ambiguity variance is smaller than the first variance threshold, and the ambiguity mean is larger than the reference ambiguity mean.
[0033] Optionally, obtaining the first image includes:
[0034] In response to the target shooting instruction, shooting and obtaining a plurality of frames of first images based on the target shooting mode;
[0035] The method further comprises at least one of:
[0036] saving the first image satisfying the target condition as the target image corresponding to the target shooting instruction;
[0037] In the case that there are multiple frames of the first image that meet the target condition, one frame of the first image that meets the target condition is selected according to the blurriness of the first image and saved as the target image corresponding to the target shooting instruction.
[0038] Optionally, obtaining the first image includes:
[0039] Among the images shot based on the target shooting mode, multiple frames of images whose content similarity is higher than a similarity threshold are selected as first images.
[0040] A second aspect of the present application provides an image detection device, comprising:
[0041] An obtaining unit, configured to obtain a first image;
[0042] An analysis unit, configured to obtain a blur analysis result of the first image;
[0043] a determining unit, configured to determine, if the blur analysis result satisfies a target condition, that the first image is an image captured in a target shooting mode without being affected by interference factors;
[0044] The image captured in the target shooting mode includes a focused portion and an out-of-focus portion; the blur analysis result satisfies the target condition, indicating that the blur of the first image meets the blur requirement of the target shooting mode. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0046] Figure 1 is a flow chart of an image detection method provided in an embodiment of the present application;
[0047] Figure 2 is a schematic diagram of a first image provided in an embodiment of the present application;
[0048] Figure 3 It is a schematic diagram of an image detection device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0050] This application embodiment provides an image detection method, see Figure 1 , the method may include the following steps.
[0051] S101, obtaining a first image.
[0052] The first image may include one or more frames of images captured by the capturing device in a target capturing mode.
[0053] The image captured by the shooting device in the target shooting mode may include two parts, one part may be in a blurred state when out of focus, and this part may be called an out-of-focus part, and the other part may be in a clear state when focusing successfully, and this part may be called a focused part.
[0054] As an example, see Figure 2 , a frame of the first image captured by the shooting device in the target shooting mode can be as follows Figure 2 As shown in (1), it can be seen that the part corresponding to the person in the image is displayed relatively clearly, which is the focused part, and the background part other than the person is displayed relatively blurred, which is the out-of-focus part.
[0055] The photographing device may enter the target photographing mode by adjusting the hardware parameters of the device during photographing. For example, when in the target photographing mode, the photographing device may adjust the aperture size to f1.8 to obtain the first image through a larger aperture. Alternatively, the photographing device may also photograph an image based on conventional hardware parameters, and then process the photographed image into the first image through a specific algorithm. This embodiment does not limit the method for obtaining the first image.
[0056] Since the target shooting mode can be achieved by increasing the aperture size, in some devices, the target shooting mode can be called a large aperture mode.
[0057] S102, obtaining a blur analysis result of the first image, where the blur analysis result meets the target condition, indicating that the blur of the first image meets the blur requirement of the target shooting mode.
[0058] In step S102, the first image may be processed to obtain a blur analysis result of the first image. The blur analysis result of the first image may be related to the distribution of blurs at different positions in the first image, or may be related to the blur size of the first image as a whole. This embodiment does not limit the method for obtaining the blur analysis result and the specific form of the blur analysis result.
[0059] After obtaining the blur analysis result, if the blur analysis result of the first image meets the target condition, it can be determined that the blur of the first image meets the blur requirement of the target shooting mode, that is, the first image includes a blurred part that is out of focus and a clearly displayed part when the focus is successful, for example Figure 2 (1); if the blur analysis result of the first image does not meet the target condition, it can be determined that the blur of the first image does not meet the blur requirement of the target shooting mode, for example Figure 2 (2).
[0060] Among them, for different forms of fuzzy analysis results, the corresponding target conditions may be different.
[0061] S103: If the blur analysis result meets the target condition, determine that the first image is an image captured in the target shooting mode without being affected by interference factors.
[0062] When the shooting device captures an image in the target shooting mode, if the shooting device is affected by interference factors during shooting, the blur of the first image captured is likely to not meet the blur requirement of the target shooting mode. Therefore, if the first image meets the blur requirement of the target shooting mode, it can be considered that the first image is an image captured in the target shooting mode without being affected by interference factors. If the first image does not meet the blur requirement of the target shooting mode, it can be considered that the first image is an image captured in the target shooting mode with the influence of interference factors.
[0063] The interference factors here may include various factors that may affect the quality of the captured image (especially blur) during the shooting process. For example, the interference factors may include unexpected irregular shaking of the shooting device, or excessive or insufficient exposure caused by unreasonable shutter time setting (too long or too short).
[0064] If there are interference factors during shooting, each part of the captured image may be in a blurred state, and it is impossible to distinguish between the blurred out-of-focus part and the clear in-focus part. The more serious the interference factors, such as the greater the jitter amplitude and the more the exposure deviates from the normal value, the greater the blurriness of each part of the image may be.
[0065] As an example, an image captured in the target shooting mode without being affected by interference factors can be as follows: Figure 2 As shown in (1), when shooting in the target shooting mode, but the shooting device shakes irregularly during shooting, the image obtained may be as follows Figure 2 As shown in (2), it can be seen that there is no clear part in the image captured at this time when the focus is successful, and all parts of the image are in a blurred state.
[0066] The beneficial effects of this embodiment are:
[0067] After obtaining the first image, the present solution can determine whether the first image is an image captured in the target shooting mode without being affected by interference factors based on the blur analysis result of the first image. Therefore, after several frames of first images are captured based on the target shooting mode, the present solution can quickly select images that meet the blur requirements of the target shooting mode and are not affected by interference factors from these first images, thereby meeting the user's need to conveniently filter images from images captured based on the target shooting mode.
[0068] In some embodiments, the blur analysis result of the first image may be obtained by:
[0069] Acquire a frequency domain feature map of the first image as a fuzzy analysis result of the first image;
[0070] The blur analysis result satisfies the target condition, including that the frequency domain feature map matches a preset target frequency domain feature map, and the target frequency domain feature map is a frequency domain feature map of an image that has been determined to meet the blur requirement of the target shooting mode.
[0071] In this embodiment, the first image may be subjected to Fourier transformation to obtain a frequency domain feature map of the first image. The frequency domain feature map of the first image may include the frequency corresponding to each pixel in the first image. The frequency of the pixel may characterize the rate of change of the gray value at the location of the pixel in the first image. The lower the frequency, the slower the gray value at the location of the pixel changes, and the smaller the difference in gray values between adjacent pixels. The higher the frequency, the faster the gray value at the location of the pixel changes, and the larger the difference in gray values between adjacent pixels. Generally, the frequencies corresponding to the pixels of the smooth background and large areas of the same color in the image are relatively small, and the frequencies corresponding to the pixels of the edges, textures, and other parts of the object that change dramatically are relatively large.
[0072] Based on the above characteristics of the frequency of pixels, if the first image is an image that meets the blur requirement of the target shooting mode, the distribution of blurs in different parts of the first image has a certain regularity, and the frequency distribution of pixels in different parts of the frequency domain feature map of the corresponding first image will also have certain characteristics. That is to say, most images that meet the blur requirement of the target shooting mode generally have certain similarities in their frequency domain feature maps. For example, Figure 2 As can be seen from (1), the color change of the out-of-focus part is relatively gentle, so the frequency corresponding to the pixels in this part is generally small.
[0073] In contrast, for images that are affected by interference factors and do not meet the blur requirements of the target shooting mode, due to the randomness of the interference factors, the frequencies of each pixel in the frequency domain feature map of such images generally also present a randomly distributed characteristic, that is, for images that do not meet the blur requirements of the target shooting mode, the distribution of frequencies in their frequency domain feature maps generally has no specific regularity.
[0074] Therefore, in this embodiment, some images that meet the blur requirements of the target shooting mode can be pre-determined by manual labeling or screening by other methods, and then the frequency domain feature maps of these images are extracted as target frequency domain feature maps. After obtaining the frequency domain feature map of the first image, it can be determined whether the frequency domain feature map of the first image and these target frequency domain feature maps match. If the two match, it means that the frequency domain feature map of the first image and the frequency domain feature map of the image that meets the blur requirements of the target shooting mode have similar frequency distributions, so it can be determined that the first image is also an image that meets the blur requirements of the target shooting mode. If the two do not match, it means that the frequency domain feature map of the first image may have strong randomness, so it can be determined that the first image is an image that does not meet the blur requirements of the target shooting mode.
[0075] A method for determining whether the frequency domain feature map of the first image and the target frequency domain feature map match can be to calculate the similarity between the frequency domain feature map of the first image and the target frequency domain feature map, and if the similarity is greater than a certain threshold, it is determined that the two match; if the similarity is less than or equal to the threshold, it is determined that the two do not match.
[0076] A method for determining whether the frequency domain feature map of the first image matches the target frequency domain feature map can also be to train a neural network model with multiple target frequency domain feature maps so that the model learns the distribution characteristics of the frequency of each pixel in the target frequency domain feature map. After obtaining the frequency domain feature map of the first image, the neural network model can be used to determine whether the frequency domain feature map of the first image matches the target frequency domain feature map.
[0077] In some embodiments, the blur analysis result of the first image may be obtained by:
[0078] Detecting the contour of the target object in the first image to obtain characteristic parameters of the contour of the target object as a fuzzy analysis result of the first image, wherein the characteristic parameters include at least one of clarity and smoothness;
[0079] The fuzzy analysis result satisfies the target condition, including that the characteristic parameter of the contour of the target object is greater than the corresponding characteristic parameter threshold.
[0080] Combination Figure 2 From the examples (1) and (2), it can be seen that in the image that meets the blur requirement of the target shooting mode, the subject (such as the back of the person in the figure) has a continuous and clearly recognizable outline; in the image that does not meet the blur requirement of the target shooting mode, the outline of the subject (such as the face of the person in the figure) is difficult to recognize and there is a discontinuity problem in some areas.
[0081] Based on this, the first image can be processed based on image detection technology to obtain the outline of the target object photographed in the first image, and then determine the characteristic parameters of the outline, for example, the clarity of the outline, the smoothness of the outline, and the clarity and smoothness of the outline.
[0082] Among them, the smoothness of the contour reflects the continuity of the contour. If all parts of the contour are complete and smooth curves, the smoothness of the contour is high. If the contour has irregular and large fluctuations in some parts, or is disconnected in some parts, the smoothness of the contour is low.
[0083] By obtaining the characteristic parameters of the contour, it can be determined whether the characteristic parameters of the contour are greater than the corresponding characteristic parameter threshold. If they are greater than the characteristic parameter threshold, it can be determined that the fuzzy analysis result of the first image meets the target condition. If the characteristic parameters of the contour are less than or equal to the corresponding characteristic parameter threshold, it can be determined that the fuzzy analysis result of the first image does not meet the target condition.
[0084] When the characteristic parameters of the contour include clarity and smoothness, if both the clarity and the smoothness are greater than the corresponding thresholds, it can be determined that the blur analysis result of the first image meets the target condition; if at least one of the clarity and the smoothness is less than or equal to the corresponding characteristic parameter threshold, it can be determined that the blur analysis result of the first image does not meet the target condition.
[0085] In some embodiments, the blur analysis result of the first image may be obtained by:
[0086] Obtaining pixel value variances of a plurality of regions in the first image as a fuzzy analysis result of the first image, the plurality of regions including a plurality of regions having different distances from a focus of the first image;
[0087] The fuzzy analysis results meet the target conditions, including that the variation trend of the pixel value variance of the multiple regions with the distances from the multiple regions to the focus matches the target variation trend.
[0088] In this embodiment, the first image may be divided into at least two areas. For example, the target object may be detected in the first image, the area where the target object is located is determined as the first area, and the area other than the area where the target object is located is determined as the second area.
[0089] Alternatively, the image focus during shooting may be determined in the first image, and an area within a certain distance from the focus may be determined as the first area, and an area outside the distance may be determined as the second area.
[0090] Alternatively, a plurality of non-overlapping circular, square or other shaped regions may be randomly determined in the first image.
[0091] For each region, the pixel values of all pixels in the region can be obtained, so as to calculate the pixel value variance corresponding to the region. Then, according to the pixel value variance of each region and the distance of each region to the focus of the first image, the variation trend of the pixel value variance of multiple regions in the first image with the distance of multiple regions to the focus is determined.
[0092] The position of the focus in the image can be determined by various related technologies, which will not be described in detail in this embodiment.
[0093] from Figure 2It can be seen from (1) that for an image that meets the blur requirement of the target shooting mode, the variance of the pixel values in the area close to the focus (such as the back area of the person in the figure) is small, and the variance of the pixel values in the area far from the focus (such as the background area in the figure) is large.
[0094] and Figure 2 In the image shown in (2) that does not meet the blur requirement of the target shooting mode, there is no obvious correlation between the pixel value variance of each area and the distance from the area to the focus. The area far from the focus can have a larger pixel value variance or a smaller pixel value variance.
[0095] Therefore, it can be determined that the target change trend is that the variance of the pixel values of the multiple regions increases as the distances from the multiple regions to the focus increase, that is, the variance of the pixel values of the regions farther from the focus is greater than the variance of the pixel values of the regions closer to the focus. If the trend of the change of the variance of the pixel values of the multiple regions in the first image as the distances from the multiple regions to the focus matches the target trend, it is determined that the first image meets the blur requirement of the target shooting mode; if the two do not match, it is determined that the first image does not meet the blur requirement of the target shooting mode.
[0096] In some embodiments, the blur analysis result of the first image may be obtained by:
[0097] Acquiring a texture feature of the first image as a fuzzy analysis result of the first image;
[0098] The blur analysis result satisfies the target condition, including that the texture feature of the first image matches the target texture feature, and the target texture feature is the texture feature of the image that has been determined to meet the blur requirement of the target shooting mode.
[0099] The texture features of the image may be obtained by various methods in the relevant technical field, and this embodiment does not limit the obtaining method. As some examples, the texture features of the first image may be a gray level co-occurrence matrix of the first image.
[0100] For the first image that meets the blur requirement of the target shooting mode, since the distribution of blur in the image has a certain regularity, the texture features of the first image will also have a specific regularity. However, for the first image that does not meet the blur requirement of the target shooting mode, due to the influence of random interference factors, its texture features generally do not have obvious regularity.
[0101] Therefore, after obtaining the texture features of the first image, it can be determined whether the texture features of the first image match the target texture features. If they match, it can be determined that the first image meets the blur requirements of the target shooting mode. If they do not match, it can be determined that the first image does not meet the blur requirements of the target shooting mode.
[0102] The method for determining whether the texture features of the first image and the target texture features match can be to calculate the similarity between the texture features of the first image and the target texture features, and if the similarity is greater than a certain threshold, it is determined that the two match, and if the similarity is less than or equal to the threshold, it is determined that the two do not match.
[0103] A method for determining whether the texture features of the first image match the target texture features can also be to train a neural network model with multiple target texture features so that the model learns the distribution characteristics of the frequency of each pixel in the target texture features. After obtaining the texture features of the first image, the neural network model can be used to determine whether the texture features of the first image match the target texture features.
[0104] In some embodiments, when the number of the first image is multiple frames, that is, multiple frames of the first image are obtained in step S101, the blur analysis result of the first image may be obtained in the following manner:
[0105] Obtaining statistical parameters of blurriness of the first image frames, wherein the statistical parameters include blurriness mean and blurriness variance of the first image frames;
[0106] The statistical parameters and the blurriness of the first image are used as blur analysis results of the first image.
[0107] In this embodiment, the blurriness of each frame of the first image can be calculated first. The blurriness of the first image is used to characterize the overall blurriness of the first image. The size of the blurriness is related to the blurriness of each part of the first image. For example, if some areas are clear and some areas are blurred, the first image can have a smaller blurriness. If every part of the first image is blurred, the first image can have a larger blurriness.
[0108] The blurriness of a frame of image can be determined by a variety of methods. As an example, the blurriness of a frame of first image can be determined by:
[0109] Decoding the first image to obtain the first image in a target format, where the target format may be a bitmap format;
[0110] Converting a first image in a target format from a color image with multiple color channels to a single-channel grayscale image;
[0111] The grayscale image is processed based on the Laplace operator function and a 3*3 convolution kernel to obtain a processed feature map. Finally, the variance value of the feature map is obtained based on the numerical calculation of each element in the feature map, and the variance value is determined as the blurriness of the first image.
[0112] Among them, since the Laplace operator function is a second-order derivative function used to measure the image, it can emphasize the area with rapid density changes in the image. Therefore, the variance value of the feature map processed by the Laplace operator function can be regarded as a quantitative measurement value of the blurriness of a single image, that is, the blurriness of the image.
[0113] For a frame of the first image, the greater the blurriness of the first image, the more serious its overall blurriness is, and the smaller the blurriness is, the less severe its overall blurriness is.
[0114] After obtaining the blurriness of multiple frames of first images, the blurriness of the multiple frames of first images can be averaged to obtain a blurriness mean. For example, if there are 10 frames of first images, the blurriness of the 10 frames of first images can be added together and then the sum can be divided by 10 to obtain a blurriness mean. Then, the blurriness variance of the multiple frames of first images can be calculated based on the deviation of the blurriness of each frame of the first image relative to the blurriness mean.
[0115] Finally, for each frame of the first image, the blurriness mean, the blurriness variance and the blurriness of the frame of the first image may be determined as the blur analysis result of the first image.
[0116] In this embodiment, if the blur analysis result of a frame of the first image satisfies the following condition 1 or condition 2, it can be determined that the blur analysis result of the frame of the first image satisfies the target condition:
[0117] Case 1: when the blur variance is greater than the first variance threshold, the blur of the first image is less than the blur reference value, and the blur reference value is determined at least according to the blur mean value;
[0118] Case 2: the ambiguity variance is less than the first variance threshold, and the ambiguity mean is less than or equal to the reference ambiguity mean;
[0119] If the blur analysis result of a frame of the first image meets the following situation 3 or situation 4, it can be determined that the blur analysis result of the frame of the first image does not meet the target condition:
[0120] Case 3: when the blur variance is greater than the first variance threshold, the blur of the first image is greater than or equal to the blur reference value;
[0121] Case 4: the ambiguity variance is less than the first variance threshold, and the ambiguity mean is greater than the reference ambiguity mean.
[0122] If the blur variance of the multiple frames of first images is greater than the first variance threshold, it means that the blur differences of the first images are relatively large, and some of the first images have relatively large blurs, while other first images have relatively small blurs. In this case, it can be considered that some of the multiple frames of first images meet the blur requirements of the target shooting mode, while other images do not meet the blur requirements of the target shooting mode. Considering that the focused part of the first image that meets the blur requirements of the target shooting mode is clear, and only the out-of-focus part is blurred, it can be considered that the blur of the first image that meets the blur requirements of the target shooting mode is smaller than the blur of the first image that does not meet the blur requirements.
[0123] Therefore, when the blur variance is greater than the first variance threshold, it can be determined that among the multiple frames of first images, the first image whose corresponding blur is less than the blur reference value meets the blur requirement of the target shooting mode, and the first image whose corresponding blur is greater than or equal to the blur reference value does not meet the blur requirement of the target shooting mode.
[0124] If the blur variance is less than the first variance threshold, it means that the blurs of multiple frames of first images are relatively close. In this case, it is possible that the multiple frames of first images are all images affected by interference factors, resulting in that the multiple frames of first images have higher blurs. It is also possible that the multiple frames of first images are all images taken in the target shooting mode without being affected by interference factors, resulting in that the multiple frames of first images have lower blurs. In order to distinguish these two situations, the blur mean of the multiple frames of first images can be compared with the preset baseline blur mean.
[0125] If the blur mean is greater than the baseline blur mean, it means that the multiple frames of first images all have a large blur. At this time, it can be determined that the multiple frames of first images are all images affected by interference factors during shooting; if the blur mean is less than or equal to the baseline blur mean, it means that the multiple frames of first images all have a small blur. At this time, it can be determined that the multiple frames of first images are all images taken in the target shooting mode without being affected by interference factors.
[0126] The first variance threshold may be determined by:
[0127] A plurality of image sets are obtained, each of which includes a plurality of frames of images that meet the blur requirement of a target shooting mode and a plurality of frames of images that meet the blur requirement of the target shooting mode, a blur variance corresponding to each image set is calculated, and a minimum value among a plurality of blur variances corresponding to the plurality of image sets is determined as a first variance threshold.
[0128] The fuzzy baseline value can be determined in several ways:
[0129] The fuzziness mean value may be multiplied by a preset coefficient, and the result obtained is used as the fuzziness reference value; for example, the fuzziness mean value may be multiplied by 1.2, and the result obtained is used as the fuzziness reference value;
[0130] You can also add the fuzziness mean to the fuzziness variance and use the result as the fuzziness reference value.
[0131] The baseline ambiguity mean can be determined as follows:
[0132] A plurality of image sets are obtained, each of which includes a plurality of frames of images shot in a target shooting mode without being affected by interference factors, a blurriness mean corresponding to each image set is calculated, and a maximum value among a plurality of blurriness means corresponding to the plurality of image sets is determined as a reference blurriness mean.
[0133] The benefits of determining whether the first image meets the target condition based on the statistical parameters of the above embodiment are:
[0134] When there are multiple frames of first images, it is only necessary to calculate the blur of each frame of the first image, and then the first image that meets the blur requirement of the target shooting mode can be determined based on the blur of the multiple frames of first images and their statistical parameters. Compared with other methods, this method based on the statistical parameters of the blur of multiple frames of images has less calculation amount and can use fewer resources to more quickly determine the first image that meets the blur requirement of the target shooting mode.
[0135] In some optional embodiments, the electronic device that executes the method of this embodiment may be a photographing device for photographing the first image. In this case, the first image may be obtained by the photographing device responding to a target photographing instruction and photographing multiple frames of the first image based on a target photographing mode.
[0136] The target shooting instruction may be an instruction for controlling the shooting device to shoot an image in a target shooting mode.
[0137] After obtaining multiple frames of first images in the above manner, the photographing device may obtain and save the target image from the multiple frames of first images based on at least one of the following methods:
[0138] The first image whose fuzzy analysis result satisfies the target condition is saved as the target image corresponding to the target shooting instruction;
[0139] In the case that there are multiple frames of the first image whose blur analysis results meet the target condition, one frame of the first image meeting the target condition is selected according to the blurriness of the first image and saved as the target image corresponding to the target shooting instruction.
[0140] The method of selecting the first image according to the blurriness of the first image may be to select a first image frame with the smallest blurriness among multiple frames of first images that meet the target condition and save it as the target image.
[0141] As an example, the shooting device may be a mobile phone with a shooting function. After the mobile phone opens a camera application, the large aperture mode (i.e., target shooting mode) of the camera application is enabled based on a mode selection instruction of a user. After the mobile phone lens is aimed at the subject, the mobile phone responds to an instruction of the user clicking a shooting button and shoots multiple frames of first images in the large aperture mode. Then, the mobile phone determines which first images of the multiple frames of first images meet the target condition according to the method of this embodiment, that is, determines which first images are images shot in the target shooting mode without being affected by interference factors.
[0142] If only one frame of the first image meets the target condition, the mobile phone determines this image as the target image captured in response to the user's instruction to click the capture button, saves the target image, and displays the target image in the display interface;
[0143] If there are multiple frames of first images that meet the target condition, the mobile phone selects the frame of first image with the smallest blur as the target image captured in response to the user's instruction to click the shooting button, saves the target image, and displays the target image in the display interface.
[0144] After determining the target image, the mobile phone can delete the remaining target images.
[0145] The above-mentioned instruction of the user clicking the shooting button is equivalent to the target shooting instruction.
[0146] Optionally, the photographing device may also save multiple frames of first images that meet the target condition together.
[0147] Optionally, if the shooting device determines that the multiple frames of first images captured do not meet the target conditions, the shooting device can output corresponding prompt information, which can prompt the user that the quality of the photos taken this time does not meet the blur requirements of the target shooting mode, and prompt the user to shoot again in the target shooting mode to obtain an image that meets the blur requirements of the target shooting mode.
[0148] In some optional embodiments, the method for obtaining the first image may also be to select multiple frames of images from the multiple frames of images that have been captured as the first image. The selection method may be to respond to the user's selection instruction and determine the image corresponding to the selection instruction as the first image.
[0149] Alternatively, the first image may be selected as follows:
[0150] Among the images shot based on the target shooting mode, multiple frames of images with content similarity higher than a similarity threshold are selected as the first image.
[0151] The detection method provided in this embodiment has a high accuracy when applied to multiple frames of images obtained by shooting the same scene, and the image contents of the multiple frames of images obtained by shooting the same scene generally have a high degree of similarity.
[0152] Therefore, when it is necessary to determine images that are taken in the target shooting mode and are not affected by interference factors based on the method of this embodiment, it is possible to first determine which of the currently stored images are images taken based on the target shooting mode, and then, among these images taken based on the target shooting mode, select multiple frames of images whose content similarity is higher than a similarity threshold, and use these images as the first images, and then determine the images that are taken in the target shooting mode and are not affected by interference factors based on the method of this embodiment.
[0153] The present application provides an image detection device. Figure 3 , the device may include the following units.
[0154] An obtaining unit 301, configured to obtain a first image;
[0155] An analysis unit 302, configured to obtain a blur analysis result of the first image;
[0156] A determination unit 303, configured to determine that the first image is an image captured in a target shooting mode without being affected by interference factors if the blur analysis result satisfies the target condition;
[0157] The image captured in the target shooting mode includes a focused portion and an out-of-focus portion; the blur analysis result satisfies the target condition, indicating that the blur of the first image meets the blur requirement of the target shooting mode.
[0158] Optionally, when the analysis unit 302 obtains the blur analysis result of the first image, it can be used to:
[0159] Acquire a frequency domain feature map of the first image as a fuzzy analysis result of the first image;
[0160] The blur analysis result satisfies the target condition, including that the frequency domain feature map matches a preset target frequency domain feature map, and the target frequency domain feature map is a frequency domain feature map of an image that has been determined to meet the blur requirement of the target shooting mode.
[0161] Optionally, when the analysis unit 302 obtains the blur analysis result of the first image, it can be used to:
[0162] Detecting the contour of the target object in the first image to obtain characteristic parameters of the contour of the target object as a fuzzy analysis result of the first image, wherein the characteristic parameters include at least one of clarity and smoothness;
[0163] The fuzzy analysis result satisfies the target condition, including that the characteristic parameter of the contour of the target object is greater than the corresponding characteristic parameter threshold.
[0164] Optionally, when the analysis unit 302 obtains the blur analysis result of the first image, it can be used to:
[0165] Obtaining pixel value variances of a plurality of regions in the first image as a fuzzy analysis result of the first image, the plurality of regions including a plurality of regions having different distances from a focus of the first image;
[0166] The fuzzy analysis results meet the target conditions, including that the variation trend of the pixel value variance of the multiple regions with the distances from the multiple regions to the focus matches the target variation trend.
[0167] Optionally, when the analysis unit 302 obtains the blur analysis result of the first image, it can be used to:
[0168] Acquiring a texture feature of the first image as a fuzzy analysis result of the first image;
[0169] The blur analysis result satisfies the target condition, including that the texture feature of the first image matches the target texture feature, and the target texture feature is the texture feature of the image that has been determined to meet the blur requirement of the target shooting mode.
[0170] Optionally, the number of the first image is multiple frames;
[0171] When the analysis unit 302 obtains the blur analysis result of the first image, it can be used to:
[0172] Obtaining statistical parameters of blurriness of the first image frames, wherein the statistical parameters include blurriness mean and blurriness variance of the first image frames;
[0173] The statistical parameters and the blurriness of the first image are used as blur analysis results of the first image.
[0174] Optionally, the fuzzy analysis result of the first image satisfies the target condition, including at least one of the following:
[0175] When the blur variance is greater than the first variance threshold, the blur of the first image is less than a blur reference value, and the blur reference value is determined at least according to the blur mean value;
[0176] The ambiguity variance is less than a first variance threshold, and the ambiguity mean is less than or equal to a reference ambiguity mean;
[0177] The blur analysis result of the first image does not meet the target condition, including at least one of the following:
[0178] When the blur variance is greater than the first variance threshold, the blur of the first image is greater than or equal to the blur reference value;
[0179] The ambiguity variance is less than a first variance threshold, and the ambiguity mean is greater than a reference ambiguity mean.
[0180] Optionally, when the obtaining unit 301 obtains the first image, it can be used to:
[0181] In response to the target shooting instruction, shooting and obtaining a plurality of frames of first images based on the target shooting mode;
[0182] The determining unit 303 may also be used for at least one of the following:
[0183] The first image satisfying the target condition is saved as the target image corresponding to the target shooting instruction;
[0184] In the case that there are multiple frames of the first image that meet the target condition, one frame of the first image that meets the target condition is selected according to the blurriness of the first image and saved as the target image corresponding to the target shooting instruction.
[0185] Optionally, when the obtaining unit 301 obtains the first image, it can be used to:
[0186] Among the images shot based on the target shooting mode, multiple frames of images with content similarity higher than a similarity threshold are selected as the first image.
[0187] The working principle of the image detection device of this embodiment can be found in the relevant steps of the image detection method provided in any embodiment of the present application, and will not be repeated here.
[0188] An embodiment of the present application also provides an electronic device, which may be the above-mentioned shooting device.
[0189] The electronic device may include a processor, a memory, and an image acquisition module. The image acquisition module may capture images in a target capture mode, the memory may store a computer program, and the processor may execute the stored computer program to execute the image detection method provided in any embodiment of the present application, and obtain an image captured in the target capture mode without being affected by interference factors from the image captured by the image acquisition module based on the image detection method.
[0190] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0191] For the convenience of description, the above system or device is described by dividing it into various modules or units according to its functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0192] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.
[0193] Finally, it should be noted that, in this article, relational terms such as first, second, third and fourth are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0194] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. An image detection method, comprising: obtaining a first image; Obtaining a fuzzy analysis result of the first image; If the blur analysis result satisfies the target condition, determining that the first image is an image captured in a target shooting mode without being affected by interference factors; Wherein, the image captured in the target shooting mode includes a focused portion and an out-of-focus portion; The blur analysis result satisfies the target condition, indicating that the blur of the first image meets the blur requirement of the target shooting mode.
2. According to the method of claim 1, the obtaining of the blur analysis result of the first image comprises: Acquire a frequency domain feature map of the first image as a fuzzy analysis result of the first image; Among them, the blur analysis result meets the target condition, including that the frequency domain feature map matches a preset target frequency domain feature map, and the target frequency domain feature map is a frequency domain feature map of an image that has been determined to meet the blur requirement of the target shooting mode.
3. According to the method of claim 1, the obtaining of the blur analysis result of the first image comprises: Detecting the contour of the target object in the first image to obtain characteristic parameters of the contour of the target object as a blur analysis result of the first image, wherein the characteristic parameters include at least one of clarity and smoothness; The fuzzy analysis result satisfies a target condition, including that a characteristic parameter of the contour of the target object is greater than a corresponding characteristic parameter threshold.
4. The method according to claim 1, wherein obtaining the blur analysis result of the first image comprises: Obtaining pixel value variances of a plurality of regions in the first image as a blur analysis result of the first image, the plurality of regions including a plurality of regions having different distances from a focus of the first image; The fuzzy analysis result satisfies the target condition, including that the variation trend of the pixel value variance of the multiple regions with the distance from the multiple regions to the focus matches the target variation trend.
5. The method according to claim 1, wherein obtaining the blur analysis result of the first image comprises: Acquiring a texture feature of the first image as a fuzzy analysis result of the first image; The blur analysis result satisfies the target condition, including that the texture feature of the first image matches the target texture feature, and the target texture feature is the texture feature of the image that has been determined to meet the blur requirement of the target shooting mode.
6. The method according to claim 1, wherein the number of the first images is multiple frames; The obtaining of the blur analysis result of the first image includes: Obtaining statistical parameters of blurriness of multiple frames of the first image, wherein the statistical parameters include blurriness mean and blurriness variance of the multiple frames of the first image; The statistical parameters and the blurriness of the first image are used as blur analysis results of the first image.
7. The method according to claim 6, wherein the blur analysis result of the first image satisfies a target condition, including at least one of the following: When the blur variance is greater than a first variance threshold, the blur of the first image is less than a blur reference value, and the blur reference value is determined at least according to the blur mean value; The ambiguity variance is less than the first variance threshold, and the ambiguity mean is less than or equal to the reference ambiguity mean; The blur analysis result of the first image does not meet the target condition, including at least one of the following: When the blur variance is greater than a first variance threshold, the blur of the first image is greater than or equal to the blur reference value; The ambiguity variance is smaller than the first variance threshold, and the ambiguity mean is larger than the reference ambiguity mean.
8. The method according to claim 1, wherein obtaining the first image comprises: In response to the target shooting instruction, shooting and obtaining a plurality of frames of first images based on the target shooting mode; The method further comprises at least one of: saving the first image satisfying the target condition as the target image corresponding to the target shooting instruction; In the case that there are multiple frames of the first image that meet the target condition, one frame of the first image that meets the target condition is selected according to the blurriness of the first image and saved as the target image corresponding to the target shooting instruction.
9. The method according to claim 1, wherein obtaining the first image comprises: Among the images shot based on the target shooting mode, multiple frames of images whose content similarity is higher than a similarity threshold are selected as first images.
10. An image detection device, comprising: An obtaining unit, configured to obtain a first image; An analysis unit, configured to obtain a blur analysis result of the first image; a determining unit, configured to determine, if the blur analysis result satisfies a target condition, that the first image is an image captured in a target shooting mode without being affected by interference factors; Wherein, the image captured in the target shooting mode includes a focused portion and an out-of-focus portion; The blur analysis result satisfies the target condition, indicating that the blur of the first image meets the blur requirement of the target shooting mode.
Citation Information
Cited By
Remote video monitoring method, system and device capable of intelligently zooming
CN121751009A