THz radiation can penetrate through many nonpolar dielectric materials and can be used for nondestructive/noninvasive sensing and imaging of targets under nonpolar, nonmetallic covers or containers. Thus using THz systems to "see through" concealing barriers (i.e. packaging, corrugated cardboard, clothing) has been proposed as a new security screening method. Objects that can be detected by THz include concealed weapons, explosives, and chemical agents under clothing. Passive THz imaging system can detect THz wave from human body without transmit any electromagnetic wave, and the suspicious objects will become visible because the THz wave is blocked by this items. We can find out whether or not someone is carrying dangerous objects through this image. In this paper, the THz image enhancement, segmentation and contour extraction algorithms were studied to achieve effective target image detection. First, the terahertz images are enhanced and their grayscales are stretched. Then we apply global threshold segmentation to extract the target, and finally the targets are marked on the image. Experimental results showed that the algorithm proposed in this paper can extract and mark targets effectively, so that people can identify suspicious objects under clothing quickly. The algorithm can significantly improve the usefulness of the terahertz security apparatus.