Problem in load library when using opencv and matlab

조회 수: 2 (최근 30일)
chitra
chitra 2012년 2월 4일
댓글: Zaigham Bajwa 2018년 12월 10일
http://blog.cordiner.net/2010/02/15/opencv-viola-jones-object-detection-in-matlab/ describes how to use OpenCv with matlab. I tried to execute the following command given at the end of the page :
opencvPath = 'C:\Program Files (x86)\OpenCV1.1';
includePath = fullfile(opencvPath, 'cxcore\include');
loadlibrary(...
fullfile(opencvPath, 'bin\cxcore110.dll'), ...
fullfile(opencvPath, 'cxcore\include\cxcore.h'), ...
'mfilename', 'proto_cxcore');
loadlibrary(...
fullfile(opencvPath, 'bin\cv110.dll'), ...
fullfile(opencvPath, 'cv\include\cv.h'), ...
'alias', 'cv110', 'includepath', includePath);
loadlibrary(...
fullfile(opencvPath, 'bin\highgui110.dll'), ...
fullfile(opencvPath, 'otherlibs\highgui\highgui.h'), ...
'alias', 'highgui110', 'includepath', includePath);
classifierFilename = 'C:/Program Files (x86)/OpenCV1.1/data/haarcascades/haarcascade_frontalface_alt.xml';
cvCascade = calllib('cv110', 'cvLoadHaarClassifierCascade', classifierFilename, ...
libstruct('CvSize',struct('width',int16(100),'height',int16(100))));
However,it returns an error ??? Error using ==> loadlibrary at 279 Microsoft Visual C++ 2005 or 2008 is required to use this feature.
Error in ==> opencv_test_prototype at 4
loadlibrary(...
I have Visual Studio 2010 Express as well as 2008 installed and have worked with MEX files before. I dont know how to proceed. Kindly help

답변 (2개)

Kaustubha Govind
Kaustubha Govind 2012년 2월 6일
  댓글 수: 8
chitra
chitra 2012년 2월 8일
Hi Kaustubha and Walter: I followed all the steps described in link http://www.mathworks.com/support/solutions/en/data/1-6IJJ3L/?solution=1-6IJJ3L . Now in mex setup there is no error(the prev err Could not find 64 bit compiler etc vanished). However,the load library error remains! What else is left to do now?
Kaustubha Govind
Kaustubha Govind 2012년 2월 9일
Chitra - you mentioned in your previous comment that you are using R2011a, but from the output of your "mex -setup" it shows that you are using R2010b, which is older than R2011a. The previous discussion I pointed to in my original answer is applicable to you.

댓글을 달려면 로그인하십시오.


Zaigham Bajwa
Zaigham Bajwa 2018년 12월 10일
Failed to find OpenCV libraries in C:\opencv\build\x64\mingw\lib
Dont know what the error is ?Capture.PNG
  댓글 수: 2
Walter Roberson
Walter Roberson 2018년 12월 10일
Where did you install OpenCV ?
Zaigham Bajwa
Zaigham Bajwa 2018년 12월 10일
C:\opencv
This is the location

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by