Minimal build Python OpenCV 2.4.3
I am using OpenCV Python bindings to call a function matchTemplate
. This is the only function I need. To be able to call matchTemplate
, I have to post the python bindings for OpenCV cv2.pyd
with my (Windows) application, which weighs in at a massive 9MB.
Is there a way to build (Python bindings) OpenCV in such a way that only the modules I need are included in cv2.pyd
? matchTemplate
seems to be part of a module imgproc
, so I guess I only really need OpenCV core
and imgproc
.
I have already tried playing with the OpenCV CMake options and I think I only managed to create some modules. However, as soon as I disable one module, say calib3d
by setting CMake BUILD_OPENCV_calib3d
to false, I also "lose" the Python build. In other words, when I use CMake to generate Visual Studio solution files to create all modules except calib3d
and python
, the Visual Studio solution contains all modules, but calib3d
also python
. I tried to remake the module CMakeLists file by python
removing calib3d
from the callocv_add_module
ocv_add_module(python BINDINGS opencv_core opencv_flann ...)
and setting the included headers
set(opencv_hdrs
"${OPENCV_MODULE_opencv_core_LOCATION}/include/opencv2/core/core.hpp"
...
Unfortunately, to no avail. Does anyone know how to do this?
I am building Microsoft Visual Studio 2012.
Thank!
source to share
No one has answered this question yet
Check out similar questions: