If you are using the RealSense SDK in Windows then you could use this instruction to project world coordinates to the depth coordinates:
Or use this instruction to project depth coordinates to the world coordinates.
You can set your stream to 640x480 resolution with:
sm->EnableStream(PXCCapture::STREAM_TYPE_COLOR, 640, 480, 30);
The values 640, 480 of course refer to a resolution of 640x480, whilst the third value in the sequence (30) sets the FPS of the stream.
Below is a discussion that has a script for ProjectDepthToCamera that has headers in it. This may be a useful guide.
If you are using the Librealsense SDK instead of the RealSense SDK then you could use this instruction: