Aligning RGB and Depth Kinect2


#1

Hi vvvvorum!
Anyone knows how to align the depth map and the colour map from kinect2? In old kinect and OpenNI drivers it was buid into Depth node. I want to use Kinect2 as simple “greenscreen” generator…


#2

not really working for fast moving objects
witch res u want depth or rgb
and u wanna do it urself or just a working code?


#3

antokhio, I don’t think I’m capable of coding it myself(no experience at all), so working code. With kinect2 drivers comes wpf demo of kinect “greenscreen”, and is fast enough for me for overlaying hd rgb on background using depth mask.


Kinect movebackground skeleton RGB
#4

… no text …

DepthToRgb.7z (1.8 kB)


#5

Antokhio! thank you. I will try it tomorrow!


#6

Antokhio! Working like a charm!. You 're right - rgb stream seems to be slower,more blurry, so I added echo to the mask. Not elegant way, but looks better…


#7

Thumbs up to vux ;] Nice to hear all good, if u need more help gonna be around here…


#8

Hi Antokhio! Is there an easy way to change playertexture to depthtexture, ie: to align depth to rgb, not player?
Texture2D ColorTexture : register(t0) : PREVIOUS;
Texture2D PlayerTexture : register(t1); <-------------depthtexture?
Texture2D DepthRGBMapTexture : register(t2);
G.


#9

hi, u gonna need more then that:
so line 25

return float4 (rgb.xyz,body)

“body” is player atm so u have on output vector for rgb color and u add player as alpha to it. So if u change player texture on depth map it’s not gonna help much since u gonna write it to alpha

do a copy of ur shader and change

float body = PlayerTexture.Sample(linearSampler,map).r;
return float4 (rgb.xyz,body);

to

float4 body = PlayerTexture.Sample(linearSampler,map);
return body;

that’s gonna give u back whatever texture u put in there aligned to color


RGBDepth (Kinect2)
#10

God bless you, Antokhio (and vux of course)! I just changed one additional parameter, defining filter result as r16g16b16a16 (no banding). BTW, is there a node to change to-from a8r8g8b8 or any other combination, as it was in an old dx9 texture?

filter_all_to_rgb (724 Bytes)


#11

To change the format you can use Renderer (DX11 TempTarget) … Check ChangeFormat (DX11.Texture 2d)


#12

You can also specify in the pass section, copy the text from the renderer formats eg

pass P1 <string format=“R16G16B16A16_Float”;>
{SetPixelShader(CompileShader(ps_4_0,PS()));}


#13

Great, thank you all!


#14

Kinect2, win8.1 x64, try the above nodes, but didn’t get the effect of the below! You have any Suggestions


#15


#16

Evan, I will send you some help files tomorrow…


#17

Evan, just unpack, and put “kinect_toolbox” folder into your x64 “packs” folder.
It’s little messy (in fact nodes are copies of kinect2 contribution- which is not necessary, plus some nodes added, hdface not working…). I’m using it without a problem with 33.7 x64. Your effect needs rgb and player combined. Have fun!

kinect toolbox (39.3 MB)


#18

rogalag!This problem I’ve struggled with for a long time! Try to use node fusion player and RGB blend! But there are RGB camera and depth camera distance deviation! How can I thank you, really thank you very much!


#19

you’re welcome!


#20

… no text …