An error while use of SURFpoints.m / problem with SURFmex library

I have a problem with use of SURFmex library. I started with download of Object Matching files from the Matlab webpage below:
But an error occures with the file SURFpoints.
Cannot find an exact (case-sensitive) match for 'SURFpoints'
The closest match is: surfpoints in C:\Users\Krzysztof\Desktop\surfmex-master\mexw64\surfpoints.m
I have downloaded SURFmex Library and run startup, but there is new error:
Attempt to execute SCRIPT surfpoints as a function:
C:\Users\Krzysztof\Desktop\surfmex-master\mexw64\surfpoints.m
I tried to replace the files Matlab/toolbox/vision/SURFpoints.m with surfmex-master\mexw64\surfpoints.m with exchange of letters, but now I have this one:
The constructor for class 'SURFpoints' must return only one output value.
How to run this correctly? I have 2016B.

6 Comments

It looks likely to me that you need to use mex to compile C source code into a mexw64 binary.
Edit make.m to reflect the location of opencv. Then run make to create the mex library.
Ok I did it, but there are new warnings:
MEX completed successfully.
surfmatch OK
Building with 'MinGW64 Compiler (C++)'.
Error using mex
C:\Users\Krzysztof\Desktop\Nowy folder\surfmex-master\surfpoints.cpp: In function 'void mexFunctionReal(int,
mxArray**, int, const mxArray**)':
C:\Users\Krzysztof\Desktop\Nowy folder\surfmex-master\surfpoints.cpp:56:2: error: 'initModule_nonfree' is not a
member of 'cv'
cv::initModule_nonfree();
^
C:\Users\Krzysztof\Desktop\Nowy folder\surfmex-master\surfpoints.cpp:62:2: error: 'matrix' was not declared in
this scope
matrix<unsigned char> mximg(prhs[0]);
^
C:\Users\Krzysztof\Desktop\Nowy folder\surfmex-master\surfpoints.cpp:62:9: error: expected primary-expression
before 'unsigned'
matrix<unsigned char> mximg(prhs[0]);
^
In file included from C:\Users\Krzysztof\Desktop\Nowy folder\surfmex-master\mextiming.h:16:0,
from C:\Users\Krzysztof\Desktop\Nowy folder\surfmex-master\surfpoints.cpp:18:
C:\Users\Krzysztof\Desktop\Nowy folder\surfmex-master\surfpoints.cpp:63:9: error: 'mximg' was not declared in
this scope
ASSERT(mximg.O == 1);
^
C:\Users\Krzysztof\Desktop\Nowy folder\surfmex-master\mexutils.h:22:28: note: in definition of macro 'ASSERT'
#define ASSERT(cond) if (!(cond)) { std::stringstream sout; \
^
C:\Users\Krzysztof\Desktop\Nowy folder\surfmex-master\surfpoints.cpp:68:2: error: 'CvSURFParams' was not declared
in this scope
CvSURFParams params = cvSURFParams(500, 0);
^
C:\Users\Krzysztof\Desktop\Nowy folder\surfmex-master\surfpoints.cpp:83:17: error: 'params' was not declared in
this scope
params.nOctaveLayers = int(value+0.5);
^
C:\Users\Krzysztof\Desktop\Nowy folder\surfmex-master\surfpoints.cpp:86:17: error: 'params' was not declared in
this scope
params.nOctaves = int(value+0.5);
^
C:\Users\Krzysztof\Desktop\Nowy folder\surfmex-master\surfpoints.cpp:89:17: error: 'params' was not declared in
this scope
params.hessianThreshold = value;
And so on (it's only a part of them). When I run Demo.m from Object Matching, I still have old warning "[...] only one output value".
Hmmm, that output would tend to suggest that you have a different opencv header file. That could be due to having a random directory in your include path that should not be there, or it could be due to an incompatibility of OpenCV versions. You get those kinds of errors when using code designed with OpenCV2 with an OpenCV3 installation.
I have download other mex64 folder and everything is fine now. It seems it was something wrong with files or version of files, but I'm not sure. Thanks for help.

Sign in to comment.

Answers (0)

Categories

Asked:

on 22 Jan 2020

Commented:

on 29 Jan 2020

Community Treasure Hunt

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

Start Hunting!