We present a novel and practical algorithm for the self-detection problem of contamination or occlusions on the lens of a camera mounted on a vehicle. First, we analyze the intrinsic characteristics of such contamination on the video image. Based on this, cumulative differences are used to segment the static region in the image. A blurred edge detection algorithm based on wavelet decomposition is introduced to confirm if the static region belongs to contamination or an occlusion. Through the combination of these algorithms, contamination or occlusions can be detected. Experimental data are analyzed to show the detection performance of our algorithm and the effect of different contamination or occlusion material.