In focal stack, if an area is not focused, it will look fussy. It’s like the area is convolved by a Gaussian filter.
In this method, we determined the depth of an area by calculating the local STD of an area around each point. Then we continued to calculate the STD of that point in all the images from the focal stack. The largest STD would correspond to the most focused image.
We ranked the images from focal stack in a way from near-focused to far-focused so that once we knew the corresponding relation of an image with the area, we would know the relative depth of the area. The result is shown in fig. 1.