https://github.com/charlotte-visionlab/pybindings_opencv3.2_example
https://github.com/charlotte-visionlab/pybindings_opencv3.2_example
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (6.5%) to scientific vocabulary
Last synced: 10 months ago
·
JSON representation
Repository
Basic Info
- Host: GitHub
- Owner: charlotte-visionlab
- Language: Python
- Default Branch: master
- Size: 37.1 KB
Statistics
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
- Releases: 0
Created over 5 years ago
· Last pushed over 5 years ago
Metadata Files
Readme
README
mkdir ovex
cd ovex
mkdir src
cp ../opencv-3.1.0/modules/python/src2/{pycompat.hpp,cv2.cpp,gen2.py,hdr_parser.py} ./
cp ../learnopencv-master/pymodule/src/* src/
cp ../learnopencv-master/pymodule/headers.txt ./
Prepare to use pycompat.hpp, cv2.cpp in opencv-3.1.0 source code,gen2.py, hdr_parser.py file, use the opencv c++ source file in the blog above, take your time
Modify gen2.py where you see # ARW 12/23/2020
In gen2.py do a global search an replace of "pyopencv2" with ${modulePrefix}
In strings do "..."+ modulePrefix +"..."
All invocations of substitute() have the following for the first argument .substitute(modulePrefix=modulePrefix, ...
Console commands from root directory (where headers.txt is)
mkdir build
./gen2.py build ./headers.txt
Modify the cv2.cpp file
define macros
#define PYOPENCV_TO pybv_to
#define PYOPENCV_FROM pybv_from
Global replace pyopencv_to -> PYOPENCV_TO
Global replace pyopencv_from -> PYOPENCV_FROM
change the #include files to reference your files in the build folder
fix the MKTYPE2(NAME) macros and substitute your module name
mkdir build
python3 gen2.py build headers.txt
g++ -shared -rdynamic -g -O3 -Wall -Wno-unused-function -Wno-unused-variable -fPIC cv3.cpp src/bvmodule.cpp -DMODULE_STR=bv -DMODULE_PREFIX=pybv -DNDEBUG -DPY_MAJOR_VERSION=3 `pkg-config --cflags --libs opencv` `python3-config --includes --ldflags` -I . -I/usr/lib/python3/dist-packages/numpy/core/include -I build -L`/usr/bin/python3-config --exec-prefix`/lib -o bv.so
python3
import bv
dir(bv)
mkdir build
python2.7 gen2.py build headers.txt
g++ -shared -rdynamic -g -O3 -Wall -Wno-unused-function -Wno-unused-variable -fPIC cv3.cpp src/bvmodule.cpp -DMODULE_STR=bv -DMODULE_PREFIX=pybv -DNDEBUG -DPY_MAJOR_VERSION=2 `pkg-config --cflags --libs opencv` `python2.7-config --includes --ldflags` -I . -I/usr/lib/python2.7/dist-packages/numpy/core/include -I build -L`/usr/bin/python2.7-config --exec-prefix`/lib -o bv.so
python2.7
import bv
dir(bv)
Owner
- Name: UNC Charlotte VisionLab
- Login: charlotte-visionlab
- Kind: organization
- Website: http://visionlab.charlotte.edu
- Repositories: 7
- Profile: https://github.com/charlotte-visionlab