【问题标题】:How do QGIS preprocess the image, why they looks so beautiful?QGIS如何预处理图像,为什么它们看起来如此美丽?
【发布时间】:2021-07-11 02:16:28
【问题描述】:

刚接触卫星图像,发现了一些奇怪的东西。 光栅打开的卫星图像(仅限3通道,rgb)是这样的。

但是我用QGIS打开的图片(直接拖拽,不设置任何参数)是这样的。

幕后的算法是什么?是否可以直接使用 QGIS 对图像进行批处理?并在图像上应用“使用当前范围进行拉伸”。

谢谢

【问题讨论】:

    标签: qgis satellite-image


    【解决方案1】:

    找出我认为的答案,就是最小-最大拉伸+百分位数

    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)
    

    查看这个小部件后弄清楚这一点

    【讨论】:

      猜你喜欢
      • 2010-12-08
      • 1970-01-01
      • 1970-01-01
      • 2014-02-12
      • 1970-01-01
      • 2022-01-18
      • 2016-08-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多