Description:
After we computed the 2D coordinates of the points in the camera image (xc, yc) and in the projector image (xp, yp cannot be determined from the images and it is not needed for triangulation), we can start determining the 3D coordinates of the points, by the means of triangulation. We also need the parameters determined in the calibration procedure (R, T the transformation between the camera coordinates and projector coordinates and the intrinsic parameters of the two devices: c, f, k). The details of the method consist of pure matrix algebra.
Code:
Results:

With this cloud of 3D points we can proceed to create the mesh.
Comments:
As it can be seen in the images above, after triangulation we still get some noisy points. This is because the procedure to get rid of the noise at the previous step was not 100% effective, due to the fact that a square is selected as valid range, but our object occupies only part of the square, so there are points left that are not part of the object. This is fixed by adding an editor at the end of the program, in order to get rid of the noise.
Special care should be taken at the next step, the mesh generation, to smooth the noisy points, otherwise the mesh will have serious spikes.