error: OpenCV(4.5.5) :-1: error: (-5:Bad argument) in function 'imshow' > Overload resolution failed: > - imshow() missing required argument 'mat' (pos 2) > - imshow() missing required argument 'mat' (pos 2) > - imshow() missing required argument 'mat' (pos 2)
时间: 2023-09-26 12:09:24 浏览: 233
这个错误信息是 OpenCV 库中 imshow 函数的错误。它说明在调用 imshow 函数时,没有传递正确的参数。
通常情况下,imshow 函数应该传递两个参数:窗口名称和要显示的图像。如果在调用 imshow 函数时没有传递这些参数,则会出现这个错误。
解决这个问题的方法是检查 imshow 函数调用是否正确,确保两个参数都正确传递。此外,还需要确保传递给 imshow 函数的图像参数正确加载,且未被修改。如果仍然无法解决问题,可以尝试使用不同的图像库或者更新 OpenCV 库版本。
相关问题
cv2.error: OpenCV(4.5.5) :-1: error: (-5:Bad argument) in function 'imwrite'
引用: 报错信息中提到了函数'imwrite',但是在用户提供的引用内容中并没有包含与'imwrite'相关的代码或错误信息。因此,我无法提供与'imwrite'相关的答案。请您提供包含与'imwrite'相关的代码或错误信息,以便我能够更好地回答您的问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span><span class="em">4</span>
cv2.error: OpenCV(4.5.5) :-1: error: (-5:Bad argument) in function 'flip'
This error occurs when the flip() function in OpenCV is called with an incorrect or invalid argument. The most common reason for this error is passing an image that has not been properly loaded or has been corrupted.
To resolve this error, make sure that the image you are passing to the flip() function is a valid image and has been loaded correctly using the imread() function in OpenCV. Additionally, check that the argument being passed to the flip() function is one of the allowed values (0, 1, or -1) for flipping the image horizontally, vertically, or both.
阅读全文