python内置图像算法参数问题
def getSimilar(self, g) -> float:ssim = structural_similarity(np.array(self.orignal_img), np.array(g), multichannel=True)
return ssim
def get_antibody_similar(self, g1, g2):
ssim = structural_similarity(np.array(g1), np.array(g2), multichannel=True)
return ssim
返回
D:\python\Genetic-3.py:60: FutureWarning: `multichannel` is a deprecated argument name for `structural_similarity`. It will be removed in version 1.0. Please use `channel_axis` instead.
ssim = structural_similarity(np.array(g1), np.array(g2), multichannel=True)
D:\python\Genetic-3.py:56: FutureWarning: `multichannel` is a deprecated argument name for `structural_similarity`. It will be removed in version 1.0. Please use `channel_axis` instead.
ssim = structural_similarity(np.array(self.orignal_img), np.array(g), multichannel=True)
本帖最后由 sfqxx 于 2023-5-21 21:44 编辑
这个警告是由于使用了FutureWarning,它提示你所使用的函数structural_similarity()将来的版本会不再支持multichannel参数,建议修改为channel_axis参数。建议您将代码修改为:
def getSimilar(self, g) -> float:
ssim = structural_similarity(np.array(self.orignal_img), np.array(g), channel_axis=2)
return ssim
def get_antibody_similar(self, g1, g2):
ssim = structural_similarity(np.array(g1), np.array(g2), channel_axis=2)
return ssim
注意:如果您的图片是单通道图像(比如灰度图像),则需要将channel_axis设置为None。
页:
[1]