An Image Defogging Approach Based on a Constrained Energy Functional under Bayesian and Variation Theories