Nuffnang Ads
Showing posts with label imaging. Show all posts
Showing posts with label imaging. Show all posts
Friday, December 28, 2012
Tuesday, December 4, 2012
Matlab 2012 link with opencv VS2010 (mex setup)
To use OpenCV library
Download mexopencv library from https://github.com/kyamagu/mexopencv
Prerequiste Components:
VC++ Compiler (included in VS2010)
Microsoft SDK 7.1 (included in VS2010)
Matlab
Download mexopencv library from https://github.com/kyamagu/mexopencv
Prerequiste Components:
VC++ Compiler (included in VS2010)
Microsoft SDK 7.1 (included in VS2010)
Matlab
- Open Matlab, type mex -setup in command windows
- Check whether there is any default compiler
- If no default compiler, choose a compiler from the list
- Type command cv.make('opencv_path','your\opencv\path')- replace your opencv path with your opencv directory (E.g. 'C:\OpenCV2.4')
- Let it compile
- After compiled, type addpath('mexopencv_path') - This must be called first for every project that used opencv library
- Type 'help cv' to display list of opencv command
- Can start using opencv library
Tutorial
http://www.cs.stonybrook.edu/~kyamagu/mexopencv/
https://github.com/kyamagu/mexopencv/blob/master/README.markdown
List of opencv function
http://www.cs.stonybrook.edu/~kyamagu/mexopencv/matlab/
OpenCV 2.4.2 Visual Studio 2010 (VS2010) Windows 7 64bit setup
Installation of OpenCV 2.4.2 for Visual Studio 2010 (Windows 7 x64)
Download the latest OpenCV library from sourceforge (2.4.2 or 2.4.3)
Download the latest OpenCV library from sourceforge (2.4.2 or 2.4.3)
- Right Click My Computer -> Properties -> Advance System Setting -> Environment Variables -> Path -> Type in OpenCV dir ("C:\OpenCV2.4\build\x64\bin")
- Open Visual Studio 2010. Click New Project -> Select Win32 Console Application -> Check Empty Project -> Finish
- Click Property Manager Tab (Bottom right) -> Create 2 New Property Sheets with preference name ( OPENCV_DEBUG & OPENCV_RELEASE)
- Open OPENCV_DEBUG Property Sheet
- For C/C++ - Add path for Additional Include Directories (OpenCV2.4\build\include)
- For Linker/General - Add path for Additional Library Directories (OpenCV2.4\build\x64\vc10\lib)
- For Linker/General - Add the following lib file (For OpenCV2.4.3). The list of lib file can be found in OpenCV2.4\build\x64\vc10\lib:
opencv_core243d.lib
opencv_imgproc243d.lib
opencv_highgui243d.lib
opencv_ml243d.lib
opencv_video243d.lib
opencv_features2d243d.lib
opencv_calib3d243d.lib
opencv_objdetect243d.lib - Repeat the steps for OPENCV_RELEASE, and change the lib file for Linker/General to:
opencv_core243.lib
opencv_imgproc243.lib
opencv_highgui243.lib
opencv_ml243.lib
opencv_video243.lib
opencv_features2d243.lib
opencv_calib3d243.lib
opencv_objdetect243.lib
same filenames with 'd' - debug version removed - To run x64 environment
Go Build -> Configuration Manager -> Active Solution Platform -> New -> Change Itanium to x64 - Compile and run opencv code
- If tbb_debug.dll not found (for OpenCV 2.4.2), (OpenCV2.4.3 does not has this problem). Go download the tbb_debug.dll file from Intel Threading Building Blocks. extract x64 version and place into OpenCV\build\x64\bin
- if 32-bit win, extract x86 version out and place into OpenCV\build\x86\bin
- Compile your opencv code
Note:
For some PC there will be Illegal Instruction Error when running cvHaarDetectObjects library (2.4.3 version). (Rare case).
Solution: Use 2.4.2 version
Subscribe to:
Posts (Atom)