function points3D = exampleHelperExtract3DPointsFromDepthimage(depthimage,K)
len = size(depthimage,1)*size(depthimage,2);
aa = 1:size(depthimage,2);
bb = (1:size(depthimage,1))';
xa = repmat(aa,size(depthimage,1),1);
xb = repmat(bb,1,size(depthimage,2));
depthimage = double(depthimage)/5000;
x = ((xa - K(1,3)).* depthimage )/ K(1,1);
y = ((xb - K(2,3)).* depthimage )/ K(2,2);
x = x((1:len)');
y = y((1:len)');
depthimage = depthimage((1:len)');
points3D = [x,y,depthimage];
end