pyfusion.utils package

Module contents

pyfusion.utils.Entropy(src)[源代码]

计算影像的信息熵

The Entropy will calculate the information entropy of image

参数

src – source image, it should be read by cv2.imread() and grayscale image

返回

信息熵

返回类型

float

pyfusion.utils.GetOutputDriverFor(filename)[源代码]
class pyfusion.utils.Image(image=None)[源代码]

基类:object

Image is a custom class. It wrap the osgeo.gdal.Dataset

We add some feature on it. It can be accessed by slice, so you can read/write any pixel(s) directly.

There is a attribute named image, it can access osgeo.gdal.Dataset object directly.

property image
pyfusion.utils.RMSE(src, pan)[源代码]

计算影像的RMSE

参数

src – source image, it should be read by cv2.imread() and grayscale image

返回

RMSE

返回类型

float

pyfusion.utils.R_value(src, pan)[源代码]

计算影像的相关性系数

参数

src – source image, it should be read by cv2.imread() and grayscale image

返回

R value

返回类型

float

pyfusion.utils.ReadImageFile(filepath: str)[源代码]

Read image

用`gdal.OpenShared`读的只读影像

参数

filepath – The file path

返回

Image

返回类型

pyfusion.utils.Image

pyfusion.utils.avg_grad(src)[源代码]

计算影像的平均梯度

参数

src – source image, it should be read by cv2.imread() and grayscale image

返回

average gradient

返回类型

float

pyfusion.utils.histMatch(src, ref)[源代码]

直方图匹配

histMatch函数将会返回以`ref`影像为基准的匹配影像,`src`和`ref`都应该为灰度影像

参数
  • src – 源影像,应该为`numpy.ndarry`的数据结构,应该使用`opencv`包来读入

  • ref – 参考影像,应该为`numpy.ndarry`的数据结构,应该使用`opencv`包来读入

返回

结果影像

返回类型

numpy.ndarray

pyfusion.utils.histMatch2(src, ref, nodata=None)[源代码]

直方图匹配

histMatch2函数功能与histMatch函数类似,但这个处理的不是8位的影像,PCA融合时需要使用

参数
  • src – 源影像,应该为`numpy.ndarry`的数据结构,应该使用`opencv`包来读入

  • ref – 参考影像,结构为`numpy.ndarry`,dtype为`numpy.float32`

  • nodata – nodata的值,默认为None。如果要使用,则应为一个元组,分别为原影像和参考影像的nodata的值

返回

结果影像

返回类型

numpy.ndarray

pyfusion.utils.judge(img, pan=None)[源代码]

计算`img`影像的一些信息

The img should be a grayscale image

参数
  • img – The image

  • pan – The pan image

返回

Some infomation

返回类型

dict

pyfusion.utils.piancha_relativepiancha(src, pan)[源代码]
pyfusion.utils.scala_image(img, rg)[源代码]