So the Kinect v2 has a color stream of 1920 x 1080. The depth stream is 512 x 424. The FOV is also different from what I can tell. I tried to resize both streams to 500 x 500 (the size of my canvas).
Data from here.
if (img.width >= img.height)
{
float w = img.width*height/img.height - width;
image(img, 0 - w/2, 0, img.width*height/img.height, height);
}
else
{
float h = img.height*width/img.width - height;
image(img, 0, 0 - h/2, width, img.height*width/img.width);
}
However, even when centering the images, they still do not match correctly. One seems a little wider which could be from the FOV. Any suggestions on how to match the color and depth images as close as I can?