All Projects → edmBernard → Pybind11_opencv_numpy

edmBernard / Pybind11_opencv_numpy

Licence: apache-2.0
Implementation of cv::Mat conversion to numpy.array for pybind11

Programming Languages

python
139335 projects - #7 most used programming language
cpp
1120 projects

Projects that are alternatives of or similar to Pybind11 opencv numpy

Python Tutorial
🏃 Some of the python tutorial - 《Python学习笔记》
Stars: ✭ 122 (+27.08%)
Mutual labels:  opencv, numpy
Stb Tester
Automated Testing for Set-Top Boxes and Smart TVs
Stars: ✭ 148 (+54.17%)
Mutual labels:  opencv, numpy
Studybook
Study E-Book(ComputerVision DeepLearning MachineLearning Math NLP Python ReinforcementLearning)
Stars: ✭ 1,457 (+1417.71%)
Mutual labels:  opencv, numpy
Opencv Ndarray Conversion
NumPy ndarray ⇋ OpenCV Mat conversion, that just works.
Stars: ✭ 107 (+11.46%)
Mutual labels:  opencv, numpy
Human Detection And Tracking
Human-detection-and-Tracking
Stars: ✭ 753 (+684.38%)
Mutual labels:  opencv, numpy
Deeplearning cv notes
📓 deepleaning and cv notes.
Stars: ✭ 223 (+132.29%)
Mutual labels:  opencv, numpy
Color Tracker
Color tracking with OpenCV
Stars: ✭ 128 (+33.33%)
Mutual labels:  opencv, numpy
Lambda Packs
Precompiled packages for AWS Lambda
Stars: ✭ 997 (+938.54%)
Mutual labels:  opencv, numpy
Face morpher
👼 Morph faces with Python, Numpy, Scipy
Stars: ✭ 732 (+662.5%)
Mutual labels:  opencv, numpy
Finger Detection And Tracking
Finger Detection and Tracking using OpenCV and Python
Stars: ✭ 317 (+230.21%)
Mutual labels:  opencv, numpy
Skydetector
A Python implementation of Sky Region Detection in a Single Image for Autonomous Ground Robot Navigation (Shen and Wang, 2013)
Stars: ✭ 23 (-76.04%)
Mutual labels:  opencv, numpy
Eulerian Remote Heartrate Detection
Remote heart rate detection through Eulerian magnification of face videos
Stars: ✭ 48 (-50%)
Mutual labels:  opencv, numpy
Credit Risk Modelling
Credit Risk analysis by using Python and ML
Stars: ✭ 91 (-5.21%)
Mutual labels:  numpy
Wow Fish Bot
World of Warcraft ( WoW ) Fish BOT. Python. Simple. For me.
Stars: ✭ 93 (-3.12%)
Mutual labels:  opencv
The bilateral solver
Fast Bilateral Solver implementation with C++ and demos
Stars: ✭ 87 (-9.37%)
Mutual labels:  opencv
Opencv image comparator
图片相似度计算(直方图、峰值信噪比、结构相似性、感知哈希算法)、轮廓检测、直线检测、圆检测、角点检测、直线交点计算、旋转角度矫正、图像匹配的对应相似处连线、灰度、二值化、直方图均衡化。
Stars: ✭ 87 (-9.37%)
Mutual labels:  opencv
Signature Recognition
Verify the authenticity of handwritten signatures through digital image processing and neural networks.
Stars: ✭ 95 (-1.04%)
Mutual labels:  opencv
Kinectazuredkprogramming
Samples about Kinect Azure DK programming
Stars: ✭ 92 (-4.17%)
Mutual labels:  opencv
Ghpythonremote
A two-way connector to use regular Python from IronPython in Rhino/Grasshopper, and vice-versa.
Stars: ✭ 85 (-11.46%)
Mutual labels:  numpy
Fisheye Stereo Calibration
📷 📷 Fisheye stereo calibration using OpenCV and C++
Stars: ✭ 85 (-11.46%)
Mutual labels:  opencv

pybind11_opencv_numpy

Binding between cv::Mat and np.array. And a small code example of how it work. the code work for OpenCV 2.4, OpenCV 3+ and OpenCV 4+

The code in this repository create a simple binding, function in c++ are implemented in example.cpp file and the script that use them is test.py.

/project folder
├── build
├── example
│   ├── exemple.so                               # generate with cmake
│   └── example.cpython-36m-x86_64-linux-gnu.so  # generate with setup.py (the name will depends of the python version use)
├── CMakeLists.txt
├── setup.py
├── ndarray_converter.cpp  # Effective implementation of the binding
├── ndarray_converter.h    # Header for binding functions
└── ...

Generation with cmake/make

Note : This method support opencv 2.4, opencv 3 and opencv 4.

We use vcpkg to install pybind11 library

./vcpkg install pybind11

Compile

mkdir build
cd build
# configure make with vcpkg toolchain
cmake .. -DCMAKE_TOOLCHAIN_FILE=${VCPKG_DIR}/scripts/buildsystems/vcpkg.cmake
# generate the example.so library
make
# move example.so library in example folder
make install

Generation with setup.py

install pybind11

pip3 install pybind11

Compile

OpenCV 2.4+, OpenCV 3+

python3 setup.py build

OpenCV 4

In OpenCV 4, there a extra folder level for headers (ex: opencv4/opencv2/core/core.hpp). To be able to compile with setup.py we need a extra command to indicate header location.

python3 setup.py build_ext --include-dirs "/usr/local/include/opencv4"
python3 setup.py build

Install

python3 setup.py install

or

mv build/lib.linux-x86_64-3.5/example/example.cpython-36m-x86_64-linux-gnu.so example/example.cpython-36m-x86_64-linux-gnu.so
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].