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!

+3
python build opencv cmake


source to share


No one has answered this question yet

Check out similar questions:

5504
Does Python have a ternary conditional operator?
5231
What are metaclasses in Python?
4473
Calling an external command in Python
3790
How can I safely create a subdirectory?
3602
Does Python have a substring method "contains"?
3119
What is the difference between Python list methods that are appended and expanded?
2818
Finding the index of an element by specifying the list that contains it in Python
2601
How can I make a time delay in Python?
2568
How to find the current time in Python
2097
Is there a way to run Python on Android?



All Articles
Loading...
X
Show
Funny
Dev
Pics