A recent study found that it is very difficult to use the squared binary defocusing technique to eliminate the influence of third-order harmonics without compromising fringe quality, and thus it is challenging to utilize Fourier transform profilometry to achieve high-quality three-dimensional measurement. A novel approach is presented to effectively eliminate the third-order harmonics by modulating the squared binary structured patterns. Both simulation and experiments are presented to verify the performance of the proposed technique.