Tuesday, September 13, 2016

Shallow Depth-of-Field Generator 11 (SDOFG11)

SDOFG11 simulates a shallow depth-of-field lens effect, commonly seen in macro photography. Because the depth-of-field of modern cameras is quite deep (everything in an image looks quite in focus), it is often necessary (long after the picture was taken) to blur areas of an image that were not meant to be in focus. The shallow depth-of-field lens effect is commonly used to give the impression that objects that are large in real life appear small in the processed image. This effect is commonly known as "miniature faking", "diorama effect", or "tilt-shift photography". In Japan, it's called "bokeh" although "bokeh" implies a special treatment is given to highlights.

The manual for SDOFG11 is in the "ugosoft3d-11-x64.rar" archive. It thoroughly explains the parameters that are needed to run SDOFG11 via the input file "sdofg11_input.txt".


Image for which we want to generate a shallow depth-of-field version. This image comes from the Middlebury stereo database and is called "Dolls".


Depth map (ground-truth) for "Dolls".


Shallow depth-of-field version of the image obtained by SDOFG11.

The windows executable (guaranteed to be virus free) is available for free via the 3D Software Page.

8 comments:

  1. Hi,

    Impressive synthetic bokeh effect !
    Can you explain the main idea of the algorithm used to generate this blurred image ?
    (or may be point some related papers that you found out on the subject).

    Thanks!

    ReplyDelete
    Replies
    1. it's real easy. You just apply a Gaussian filter where the sigma (in the Gaussian filter formula) depends on how far in depth you are from the focus plane. The further in depth from the focus plane, the larger the sigma and the larger the blurring. True bokeh is a little bit more involved since highlights are treated differently from anything else.

      Delete
  2. I see, thanks for the info.

    I have another questions :) . In one of your previous post,
    you provided a good overview of the The paper from Jon Barron (Fast Bilateral-Space Stereo for Synthetic Defocus).
    Do you know what is the algorithm used for the blurring part ?

    Thanks !

    ReplyDelete
    Replies
    1. You mean the blurring part for the defocusing? He's using a disc blur instead of a Gaussian blur. Check section 6. "Rendering" of the supplemental of his paper https://people.eecs.berkeley.edu/~barron/BarronCVPR2015_supp.pdf

      Delete
  3. Hi, it doesn't work on my computer, I have windows 7...when I run the sdofg11 application, it crashes. Is there a solution? Thanks.

    ReplyDelete
    Replies
    1. Make sure to read sdofg11_manual.pdf. If it still doesn't work, please send me your sdofg11.bat and yout sdofg11_input.txt. Also, it would be nice to copy/paste the output from the program. Thanks.

      Delete
  4. Hi Ugo, I am looking for a way to create a 3D mesh from a depth map created from one single image. What I am trying to do is create more accurate actual 3D elements of military uniforms, mainly the various badges, medals, rank or insignia so that when I create the uniform itself on a 3D character the various elements will have a normal or bump map that accurately shows depth, but I would also like to use the meshes created to be able to have a starting point to create actual 3D files of these badges, etc. to create .STL or other files that can be used to drive a CNC router to recreate these in wood or other CNC carveable materials. Any help or suggestions on which of your many application might be able to do what I want with a minimum of fuss, (since there's so many different badges, etc. between various military branches/Countries), I would be extremely thankful, for I am a disabled Veteran and I want to create something that other Veterans can obtain to create those emblems that represent their own personal military service.

    ReplyDelete
    Replies
    1. I think free software like Blender might be able to do what you want. But it's a steep learning curve to learn Blender.

      Delete