We propose a flexible technique to easily calibrate a structured light system, in which only two patterns are required: a paper checkerboard printed on a laser printer and attached to a surface plane, and a pattern image of a checkerboard, which is projected on the surface plane by a LCD projector. We treat the projector as a second camera; then the problem of calibrating the structure light system becomes equivalent to calibrating a stereovision system. The key to our technique is to make the projector able to see the calibration checkerboard like a camera. For that purpose, two approaches are proposed, called the black-and-white checkerboard method and the red-and-blue checkerboard method. Both computer simulation and real data are used to test the proposed technique, and very good results are obtained.