Ask Your Question
0

Cannot generate matlab bindings in OpenCV

asked 2015-03-05 07:03:29 -0600

krammer gravatar image

updated 2015-03-05 07:05:02 -0600

Hi

I am trying to compile OpenCV on 64bit ubuntu system having Matlab R2014b(64bit) with gcc 4.9.x.

I use the following cmake parameters:

cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/home/siddharth/opencv-master/install -D OPENCV_EXTRA_MODULES=/home/siddharth/opencv-master/opencv_contrib-master -D MATLAB_ROOT_DIR=/home/siddharth/matlab -D WITH_IPP=off ..

But during the configuration, I get the following message:

Matlab: -- mex: /home/siddharth/matlab/bin/mex -- Compiler/generator: Not working (bindings will not be generated)

I have checked that I can compile mex files from within Matlab. All other modules are generated in the build directory except the matlab bindings. I have also seen the question: Bindings to access openCV from MATLAB do not generate. But no working solution is there.

I have put the output of cmake at http://pastebin.com/rWcttkTU

How can I proceed now ? (FYI, I don't have Computer Vision Toolbox in Matlab if that matters)

EDIT: I report same behaviour with both OpenCV-3.0.0 beta and opencv-master(from github).

edit retag flag offensive close merge delete

Comments

1

there's current refactoring of the general wrapper mechanisms going on, it seems like the matlab ones were temporarily disabled

(i guess, you will have to wait a few days, and watch the github repo)

berak gravatar imageberak ( 2015-03-05 07:40:09 -0600 )edit

Or you clone the 3.0.0 branch which already contained the wrappers but with possibly alot of bugs :D

StevenPuttemans gravatar imageStevenPuttemans ( 2015-03-05 07:49:07 -0600 )edit

Is there anybody around who recently (since January 2015) was able to build the openCV 3 beta code and matlab bindings from source code?

talby gravatar imagetalby ( 2015-04-03 10:02:26 -0600 )edit

@StevenPuttemans: Hi, I also use branch 3.0.0-dev, if it contains a lot of bugs, but bindings should not be a problem. So sad, I cannot build it also.

beahacker gravatar imagebeahacker ( 2015-06-02 22:30:41 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-06-02 23:14:02 -0600

beahacker gravatar image

updated 2015-06-02 23:14:26 -0600

@krammer: You can download rst_parser.py here https://github.com/Itseez/opencv/blob.... I downloaded and put it in my local corresponding folder, according to this solution [http://code.opencv.org/issues/4175]. And it works for me.

edit flag offensive delete link more

Comments

1

could you do other potential matlab users a favour, and make a short experiment ?

  • remove the rst_parser.py file for a moment
  • replace gen_matlab.py with this version (that does not rely on the rst parser)

  • try to build.

see, in the long run, the rapper script has to get fixed, so let's try that, instead of doing workarounds.

berak gravatar imageberak ( 2015-06-03 00:20:46 -0600 )edit
1

@berak: Hi, I did what you said, it passed Cmake step, but cannot build. The error log: [ 13%] Generating Matlab source files [ 13%] Built target opencv_test_ximgproc_pch_dephelp [ 13%] Built target pch_Generate_opencv_hal usage: gen_matlab.py [-h] [--jinja2 JINJA2] [--hdrparser HDRPARSER] [--moduleroot [MODULEROOT [MODULEROOT ...]]] [--modules [MODULES [MODULES ...]]] [--extra [EXTRA [EXTRA ...]]] [--outdir OUTDIR] gen_matlab.py: error: unrecognized arguments: --rstparser /home/beahacker/Downloads/opencv-new/opencv/modules/java/generator make[2]: * [modules/matlab/generate.proxy] Error 2 make[1]: [modules/matlab/CMakeFiles/opencv_matlab_sources.dir/all] Error 2 make[1]: ** Waiting for unfinished jobs....

beahacker gravatar imagebeahacker ( 2015-06-06 03:21:25 -0600 )edit

a lot of thanks for trying !!

(ok, either the script calling gen_matlab.py has to get fixed too(remove the --rstparser arg) or the argument will have to go back into the gen_matlab.py)

(no real matlab here, unfortunately, so i could only test from console

berak gravatar imageberak ( 2015-06-06 03:40:18 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2015-03-05 07:03:29 -0600

Seen: 1,590 times

Last updated: Jun 02 '15