Closed hughhugh closed 7 years ago
@hughhugh If you are using old version of OpenCV, use the corresponding release. mexopencv for v2.4 is here. Or, v2.3 is available via branch (git checkout v2.3
before build).
@kyamagu I use opencv2.4.13, and in the directory of mexopencv, I use "git checkout v2.4" , and make
command works. However , theres are still some errors when using 'make test'. What is the solution to the problem? Thank you .
The log as follows:
name@ubuntu:~/mexopencv$
name@ubuntu:~/mexopencv$ **make test MATLABDIR=/usr/local/MATLAB/R2013a**
/usr/local/MATLAB/R2013a/bin/matlab -nodisplay -r "addpath(pwd);cd test;try,UnitTest;catch e,disp(e.getReport);end;exit;"
< M A T L A B (R) >
Copyright 1984-2013 The MathWorks, Inc.
R2013a (8.1.0.604) 64-bit (glnxa64)
February 15, 2013
To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.
== TestANN_MLP ======
-- test_1 ------
Invalid MEX-file '/home/name/mexopencv/+cv/private/ANN_MLP_.mexa64': /usr/local/lib/libopencv_ocl.so.2.4: undefined symbol: _ZTIN2cv16ParallelLoopBodyE
Error in cv.ANN_MLP (line 113)
this.id = ANN_MLP_();
Error in TestANN_MLP.test_1 (line 10)
classifier = cv.ANN_MLP([3,1]);
Error in UnitTest.all (line 44)
feval([class_name,'.',m{:}]);
Error in UnitTest (line 18)
UnitTest.all(class_name);
FAIL
== TestAdaptiveThreshold ======
-- test_1 ------
Error using cv.adaptiveThreshold
Invalid MEX-file '/home/name/mexopencv/+cv/adaptiveThreshold.mexa64': /usr/local/lib/libopencv_ocl.so.2.4: undefined symbol: _ZTIN2cv16ParallelLoopBodyE
Error in TestAdaptiveThreshold.test_1 (line 9)
result = cv.adaptiveThreshold(TestAdaptiveThreshold.img, 255);
Error in UnitTest.all (line 44)
feval([class_name,'.',m{:}]);
Error in UnitTest (line 18)
UnitTest.all(class_name);
FAIL
-- test_2 ------
Error using cv.adaptiveThreshold
Invalid MEX-file '/home/name/mexopencv/+cv/adaptiveThreshold.mexa64': /usr/local/lib/libopencv_ocl.so.2.4: undefined symbol: _ZTIN2cv16ParallelLoopBodyE
Error in TestAdaptiveThreshold.test_2 (line 13)
result = cv.adaptiveThreshold(TestAdaptiveThreshold.img, 255, 'AdaptiveMethod', 'Gaussian');
Error in UnitTest.all (line 44)
feval([class_name,'.',m{:}]);
Error in UnitTest (line 18)
UnitTest.all(class_name);
FAIL
-- test_3 ------
Error using cv.adaptiveThreshold
Invalid MEX-file '/home/name/mexopencv/+cv/adaptiveThreshold.mexa64': /usr/local/lib/libopencv_ocl.so.2.4: undefined symbol: _ZTIN2cv16ParallelLoopBodyE
Error in TestAdaptiveThreshold.test_3 (line 17)
result = cv.adaptiveThreshold(TestAdaptiveThreshold.img, 255, 'ThresholdType', 'BinaryInv');
Error in UnitTest.all (line 44)
feval([class_name,'.',m{:}]);
Error in UnitTest (line 18)
UnitTest.all(class_name);
FAIL
@hughhugh see #212 or #123
Basically there are conflicting libraries (http://kyamagu.github.io/mexopencv/#linux), especially if you also have the "Computer Vision System Toolbox" from MathWorks (which also includes it's own opencv 2.4 libs).
@amroamroamro Hi,I reinstall matlab without Computer Vision System Toolbox again, but there are still conflicting problem. Thank you . The log as follows:
== TestIntegral ======
-- test_1 ------
PASS
-- test_2 ------
PASS
-- test_3 ------
PASS
-- test_error_1 ------
PASS
== TestInvert ======
-- test_1 ------
PASS
-- test_error_1 ------
PASS
== TestInvertAffineTransform ======
-- test_1 ------
PASS
-- test_error_1 ------
PASS
== TestIsContourConvex ======
-- test_1 ------
PASS
-- test_error_1 ------
PASS
== TestKNearest ======
-- test_1 ------
PASS
== TestKalmanFilter ======
-- test_1 ------
PASS
== TestKmeans ======
-- test_1 ------
PASS
-- test_error_1 ------
PASS
== TestLaplacian ======
-- test_1 ------
PASS
-- test_2 ------
PASS
-- test_error_1 ------
PASS
== TestLatentSvmDetector ======
-- test_1 ------
PASS
== TestLine ======
-- test_1 ------
PASS
-- test_error_1 ------
PASS
== TestMSER ======
-- test_1 ------
PASS
-- test_error_1 ------
PASS
== TestMatMulDeriv ======
-- test_1 ------
PASS
-- test_error_1 ------
PASS
== TestMatchShapes ======
-- test_1 ------
PASS
-- test_error_1 ------
PASS
and
root@ubuntu:/home/name/mexopencv# ldd +cv/imread.mexa64
linux-vdso.so.1 => (0x00007fffe189b000)
libopencv_calib3d.so.2.4 => /usr/local/lib/libopencv_calib3d.so.2.4 (0x00007fafe8c96000)
libopencv_contrib.so.2.4 => /usr/local/lib/libopencv_contrib.so.2.4 (0x00007fafe89b2000)
libopencv_core.so.2.4 => /usr/local/lib/libopencv_core.so.2.4 (0x00007fafe8565000)
libopencv_features2d.so.2.4 => /usr/local/lib/libopencv_features2d.so.2.4 (0x00007fafe82ba000)
libopencv_flann.so.2.4 => /usr/local/lib/libopencv_flann.so.2.4 (0x00007fafe8040000)
libopencv_gpu.so.2.4 => /usr/local/lib/libopencv_gpu.so.2.4 (0x00007fafe7df1000)
libopencv_highgui.so.2.4 => /usr/local/lib/libopencv_highgui.so.2.4 (0x00007fafe7b9c000)
libopencv_imgproc.so.2.4 => /usr/local/lib/libopencv_imgproc.so.2.4 (0x00007fafe76e0000)
libopencv_legacy.so.2.4 => /usr/local/lib/libopencv_legacy.so.2.4 (0x00007fafe73bc000)
libopencv_ml.so.2.4 => /usr/local/lib/libopencv_ml.so.2.4 (0x00007fafe713b000)
libopencv_nonfree.so.2.4 => /usr/local/lib/libopencv_nonfree.so.2.4 (0x00007fafe6f02000)
libopencv_objdetect.so.2.4 => /usr/local/lib/libopencv_objdetect.so.2.4 (0x00007fafe6c7c000)
libopencv_ocl.so.2.4 => /usr/local/lib/libopencv_ocl.so.2.4 (0x00007fafe6896000)
libopencv_photo.so.2.4 => /usr/local/lib/libopencv_photo.so.2.4 (0x00007fafe6677000)
libopencv_stitching.so.2.4 => /usr/local/lib/libopencv_stitching.so.2.4 (0x00007fafe63f8000)
libopencv_superres.so.2.4 => /usr/local/lib/libopencv_superres.so.2.4 (0x00007fafe61bc000)
libopencv_video.so.2.4 => /usr/local/lib/libopencv_video.so.2.4 (0x00007fafe5f6a000)
libopencv_videostab.so.2.4 => /usr/local/lib/libopencv_videostab.so.2.4 (0x00007fafe5d31000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fafe5b29000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fafe590c000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fafe5707000)
libmx.so => not found
libmex.so => not found
libmat.so => not found
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fafe540a000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fafe510a000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fafe4ef3000)
@hughhugh The unit tests you're showing all passed, right?
Now in order to find conflicting libraries, you must run ldd
both in the MATLAB command prompt and in the system shell, and look for differences in loaded libraries.
You didn't really need to uninstall CVST toolbox (that would be a last resort). You could have either temporarily moved the libopencv_*.so.2.4
libs inside the MATLAB bin directory, replace symlinks, or used the LD_PRELOAD
preloading trick explained in the previous links I posted...
Alternatively you could switch to the latest OpenCV 3.1.0, avoiding conflict with MATLAB's included OpenCV 2.4.x. That way you can keep using both mexopencv and CVST at the same time (although there still might be conflicts in other indirect dependencies, just use ldd
to sort it out)
Did you clean the previous build artifacts? i.e., make clean
if that doesn't solve the issue, checkout the old tag.
Hi, I met this problem when make . What can I do to solve this issue? Thank you.
system ubuntu 12.04 64bit , matlab 2013a, opencv 2.4.13, g++ 4.4 Log as follows: