1. A method implemented by a computing device, the method comprising: extracting feature maps from a hazy image of a scene, each of the feature maps conveying information about visual characteristics of the scene captured in the hazy image; computing portions of light that are not scattered by atmosphere and are captured from the scene to produce the hazy image, including using a trained model that derives the portions of light based on the visual characteristics conveyed by the feature maps; ascertaining, based on at least one of the feature maps, airlight of the hazy image that represents constant light of the scene; and generating a dehazed image from the hazy image using the computed portions of light and the calculated airlight.