New to the satellite image and found something weird. The satellite image(3 channels only, rgb) open by the rasterio looks like this.
But the image I open by the QGIS(just drag and drop, without setting any parameters) looks like this.
What are the algorithms behind the scene? Is is possible to use QGIS directly to perform batch processing on the images? And apply "stretch using current extent" on the image.
Thanks
Find out the answer I think, it is just min-max stretching + percentile
def stretch_to_min_max(img):
min_percent = 2 # Low percentile
max_percent = 98 # High percentile
lo, hi = np.percentile(img, (min_percent, max_percent))
res_img = (img.astype(float) - lo) / (hi-lo)
return np.maximum(np.minimum(res_img*255, 255), 0).astype(np.uint8)
Figure this out after look at this widget