Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

MATLAB2013a update and mexopencv failing #62

Closed
axjensen opened this issue Mar 18, 2013 · 7 comments
Closed

MATLAB2013a update and mexopencv failing #62

axjensen opened this issue Mar 18, 2013 · 7 comments

Comments

@axjensen
Copy link

axjensen commented Mar 18, 2013

Hi,

I recently upgraded to MATLAB 2013a and now function which used to work are failing. (I've also updated the OS, so that might also be the problem)

For instance, cv.FeatureDetector is failing, from MATLAB:

Invalid MEX-file '/home/aej/Downloads/mexopencv/+cv/private/FeatureDetector_.mexa64':
/home/aej/Downloads/mexopencv/+cv/private/FeatureDetector_.mexa64: undefined symbol: _ZN2cv9Algorithm7setBoolERKSsb

Error in cv.FeatureDetector (line 88)
            this.id = FeatureDetector_(type);

Error in cal_test (line 119)
detector = cv.FeatureDetector('GFTT');

Please let me know if I should supply additional information. Thank you

@kyamagu
Copy link
Owner

kyamagu commented Mar 18, 2013

What is your OpenCV version? If you're using 2.3.x, please use the mexopencv v2.3 branch.

@axjensen
Copy link
Author

I'm using OpenCV version 2.4.4 and latest mexopencv

@kyamagu
Copy link
Owner

kyamagu commented Mar 18, 2013

Alright, then you need to make sure your shared object is loaded in matlab as expected. Repeat the following steps to find a missing dependency.

Use ldd in unix shell.

$ ldd /home/aej/Downloads/mexopencv/+cv/private/FeatureDetector_.mexa64

Use ldd in matlab shell.

>> !ldd /home/aej/Downloads/mexopencv/+cv/private/FeatureDetector_.mexa64

Find any difference in the loaded libraries. Usually such libraries are causing error. If you find any, such as libstdc++ or libgcc_s, put them in the LD_PRELOAD variable before launching matlab.

LD_PRELOAD=/usr/lib/libstdc++.6.so matlab

If you still cannot solve this issue, I suspect your opencv installation is missing something.

@axjensen
Copy link
Author

axjensen commented Mar 18, 2013

Thank you.

This doesn't seem right:

From matlab !ldd:

...
libopencv_core.so.2.4 => /usr/local/MATLAB/R2013a/bin/glnxa64/libopencv_core.so.2.4 (0x00007f63ce2ac000)
libopencv_features2d.so.2.4 => /usr/local/MATLAB/R2013a/bin/glnxa64/libopencv_features2d.so.2.4 (0x00007f63ce01c000)
...

and from console ldd:

...
libopencv_core.so.2.4 => /usr/local/lib/libopencv_core.so.2.4 (0x00007f0cf327a000)
libopencv_features2d.so.2.4 => /usr/local/lib/libopencv_features2d.so.2.
...

There shouldn't be any OpenCV related stuff under MATLAB, right? Or is this copied during 'make' in mexopencv?

Thanks

@axjensen
Copy link
Author

Hmm, if I, for instance, preload OpenCV core and High gui, then things starts to work again. For instance cv.imread is working again.

I can't figure out why these opencv shared objects are in the matlab installation. Is it something new or have I done something wrong?

@kyamagu
Copy link
Owner

kyamagu commented Mar 18, 2013

This can happen if you have the computer vision toolbox from mathworks. They internally use opencv, and therefore it gives you version conflict. Unless you link mexopencv with these mathworks-provided libraries, you should preload to avoid issues.

@axjensen
Copy link
Author

Thank you. That would be the reason. I will preload OpenCV libs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants