Closed NIDHIPANDA closed 6 years ago
two things:
make sure you first run mex -setup
in MATLAB, and select the same compiler you used to build opencv. I assume you have multiple versions of Visual Studio installed, maybe VS2010 and VS2015?
you must have built the 32-bit version of opencv instead of the 64-bit version. So in this image from the wiki, notice it says "x64 Release mode" at the top. Obviously you can't use 32-bit binaries in 64-bit matlab. When you run CMake, make sure to select the right generator, i.e "Visual Studio 14 2015 Win64"
Thank you for your response.
I tried mex -setup
in MATLAB it is showing
MEX configured to use 'Microsoft Visual C++ 2015 (C)' for C language compilation.
Also on following your second suggestion
When you run CMake, make sure to select the right generator, i.e "Visual Studio 14 2015 Win64"
I was able to successfully build in Visual studio. But the error is now also same i.e.
Error using mexopencv.make>pkg_config (line 325)
OpenCV library path not found: C:\opencv\build\install\x64\vc10\lib
Error in mexopencv.make>mex_options (line 265)
[cv_cflags, cv_libs] = pkg_config(opts);
Error in mexopencv.make (line 82)
mex_flags = mex_options(opts);
I have already uninstalled the visual studio 10.
You should do both mex -setup
and mex -setup C++
for C and C++ compilers respectively.
I tried both of the command it is detecting VS15 only.
That's weird, if VS2015 is configured as compiler, how come it still picks vc10
?
Can you run this in MATLAB and post the output:
>> cc = mex.getCompilerConfigurations('C++', 'Selected');
>> disp(cc)
Sorry for my late reply. I tried your suggested command. The output is Now it is not take visual stdio 10 but now the error is One more thing I noticed that in my build-install folder there is no bin folder created. .
Seeing the above images, you passed the wrong path, it should be:
>> mexopencv.make('opencv_path','C:\opencv\build\install', 'opencv_contrib',true)
Please follow the installation instructions more carefully: https://github.com/kyamagu/mexopencv/wiki/Installation-(Windows,-MATLAB,-OpenCV-3)
Now just to be clear, you must build opencv and mexopencv all using the same compiler with the same architecture, this means compiling both as x64 in VS2015.
Seeing your previous comments, you once had VS2010 vs VS2015, you were also mixing 32-bit and 64-bit binaries... So first thing is make sure you're using the correct configuration. Run this in MATLAB and post the output here:
>> !tree /F "C:\opencv\build\install\x64"
Thank you so much for your replies and support. It finally worked.
On running the command !tree /F "C:\opencv\build\install\x64"
the matlab output is
Hello I am using Matlab 2015a ,visual stdio 2015 , openCV and openCV contribution 3.3.1
In the final step while running
mexopencv.make('opencv_path','C:\opencv\build\install', 'opencv_contrib',true)
I am getting this error.My
C:\opencv\build\install
folder includes\x86\vc14
not the\x64\vc10
. I really appreciate if somebody helps me. Thank you