Problemas encontrados al ejecutar opencv

Problemas encontrados al ejecutar opencv

cv2.error: OpenCV(4.6.0) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:967: error: (-215: error de afirmación) tamaño.ancho> 0 && tamaño.altura>0 en la
función 'cv::imshow'

cv2.error: OpenCV(4.6.0) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:967: error: (-215:Assertion failed) size.width>0 && size.height>0 in 
function 'cv::imshow'

Probablemente signifique: Hay chino en la ruta de la imagen.

Solución:
compruebe si hay 'D:\text\picture.jpg' en su ruta.
Simplemente cambie "\" a "/", como
cv2.imread('D:/text/picture.jpg')

Guess you like

Origin blog.csdn.net/m0_53126906/article/details/126230834