Ask Your Question

Revision history [back]

It is not possible int the all situation.If your picture is in specific situation (maximum distance form camera & type of picture) you can compute it. For compute sharpness in the whole image you can use this post.If you want compute regions of focus & out of focus convert code to blockwise or adaptive.

It is not possible int the all situation.If your picture is in specific situation (maximum distance form camera & type of picture) you can compute it. it.

For compute sharpness in the whole image you can use this post.If you want compute regions of focus & out of focus convert the code to blockwise or adaptive.adaptive method.

In the adaptive method,compute focus for each point with gradient of neighbors by gaussian distribution.In the finally separate result by threshold.