Resize sketch error

I don’t have an unit to test your code on. I think your cam could have a resolution that is different from your depth data. Can you check the documentation and confirm what is the resolution of your kinect RGB data and the resolution of the depth data? Or could you run these lines in draw():

println("Depth length is ", depth.length);
println("Cam size is ",cam.width, cam.height);

Kf