[ WARN:0@0.184] global loadsave.cpp:248 cv::findDecoder imread_('resized_img'): can't open/read file: check file path/integrity Traceback (most recent call last): File "D:\Data\Python Data\work1\opencv.py", line 14, in <module> cv2.imshow('a', img) cv2.error: OpenCV(4.8.0) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:971: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow' 进程已结束,退出代码1
时间: 2023-10-15 08:07:06 浏览: 607
根据错误提示,出现了两个问题:
1. `cv::findDecoder imread_('resized_img'): can't open/read file: check file path/integrity` 这个错误表明无法打开或读取名为 "resized_img" 的图像文件。请检查图像文件路径是否正确,并确保文件存在。
2. `cv2.error: OpenCV(4.8.0) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:971: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'` 这个错误是由于显示图像时出现了尺寸错误。可能是因为图像尺寸为零导致的。请检查图像是否正确加载,并且尺寸大于零。
你可以先确认图像文件路径是否正确,然后检查图像文件是否存在。如果问题仍然存在,你可以提供更多的代码和错误信息以供进一步调试。
相关问题
[ WARN:0@0.090] global loadsave.cpp:248 cv::findDecoder imread_('input_path'): can't open/read file: check file path/integrity什么意思
这个警告信息是由OpenCV库中的loadsave.cpp文件产生的。它表明在读取图像文件时出现了问题,可能是由于文件路径错误或文件损坏导致的。具体来说,警告信息中的"imread_('input_path')"表示无法打开或读取指定路径的文件。建议您检查文件路径是否正确,并确保文件的完整性。如果问题仍然存在,您可以尝试使用其他图像处理方法或更换图像文件来解决该问题。
[ WARN:0@0.370] global loadsave.cpp:244 cv::findDecoder imread_('4.jpeg'): can't open/read file: check file path/integrity
As an AI language model, I do not have access to the context of the error message. However, the error message seems to indicate that there is an issue with the file path or the integrity of the file "4.jpeg". The imread() function is unable to open/read the file, which suggests that the file may not exist or the path to the file may be incorrect. You may want to double-check the file path and ensure that the file exists in the specified location. Additionally, you can try opening the file manually to ensure that it is not corrupted or damaged.
阅读全文