pyfusion.utils package

Submodules

pyfusion.utils.histMatch module

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

直方图匹配

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

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

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

返回

结果影像

返回类型

numpy.ndarray

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

直方图匹配

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

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

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

返回

结果影像

返回类型

numpy.ndarray

pyfusion.utils.histMatch.lut(src, result, lut, start, factor=1)[源代码]

LUT

这是一个自定义的LUT实现,opencv中的LUT只能处理8位影像

参数
  • src – The source image

  • result – 结果影像

  • lut – LUT表

  • start – 开始的值

  • factor – 因子

返回

None

pyfusion.utils.judge module

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

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

The img should be a grayscale image :param img: The image :param pan: The pan image :return: Some infomation :rtype: dict

pyfusion.utils.utils module

pyfusion.utils.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.utils.RMSE(src, pan)[源代码]

计算影像的RMSE

参数

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

返回

RMSE

返回类型

float

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

计算影像的相关性系数

参数

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

返回

R value

返回类型

float

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

计算影像的平均梯度

参数

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

返回

average gradient

返回类型

float

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

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.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.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)[源代码]

直方图匹配

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

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

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

返回

结果影像

返回类型

numpy.ndarray

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

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

The img should be a grayscale image :param img: The image :param pan: The pan image :return: Some infomation :rtype: dict

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