This isn’t so much as for others as it’s a “note to self”.
I’ve recently begun actual work at my research course. Obviously, I prefer to use Octave to Matlab. Here’s how to use the SURFmex toolkit for Matlab with Octave:
Download the source and unzip it someplace. You can get rid of the mexw{32,64} directories, since they’re binaries for Windoz.
Create a folder called mex, just to keep all our output mex files together.
Install the opencv-devel package. On fedora:
$ su -c 'yum install opencv-devel'
Then, compile the cpp files into mex files:
$ mkoctfile-3.6.2 --mex -v `pkg-config --libs --cflags opencv` surfpoints.cpp
$ mkoctfile-3.6.2 --mex -v `pkg-config --libs --cflags opencv` surfmatch.cpp
# Move them to your mex folder:
$ mv *.mex mex/ -v
You should now have two mex files generated:
[ankur@ankur SURFmex-v2(master *%)]$ cd mex/ [ankur@ankur mex(master *%)]$ ll total 484 rwxrwxr-x. 1 ankur ankur 219400 Aug 22 11:20 surfmatch.mex rwxrwxr-x. 1 ankur ankur 273339 Aug 22 11:20 surfpoints.mex
That’s pretty much it. All the hints were in the make.m file really.
To run one of the examples:
Copy an image to the examples folder and name it peppers.png. This appears to be one of the default images that matlab provides.
$ cd examples/ octave octave> octave> addpath ../mex % add the mex files to path octave> addpath ../common % add the common functions to the path octave> path % check your path octave> small_example
Your screenshot won’t look like this. I’ve modified the example a little to use different images.


Great that you got it to work!
Hi,
Can you help me PLZ,
I have some problem’s when i compile “surfpoints.cpp” and “surfmatch.cpp” under matlab; i have this :
In file included from surfpoints.cpp:21:
cppmatrix.h: In member function ‘void matrix::init(const mxArray*) [with T = unsigned char]’:
cppmatrix.h:32: instantiated from ‘matrix::matrix(const mxArray*) [with T = unsigned char]’
surfpoints.cpp:59: instantiated from here
cppmatrix.h:37: error: ‘~matrix’ is not a member of ‘matrix’
mex: compile of ‘ “surfpoints.cpp”‘ failed.
??? Error using ==> mex at 207
Unable to complete successfully.
Hey,
I haven’t done it on matlab so I’m not really sure. May be you could ask their forums?
thank you for your repense.
I thought this is the same approach that Octave,
Can you give me the link of forums, please
thank you again