Towards Minimal Focal Stack in Shape from Focus
Organizations: Korea University of Technology and Education
Abstract
Shape from Focus (SFF) is a depth reconstruction technique that estimates scene structure from focus variations observed across a focal stack, that is, a sequence of images captured at different focus settings. A key limitation of SFF methods is their reliance on densely sampled, large focal stacks, which limits their practical applicability. In this study, we propose a focal stack augmentation that enables SFF methods to estimate depth using a reduced stack of just two images, without sacrificing precision. We introduce a simple yet effective physics-based focal stack augmentation that enriches the stack with two auxiliary cues: an all-in-focus (AiF) image estimated from two input images, and Energy-of-Difference (EOD) maps, computed as the energy of differences between the AiF and input images. Furthermore, we propose a deep network that computes a deep focus volume from the augmented focal stacks and iteratively refines depth using convolutional Gated Recurrent Units (ConvGRUs) at multiple scales. Extensive experiments on both synthetic and real-world datasets demonstrate that the proposed augmentation benefits existing state-of-the-art SFF models, enabling them to achieve comparable accuracy. The results also show that our approach maintains state-of-the-art performance with a minimal stack size.
Figures & tables
| Dataset | Size | Input | Indices | Patch |
|---|---|---|---|---|
| FT | 15 | 2 ; 3 | [5,11] ; [4,8,12] | 512x512 |
| FOD | 5 | 2 ; 3 | [2,4] ; [1,3,5] | 256x256 |
| DDFF | 10 | 2 ; 3 | [4,7] ; [3,6,8] | 224x224 |
| Ablation | MAE | RMS | SqRel | ||
|---|---|---|---|---|---|
| Imgs | 6.61 | 11.82 | 9.05 | 83.22 | 87.39 |
| AiF+Imgs | 6.22 | 11.30 | 7.81 | 84.81 | 87.74 |
| AiF+EODs | 6.91 | 12.06 | 9.06 | 83.30 | 87.36 |
| Imgs+EODs | 6.32 | 11.40 | 7.95 | 84.42 | 87.65 |
| Imgs+AiF+EODs | 6.18 | 11.26 | 7.68 | 84.64 | 87.72 |
| FT | FOD | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Method | Input | MAE | RMS | AbsRel | Input | MAE | RMS | AbsRel | ||||||
| Using Full Focal Stack | ||||||||||||||
| AiFDNet | 15 | 6.812 | 13.14 | 0.731 | 85.43 | 87.67 | 88.87 | 5 | 0.071 | 0.156 | 0.118 | 84.75 | 94.67 | 97.46 |
| DFV-FV | 15 | 6.332 | 12.09 | 0.899 | 85.09 | 87.60 | 89.52 | 5 | 0.078 | 0.160 | 0.142 | 80.93 | 94.19 | 97.57 |
| DFV-Diff | 15 | 5.509 | 10.65 | 0.615 | 86.18 | 88.09 | 89.93 | 5 | 0.077 | 0.165 | 0.133 | 81.77 | 93.98 | 97.43 |
| DWild | 15 | 5.542 | 10.44 | 0.611 | 86.35 | 88.21 | 89.84 | 5 | 0.073 | 0.154 | 0.138 | 83.12 | 94.45 | 97.26 |
| Method | Input | MAE | RMS | ||
|---|---|---|---|---|---|
| AiFDNet | 3 | 0.0028 | 0.0084 | 98.04 | 98.63 |
| DFV-FV | 3 | 0.0035 | 0.0072 | 97.75 | 99.01 |
| DFV-Diff | 3 | 0.0040 | 0.0076 | 97.68 | 99.03 |
| Ours | 3 | 0.0031 | 0.0065 | 98.60 | 99.39 |
| AiFDNet | 2 | 0.0028 | 0.0082 | 98.12 | 98.71 |
| DFV-FV | 2 | 0.0036 | 0.0074 | 97.64 | 98.93 |
| AiF | Input | MAE | RMS | SqRel | ||
|---|---|---|---|---|---|---|
| Estimated AiF | 3 | 1.78 | 4.08 | 1.18 | 97.95 | 99.55 |
| GT AiF | 3 | 1.48 | 3.30 | 0.56 | 98.56 | 99.68 |
| Estimated AiF | 2 | 2.18 | 4.65 | 1.61 | 97.21 | 99.37 |
| GT AiF | 2 | 1.68 | 3.64 | 0.60 | 98.39 | 99.39 |
Depth Estimation
Depth estimation infers scene distance from images and sensors, enabling 3D reconstruction, navigation, and spatial understanding.
See all 198 papers