How to detect when an image is out of focus? -


at times our optical inspection system gets out of focus results in nonsensical measurements. i've been tasked develop 'out of focus' detector used drive z axis of camera system. images available me bmp.

i'm looking approaches , algorithms investigate. instance, should isolating features , measuring conformance or edge detection used?

this in focus image:

in focus


, out of focus image:

out of focus

the key in-focus image has more strong gradients , sharp features. suggest apply gaussian laplace filter , @ distribution of pixel values of result. plot below shows application of idea images, black refers out of focus image, , red 1 in focus. in-focus 1 has more high values (because image has more sharp gradients).

when have histograms, can distinguish 1 comparing e.g. 90%th percentiles of distributions (which sensitive tails). out of focus image 7 , in-focus image 13.6 (so twice difference).

enter image description here


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -