-
-
Notifications
You must be signed in to change notification settings - Fork 499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using a USB camera? #193
Comments
It depends on what you would like to do with it. I'm open to suggestions. Do you have a specific use in mind? |
I would think for the moment only as a follow-up for an indoor crop, or as an outdoor security camera. Not everyone has a Pi camera, and the USB camera also it is more accessible and cheaper. |
The nice thing about the Pi camera is it's guaranteed to work because the hardware is standardized. Mycodo uses the python module, picamera. USB cameras are pretty variable in how to acquire images from them. I haven't really explored using them with Mycodo, but I would give it a try. If there's a universal python module that can detect/acquire from USB cameras, this would be rather easy to integrate into Mycodo. I'm not sure if this exists or not, I haven't really looked. As of how, if you want to do time-lapses, the easiest way is to write a script and add it to cron. From within Mycodo, you can trigger still image captures from relay/sensor/PID conditional statements by creating a script that captures an image, then use the 'execute command' option in the conditional. So, when your conditional is triggered, the script is executed and the image acquired. I believe there is also some good software for the Pi that can turn it into a security camera, and I believe it allows the use of USB cameras. These software that allow USB cameras may also be a good place to look how they acquire images from the USB camera, for possible use within Mycodo. |
I just tested my webcam with opencv, and I was able to get an image right away! Very promising! |
You can try the new script I pushed, test_camera_capture_still.py, by saving it and running the following: sudo apt-get install python-opencv
python test_camera_capture_still.py An image 'camera_image_[timestamp].bmp' will be created if it successfully detects a camera. If you have multiple cameras connected to your Pi, you can change the device by altering Line 29 to a different integer greater than 0: cap = cv2.VideoCapture(0) Let me know if it works for you and I'll look into ways to integrate the code into mycodo. |
thank Kyle for trying this... it is work, an image was created with the name you wrote, but I give the following errror:
|
I've got a whole new camera system working in the dev-5.0 branch, with USB cameras working with opencv. When I release 5.0.0, you'll be able to test it out. |
Excellent ! Can't wait ! :D
2017-02-13 2:58 GMT+04:00 Kyle Gabriel <notifications@github.com>:
… I've got a whole new camera system working in the dev-5.0 branch, with USB
cameras working with opencv. When I release 5.0.0, you'll be able to test
it out.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#193 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABvpRIMPSuOjhwPEKhWxjxi1rJqfnAxTks5rb46egaJpZM4L52h4>
.
|
Hi, well this is an only question or suggestion if is not possible. Can I use a USB camera instead of a Picamera???
The text was updated successfully, but these errors were encountered: