Efficient Inference of Continuous Markov Random Fields with Polynomial Potentials