Projector calibration is one of the most essential steps for structured light systems. Some methods have high precision but require a complicated calibration procedure, such as the method based on phase-shifting. Other methods take advantage of simple implementation but cannot meet the accuracy requirement, for example, the method based on homography. In this paper, we proposed a compensation method for flexible and accurate projector calibration. To make the calibration procedure easy to operate, the homographic matrix between the projector and camera is established through feature points projected. Then, the 2D image points compensation method based on the re-projection error iteration algorithm was carried out, and a modified bundle adjustment (BA) algorithm is put forward to refine the calibration parameters of the system. Finally, the feature point reconstruction experiment is implemented to verify the high flexibility and accuracy performance of the proposed method.