zk00006 / OpenTLD

OpenTLD is an open source library for real-time 2D tracking of a single object in video. This repository is no longer under development. For latest version see: http://www.tldvision.com/tld2.html
GNU General Public License v3.0
2.09k stars 1.27k forks source link

Compile errors (Ubuntu, MatLAB) #55

Open GerardWalsh opened 7 years ago

GerardWalsh commented 7 years ago

Hi there. I'm trying to run the TLD algorithm on Ubuntu 16.04 (64-bit) and MatLAB R2016b

I have not installed openCV, but rather the libraries as stated in the installation guide by

sudo apt-get install libcv-dev

When running compile.m from within MatLAB I get the error (s)

Error using mex /tmp/mex_12399154940837_20301/lk.o: In function normCrossCorrelation(_IplImage*, _IplImage*, CvPoint2D32f*, CvPoint2D32f*, int, char*, float*, int, int)': lk.cpp:(.text+0x1a0): undefined reference tocvCreateImage' lk.cpp:(.text+0x1b9): undefined reference to cvCreateImage' lk.cpp:(.text+0x1d6): undefined reference tocvCreateImage' lk.cpp:(.text+0x214): undefined reference to cvGetRectSubPix' lk.cpp:(.text+0x227): undefined reference tocvGetRectSubPix' lk.cpp:(.text+0x23b): undefined reference to cvMatchTemplate' lk.cpp:(.text+0x274): undefined reference tocvReleaseImage' lk.cpp:(.text+0x27d): undefined reference to cvReleaseImage' lk.cpp:(.text+0x286): undefined reference tocvReleaseImage' /tmp/mex_12399154940837_20301/lk.o: In function mexFunction': lk.cpp:(.text+0x323): undefined reference tocvReleaseImage' lk.cpp:(.text+0x341): undefined reference to cvReleaseImage' lk.cpp:(.text+0x438): undefined reference tocvCreateImage' lk.cpp:(.text+0x455): undefined reference to cvCreateImage' lk.cpp:(.text+0x4be): undefined reference tocvCreateImage' lk.cpp:(.text+0x4dc): undefined reference to cvCreateImage' lk.cpp:(.text+0x553): undefined reference tocvAlloc' lk.cpp:(.text+0x565): undefined reference to cvAlloc' lk.cpp:(.text+0x578): undefined reference tocvAlloc' lk.cpp:(.text+0x613): undefined reference to cvAlloc' lk.cpp:(.text+0x61e): undefined reference tocvAlloc' /tmp/mex_12399154940837_20301/lk.o:lk.cpp:(.text+0x626): more undefined references to cvAlloc' follow /tmp/mex_12399154940837_20301/lk.o: In functionmexFunction': lk.cpp:(.text+0x6c1): undefined reference to cvCalcOpticalFlowPyrLK' lk.cpp:(.text+0x73e): undefined reference tocvCalcOpticalFlowPyrLK' collect2: error: ld returned 1 exit status

Error in compile (line 77) eval(['mex lk.cpp -O' include lib]);

I have implemented the changes to the files as in Schloegl's pull request and thought this would sort out the error (s) I thought there were between linking MatLAB and OpenCV's libraries

Thanks Gerard

fabiovii commented 6 years ago

Hi,

I have the very same problem of @gerrywalsh when executing the line:

eval(['mex lk.cpp -O' include lib]);

However, if I run the command with the -c option (which means "Compiles an object file only. Does not build a binary MEX file.") compilation end successfully (but then "run_TLD.m" fails with "Undefined function or variable 'lk' since the associated mex does not exist I believe" )

I tried also to link to version 2.4 of opencv but the same error occurs.

Thanks