Opencv - cv2.imshow('frame', frame)

Merhaba
Bir şeyi tam olarak anlamadım.
Bilgisayarımda dahili kamera yok. Usb’ye takılı olan webcam ile görüntü almak istiyorum.
cv2.VideoCapture(0) olarak kullandıpımda dahili kamerayı kullan anlamına mı geliyor. ilk kamerayı kullan anlamına mı gelir?

Aşağıdaki kodlarda hata alıyorum. Windows işletim sistemi kullanıyorum.
opencv yüklü.

import cv2

vg = cv2.VideoCapture(0)
while (True):

    ret, frame = vg.read()
    cv2.imshow('frame', frame)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

vg.release()

cv2.destroyAllWindows()

cv2.VideoCapture(0) olarak kullandığımda şu hatayı alıyorum;
…, line 7, in
** cv2.imshow(‘frame’, frame)**
cv2.error: OpenCV(4.6.0) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:1267: 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’

cv2.VideoCapture(1) olarak yazdığımda ise şu hatayı alıyorum:
…, line 7, in
** cv2.imshow(‘frame’, frame)**
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’
Opencv versiyonu:

Buradaki hataları nasıl çözebilirim?

Opencv-python-headlessi kaldirip dener misin