ZDefocus plugin
devernay opened this issue · comments
inputs are:
- a depth or disparity map
- an image
parameters are:
- boolean: is it depth or disparity?
- boolean: is the focus distance set using a point interact or a scalar value?
- double2D: point interact (disabled if focus is set using a value)
- double: focus distance
- depth of focus
- number of focus slices
- apperture shape (Gaussian apperture uses a fast blur)
Algorithm: create masks for each focus slice, blur premultiplied image+mask with the right blur radius (using convolve, for a nice bokeh effect), and merge over successively each blurred image from far to near focus slices, to handle occlusions correctly.
In draft mode, always use Gaussian blur