Test-time Adaptation Meets Image Enhancement: Improving Accuracy via Uncertainty-aware Logit Switching