Auto focus on different images

Viewed 55

I have some images of a fluidic system taken from a camera at different focuses.

How can i decide in which focus I have the best images? Which features of image do i have to look at? Is there a measurement of sharpness on different images?

Example image1

enter image description here

Example image2

enter image description here

Every image is different from each other.

Thanks.

1 Answers

Despite the fact your examples demonstrate clear difference between "good" and "bad" quality images you can use a simple edge detection filter to make the difference obvious.

This approach literally highlights depth of field (DOF):

enter image description here (see in action)

Let's apply to your examples:

example 1

enter image description here

example 2

enter image description here

Even a simple thresholding technique will provide a proper result.

Related