Open eboyda opened 6 years ago
I can't remember what resolved the original issue, but suffice it to say that the img.geotiff() method has been functioning in the code base for months now, at least since the big rewrite of the grabbing tools around Christmas 2018. However, as stated in the DG docs, the dtype kwarg only works for WorldView images - and in fact, calling img.geotiff(... dtype='uint16'... ) often (always?) yields float32 images even for WorldView sensors.
Across all sensors, images come either as float32 with a uint16-like value range or as uint16. I have observed pixel values larger than 2^14, but not larger than 2^16, and generally the histogram is concentrated in the first twelve bits. Therefore we can simply cast everything to uint16 to get a consistent format for DG images. This is handled in DGImageGrabber._ensure_uint16().
Geotiff headers come back correct. Images are almost purely black (pixel values <~ 24 out of uint16 possible values) and cannot be opened with pillow tif utilities (though they can be with cv2).