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.
Related
From the internet I have learnt that Python does not have any standard modules to access the webcam. In order to capture a photo using the WebCam, we need to use an open source module called opencv (cv2 for python) which is written in C++. My question is why does python interpreter not throw an error when a piece of C++ code is used inside a Python code? How can it interpret something which is not python?
The python functions act as wrappers, meaning they just provide a python interface but behind the scenes they just execute the C++ code. So all you need is some code that lets you interpret the data that is sent from C++ and find the python equivalent like https://docs.python.org/3/library/ctypes.html and you're done. Though in case of OpenCV people have already done that for you so you can use the python stuff as if it were written in 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!
For image processing I tend to use python to speed up my workflow. But what if there is missing functionality and you only find a library written in c++?
For this special case, one could write a c++ extension and import it in python. The extension relies on openCV which would be bundled into the extension. But python can already use openCV on its own. So I would end up with 2 versions of openCV in my programm. Is there a way around this?
I am not sure I understand what you mean. So you have a third library with C++ that has some functionality which is lacking in OpenCV. You then want to talk to this library in Python together with the Python API from OpenCV. The extension you linked is just a way to include python in a C++ program and does not necessarly need OpenCV. Does the third library use OpenCV as well?
In general you can say:
If you do not modify OpenCV you do not need two versions. You install one and just have to make sure that another library that uses OpenCV as well links to the version you have used in the Python API when you build it.
If you do modify OpenCV you should build it yourself with your changes and then use the Python API from this self build OpenCV to be used in your applications.
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.
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.