Python api for OpenCV library [closed] - python

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I use Python api for OpenCV Library and it's great. I want to adapt the same technology to my own C++ library. Here is the source code:
https://github.com/Itseez/opencv/tree/master/modules/python/src2
As far as I know this is not SWIG, or Cython but a manual approach. Can someone please explain the architecture of the Python wrapping?

the python scripts in opencv\modules\python\src2 are used to generate the api
first hdr_parser.py is run on the opencv c++header files (just try to run it!), to collect the classes/functions(that's what the EXPORTS_W and CV_WRAP tags are for in the c++ headers),
then gen2.py is the 'backend', which generates the python wrappers.
the java / matlab bindings are done in the very same way (just different backends)

Related

How to call Python from MATLAB R2019a? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I have been searching for the way to call Python from MATLAB on Google and YouTube. However, I got confused due to the many ways of doing so.
I have a Python library DESlib downloaded. I have a program from MATLAB that needs that library to perform dynamics classifier selection. No one has developed such a library for MATLAB. I can only found for Python.
So, how I do that call this library from MATLAB?
If your MATLAB version is new enough (the following definitely works on R2019a), MATLAB has builtin support for calling python functions.
Say module is your python library that you downloaded and you want to use a function func in that module, all you need to do is just
py.module.func(<arguments>)
See here for more details.
module has to be in the python search path, otherwise add it as detailed here

What language are exe files? Can I make a .exe from python? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I was wondering what language are windows programs coded in? Can a python program run on windows if the computer doesn't have python installed?
I would recommend reading into this:
https://en.wikipedia.org/wiki/Portable_Executable
An EXE is a bundle of machine code. Take a look in a hex editor and grab an opcode manual. You probably won't be able to make sense of it without a lot of studying, but they're basically micro instructions.
To your other question, though. Yes, you can make an exe from a Python script. This works by bundling the python runtime with the script itself. Take a look at pyinstaller:
http://www.pyinstaller.org/
EDIT: As pointed out in the comments, use pyinstaller instead of py2exe. It is more actively maintained.

Calling C++ library with Python 2.7 and Python 3.x [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have a large performance sensitive library written in C++11 with variadic templates and model classes. This is a header only C++ library.
I want to write the Python bindings for this library.
The python bindings should support Python 2.7 and Python 3.x.
My problem is I am not finding a way to create bindings between C++ and Python. I did see references to Boost.Python and SWIG, however, I could not find anything that clearly identified how to create the bindings between C++ and Python.
What is the simplest, clearest, step-by-step method of creating a binding?

Make a python module accessible to everyone [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I've made a python module myself and I would like to make it accessible online (without having to create a website). Do you know any website that collects user-created modules that can be accessed by everyone for import? And if so, what is the process needed to upload it?
You are thinking on PyPi
What is PyPI?
The Python Package Index is a repository of software for the Python programming language. There are currently 83402 packages here.
You can learn about it here: How to submit a package to PyPi

Porting a Python 2.X based project to Python 3 [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want to port a web application scanning framework from Python 2.6.5-2.7.3 to Python 3 without causing much harm to the compatibility with Python 2.6+.
I have read briefly about six: Python 2 and 3 Compatibility Library and python-modernize.
The framework I am intending to port uses libraries like twisted which are natively supported in Python 2. I have read http://twistedmatrix.com/trac/wiki/Plan/Python3 which warns against usage of 2to3 at any stage during this process. The fact that python-modernize is a version of 2to3 has been another source of confusion.
May I have some suggesions on the optimal approach to carry out such a porting and some common bugs that I might encounter ?

Categories