Closed shicaiwei123 closed 6 years ago
what I use is mexopencv2.4 and opencv2.4.9
Here is a list of things to check. When specified, please run the commands in MATLAB and post the output here:
how was OpenCV built (precompild binaries or manually compiled from source?)
what compiler are you using?
cc = mex.getCompilerConfigurations('C++','Selected') cc.Details
confirm you are using the same compiler used for building both opencv and mexopencv
check that OpenCV is added to the system PATH environment variable:
!set regexp(getenv('PATH'), pathsep(), 'split')'
verify OpenCV build info:
cv.getBuildInformation()
do you have Computer Vision System Toolbox installed?
ver vision
use Dependency Walker to check that the correct DLLs are being loaded (see this):
!"C:\path\to\x64\depends.exe" D:\mexopencv-2.4+cv\private\ANNMLP.mexw64
Don't forget to consult the readme file and the wiki, although our focus these days is on OpenCV 3.x
the OpenCV I used is the precompild binaries on official website
the compilier is Microsoft C++ 10.0,this is the info
cc =
CompilerConfiguration with properties:
Name: 'Micros...'
Manufacturer: 'Microsoft'
Language: 'C++'
Version: '10.0'
Location: 'D:\vis...'
ShortName: 'MSVCPP100'
Priority: 'B'
Details: [1x1 mex.CompilerConfigurationDetails]
LinkerName: 'link'
LinkerVersion: ''
MexOpt: 'C:\Use...'
I‘m sure that I have added the OpenCv to the system PATH environment variable:
'D:\MATLAB\bin\win64'
'C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Xi...'
'D:\WinSCP\'
'E:\opencv\build\x64\vc10\bin'
'D:\intellijIDEA\IntelliJ IDEA 2017.2.5\JAVAJDK\javajdk9\bin'
'D:\intellijIDEA\IntelliJ IDEA 2017.2.5\JAVAJDK\javajdk9\jre\bin'
Computer Vision System Toolbox version
MATLAB Version: 8.5.0.197613 (R2015a)
MATLAB License Number: 161052
Operating System: Microsoft Windows 10 Professional Edition Version 10.0 (Build 14393)
Java Version: Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed
mode
----------------------------------------------------------------------------------------------------
Computer Vision System Toolbox Version 6.2 (R2015a)
Sorry for not giving you the answer about the OpenCV2.4.9 info and the last one because I change OpenCV2.4.9 to OpenCV2.4.10 finally. Surprisingly ,I pass the test when I do exactly the same operation as I use the OpenCV2.4.9 ,the same MATLAB ,the same mexopencv,even the same commands. Then I see the answer when I want to tell you what happened. I‘m I am confused if there is anything wrong in the code
If I understood correctly, you switched to OpenCV 2.4.10 and it's working fine now. Is that right?
If not, try to provide the rest of the info requested in my previous post...
Yes,I switch to OpenCV2.4.10 and it's working fine now.But I don't konw why it doesn't work on the OoenCV2.4.9.
It's probably because the wrong OpenCV DLLs are being loaded; MATLAB R2015a comes with opencv 2.4.9 binaries for its own use (the CVST toolbox), which are incompatible with the ones mexopencv was built against:
C:\> dir "C:\Program Files\MATLAB\R2015a\bin\win64\opencv*.dll"
By switching to 2.4.10, the correct dlls are now loaded (they have different names so there is no conflict).
(Note that different MATLAB versions come with different opencv versions. For instance R2017a has updated to opencv 3.1.0)
You would have detected this if you ran Dependency Walker like I suggested above.
See this thread for details:
https://github.com/kyamagu/mexopencv/issues/218#issuecomment-161690377
Yeah,I got it. I detect the opencv_*249.dll file in my matlab2015a and understand why it doens't work on Opencv2.4.9.
Thanks a lot.
hi
I am having trouble running the test code when I finished the compilation of mexopencv on Windows 10 and matlab2015a
this is the error
thanks