Open devernay opened 6 years ago
I think this kind of easy conversion can be done using a guided bilateral filter: generate a vertical ramp (or a gradient that looks roughly like image depth for your scene), and then apply a bilateral filter to this ramp with a very large sigma_position, guided by the intensity image, so that pixels of the same color that are close enough get roughly the same depth. From the images I see on that web site, this certainly works this way. For now, the bilateral filter in Natron doesn't accept an external guide, but this may be changed in the future, making this kind of effect possible. And at least you understand what's inside! It's not a black box that says 'convert 2D to 3D'.
From @blackearth2014 on November 26, 2014 20:9
Thanks. I will try this tonight.
From @sozap on November 27, 2014 14:34
thanks for the tips ! I've tried it in blender and it works . I would never thougth of that trick by myself !
If that trick (ramp + guided bilateral) works, do you think It should be i tegrated as a single node (or maybe a pyplug)?
From @blackearth2014 on July 22, 2015 14:41
I didn't get it to work. Maybe I was doing something wrong. A pynode should be sufficient.
From @sozap on May 21, 2016 12:23
the thing is, that depending on the image you want to convert depth to, the gradient need to be different. Also you may want to add masks, or tweak the grayscale image very differently. So it's difficult to think of a general pyplug that can do the job on most cases. Maybe that trick can be explain on a Natron Cookbook wiki next to the documentation, with cool tips and tricks were users can learn more on what to do with nodes rather that what nodes do...
From @blackearth2014 on November 26, 2014 3:17
Will it be possible to get a depth tool node when the Deep Data Nodes get developed. I want to covert a 2d image into a depth map greyscale. Silhouettefx has this ability. You can see an example at http://www.silhouettefx.com/ under the S3D tab.
Copied from original issue: MrKepzie/Natron#332