Skip to content

Using OpenCV to add a depth-of-field bokeh effect to 3D scenes rendered by OpenGL. Uses some optimizations and tricks such as dividing the Z-axis into slices that get coarser the further they are from focus, and some faux HDR by spreading very bight points more.

Notifications You must be signed in to change notification settings

akakikuumeri/OpenCV-bokeh

Repository files navigation

OpenCV-bokeh

Using OpenCV to add a depth-of-field bokeh effect to 3D scenes rendered by OpenGL. Uses some optimizations and tricks such as dividing the Z-axis into slices that get coarser the further they are from focus, and some faux HDR by spreading very bight points more.

##Demo example1

example2

##Behind the scenes Here is the plain render of the scene, and a sample of the depth buffer.

example3

The program slices the image into different depths based on the pixel information in the depth buffer, and applies variable blur to different depths. Optionally, very bright spots can be blurred more to achieve a more natural effect.

About

Using OpenCV to add a depth-of-field bokeh effect to 3D scenes rendered by OpenGL. Uses some optimizations and tricks such as dividing the Z-axis into slices that get coarser the further they are from focus, and some faux HDR by spreading very bight points more.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published