Pycharm open CV learning 2
May 28, 2021
How to open the camera
import cv2
cap = cv2.VideoCapture(0)
cap.set(3,640)
cap.set(4,480)
while True:
success, img = cap.read()
cv2.imshow("video",img)
if cv2.waitKey(1) & 0xFF == ('q'):
break
then you can see your camera is working
you can do more brightlight
import cv2
cap = cv2.VideoCapture(0)
cap.set(3,640)
cap.set(4,480)
cap.set(10,100)
while True:
success, img = cap.read()
cv2.imshow("video",img)
if cv2.waitKey(1) & 0xFF == ('q'):
break