add a custom point attribute to a grid from pixel values

   4367   5   2
User Avatar
Member
6 posts
Joined: Aug. 2016
Offline
Hello,

I have a mono channel depth image coming from a Kinect (512x424 pixels).

I created a 512x424 grid.

I want to add a custom attribute “kinect” to each point of the grid where “kinect” is the value of the “corresponding pixel” (same row, same column).

I try to use pointwrangle and write something like :
@kinect = @pixel.r;

But I have no idea how :
- connect the COP output as the second input ?
- how to get the pixel value in VEX (I am aware that @pixel.r is “pseucode” VEX) ?

I'd rather avoid uvtexture or something similar in order to avoid any filtering (I need a perfect 1 to 1 mapping between pixels and points).

Thank you for any help or clue possible :-)
Nicolas.
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
Hi
Try the “Attribute from Map” SOP node. And set “Export attribute” to “kinect”

-b
http://www.racecar.no [www.racecar.no]
User Avatar
Member
6 posts
Joined: Aug. 2016
Offline
Hi

Thanks a lot, it looks like it does the job :-)

I feel I just need to be carefull with all the options to avoid any resampling or post process.

Just in case, this is waht I did :

In Color settings :
- Source Color Space = Linear
- Do Remap = false

Filter Settings :
- Filter = Point

if somebody thinks I messed up with the parameters, you're very welcome to let me know.

Thanks again Bonsak,
Nicolas.
User Avatar
Member
6 posts
Joined: Aug. 2016
Offline
Sorry I forgot, is there a way to link the “Texture Map” channel to a COP net output instead of an external file ? Because I did not manage to do it.

I'd like to process the image in Houdini before applying the attribute (to create a threshold for instance)

Thanks,
Nicolas.
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
You can set “Texture map” to
op:/img/YOUR_COMP_NAME/YOUR_OUTPUTNODE

-b
Edited by bonsak - Aug. 10, 2016 10:59:01

Attachments:
from-cop.hip (162.8 KB)

http://www.racecar.no [www.racecar.no]
User Avatar
Member
6 posts
Joined: Aug. 2016
Offline
Thank you Bonsak :-)
  • Quick Links