Ko user1744439
Ko user1744439

Reputation: 23

Errors when run compile.m for TLD

I am installing the TLD application based on the instructions shown on https://github.com/zk00006/OpenTLD/wiki/Installation

Using:

OpenCV 2.4.2

Matlab R2010b x 64bits

Win7 x 64

VS2010 Professional

Everything works fine until I executed this step "6) In Matlab, run compile.m"

" PC Creating library C:\Users\Ko\AppData\Local\Temp\mex_VUBK1k\templib.x and object C:\Users\Ko\AppData\Local\Temp\mex_VUBK1k\templib.exp

lk.obj : error LNK2019: unresolved external symbol cvReleaseImage referenced in function "void __cdecl normCrossCorrelation(struct _IplImage *,struct _IplImage *,struct CvPoint2D32f *,struct CvPoint2D32f *,int,char *,float *,int,int)" (?normCrossCorrelation@@YAXPEAU_IplImage@@0PEAUCvPoint2D32f@@1HPEADPEAMHH@Z)

lk.obj : error LNK2019: unresolved external symbol cvMatchTemplate referenced in function "void __cdecl normCrossCorrelation(struct _IplImage *,struct _IplImage *,struct CvPoint2D32f *,struct CvPoint2D32f *,int,char *,float *,int,int)" (?normCrossCorrelation@@YAXPEAU_IplImage@@0PEAUCvPoint2D32f@@1HPEADPEAMHH@Z)

lk.obj : error LNK2019: unresolved external symbol cvGetRectSubPix referenced in function "void __cdecl normCrossCorrelation(struct _IplImage *,struct _IplImage *,struct CvPoint2D32f *,struct CvPoint2D32f *,int,char *,float *,int,int)" (?normCrossCorrelation@@YAXPEAU_IplImage@@0PEAUCvPoint2D32f@@1HPEADPEAMHH@Z)

lk.obj : error LNK2019: unresolved external symbol cvCreateImage referenced in function "void __cdecl normCrossCorrelation(struct _IplImage *,struct _IplImage *,struct CvPoint2D32f *,struct CvPoint2D32f *,int,char *,float *,int,int)" (?normCrossCorrelation@@YAXPEAU_IplImage@@0PEAUCvPoint2D32f@@1HPEADPEAMHH@Z)

lk.obj : error LNK2019: unresolved external symbol cvCalcOpticalFlowPyrLK referenced in function mexFunction

lk.obj : error LNK2019: unresolved external symbol cvAlloc referenced in function mexFunction

lk.mexw64 : fatal error LNK1120: 6 unresolved externals

C:\PROGRA~1\MATLAB\R2010B\BIN\MEX.PL: Error: Link of 'lk.mexw64' failed.

??? Error using ==> mex at 208 Unable to complete successfully.

Error in ==> compile at 32 eval(['mex lk.cpp -O' include lib]);

"

I have searched through many websites but to no avail. Hopefully, someone can enlighten me on this problem. All solutions are greatly appreciated.

Upvotes: 1

Views: 1588

Answers (1)

user349026
user349026

Reputation:

If you have read the instructions well, and followed them, then you must have created the .mex binary output files. That is compiling the mex files that contain opencv codes. You are getting the errors as you have not been able to compile them properly. Check the folders for mex32 files.

Here are the step to accomplish a complete compilation and a successful run, hope this works for you

1 - Install OpenCV 2.2, not beyond 2.2. This get crazy if you try to do so. And install it to C:/OpenC2.2, maker sure you do not use any spaces. Spaces makes path search in Matlab go coo coo. Actually spaces are broken up in Matlab.

2 - If you have a x64 system, with 64Bit Matlab (2011) and 64Bit C++ compilers, you will need select via 'mex' compiler options a 32 bit compiler. I used MSVC C++ 9.0 32 bit compiler.

3 - Once you have selected the compiler, do the compilation. You must have a successful compilation. Try using the debug flags for compiler and once compilation completes you will get an output. If any errors occur, try fixing them.

4- What this means is that donot change any paths that have been set in OpenTLD to find OpenCV2.2 - This is the most tricky part. You can install openTLD anywhere. Just make sure that you have selected 32bit C++ compilers. NOT 64bit.

Once the above is done. You should be able to do a run. OpenTLD is cool after the first run!

Upvotes: 2

Related Questions