Compilation on Linux with Octave #3

Closed
wants to merge 1 commit into
from
View
@@ -31,6 +31,8 @@ INSTALLATION
...
3. Linux
...
+ 1,1, Install Octave & OpenCV
+ sudo apt-get install octave3.2 octave3.2-headers libcv-dev
Copyright 2011 Zdenek Kalal
View
@@ -63,7 +63,23 @@
if isunix
disp('Unix');
- % to come
+ include = ' -I/usr/include/opencv/ -I/usr/include/'; % /opt/local -> /usr/local
+ libpath = '/usr/lib/'; % /opt/local -> /usr/local
+
+ files = dir([libpath 'libcv.so']);
@bilderbuchi
bilderbuchi Apr 12, 2011

Interestingly, here I had to say
files = [dir([libpath 'libcv.so']) dir([libpath 'libcxcore.so'])];
to make it compile in matlab, ubuntu maverick 10.10 32bit.
Just fyi, I don't yet know what to make of it.

@gzsombor
gzsombor Apr 12, 2011

hmm, yes, interesting. What is failing when that libcxcore.so is missing ? Unfortunately I'm not able run the code yet, so it is possible that you are right, and that cvcore is needed to

@bilderbuchi
bilderbuchi Apr 12, 2011

can't tell you right now, only got matlab at work. it was complaining about an undeclared function. a quick googling showed that said function was included in libcxcore.so, so including it solved it.

@bilderbuchi
bilderbuchi Apr 13, 2011

probably from a wrong opencv version. turns out current ubuntu package is only 2.1, not yet 2.2.

+
+ lib = [];
+ for i = 1:length(files),
+ lib = [lib ' ' libpath files(i).name];
+ disp(lib);
+ end
+ eval(['mex lk.cpp ' include lib]);
+ mex -c tld.cpp
+ mex fern.cpp tld.o
+ mex linkagemex.cpp
+ mex bb_overlap.cpp
+ mex warp.cpp
+ mex distance.cpp
end
View
@@ -16,9 +16,9 @@
// along with TLD. If not, see <http://www.gnu.org/licenses/>.
#include "cv.h"
-#include "highgui.h"
@bilderbuchi
bilderbuchi Apr 12, 2011

why did you remove this?

@gzsombor
gzsombor Apr 12, 2011

Because there was no "highgui.h" in OpenCV 2.1, fortunately the code doesn't need it.

@bilderbuchi
bilderbuchi Apr 12, 2011

you do know about the packages libhighgui2.1 and libhighgui-dev? (e.g. in ubuntu repo)
OTOH, good to not include it if it's not needed. :-)

#include "math.h"
#include <limits>
+#include <stdio.h>
#ifdef _CHAR16T
#define CHAR16_T
#endif
@@ -15,7 +15,9 @@
% You should have received a copy of the GNU General Public License
% along with TLD. If not, see <http://www.gnu.org/licenses/>.
-beep off;
+if !isunix
+ beep off;
+end
clc; clf;
clear tld;
clear global;