Recompile the modified source code for opencv python

asked 2015-12-01 04:28:07 -0600

czc080 gravatar image

I'm currently trying to expose different internal c++ function to python, for example, to expose the elbp function, I opened the facerec.hpp and put the following code

CV_EXPORTS_W Mat elbp(InputArray src, int radius, int neighbors);

after namespace while removing the static before the wrapper function:

static Mat elbp(InputArray src, int radius, int neighbors) {
Mat dst;
elbp(src, dst, radius, neighbors);
return dst;}

After this, what I did was to run the cmake in the opencv build directory and then make the whole opencv again,the whole process took like 2 hour(since im doing it on a raspberry pi) which is really painful. I dont want to switch to c++ atm, is there any other way to simply expose the internal c++ function(or do some modification on the existing function) without recompile the whole opencv?

I'm quite new to both Linux and opencv,i would be really appreciated if anyone can help.....

edit retag flag offensive close merge delete

Comments

1

I am afraid that this is the only way to do it ...

StevenPuttemans gravatar imageStevenPuttemans ( 2015-12-01 06:44:33 -0600 )edit

You can use cross-compilation to speedup the process, here is the example build: http://pullrequest.opencv.org/buildbo...

Also note that it is easier to cross-compile on linux host.

mshabunin gravatar imagemshabunin ( 2015-12-07 05:37:43 -0600 )edit