Retrievals of atmospheric variables on the gas giants from ground-based mid-infrared imaging