SSIM报错
value, ssimmap = metrics.structural_similarity( im1[i], im2[i],multichannel=True, full=True )
im1[i].shape
im2[i].shape
代码如下(示例):
ValueError: Since image dtype is floating point, you must specify the data_range parameter. Please read the documentation carefully (including the note). It is recommended that you always specify the data_range anyway.
设置 参数data_range=255
代码如下(示例):
ValueError: win_size exceeds image extent. Either ensure that your images are at least 7x7; or pass win_size explicitly in the function call, with an odd value less than or equal to the smaller side of your images. If your images are multichannel (with color channels), set channel_axis to the axis number corresponding to the channels.
由于多通道问题,需要将参数multichannel=True改为channel_axis=2,
问题解决
修改代码如下(示例):
value, ssimmap = metrics.structural_similarity( im1[i], im2[i],channel_axis=2, data_range=255, full=True )