In practical motion target detection, there always meet with the interference of background, such as a rainy day. Some of the original mo-tion target detection algorithms cannot be directly used to solve the problem. Analyzes the characteristics of the rainy scenario, and through dynamic background modeling background, and describes the selection of the longest length to the stability of the pixels. Wishes it can provide data support for motion target detection under the rainy scenario.