A probabilistic model for visual perception