5.0

5.0 | 2 ratings Rate this file 109 Downloads (last 30 days) File Size: 313.57 KB File ID: #21818

OpenCV And MEX Files quick guide

by Rachel Esman

 

20 Oct 2008 (Updated 21 Oct 2008)

How to use openCV library in MATLAB

| Watch this File

File Information
Description

This document was created as part of a final project for a BSc degree at the Academic College of Tel-Aviv Yaffo, by Rachely Esman and Yoad Snapir, under the supervision of Tal Hassner.
As part of the project, we used Intel's OpenCV library, calling its functions from MATLAB. We found the subject tricky and thus decided to share the experience of our work with others describing the common pitfalls.
 You can use this document freely according to the copyrights noted below but under your sole responsibility.

Acknowledgements
This submission has inspired the following:
Image Aquisition
MATLAB release MATLAB 7.5 (R2007b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (7)
20 Oct 2008 Joaquim Luis

You would have saved yourself s a lot of work if you had searched the FEX and found "cvlib_mex" wich, BTW, uses only C (not C++).

18 Dec 2008 Fabio Caponetti

Hi, I was looking for the wrapper lib cvlib_mex, but I cannot find a working link to download it!

I would like to test it under Linux and the newest Matlab version...

regards

05 Mar 2009 Joaquim Luis

It was me who removed all contribs from FEX.
I got too pissed off with TMW. See
http://www.mathworks.com/matlabcentral/newsreader/view_thread/239279#611833

Anyway, cvlib_mex as well as my other files are now available at
http://code.google.com/p/j-ml-contrib/source/browse/

05 Jul 2010 Art

Hello.
I have read this paper and try it. I use Matlab 2010, OpenCV1.1 and Visual Studio 2008. There is a big trouble: when I call mex-function, that contains a call of OpenCV functions ( such as cvNamedWindow, cvLoadImage and cvDestroyAllWindows, cvReleaseImage, etc. ) it's look all right, but there is a fail later, when I call matlab functions of Calibration Toolbox for Matlab. For example, I call one mex-function and after that the toolbox loads images and crush comes, but crush comes not at the momemnt of mex-function calling, but much later. In fact Matlab crushes on that code:
mask = exp(-((-wintx:wintx)'/(wintx)).^2) * exp(-((-winty:winty)/(winty)).^2);
In other words, it looks like crush happens, when there were computing intensive operations =)
It looks very strange that during the time after a calling mex-function and before crush, windows are creating and some matlab code works fine.
Could anybody help me solve this problem? Thanks

13 Apr 2011 Zhou

First I copied your method without any modification but I failed. Then I found my directories are different from yours. I used Visual Studio 8.0 as the compiler and I built a debug and release version respectively. Then the .lib files should be in OPENCVDIR\VS2005\lib\debug,OPENCVDIR\VS2005\lib\release,OPENCVDIR\VS2005\bin\debug,OPENCVDIR\VS2005\bin\release respectively.
(Btw, the VS2005 directory is not there at first place, but was built when I used CMake to make the files, containing the built .sln and other files. You can name it differently, but the you should refer to compiled .libs.)
Also the .h files are in different places, possibly because I use a different version of OpenCV(I use 2.0). In this case it's in OPENCVDIR\include\opencv.

I still thank the author for making the principle right. All you have to pay attetion to is the concrete path names.

13 Jul 2011 Aakash  
23 Feb 2012 Gareth Bell

Try

http://www.cs.stonybrook.edu/~kyamagu/mexopencv/index.html

while it lasts.

Please login to add a comment or rating.
Updates
21 Oct 2008

updated

Tag Activity for this File
Tag Applied By Date/Time
external interface Rachel Esman 22 Oct 2008 10:25:19
opencv Rachel Esman 22 Oct 2008 10:25:19
utilities Rachel Esman 22 Oct 2008 10:25:19
external interface Fabio Caponetti 18 Dec 2008 05:13:05
opencv Fabio Caponetti 18 Dec 2008 05:13:08
opencv Florian 06 Jan 2009 07:57:28
external interface Florian 06 Jan 2009 07:57:30
external interface Richard 18 Feb 2009 18:16:31
opencv Andrew 02 Mar 2009 18:14:12
external interface chanseok choi 07 Feb 2010 23:32:06
utilities gaofeng Wu 10 Apr 2010 03:54:40
external interface dung pc 14 Apr 2010 08:50:29
opencv Riku 15 Jul 2010 06:40:05
external interface Sharon 03 Feb 2011 04:44:11
external interface Andreu Mora 13 Mar 2012 09:30:52

Contact us at files@mathworks.com