cv2 has no attribute "waitKey"
时间: 2023-12-12 12:04:27 浏览: 13
The error "cv2 has no attribute 'waitKey'" usually occurs when you are trying to use the waitKey function from OpenCV's cv2 module, but it cannot be found. This error can occur due to a few reasons:
1. You might be using an old version of OpenCV. The waitKey function was introduced in OpenCV version 2.0. If you are using an older version, you might need to upgrade to a newer version.
2. You might have misspelled the function name. Make sure you have spelled the function name correctly as "waitKey" with a capital "K".
3. You might have imported the cv2 module incorrectly. Make sure you have imported it correctly by using "import cv2" at the beginning of your code.
To fix this error, try upgrading your OpenCV version or check your code for spelling errors or import issues.