According to the background, we divide motion detection into two categories: the detection under static background (static camera) and the detection under moving background (moving camera). The motion detection algorithm under a moving camera is more complex than that under a static camera due to the mixture of the motions of target and background. We propose a spatiotemporal image edge analysis method (STIEA) for motion detection under a pan-tilt (PT) camera. First, we obtain the spatiotemporal image (STI) by extracting the corresponding rows from each frame and displaying them one above another after motion estimation. Subsequently, the distribution characteristic (the slope of each edge) of STI is further analyzed theoretically. Overall, the pixels with the same gray value in STI are almost distributed in the same line (linear characteristic). Based on this characteristic, we cluster the edges and detect the abnormal edges. The moving objects exist in the columns with abnormal edges. In addition, the influence of parallax on edges slope is also analyzed. Finally, our method is compared with several existing algorithms. The experimental results demonstrate that our algorithm performs better than others in various scenarios, which provides a unique thought for motion detection under a PT camera.