Difference between focus and out of focus images.

19 views (last 30 days)
Hello everyone.
I have a stack of images and I am trying to find which of those are in focus and which of those are out of focus?
How can I do this?
thanks

Accepted Answer

Image Analyst
Image Analyst on 26 Nov 2014
You can use contrast detection. See http://en.wikipedia.org/wiki/Autofocus
Or you can take the FFT and sum up the higher frequencies.
Or you can call stdfilt() or imgradient() and take the mean of the output image, the thought being that the in focus image will have more edges and thus the mean will be higher.

More Answers (0)

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!