"D:/master/Project_group/YOLO/Project/Infrared small target/psnr.py" [ WARN:[email protected]] global D:\a\opencv-python\opencv-python\opencv\modules\imgcodecs\src\loadsave.cpp (239) cv::findDecoder imread_('50-5s_X1.tif'): can't open/read file: check file path/integrity [ WARN:[email protected]] global D:\a\opencv-python\opencv-python\opencv\modules\imgcodecs\src\loadsave.cpp (239) cv::findDecoder imread_('denoised_image(2).tif'): can't open/read file: check file path/integrity Traceback (most recent call last): File "D:/master/Project_group/YOLO/Project/Infrared small target/psnr.py", line 22, in <module> psnr_value = psnr(img1_path, img2_path) File "D:/master/Project_group/YOLO/Project/Infrared small target/psnr.py", line 10, in psnr mse = np.mean((img1 - img2) ** 2) TypeError: unsupported operand type(s) for -: 'NoneType' and 'NoneType'
时间: 2024-04-22 12:21:47 浏览: 199
这个错误提示是由于程序无法打开或读取指定的图片文件所致,需要检查图片文件路径是否正确以及文件是否存在。你可以尝试打印出图片文件路径,以确保程序能够正确找到图片文件。同时,也需要确保图片文件的格式与程序中指定的格式一致,例如使用cv2.imread()函数读取tif格式的图像时需要使用cv2.IMREAD_ANYDEPTH标志。
阅读全文
相关推荐

















