Python and gpu OpenCV functions - python

I want to know if it is possible to use opencv gpu functions like those from here?
Or I have to wrap it into python class.

Right now OpenCV 2.4.7 doesn't support the GPU module on OpenCV-Python.
That means that you must write wrappers yourself.

To answer the question in the comment made by fbence in the accepted answer, this is now possible with OpenCV 3 and Python 2.7+ or Python 3+. However, the OpenCV 3 GPU module must be compiled from source.
Assuming you are working on a Linux system you can follow these guides:
For OpenCV 3 GPU and Python 2.7+ follow this guide.
For OpenCV 3 GPU and Python 3, follow this guide from Step 0 to Step 5.

Related

How can I get a TensorFlow C binding for Raspberry Pi?

We have a language binding with FFI using the "TensorFlow for C" and “the corresponding header files.
While we could find binaries for:
Linux, 64-bit, x86
macOS X, Version 10.12.6 (Sierra) or higher
Windows, 64-bit x86
We can't find binaries for Raspberry/ARM/Raspbian. And this is really a pity because if you go to Tensorflow downloads you can read that "Raspbian 9.0 or later" is officially supported.
But I need the C binding for Raspberry Pi.
Any idea if the binary is available? and if not, at least instructions for compiling in?
Thanks in advance,
The last paragraph of the "TensorFlow for C" you cited points to a how-to file which does show you how to build TensorFlow C API from source code with bazel
OK, after a long search, I found no binary available, so I had to manage myself.
I finally took the time to write down everything I found during my attempt to get TensorFlow C library compiled for Raspberry Pi. So, feel free to read that for a more detailed answer to my original question.

Python extension with c++ and a common library

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.

How to install opencv 2.4 and opencv 3 in same machine

I am working in opencv 2.4 and python 2.7.But now i got project from github which is imlemented in opencv 3.Is it possible to test that same code in my machine.
Assuming the package is named the same, you should probably use a second python installation to be able to test both.
You can then switch between those versions depending on the openCV version you'd like to have.
Besides of that, you can use virtualenv to setup two environments for the different versions.

Run Python 64bit In 32Bit mode?

Note: Running windows7X64
I want to use some audio functions I have seen allot for python 2.7 like snack and such, however I'm using python 3.3. I have come across pygame.py that has some audio functions however pygame doesn't support 64bit arch yet.
So can it be done? if not do we know of any python audio integration modules that can get the job done on python 3 with a 64bit arch
Yes I can just install python 3 32bit but that seems counterproductive and unnecessarily complicated.
Thanks
Ben
You'll have to install 32-bit Python to run 32-bit extension modules. In my experience, two Python installations can live side-by-side quite nicely on Windows, as long as you make sure your environment (PYTHONPATH esp.) is set properly.
Have you tried this?
$ defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
Edit: For the sake of sharing information, this will work (at least from my experience) on a Mac; however, it will not work on a Windows.

Getting shogun ML library to work with python

I was trying to install shogun on Windows:
http://www.shogun-toolbox.org/doc/installation.html
but evidently it requires python 2.5 to work. I tried with python 3 and it didn't work. But then python 2.5 no longer exists.
Does anybody know how to get it working with python without using python 2.5?
You won't get very far trying with Python 3 (which is not fully compatible with Python 2.x).
Furthermore, the installation instructions say:
"SHOGUN requires the standard linux
utils like bash, grep, test, sed, cut,
ldd, uname gcc g++ cat python"
sounds like you are out of luck on windows, unless you resort to Cygwin.
There are currently two Python languages out there
the original one, which is still being updated (currently at 2.7.2)
the overhauled Python 3, which is breaking compatibility (currently at 3.1.4)
Many libraries have not switched to Python 3 yet, and might not for some time, so you're better off getting 2.6 or 2.7.
For Windows or Mac, I can recommend the Enthought distribution (free for academic use), which contains loads of goodies, including scipy, which you'll very probably need -- and installs hassle-free!

Categories

Resources