codegaj / py_pansharpening

Rewrite some pansharpening methods with python
MIT License
121 stars 34 forks source link

MS数据 #12

Closed sxdeivm closed 2 years ago

sxdeivm commented 2 years ago

请问多光谱图像是如何制作的?非常感谢您的回答。

codegaj commented 2 years ago

您好,不好意思因为最近很忙一直没有回复。我没有太搞懂您的意思,卫星一般带有两个载荷一个PAN相机一个多光谱相机,可以直接获取多光谱图像。在这个包的demo_all_methods.py中,我们下采样原始多光谱图像作为算法输入,从而原始多光谱图像可以作为gt来评估各种方法。希望可以帮到您

sxdeivm commented 2 years ago

对,但是我下采样融合之后的结果很模糊,而且没有颜色只是黑白的图像,请问这是怎么回事呢?

sxdeivm commented 2 years ago

而且多光谱图像的.npy文件数组中的数据都是1或0, image 感谢您的回答!

codegaj commented 2 years ago

是不是您输入数据类型的问题呢,光看这些看不出问题所在,可以展示下融合图像和原始输入图像

sxdeivm commented 2 years ago

分别为融合图像、全色图像和多光谱图像

------------------ 原始邮件 ------------------ 发件人: "codegaj/py_pansharpening" @.>; 发送时间: 2022年2月13日(星期天) 中午1:03 @.>; @.**@.>; 主题: Re: [codegaj/py_pansharpening] MS数据 (Issue #12)

是不是您输入数据类型的问题呢,光看这些看不出问题所在,可以展示下融合图像和原始输入图像

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

codegaj commented 2 years ago

如果可以,把你的图像发到我邮箱吧,我来帮你跑下看看!anjing_guo@hnu.edu.cn

sxdeivm commented 2 years ago

------------------ 原始邮件 ------------------ 发件人: "codegaj/py_pansharpening" @.>; 发送时间: 2022年2月13日(星期天) 中午1:31 @.>; @.**@.>; 主题: Re: [codegaj/py_pansharpening] MS数据 (Issue #12)

我这边看不到,不好意思

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

从QQ邮箱发来的超大附件

GF22-pan.tif (30.55M, 无限期)进入下载页面:http://mail.qq.com/cgi-bin/ftnExs_download?k=27666433195e22c99c75b53f1164071800555351540254514b04520105490103510249510f55561a565652010f00560307075102376835702054561e47055b19120f02330a&t=exs_ftn_download&code=ffd37d57

GF22-ms.tif (7.64M, 无限期)进入下载页面:http://mail.qq.com/cgi-bin/ftnExs_download?k=77393738ecafb6cbcd2ae6341462011b0508025b060156061a0b520e564f075253581a0154010b19560d0e5b06535605020b530a32693373710b05155f111d405e5f3705&t=exs_ftn_download&code=79782b34

sxdeivm commented 2 years ago

感谢感谢,已经发过去了。

------------------ 原始邮件 ------------------ 发件人: "codegaj/py_pansharpening" @.>; 发送时间: 2022年2月13日(星期天) 中午1:38 @.>; @.**@.>; 主题: Re: [codegaj/py_pansharpening] MS数据 (Issue #12)

如果可以,把你的图像发到我邮箱吧,我来帮你跑下看看!

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

sxdeivm commented 2 years ago

我融合之后是这样的

------------------ 原始邮件 ------------------ 发件人: "codegaj/py_pansharpening" @.>; 发送时间: 2022年2月13日(星期天) 中午1:38 @.>; @.**@.>; 主题: Re: [codegaj/py_pansharpening] MS数据 (Issue #12)

如果可以,把你的图像发到我邮箱吧,我来帮你跑下看看!

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

codegaj commented 2 years ago

我这边跑起来没有问题,初步猜想您可能是用的cv2读取tif文件,这样导致读取的数据本身就有问题,对于这类带地理信息的tif文件我们一般使用tifffile这个包来读。

import tifffile as tif original_msi = tif.imread('./images/GF22-ms.tif')/1050.0 original_pan = tif.imread('./images/GF22-pan.tif')/1050.0

sxdeivm commented 2 years ago

可以看一下你运行之后的结果吗?

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2022年2月13日(星期天) 下午2:01 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [codegaj/py_pansharpening] MS数据 (Issue #12)

我这边跑起来没有问题,初步猜想您可能是用的cv2读取tif文件,这样导致读取的数据本身就有问题,对于这类带地理信息的tif文件我们一般使用tifffile这个包来读。

import tifffile as tif original_msi = tif.imread('./images/GF22-ms.tif')/1050.0 original_pan = tif.imread('./images/GF22-pan.tif')/1050.0

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

codegaj commented 2 years ago

image 这是我用demo_pansharpening.py跑的GSA方法的结果,同时我感觉您的原图配准度不够,这可能会导致PNN和MTF-GLP这些方法效果不好

sxdeivm commented 2 years ago

谢谢您,非常感谢,请问配准度我应该怎么弄呢?

------------------ 原始邮件 ------------------ 发件人: "codegaj/py_pansharpening" @.>; 发送时间: 2022年2月13日(星期天) 下午2:14 @.>; @.**@.>; 主题: Re: [codegaj/py_pansharpening] MS数据 (Issue #12)

这是我用demo_pansharpening.py跑的GSA方法的结果,同时我感觉您的原图配准度不够,这可能会导致PNN和MTF-GLP这些方法效果不好

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

sxdeivm commented 2 years ago

还有你运行demo_pansharpening.py时的输入代码可以发一下吗,我这运行不成功

------------------ 原始邮件 ------------------ 发件人: "codegaj/py_pansharpening" @.>; 发送时间: 2022年2月13日(星期天) 下午2:14 @.>; @.**@.>; 主题: Re: [codegaj/py_pansharpening] MS数据 (Issue #12)

这是我用demo_pansharpening.py跑的GSA方法的结果,同时我感觉您的原图配准度不够,这可能会导致PNN和MTF-GLP这些方法效果不好

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

codegaj commented 2 years ago

-- coding: utf-8 --

""" Created on Sun Feb 13 14:20:05 2022

@author: gaj """

import numpy as np import cv2 import os import scipy.io as sio import tifffile as tif

from methods.Bicubic import Bicubic from methods.Brovey import Brovey from methods.PCA import PCA from methods.IHS import IHS from methods.SFIM import SFIM from methods.GS import GS from methods.Wavelet import Wavelet from methods.MTF_GLP import MTF_GLP from methods.MTF_GLP_HPM import MTF_GLP_HPM from methods.GSA import GSA from methods.CNMF import CNMF from methods.GFPCA import GFPCA from methods.PNN import PNN from methods.PanNet import PanNet

used_ms = tif.imread('./images/GF22-ms.tif')/1050.0 used_pan = tif.imread('./images/GF22-pan.tif')/1050.0 used_pan = np.expand_dims(used_pan, -1)

print('ms shape: ', used_ms.shape, 'pan shape: ', used_pan.shape)

save_dir='./results/' if not os.path.isdir(save_dir): os.makedirs(save_dir)

'''here is the main function''' fused_image = GSA(used_pan[:, :, :], used_ms[:, :, :4])

cv2.imwrite(save_dir+'GSA.tiff', fused_image[:, :, [0,1,2]])

你可以使用ENVI里面的配准方法,我不在学校,要是在的话我可以用我的配准方法帮你做一下。

sxdeivm commented 2 years ago

好的呢,非常感谢您的帮助!谢谢

------------------ 原始邮件 ------------------ 发件人: "codegaj/py_pansharpening" @.>; 发送时间: 2022年2月13日(星期天) 下午2:31 @.>; @.**@.>; 主题: Re: [codegaj/py_pansharpening] MS数据 (Issue #12)

-- coding: utf-8 --

""" Created on Sun Feb 13 14:20:05 2022

@author: gaj """

import numpy as np import cv2 import os import scipy.io as sio import tifffile as tif

from methods.Bicubic import Bicubic from methods.Brovey import Brovey from methods.PCA import PCA from methods.IHS import IHS from methods.SFIM import SFIM from methods.GS import GS from methods.Wavelet import Wavelet from methods.MTF_GLP import MTF_GLP from methods.MTF_GLP_HPM import MTF_GLP_HPM from methods.GSA import GSA from methods.CNMF import CNMF from methods.GFPCA import GFPCA from methods.PNN import PNN from methods.PanNet import PanNet

used_ms = tif.imread('./images/GF22-ms.tif')/1050.0 used_pan = tif.imread('./images/GF22-pan.tif')/1050.0 used_pan = np.expand_dims(used_pan, -1)

print('ms shape: ', used_ms.shape, 'pan shape: ', used_pan.shape)

save_dir='./results/' if not os.path.isdir(save_dir): os.makedirs(save_dir)

'''here is the main function''' fused_image = GSA(used_pan[:, :, :], used_ms[:, :, :4])

cv2.imwrite(save_dir+'GSA.tiff', fused_image[:, :, [0,1,2]])

你可以使用ENVI里面的配准方法,我不在学校,要是在的话我可以用我的配准方法帮你做一下。

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

codegaj commented 2 years ago

嗯,要是没问题的话,等会我就关掉这个Issue了

sxdeivm commented 2 years ago

好的呢

------------------ 原始邮件 ------------------ 发件人: "codegaj/py_pansharpening" @.>; 发送时间: 2022年2月13日(星期天) 下午2:37 @.>; @.**@.>; 主题: Re: [codegaj/py_pansharpening] MS数据 (Issue #12)

嗯,要是没问题的话,等会我就关掉这个Issue了

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

sxdeivm commented 1 year ago

请问在demo_all_methods.py中如何分别作出有参考图像融合结果图和无参考图像融合结果图,感谢您的回答(跪谢)!

------------------ 原始邮件 ------------------ 发件人: "。。。" @.>; 发送时间: 2022年2月13日(星期天) 下午2:23 @.>;

主题: 回复: [codegaj/py_pansharpening] MS数据 (Issue #12)

还有你运行demo_pansharpening.py时的输入代码可以发一下吗,我这运行不成功

------------------ 原始邮件 ------------------ 发件人: "codegaj/py_pansharpening" @.>; 发送时间: 2022年2月13日(星期天) 下午2:14 @.>; @.**@.>; 主题: Re: [codegaj/py_pansharpening] MS数据 (Issue #12)

这是我用demo_pansharpening.py跑的GSA方法的结果,同时我感觉您的原图配准度不够,这可能会导致PNN和MTF-GLP这些方法效果不好

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>