changeset 70:a52653dca25d

got track features to compile, updated paths to headers and libraries for OpenCV 2
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Sat, 13 Nov 2010 11:20:10 -0500
parents cc192d0450b3
children 45e958ccd9bd
files c/Makefile c/track-features.cpp c/utils.cpp include/cvutils.hpp include/utils.hpp
diffstat 5 files changed, 20 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/c/Makefile	Wed Nov 10 23:41:49 2010 -0500
+++ b/c/Makefile	Sat Nov 13 11:20:10 2010 -0500
@@ -4,9 +4,11 @@
 
 INCLUDE = -I../include
 
+LIBS = -L../../klt
+
 LDFLAGS = -lm
-LDFLAGS += -lboost_program_options-mt -lboost_filesystem-mt -lboost_system-mt -lboost_unit_test_framework-mt
-LDFLAGS += -lfltk
+#LDFLAGS += -lboost_program_options-mt -lboost_filesystem-mt -lboost_system-mt -lboost_unit_test_framework-mt
+#LDFLAGS += -lfltk
 
 CFLAGS = -Wall -W -Wextra
 # -DUSE_OPENCV
@@ -14,10 +16,13 @@
 
 ifneq ($(OPENCV), 0)
 	CFLAGS += -DUSE_OPENCV
-	LDFLAGS += -lhighgui -lcxcore -lcv -lml
+	LDFLAGS += -lopencv_highgui -lopencv_core -lopencv_ml
 endif
 
 ifeq ($(UNAME), Linux)
+	OPENCV_HOME=/usr/local
+	INCLUDE+= -I$(OPENCV_HOME)/include/
+	LIBS += -L$(OPENCV_HOME)/lib
 	LINUX_BOOST_PREFIX = /usr/local
 	CFLAGS += -DLINUX
 	EXE_EXTENSION=''
@@ -42,7 +47,7 @@
 
 #GUI_OBJS = 
 CV_OBJS = cvutils.o
-#COMMON_OBJS = 
+COMMON_OBJS = utils.o
 OBJS = $(COMMON_OBJS) $(CV_OBJS)
 #TESTS_OBJS = 
 
--- a/c/track-features.cpp	Wed Nov 10 23:41:49 2010 -0500
+++ b/c/track-features.cpp	Sat Nov 13 11:20:10 2010 -0500
@@ -7,6 +7,7 @@
 #include "opencv/highgui.h"
 
 #include <iostream>
+#include <fstream>
 #include <string>
 
 using namespace std;
@@ -26,7 +27,6 @@
   int i,j;
   string fnamein, fnameout, tmp;
   string sequenceDir="../test-images";
-  FILE* out;
 
   IplImage *image;
   int width, height;
@@ -144,7 +144,7 @@
 
   int precision = 2;
   ofstream out;
-  openWriteScientific(out, fnameout, precision);//out = fopen(fnameout.c_str(),"w");
+  ::openWriteScientificPrecision(out, fnameout, precision);
 
   //fprintf(out,"%%StartFrame: 0\n");
   //fprintf(out,"%%NumFrames: %d\n",nFrames);
@@ -169,10 +169,10 @@
 	firstFrameNum = i+1;
 	lx.clear();
 	ly.clear();
+      }
     }
+  }
     
-    //fclose(out);
-
   cvReleaseCapture(&sequence);
 
   return 1;
--- a/c/utils.cpp	Wed Nov 10 23:41:49 2010 -0500
+++ b/c/utils.cpp	Sat Nov 13 11:20:10 2010 -0500
@@ -12,7 +12,7 @@
 
 void openWritePrecision(ofstream& out, const string& filename, const int& precision) {
   out.open(filename.c_str(), ios::binary);
-  ::checkFileOpening(out, filename, "openWritePrecision");
+  ::openCheck(out, filename, "openWritePrecision");
   out.precision(precision);
 }
 
--- a/include/cvutils.hpp	Wed Nov 10 23:41:49 2010 -0500
+++ b/include/cvutils.hpp	Sat Nov 13 11:20:10 2010 -0500
@@ -1,7 +1,7 @@
 #ifndef CVUTILS_HPP
 #define CVUTILS_HPP
 
-#include "opencv/cxtypes.h"
+#include "opencv2/highgui/highgui.hpp" // types are in opencv2/core/types_c.h
 
 class CvCapture;
 
--- a/include/utils.hpp	Wed Nov 10 23:41:49 2010 -0500
+++ b/include/utils.hpp	Sat Nov 13 11:20:10 2010 -0500
@@ -1,18 +1,18 @@
 #ifndef UTILS_HPP
 #define UTILS_HPP
 
-#include <iofwd>
+#include <iosfwd>
 
 static const double pi = 3.14159265358979323846;
 
 /** Opens file for writing with fixed scientific precision. */
-void openWriteScientific(ofstream& out, const string& filename, const int& precision);
+void openWriteScientificPrecision(std::ofstream& out, const std::string& filename, const int& precision);
 
-void openWritePrecision(ofstream& out, const string& filename, const int& precision);
+void openWritePrecision(std::ofstream& out, const std::string& filename, const int& precision);
 
 /** Opens files and checks how it went. */
-bool openCheck(ifstream& f, const string& filename, const string& callingFunctionName);
-bool openCheck(ofstream& f, const string& filename, const string& callingFunctionName);
+bool openCheck(std::ifstream& f, const std::string& filename, const std::string& callingFunctionName);
+bool openCheck(std::ofstream& f, const std::string& filename, const std::string& callingFunctionName);
 
 
 // inline