Answer the question
In order to leave comments, you need to log in
How to get webcam images in Python 3?
How to get images from a webcam in Python 3, which module can be used for this purpose?
Answer the question
In order to leave comments, you need to log in
You can use the opencv
module
import cv2
# Включаем первую камеру
cap = cv2.VideoCapture(0)
# "Прогреваем" камеру, чтобы снимок не был тёмным
for i in range(30):
cap.read()
# Делаем снимок
ret, frame = cap.read()
# Записываем в файл
cv2.imwrite('cam.png', frame)
# Отключаем камеру
cap.release()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question