Choosing the parameters of the MRF model for motion detection