Detecting blurred or out of focus situation


Im using openmv camera to do some image comparsion, so far system works great, but sometimes system need to make a new reference image.
And if the covering glass is dirty, dusty os something else, system will make non usable reference image but does not know it. So and now im searching a way to detect any dirt on cover glass.
Any ideas how to do it?

Depends on how big the dirt is… edge detection filters + thresholding can see it sometimes. What’s an image look like with dirt?


sorry for long pause.
Dirt is always caused by some oil. The device i’ll try to check is big heater, it is safety device to prevent starting heating process when it founds something more than allowed details.
Camera case has a protection glass and during heating process we found some times that it is covered with oil, camera sees it like blob. It is out of focus, very soft edged totally blurred area.
Main goal is detect those blobs, so the system can warn operator that covering glass needs to clean.

you must send a good picture and a bad one so to understand and maybe we can help then…

Yep, i will make these pictures.