A Markov random field approach to spatio-temporal contextual image classification