Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
TypeError:在plt.imshow()python中,无法将dtype对象的图像数据转换为浮点_Python_Image_Matplotlib_Concatenation_Cv2 - Fatal编程技术网

TypeError:在plt.imshow()python中,无法将dtype对象的图像数据转换为浮点

TypeError:在plt.imshow()python中,无法将dtype对象的图像数据转换为浮点,python,image,matplotlib,concatenation,cv2,Python,Image,Matplotlib,Concatenation,Cv2,我想读取在路径中创建的每个图像,并使用vconcat将它们连接起来。我犯了这个错误 回溯:在plt.imshow(im_v,cmap='inferno',aspect='auto',interpolation='nearest')类型错误:运行以下代码时,无法将数据类型对象的图像数据转换为float。怎么解决呢 任何帮助都将不胜感激 if nSpectogram <3765: for k in range (0,22): paths=

我想读取在
路径
中创建的每个图像,并使用
vconcat
将它们连接起来。我犯了这个错误
回溯:在plt.imshow(im_v,cmap='inferno',aspect='auto',interpolation='nearest')类型错误:运行以下代码时,无法将数据类型对象的图像数据转换为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,cmap='inferno', aspect='auto', interpolation='nearest')

            plt.axis('off') 
            plt.savefig(FirstPartPathOutput+SecondPartPathOutput+'/spec_'+isPreictal+'_'+str(nSpectogram+1)+'_'+str(k+1)+'.png')

如果先由您自己将im\u v转换为float类型?你应该检查im_v有什么值…@ted930511 im_v没有值。我希望图像已连接。我不知道为什么我没有得到任何值通常我不使用cv,我使用numpy
vstack
hstack
dstack
,为什么不在循环中打印imu v或img的形状?你有很多要尝试的。img肯定有问题,然后导致IMU v出现问题