Description:
At this point we have a total of 20 images (the normal image and the inverse) of the object on which we projected the different width stripes. Here are two samples:

The first task is to find the coordinates of the stripe boundaries in the camera frame of reference. That is done by subtracting the normal and the inverse images and looking at the sign changes in the intensity of each pixel. The zero-crossings represent the boundary points. Here is an example of the recovered points:

The next task is to identify the x-coordinate for each of the above points in the projector frame of reference. This is where we need the stripes of different widths. For each point we look it up in all the images and associate 1 to it if it is on a white stripe and 0 if it is on a blcak stripe. There are 10 images, so we obtain a 10-bit GREY CODE, that we will convert to a decimal number. This number represents the x-coordinate in the projector frame of reference, if we add 0.5 to it, because we consider a boundary falling in between two pixels. Here is a sample:

All the coordinates of the points are saved and used at the next step: the triangulation.
Code:
Comments:
In the recovery of the boundaries of the stripes, one can look only at the finest stripes and recover those points only, or the approach that I chose was to recover the boundaries from all the images and use all those points. Actually the Matlab program that I wrote is interactive and lets you choose from how many pictures to extract the boundaries. I found that using more pictures, i.e. more points, has the advantage of getting more data and the disadvantage of getting more noise. If further you can get rid of the noise and this is what I do, then extracting more points is justified. There was also a claim that if you get the points from all the boundaries, then the mesh will be very wavy. The solution to that is to use a low pass filter in order to smooth the mesh.
In the recovery of the coordinates of the points there is a lot of noise because of some points that are considered on a wrong stripe due to the resolution of the camera and the accuracy of the projector stripes. This is fixed by adding at the end of the program a procedure to get rid of the noisy points. The image of the points is plotted and the user must select only the region of the graph that is considered acceptable. This way most of the noisy points are gone and they do not get to be triangulated. This helps a lot in decrasing the processing time for creating the mesh. The mesh would get rid of those points anyway, but it is better to do it here, as the mesh creation has a lot of valid points to deal with and it is not a good idea to have it worry about noise, too.
The number of points considered valid after this procedure was about 33,000.