In automatic visual surveillance, moving target extraction and shadow depression are prerequisites for higher level image processing steps such as target tracking and scene understanding. In this paper, we present effective techniques to detect pixels of moving targets in a scene and pixels of their shadows. The foreground is extracted by adaptive background subtraction. Incomplete detection problem, which often occurs due to color or occlusion, is solved by blob merging. Shadow pixels are detected by comparing the color values of foreground pixels with those of corresponding background pixels using either a color transition model or a neural network. Techniques proposed showed high shadow detection rates in experiments with real images.