Pure Python Webcam Access and Recording - python

I was wondering if there was a way to access a computer's webcam and any usb-attached camera using camera using only python and its builtin modules.
I know that opencv exists and it is by far the best open source computer vision library, but is there any option that just uses Python?
Thanks in advance!

Related

How to use another device camera as input for NAO robot

Is it possible to use as camera input another device (like a tablet camera) instead of the robot’s camera? If possible, how should I do that using Python or through libraries using command line?
In our team, we've made a custom build to adress the problem of learning faces and recognize from files instead of standard robot camera.
You can clone our public repo:
git clone http://protolab.aldebaran.com:9000/protolab/facedetection_custom.git
You'll find compiled library binary for various classic version, pick the right one...
Don't hesitate to ask question if something's unclear...

Is there a way to use input from my PS3 controller in python?

I'm trying to find a way to use my PS3 controller in python, and just searching around I've only found ways to do this on a Raspberry Pi or on some linux software, but I'm just using windows here.
This could either be some library made for controllers or possibly I don't mind getting the input directly from the USB somehow and programming that myself
The inputs library on PyPI seems aimed at this.

Opencv Python VIDEOSTAB class

I need to implement a stabilization functionality to my opencv project. There is a videostab class, but it is only described for c++ (http://docs.opencv.org/trunk/d5/d50/group__videostab.html). Does anyone know how to use it in Python? I am going to stabilize live video feed by the way.
There are no Python bindings yet. You cannot use the class in Python at the moment.

How can I capture frames from a PointGrey USB camera in OpenCV/Python/OSX?

PointGrey is a leading manufacturer of machine vision cameras, but unfortunately their support for Mac OS is very limited. A www search led me to guess that I need to install libusb and libdc1394 in order to recognize the camera, which i did using brew. This did not work.
I don't understand exactly how libusb and libdc1394 libraries work under the hood, other than that they handle the hand-shaking with the camera and data transfer via the USB bus. OpenCV usually makes it incredibly easy to open a camera and start processing frames, but unfortunately when it doesn't work it's not clear how to debug. I found python wrappers for libusb and libdc1394 and included them in my code, which resulted in no errors, but no luck grabbing frames either.
If you don't have an exact answer, suggest strategies for solving this problem i.e. how should I systematically approach this, diagnosing all the possible failure modes. Is there a way that I can see more of what's going on when OpenCV tries to detect and read from a camera?
My python/opencv code works well with a simple capture = cv2.VideoCapture(0)
but doesn't work with capture = cv2.VideoCapture(1), giving output as follows:
Warning, camera failed to properly initialize!
Cleaned up camera.
Typically cv2.VideoCapture(0) will give the built-in camera on my macbook, and from what I understand cv2.VideoCapture(1) will give the next available camera (i.e. plugged in through USB).
I know the camera works well on a windows machine (in Windows Movie Maker). Do I need to do something further under the hood to get python and opencv to recognize the camera under OS X?
Many years later, we can answer this question. FLIR, which acquired PointGrey, has released Spinnaker, a cross-platform SDK with a UI and a set of pre-compiled examples for accessing the camera: https://www.flir.com/support-center/iis/machine-vision/downloads/spinnaker-sdk-and-firmware-download/

Prosilica GigE camera with OpenCV/python

I'm using a GigE (ethernet) prosilica GC camera on Mac OS X, and have been able to read it out through the proprietary sample viewing software from Allied Vision.
I would like to be able to read out the camera using OpenCV. I have opencv installed correctly, but I am not sure how to read out the camera. The last person to ask this question (~2 years ago) was told to use the native camera API to do this, and then analyze the images with opencv:
OpenCV with GigE Vision Cameras
However, I would like to know if it is even possible to do this with python/ opencv. There seems to be very little information online about how to do this, so I'm curious if anyone managed to get it to work, and could post some example code/etc. I have all my camera IP address information, model, etc, if that helps, but I don't know how to even tell opencv where to look.
Thanks in advance,
Mike
I believe OpenCV interfaces to the Prosilica cameras via the PvAPI. You'll need to make sure OpenCV is compiled with this setting using the WITH_PVAPI CMake option (you will need to build from source). cap_pvapi.cpp is the wrapper for the PvAPI driver that will allow you to use the VideoCapture class.
To build OpenCV from source, take a look at the tutorials here.
Try Pymba
You can use Allied Vision's new SDK Vimba and a python interface called Pymba. Instructions are on the Pymba github page but basically you
Install Vimba
Install Pymba via pip install pymba
There's example code in the repo. I've been using it and it's pretty straight forward.

Categories

Resources