In this paper, the analysis of the measurement errors in an optical sensor for the achievement of 3D range images is presented together with the procedures developed for their compensation. The optical sensor performs the 3D measurement by means of the active stereo vision approach in which the correspondence problem is solved by means of the projection of structured light, basically consisting of patterns of fringes with rectangular profile. Two measurement errors have been identified: the former, thereafter called 'waviness,' is intrinsic to the rectangular profile of the fringes. This error has been dramatically reduced by means of a filtering block, based on a cascade of two Butterworth low-pass IIR filters. The latter, thereafter called 'slope,' is due to the crossed axes optical geometry of the system, which results into a stripe broadening of the projected fringes. The compensation of this error has been achieved by taking into account the orientation of the optical devices of the system and by mapping light directions into measurement coordinates. In this paper, the main features of the procedures developed to minimize these errors are presented and some interesting experimental results are shown.