Can software auto-detect image focus?

by Andrey   Last Updated July 19, 2018 19:18 PM - source

I was wondering if there was any photo management software out there that could auto detect and "rate" images on how in focus they are. This comes up for me quite commonly when i am looking through a large series of macro images of the same subject.
In a perfect world, light room (or whatever program) could highlight in focus and out of focus ares the same way that it detects burned out areas of an image. Also the algorithm i am hoping exists would be smart and would not be detracted by blurred backgrounds and only seeks that some sufficient area is in enough focus.
Anything like that out there?

As another thought for people talking about pictures being in focus on the wrong spot, and that camera focus models already look into this. Another large factor for a lack of clarity in a macro image is blur from camera movement. This damages all points on an image, and is not something the camera accounted for when focusing.

Answers 5

What you are asking for is problematic in the sense that a software based focus detection will essentially use the same algorithm as a contrast based camera autofocus system uses. That means that you need to scan the image and look for the most contrasty place to determine the amount of "focusness". However, it is possible you were shooting a low-detail (low-contrast) subject, so even though your focus is spot-on your target, still the software algorithm will determine a low focus or out-of-focus image.

Additionally, how will the software know what was your actual intended focus point? If you're shooting a portrait, and the eyes are mis-focused, the software will detect perfect focus on the ear, but this really is a low-quality or unusable image.

January 20, 2011 22:44 PM

As a human, I would rather rate them myself with my subjective observation, seeing as I know where the focus should or shouldn't have been, but I suppose there could be a rough way to determine the focus quality of a shot based on the aperture, focal length, subject distance and focus/unfocused areas of the image.

For example, long focal length, small aperture, close subject means there is likely to be a small point of focus with a lot of bokeh (for common applications of this recipe).

On the other hand, short focal length with a longer subject distance means there's likely to be more in focus areas than out of focus areas (think landscape or group shot).

I guess the most important thing in any photo is, wherever the most focused area of a photo is, it's in focus. This simple "is the most focused point in focus" check would be one I could possibly use as there's most commonly no point in using an out of focus or back-focused shot unless you think it will work.

Nick Bedford
Nick Bedford
January 20, 2011 22:54 PM

It's an interesting question. It's certainly possible for software to detect the parts of an image that is in focus, as it's the basis for focus-stacking software like Helicon Focus.

Focus stacking is a technique used by macro photographers. The depth of field in many macro shots is very shallow, so to extend this it's possible to take a set of photos of the subject, modifying the focal point in each one. Helicon Focus takes the stack of photos and detects the most in-focus parts of each image, and blends them together to produce a result where the entire subject is in focus. It's also possible to do this with some of the technology behind Hugin, but it's a bit more tricky to set up.

I think the difficulty in extending this for a general "in focus" check would be determining whether the subject is in focus - how do we automatically determine what the subject is? How much depth of field was required by the photographer?

Maynard Case
Maynard Case
January 21, 2011 11:20 AM

Capture 1 maybe what you need!

Jorge Tavares
Jorge Tavares
January 26, 2016 15:43 PM

I want long view photo or vehicles number plate number clarity app or software download opption

Senthil anbu
Senthil anbu
July 19, 2018 18:42 PM

Related Questions

Remove or reduce blur in an image

Updated March 26, 2016 08:07 AM