A camera blur detection method
By combining multi-scale mesh generation and Gaussian blur preprocessing with Laplacian and Sobel edge detection, along with height threshold selection and continuous image analysis, the accuracy and computational complexity issues of camera blur detection for UAVs in dynamic outdoor environments are resolved, achieving efficient camera blur recognition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 杭州迅蚁网络科技有限公司
- Filing Date
- 2025-07-02
- Publication Date
- 2026-06-05
AI Technical Summary
Existing camera blur detection methods are difficult to effectively detect global and local blur in camera images in outdoor dynamic environments, and have high computational complexity, making them difficult to run on resource-constrained drone equipment.
A multi-scale grid division and Gaussian blur preprocessing method is combined with Laplacian and Sobel edge detection. The blur index is calculated through the difference image and adaptively adjusted based on the height threshold selection. The camera blur is judged by combining the analysis of continuous multi-frame images.
It can accurately identify global and local ambiguities in outdoor dynamic environments, improve the accuracy and applicability of detection, reduce computational complexity, and is suitable for the real-time requirements of UAVs.
Smart Images

Figure CN120782749B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology for unmanned aerial vehicles (UAVs), specifically to a camera blur detection method. Background Technology
[0002] In the current era of rapid development of drone technology, cameras are key devices for drones to acquire information, and their image quality plays a decisive role in the effectiveness of drone missions. However, the drone flight environment is complex and changeable, and cameras are easily affected by various factors, such as defocusing, water ingress, fog, and raindrops. These conditions can cause images to become blurry, seriously interfering with the normal flight of drones and subsequent data processing and analysis.
[0003] Currently, several camera blur detection methods have been proposed, but they still have many shortcomings. For example, CN111246203A proposes a method to identify blur by capturing template images and performing classification training, but this method is severely limited to fixed scenes. In actual outdoor dynamic environments, the scenes are complex and diverse, making it difficult to find suitable template images and unable to effectively handle local blur situations. CN118196528A constructs a neural network model for image blur classification by reconstructing blur kernels; however, model training requires a large amount of labeled data, which is not only time-consuming and labor-intensive but also has high hardware requirements, making it difficult to run effectively on resource-limited drone equipment. CN117765376A calculates sharpness through sub-image segmentation and edge detection, and judges whether the image is abnormal by statistically analyzing the proportion of blurred sub-images. However, this method has a defect for low-texture images, easily misclassifying them as blurred images, leading to inaccurate detection results. Summary of the Invention
[0004] The purpose of this invention is to provide a camera blur detection method to solve the problems mentioned in the background art, which are not convenient for effectively detecting camera image blur in outdoor dynamic environments, and cannot accurately identify global blur and local blur.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a camera blur detection method, comprising the following steps:
[0006] Step 1: Multi-scale mesh generation
[0007] For the input image, set s scales and k masks. At each scale, the image within the mask region is divided into grids once. The grid size is different for different scales. The mask regions can be the same or different.
[0008] Step 2: Ambiguity Calculation
[0009] 2.1 Preprocessing and edge detection: Each sub-image is preprocessed with Gaussian blur to obtain the preprocessed image M0. Then, Laplacian and Sobel edge detection are performed on M0 to obtain images M1a and M1b respectively.
[0010] 2.1 Gaussian blurring is applied to M0 again to obtain image M2. Laplacian and Sobel edge detection are then applied to M2 to obtain images M2a and M2b. 2.2 Difference image calculation: The difference images M3a and M3b between M1a and M2a, and between M1b and M2b, are calculated. The pixel value changes in the difference images reflect the degree of blur. 2.3 Sub-image blur calculation: The blur index of the sub-images is calculated based on the difference images, and the blur of all sub-images is sorted. 2.4 Image blur calculation: The average of the m sub-images with the highest blur is calculated to obtain the blur of the entire image.
[0011] Step 3: Height-based threshold selection
[0012] Organize two sets of image sequences collected by drones at different altitudes. One set is data A collected by a clear camera, and the other set is data B collected by a blurry camera. Calculate the blur index of the two sets of images, sort them by altitude, and filter out the altitude range [H1,H2] that completely distinguishes the two sets of blur indexes and the corresponding set of blur indexes. Calculate the average of the maximum blur of group A and the minimum blur of group B within this altitude range as the threshold F.
[0013] Step 4: Camera Blur Detection Based on Image Sequence
[0014] When the drone flies into the preset altitude range [H1, H2], it continuously collects N frames of images for T seconds and performs the above blur calculation on each frame. For a single frame, if the blur is greater than the threshold F, the frame is considered to be blurry and the total number of blurry frames K is increased by 1; otherwise, the image is considered to be clear. If the proportion of blurry frames K / N is greater than the threshold, the camera is considered to be blurry; otherwise, the camera is considered to be clear.
[0015] Furthermore, in step one, by using multi-scale segmentation, the blurring of the image can be analyzed in more detail. At the k-th scale, the masked region of the input image is extracted and divided into... There are 1 grid window, and each grid window contains 1 sub-image. and Let be the number of grids in the vertical and horizontal directions at the k-th scale. This multi-scale grid division method can analyze the image from different resolution angles, capture the image features more comprehensively, and provide a basis for accurate judgment of blur conditions in the future.
[0016] Further, for the preprocessing and edge detection in Step 2, for each sub-image M in Step 1, perform Gaussian blur preprocessing to obtain image M0, and obtain the width and height dimensions W and H of the image.
[0017] Further, in Step 2, compare the obtained image M2 with M1. Through Gaussian blur and edge detection at two different levels, the change of image edge information can be captured more meticulously, providing more accurate data for calculating the blur degree.
[0018] Further, the difference image calculation in Step 2 is mainly as follows:
[0019] Calculate the difference images M3a and M3b after the laplacian and sobel transforms before and after. The calculation method of each pixel value is as follows:
[0020]
[0021]
[0022] Where, i and j represent the pixel coordinates of the (i + 1)-th row and (j + 1)-th column of the image, 0 <= i < H, 0 <= j < W. The difference image can highlight the differences in image edge information under different blur degrees, and more intuitively reflect the blur characteristics of the image.
[0023] Further, the blur degree index for the sub-image blur degree calculation in Step 2 is:
[0024]
[0025] Comprehensively consider the information change after laplacian and sobel edge detections, and accurately measure the blur degree of the sub-image by calculating the proportional relationship between the difference and the original edge information.
[0026] Further, the image blur degree calculation in Step 2 is specifically:
[0027] Sort the blur degrees of all sub-images from high to low to obtain , n is the number of sub-images, and take the highest m indices Calculate the mean value to obtain the blur degree of the image:
[0028]
[0029] By selecting the sub-images with higher blur degrees to calculate the mean value, the overall blur degree of the image can be more accurately represented, avoiding the interference of local clear areas on the judgment of the overall blur degree.
[0030] Further, the height-based threshold selection in Step 3 is specifically:
[0031] Blur index of data A captured by a clear camera and data B captured by a blurry camera.
[0032] , The data is sorted by height, and the corresponding index sets for the two completely distinct height intervals [H1, H2] are obtained. , The mean of the maximum ambiguity of group A and the minimum ambiguity of group B within the height interval [H1, H2] is used as the threshold F.
[0033]
[0034] The threshold determined in this way can be adaptively adjusted according to the drone's flight altitude and the blurriness of the actual acquired images, thus improving the accuracy of blur detection.
[0035] Furthermore, in step four, by analyzing multiple consecutive frames of images, it is possible to more accurately determine whether the camera truly has a blur problem, thus avoiding misjudgment based on a single frame image.
[0036] Compared with the prior art, the beneficial effects of the present invention are:
[0037] This camera blur detection method is an effective way to detect camera image blur in outdoor dynamic environments. This method is not only applicable to the detection of global blur, but also to the accurate identification of local blur.
[0038] Furthermore, the method of the present invention can perform detection in a dynamic outdoor environment, and is not limited to specific indoor scenarios;
[0039] Furthermore, through multi-scale grid partitioning and fuzziness calculation, global and local fuzziness can be accurately identified, and local fuzziness can be detected.
[0040] Furthermore, the height-based threshold selection method improves the accuracy and applicability of fuzz detection;
[0041] Furthermore, the method of the present invention has low computational complexity and high detection efficiency, making it suitable for application scenarios with high real-time requirements, such as drones. Attached Figure Description
[0042] Figure 1 This is a schematic diagram of the multi-scale grid division of the present invention. Detailed Implementation
[0043] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0044] Example: Please refer to Figure 1 As shown, the present invention provides the following technical solution: a camera blur detection method, comprising the following steps:
[0045] Step 1: Multi-scale mesh generation
[0046] For the input image, set s scales and k masks. At each scale, the image within the mask region is divided into grids once. The grid size is different for different scales. The mask regions can be the same or different.
[0047] Step 2: Ambiguity Calculation
[0048] 2.1 Preprocessing and edge detection: Each sub-image is preprocessed with Gaussian blur to obtain the preprocessed image M0. Then, Laplacian and Sobel edge detection are performed on M0 to obtain images M1a and M1b respectively.
[0049] 2.1 Gaussian blurring is applied to M0 again to obtain image M2. Laplacian and Sobel edge detection are then applied to M2 to obtain images M2a and M2b. 2.2 Difference image calculation: The difference images M3a and M3b between M1a and M2a, and between M1b and M2b, are calculated. The pixel value changes in the difference images reflect the degree of blur. 2.3 Sub-image blur calculation: The blur index of the sub-images is calculated based on the difference images, and the blur of all sub-images is sorted. 2.4 Image blur calculation: The average of the m sub-images with the highest blur is calculated to obtain the blur of the entire image.
[0050] Step 3: Height-based threshold selection
[0051] Organize two sets of image sequences collected by drones at different altitudes. One set is data A collected by a clear camera, and the other set is data B collected by a blurry camera. Calculate the blur index of the two sets of images, sort them by altitude, and filter out the altitude range [H1,H2] that completely distinguishes the two sets of blur indexes and the corresponding set of blur indexes. Calculate the average of the maximum blur of group A and the minimum blur of group B within this altitude range as the threshold F.
[0052] Step 4: Camera Blur Detection Based on Image Sequence
[0053] When the flight altitude of the drone enters the preset altitude range [H1, H2], continuously collect N frames of images in T seconds, and perform the above-mentioned blur calculation on each frame of image. For a single frame of image, if the blur degree is greater than the threshold F, it is considered that this frame is blurred, and the total number of blurred frames K is increased by 1; otherwise, the image is considered clear. If the proportion of blurred frames K / N is greater than the threshold, it is considered that the camera is blurred; otherwise, the camera is considered clear.
[0054] In step one, through multi-scale partitioning, the blur situation of the image can be analyzed more meticulously. At the k-th scale, extract the image of the masked area in the input image and divide it into grid windows, and each grid window is 1 sub-image, where and are the numbers of grids in the vertical and horizontal directions at the k-th scale. This multi-scale grid partitioning method can analyze the image from different resolution perspectives, capture the features of the image more comprehensively, and provide a basis for accurately judging the blur situation subsequently.
[0055] For the preprocessing and edge detection in step two, for each sub-image M in step 1, perform Gaussian blur preprocessing to obtain the image M0, and obtain the width and height dimensions W and H of the image.
[0056] In step two, compare the obtained image M2 with M1. Through Gaussian blur and edge detection with two different degrees, the change of the edge information of the image can be captured more meticulously, providing more accurate data for calculating the blur degree.
[0057] The calculation of the difference image in step two is mainly as follows:
[0058] Calculate the difference images M3a and M3b after the laplacian and sobel transforms before and after. The calculation method of each pixel value is as follows:
[0059]
[0060]
[0061] Among them, i and j represent the pixel coordinates of the (i + 1)-th row and (j + 1)-th column of the image, 0 <= i < H, 0 <= j < W. The difference image can highlight the differences in the edge information of the image under different blur degrees and more intuitively reflect the blur characteristics of the image.
[0062] The blur index for the calculation of the blur degree of the sub-image in step two is:
[0063]
[0064] By comprehensively considering the changes in information after Laplacian and Sobel edge detection, the blurring degree of the sub-image is accurately measured by calculating the ratio between the difference and the original edge information.
[0065] The image blur calculation in step two is as follows:
[0066] Sort all sub-images by blur level from highest to lowest. n is the number of sub-images, and the highest m indicators are selected. Calculate the mean value to obtain the blur level of the image:
[0067]
[0068] By selecting sub-images with higher blur levels and calculating the mean, the overall blur level of the image can be represented more accurately, avoiding interference from local clear areas in the overall blur level judgment.
[0069] The height-based threshold selection in step three is as follows:
[0070] Blur index of data A captured by a clear camera and data B captured by a blurry camera.
[0071] , The data is sorted by height, and the corresponding index sets for the two completely distinct height intervals [H1, H2] are obtained. , The mean of the maximum ambiguity of group A and the minimum ambiguity of group B within the height interval [H1, H2] is used as the threshold F.
[0072]
[0073] The threshold determined in this way can be adaptively adjusted according to the drone's flight altitude and the blurriness of the actual acquired images, thus improving the accuracy of blur detection.
[0074] In step four, by analyzing multiple consecutive frames of images, it is possible to more accurately determine whether the camera truly has a blur problem, thus avoiding misjudgment based on a single frame image.
[0075] The contents not described in detail in this specification are existing technologies known to those skilled in the art.
[0076] Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A camera blur detection method, characterized in that: Includes the following steps: Step 1: Multi-scale mesh generation For the input image, set s scales and k masks. At each scale, the image within the mask region is divided into grids once. The grid size is different for different scales. The mask regions can be the same or different. Step 2: Ambiguity Calculation (2.1) Preprocessing and edge detection: Gaussian blur preprocessing is performed on each sub-image to obtain the preprocessed image M0. Then, Laplacian and Sobel edge detection are performed on M0 to obtain images M1a and M1b respectively. M0 is subjected to Gaussian blurring again to obtain image M2. Laplacian and Sobel edge detection are also performed on M2 to obtain images M2a and M2b; (2.2) Calculation of difference images: Calculate the difference images M3a and M3b between M1a and M2a, and between M1b and M2b. By calculating the pixel value changes of the difference images, the degree of blurring of the images can be reflected. (2.3) Sub-image blur calculation: Calculate the blur index of the sub-image based on the difference image, and sort the blur of all sub-images; (2.4) Image blur calculation: Take the m sub-images with the highest blur and calculate the average value to obtain the blur of the whole image; Step 3: Height-based threshold selection Organize two sets of image sequences acquired by drones at different altitudes. One set is data A acquired by a clear camera, and the other set is data B acquired by a blurry camera. Calculate the blur index of the two sets of images, sort them by altitude, and select the altitude range [H1, H2] that completely distinguishes the two sets of blur indexes and the corresponding set of blur indexes. Calculate the average of the maximum blur of group A and the minimum blur of group B within this altitude range as the threshold F. The height-based threshold selection specifically refers to: Blur index of data A captured by a clear camera and data B captured by a blurry camera. , The data is sorted by height, and the corresponding index sets for the two completely distinct height intervals [H1, H2] are obtained. , The mean of the maximum ambiguity of group A and the minimum ambiguity of group B within the height interval [H1, H2] is used as the threshold F. ; The threshold determined in this way can be adaptively adjusted according to the drone's flight altitude and the blurriness of the actual acquired images, thus improving the accuracy of blur detection. Step 4: Camera Blur Detection Based on Image Sequence When the drone flies into the preset altitude range [H1, H2], it continuously collects N frames of images for T seconds and performs the above blur calculation on each frame. For a single frame, if the blur is greater than the threshold F, the frame is considered to be blurry and the total number of blurry frames K is increased by 1; otherwise, the image is considered to be clear. If the proportion of blurry frames K / N is greater than the threshold, the camera is considered to be blurry; otherwise, the camera is considered to be clear.
2. The camera blur detection method according to claim 1, characterized in that: Step one, through multi-scale segmentation, allows for a more detailed analysis of image blur. At the k-th scale, the masked region of the input image is extracted and divided into... There are 1 grid window, and each grid window contains 1 sub-image. and Let be the number of grids in the vertical and horizontal directions at the k-th scale. This multi-scale grid division method can analyze the image from different resolution angles, capture the image features more comprehensively, and provide a basis for accurate judgment of blur conditions in the future.
3. The camera blur detection method according to claim 2, characterized in that: In step two, preprocessing and edge detection, Gaussian blur preprocessing is performed on each sub-image M from step one to obtain image M0, and the width and height dimensions W and H of the image are obtained.
4. The camera blur detection method according to claim 3, characterized in that: In step two, the obtained images M2 and M1 are compared. By performing Gaussian blurring and edge detection at two different levels, the changes in image edge information can be captured more meticulously, providing more accurate data for calculating blur.
5. The camera blur detection method according to claim 4, characterized in that: Step two, the difference image calculation, mainly involves: Calculate the difference images M3a and M3b after the Laplacian and Sobel transforms for the first and second times. The calculation method for each pixel value is as follows: ; ; Where, i and j represent the pixel coordinates of the (i + 1)-th row and (j + 1)-th column of the image, 0 <= i < H, 0 <= j < W. The difference image can highlight the differences in image edge information under different degrees of blurring and more intuitively reflect the blurring characteristics of the image.
6. The camera blur detection method according to claim 5, characterized in that: In the second step, the blurring index for calculating the blurring degree of the sub-image is: ; Taking into account the information changes after Laplacian and Sobel edge detections comprehensively, by calculating the proportional relationship between the difference and the original edge information, the blurring degree of the sub-image can be accurately measured.
7. The camera blur detection method according to claim 6, characterized in that: In the second step, the calculation of the image blurring degree is specifically as follows: Sort all sub-images by blur level from highest to lowest. n is the number of sub-images, and the highest m indicators are selected. Calculate the mean value to obtain the blur level of the image: ; By calculating the mean value of the sub-images with higher blurring degrees, it can more accurately represent the overall blurring degree of the image and avoid the interference of local clear regions on the judgment of the overall blurring degree.
8. The camera blur detection method according to claim 7, characterized in that: In the fourth step, by analyzing consecutive multiple frames of images, it is possible to more accurately determine whether there is a real blurring problem with the camera and avoid the misjudgment of single-frame images.
Citation Information
Patent Citations
Image screening method, device and equipment
CN117765376A
Real scene three-dimensional automatic modeling method and system based on unmanned aerial vehicle
CN119810359A
Image processing method, image processing apparatus, electronic device and computer-readable storage medium
US20220230282A1