% This function mxNiRealWorld2Pixel, takes an array of real-world coordinates (XYZ, mm)
% and projects them into projected (image) coordinates (xy)
%
% xy = mxNiRealWorld2Pixel(KinectHandles, XYZ);
%
% inputs,
% KinectHandles : Array with pointers to kinect node objects generated by
% mxNiCreateContext, such as main, image, IR, Depth and User node.
% XYZ: A Matrix of type double with size [N,3]
%
% outputs,
% xy : A Matrix of type double with size [3,N], where the first two row are
% the x and y coordinates.
%
%
% See also mxNiDepth, mxNiCreateContext, mxNiUpdateContext, mxNiPhoto,
% mxNiInfrared, mxNiSkeleton, mxNiDeleteContext
%
% Mex-Wrapper is written by Babak Taati (Oct 2011), based on D.Kroon's OpenNI
% wrapper on File Exchange, found here:
% http://www.mathworks.com/matlabcentral/fileexchange/30242-kinect-matlab
%
% to build, place the cpp file in the Mex folder of D.Kroon's wrapper and rerun
% his 'compile_cpp_files'