Robust higher order potentials for enforcing label consistency