Jump to content
Justin K

3d Volume from Image?

Recommended Posts

Hello, 

Is it possible to generate a 3d volume with depth from an incoming image?  Request is to convert a figure from an image into a cloud like structure, and Im trying to figure out an intuitive way to do this.  

Currently Ive just manged to take an image mapped to the uv coordinates of a piece, scatter points based on the color, and then create a volume from that, but that is all i have so for.  

My thought was to perhaps deform the geo based on the luminance values of the image so as to give it more depth, but overall Im not really sure how to approach this.

Ive attached a pic and the current scene file. 

Any tips would be appreciated.  Thank you!  

 

image2cloud_testing.hiplc

Screen Shot 2019-03-20 at 4.31.48 PM.png

Share this post


Link to post
Share on other sites

Hi Justin, in order to fill a voxel field with image pixels put this code in a volumewrangle after a volume node:

vector bbox = relbbox(0, v@P);
vector map = colormap(chs('image'), bbox.x, bbox.y);
f@density = luminance(map);

 

  • Like 1

Share this post


Link to post
Share on other sites

Creating geometry beforehand is not a bad idea, because it lets you tweak otherwise hard to control process.

Do you have a depth for you image? (from a render or stereo camera, or the challange is to create an illusion of such?). 

In case you want to go right from pixels to voxels and you have some depth channel, the example uses Houdini's render  with P-plane, which holds depth in (RG)B channel. Anyhow it's just a gray image after all...

volume_from_depth.hipnc

ezgif.com-crop.gif

btw: 

 

  • Like 3

Share this post


Link to post
Share on other sites
14 hours ago, konstantin magnus said:

Hi Justin, in order to fill a voxel field with image pixels put this code in a volumewrangle after a volume node:


vector bbox = relbbox(0, v@P);
vector map = colormap(chs('image'), bbox.x, bbox.y);
f@density = luminance(map);

 

Thank you Konstantin,! 

Implementing this code this morning.  

Share this post


Link to post
Share on other sites

 

Thank you as well Szymon,  

Taking a look at your file as well.  Unfortunately we do not have depth from the image.  As you questioned, that is the challenge here.  And I agree with you completely, having some sort of geo should help.  

Im gonna see what happens applying Konstantin's code to a premade 3d cloud volume and see what i get. 

What we might try--is to generate some real proxy geo of the image, project the image onto the geo as a texture, convert that into a volume, and drive both the color and the density of the volume with the color from the point or vertex level.   Maybe?  Lol

Thank you both.  Ill post here again with a file if I have any success.

 

Cheers,

JK

Share this post


Link to post
Share on other sites

Just as an update on this--we have killed the project.  The image we were given did not relay itself well to the concept itself-- it was an image of a man comped against a sky to begin with.  If we were to do this in the future, we would generate some 3d geometry to help the cause.  Szymon your heads up on the depth matte from image software is a really great thing to keep in mind though.  Thanks for the tips both of you.  

Best, 

JK

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×