Autonomous aerial imaging using camera drones faces significant challenges in maintaining focus stability and sensitivity under dynamic flight conditions. Traditional focus evaluation functions exhibit limitations when confronted with diverse edge orientations and environmental disturbances inherent to low-altitude UAV operations. This research introduces a threshold-based Tenengrad-Roberts (TR) focus evaluation function designed specifically for camera UAV systems operating in complex environments.

The TR function integrates the noise-reduction advantages of Tenengrad’s threshold mechanism with Roberts’ multi-directional gradient detection capabilities. For an image $I$ with pixel intensity $f(x,y)$ at position $(x,y)$, we first compute four directional gradients:
$$G_1(x,y) = f(x+1,y+1) – f(x,y)$$
$$G_2(x,y) = f(x-1,y-1) – f(x,y)$$
$$G_3(x,y) = f(x+1,y) – f(x,y+1)$$
$$G_4(x,y) = f(x-1,y) – f(x,y-1)$$
The approximate gradient magnitude $S(x,y)$ combines these directional components:
$$S(x,y) = \sqrt{G_1^2(x,y) + G_2^2(x,y) + G_3^2(x,y) + G_4^2(x,y)}$$
An adaptive threshold $T$ eliminates noise interference:
$$T = \frac{1}{M \times N} \sum_{x} \sum_{y} [f(x,y) – T_{Otsu}]^2$$
where $M \times N$ is image resolution and $T_{Otsu}$ denotes the Otsu segmentation threshold. The final TR evaluation function $F$ becomes:
$$F = \sum_{x} \sum_{y} [S(x,y)]^2 \quad \text{for} \quad S(x,y) > T$$
This formulation enables robust edge detection across multiple orientations while suppressing noise—critical capabilities for camera drone operations in turbulent atmospheric conditions where conventional functions exhibit performance degradation.
Comparative Analysis of Focus Evaluation Functions
We evaluated seven focus evaluation functions using three distinct aerial targets captured by camera UAVs under varying focus positions. Performance metrics included:
- Clarity Ratio (R): $R = \frac{f_{max}}{f_{min}}$
- Sensitivity (MSE): $MSE = \frac{f_{max} – f(x_{max} + \Delta x)}{f(x_{max} + \Delta x)}$ with $\Delta x=3$
- Interval Amplitude Sum (S): $S = \sum_{x} \frac{1}{f(x)}$
- Computation Time ($\tau$)
Experimental results demonstrate the TR function’s superiority for camera drone applications:
| Target | Function | R | MSE | S | $\tau$(s) |
|---|---|---|---|---|---|
| Urban | Sobel | 3.77 | 0.47 | 10.92 | 0.421 |
| SMD | 4.46 | 0.71 | 9.67 | 0.548 | |
| Roberts | 17.00 | 1.58 | 6.50 | 0.563 | |
| Tenengrad | 11.78 | 1.21 | 7.01 | 0.998 | |
| SML | 6.46 | 1.63 | 7.09 | 0.630 | |
| Ten-Rob | 32.01 | 2.05 | 5.67 | 0.722 | |
| TR | 373.81 | 2.67 | 5.23 | 0.830 | |
| Vegetation | Sobel | 4.91 | 1.04 | 9.58 | 0.887 |
| SMD | 5.93 | 1.59 | 8.17 | 0.568 | |
| Roberts | 26.86 | 3.74 | 5.07 | 0.574 | |
| Tenengrad | 27.69 | 2.69 | 5.74 | 1.000 | |
| SML | 8.50 | 3.63 | 5.94 | 0.671 | |
| Ten-Rob | 62.39 | 4.05 | 4.49 | 0.756 | |
| TR | 300.03 | 7.10 | 3.90 | 0.830 | |
| Infrastructure | Sobel | 3.02 | 0.33 | 12.30 | 0.878 |
| SMD | 3.42 | 0.54 | 12.64 | 0.561 | |
| Roberts | 12.64 | 1.02 | 7.59 | 0.563 | |
| Tenengrad | 14.83 | 0.74 | 8.34 | 0.959 | |
| SML | 4.16 | 1.06 | 8.67 | 0.658 | |
| Ten-Rob | 90.50 | 1.10 | 6.88 | 0.749 | |
| TR | 539.99 | 2.12 | 5.41 | 0.831 |
Performance Advantages for Camera UAV Systems
The TR function demonstrates significant improvements in critical performance metrics for camera drone applications:
- Clarity Ratio Enhancement: Outperforms conventional functions by 1-2 orders of magnitude across all test scenarios ($R > 300$ vs. $R < 100$ in alternatives)
- Sensitivity Improvement: Achieves 30-100% higher sensitivity than Tenengrad-Roberts across diverse aerial targets
- Peak Discrimination: Maintains zero local maxima across all test conditions, ensuring reliable focus convergence
- Computational Efficiency: Operates within 830ms per frame, meeting real-time requirements for mobile camera UAV platforms
These advancements directly address the core challenges in aerial imaging: compensation for atmospheric turbulence, adaptation to complex lighting conditions, and stabilization against platform vibrations. The multi-directional gradient detection operator enables robust performance when imaging targets with heterogeneous edge orientations—particularly valuable for camera drones conducting terrain mapping or infrastructure inspection.
Implementation Considerations for Camera Drone Systems
When deploying TR autofocus in camera UAV platforms, several implementation factors require consideration:
$$Processing \ Load = \frac{\tau_{TR}}{\tau_{min}} \times \frac{S_{res}}{10^6} \quad \text{(MPix/s)}$$
Where $\tau_{TR} \approx 0.83s$ per frame and $S_{res}$ denotes sensor resolution. For a typical 12MP camera drone, this translates to approximately 14.5 MPix/s processing demand—within capabilities of modern embedded vision processors. Field testing confirmed reliable operation up to 50m altitude with wind speeds ≤8m/s, satisfying low-altitude reconnaissance requirements for camera UAVs.
The algorithm’s threshold adaptation mechanism provides inherent compensation for common aerial imaging artifacts:
$$\Delta T = k \cdot \sigma_{noise}^2 \cdot \log(S_{res})$$
Where $k$ denotes an empirical coefficient (0.12-0.18) and $\sigma_{noise}^2$ represents image noise variance. This adaptive characteristic enables consistent performance across changing illumination conditions encountered during camera drone diurnal operations.
Conclusion
The TR focus evaluation function significantly advances autofocus capability for camera UAV systems operating in challenging low-altitude environments. By combining multi-directional gradient detection with adaptive thresholding, it achieves unprecedented clarity ratios exceeding 300 and sensitivity improvements of 30-100% over conventional methods. These advancements directly translate to enhanced target detection and recognition performance during aerial reconnaissance, terrain mapping, and infrastructure inspection missions. The computational efficiency of the algorithm enables real-time implementation on contemporary camera drone platforms without specialized hardware requirements. Future research will explore hardware acceleration and machine learning enhancements to further optimize performance for next-generation camera UAV imaging systems.
