비디오 처리할 때 발생하는 오류 :
Traceback (most recent call last): File "e:\Github\Project24\Yolo_Detect\ex68_yolov11_ocr\ocr_main.py", line 16, in <module> cv2.imshow("Frame", frame) File "C:\Python\312\Lib\site-packages\ultralytics\utils\patches.py", line 56, in imshow _imshow(winname.encode("unicode_escape").decode(), mat) cv2.error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:1301: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvShowImage'
원인 :
이 오류는 OpenCV가 GUI 창을 열 수 있는 기능을 지원하지 않는 환경에서 cv2.imshow()를 호출했을 때 발생합니다. 특히 Windows 환경에서 OpenCV의 GUI 지원이 제대로 설치되지 않은 경우 흔히 발생합니다.
해결 방법 :
기존 라이브러리 제거
pip uninstall opencv-python opencv-python-headless
다시 설치
pip install opencv-python