Last active
April 23, 2024 06:34
-
-
Save Luxato/384a7c8a6bfdeba09d54cb5bd6b2c9fb to your computer and use it in GitHub Desktop.
Take picture from USB camera with python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import imutils | |
import time | |
cap = cv2.VideoCapture(0) | |
ret, frame = cap.read() | |
def takePicture(): | |
(grabbed, frame) = cap.read() | |
showimg = frame | |
cv2.imshow('img1', showimg) # display the captured image | |
cv2.waitKey(1) | |
time.sleep(0.3) # Wait 300 miliseconds | |
image = 'C:\Users\Lukas\Desktop\REMOVE\capture.png' | |
cv2.imwrite(image, frame) | |
cap.release() | |
return image | |
print(takePicture()) |
Javedbbcc
commented
Sep 7, 2021
via email
You're welcome Bro.. 💞💓👍
…On Tue, Sep 7, 2021, 6:16 AM Kyle J. Fischer ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
Google Searched: "USB camera python" and found this! Thank you dude!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://gist.github.com/384a7c8a6bfdeba09d54cb5bd6b2c9fb#gistcomment-3884340>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANBTT6AHDTQEDMBCL62FCCTUAVRWRANCNFSM4OQ2JWNA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
I found this on Google using "python usb camera capture"
1st: Stackoverflow
2nd: YT Nicholas Renotte
3rd: Your Link!!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment