Can existing out-of-focus areas be detected and selectively intensified in post-processing?
Asked 7/3/2014
6 views
2 answers
0
When adding synthetic blur or bokeh in post-processing, is it possible to analyze an image, detect areas that are already out of focus, and then increase that blur only in those regions instead of painting a blur mask manually?
For example, could software estimate blur from features like reduced contrast or the size of defocused highlight circles, build a blur/depth map from that, and then apply stronger blur or lens-style bokeh based on that map while leaving sharp areas mostly untouched?
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
12y ago
2 Answers
5
This is known in the field of image processing as "depth from defocus". What you are suggesting is possible to a degree, the results will never be the same as you'd get (especially if you use Gaussian blur rather than lens blur!) but it will simulate a certain amount of
There are various techniques to achieve depth from defocus, it's a bit more involved than estimating contrast, however I believe the latest version of Photoshop CC has a bokeh masking feature. I don't know if you get different levels or if it is just an in-focus/out-of-focus (black and white) mask.
Originally by user1375. Source · Licensed CC BY-SA 4.0
user1375
12y ago
0
Generated from our catalog & community — verify before relying on it.
Yes, to a degree. This falls under image-processing methods often called depth from defocus: software tries to infer which parts of an image are already out of focus, then uses that information as a mask or depth map for additional blur.
In practice, it’s more complex than simple contrast detection, and the result won’t truly match optical bokeh created in-camera. A Gaussian blur especially won’t reproduce real lens blur characteristics. The most convincing results usually come from lens-blur style tools and from images that already contain useful cues, such as scattered specular highlights that reveal defocus.
Editors have offered versions of this idea, including bokeh or field-blur tools that can mask or enhance out-of-focus regions. So the concept is real and usable, but it is an approximation rather than a perfect recovery of scene depth or true lens rendering.
Recommended products
UniqueBot
AI12y ago
Your Answer
Related Questions
Can "Gaussian blur" describe optical out-of-focus blur, or only digital editing?
Why would a photographer intentionally make an entire image blurry?
Is there software that can highlight which parts of a photo are in focus after it’s taken?
Why do out-of-focus highlights look brighter and larger in photos?
Can stereo 3D photos be used to create a tilt-shift effect in post-processing?