Spatial resolution and spectral contrast are two major bottlenecks for non-destructive testing of complex samples with current imaging technologies. We use a three-dimensional terahertz (THz) imaging system to obtain the internal structure of the sample, and exploit the wavelet transform algorithm to improve the spatial resolution and the spectral contrast. With this method, the longitudinal resolution of terahertz imaging system can be improved to the wavelength comparable thickness, while the x-y plane resolution can be as high as 0.2 mm0.2 mm, which benefits from the point-to-point scanning on the x-y plane. In this three-dimensional terahertz imaging system, the Syn View Head 300 with light source/detector frequency of 0.3 THz is used for two-dimensional scanning (x-y direction) of the sample, and the linear frequency modulated continuous wave technique is used to obtain the reflected terahertz light intensity at different depths (z axis) of the sample. When the sample is thin, the upper and lower interface reflection peaks are difficult to distinguish due to broad peak width of the THz source. To solve this problem efficiently, continuous wavelet transform (CWT) is used. In recent years, CWT is applied widely because of its particular mathematical properties in the feature signal recognition. Since the Gaus2 wavelet basis is better to highlight the peak signal, we choose it for CWT. After CWT, one scale of the wavelet coefficients is chosen for three-dimensional data reconstruction, for which the widths of the reflection peaks are narrower and the noise signals are weaker. That means if we reconstruct the three-dimensional wavelet coefficient data on the chosen scale, the three-dimensional image of the tested sample will be enhanced. In order to demonstrate that, the three-dimensional images reconstructed by wavelet coefficients are compared with those by original data. The tested sample has holes inside with different depths. Based on the original three-dimensional THz image, it is hard to locate the top of 4 mm deep hole (1 mm deep photosensitive material plate), while the top of the inner 4 mm deep holes (the bottom of the 1 mm deep photosensitive material plate) can be distinctly located and the noises are greatly reduced based on the three-dimensional images reconstructed by wavelet coefficients. With this method, the longitudinal resolution of terahertz detection systems can be improved to 1 mm that is comparable to the wavelength, which demonstrates advantages of this method.