A systematic static shadow detection algorithm for color images is presented in this paper. The image is modeled by an undirected graph and the shadow detection is achieved through maximizing the graph probability using the EM algorithm. Further analysis shows the connection between our model and the relaxation labeling (RL) model. Experiments clearly indicate that our method is superior to a state-of-the-art shadow detection algorithm.