如何解决TypeError:dtype对象的图像数据无法在plt.imshowpython中转换为float
我想阅读每个在paths
中建立的图像,并使用vconcat
将它们连接起来。我得到这个错误
Traceback : in plt.imshow(im_v,cmap='inferno',aspect='auto',interpolation='nearest') TypeError: Image data of dtype object cannot be converted to float
,同时运行以下代码。怎么解决??
任何帮助将不胜感激。
if nSpectogram <3765:
for k in range (0,22):
paths=FirstPartPathOutput+SecondPartPathOutput+'/spec_'+isPreictal+'_'+str(nSpectogram+1)+'_'+str(k)
for f1 in paths:
img = cv2.imread(f1)
im_v=cv2.vconcat(img)
plt.imshow(im_v,interpolation='nearest')
plt.axis('off')
plt.savefig(FirstPartPathOutput+SecondPartPathOutput+'/spec_'+isPreictal+'_'+str(nSpectogram+1)+'_'+str(k+1)+'.png')
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。