diff options
author | John Morrison <jcm357@cs.drexel.edu> | 2014-10-28 14:31:05 -0400 |
---|---|---|
committer | John Morrison <jcm357@cs.drexel.edu> | 2014-10-28 14:31:05 -0400 |
commit | 3dd70b4d0e20f517f515a8b1d0ad7b5d79f48621 (patch) | |
tree | bccabe5e9169e2e843fba8d307ab4e117f6cf49f /fly-tools/background | |
parent | 01b3b8f87c1d4be14438a0fdc2a4daade9eb3038 (diff) | |
parent | bda4a425da1073ca38b7ccf006d02f65b25a4755 (diff) |
Merge branch 'master' of github.com:mutantturkey/FlyTracking
Diffstat (limited to 'fly-tools/background')
-rw-r--r-- | fly-tools/background/main.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/fly-tools/background/main.cpp b/fly-tools/background/main.cpp index b01305e..7504ab2 100644 --- a/fly-tools/background/main.cpp +++ b/fly-tools/background/main.cpp @@ -9,9 +9,13 @@ #define array(i,j,k,l) (array[height*width*i + width*j + k + l]) int nImages; + unsigned long height = 0; unsigned long width = 0; +using namespace std; +using namespace cv; + int findmax(long *p, int n) { int mx = 0, v = p[0]; for (int i = 1; i < n; i++) { @@ -23,8 +27,6 @@ int findmax(long *p, int n) { return mx; } -using namespace std; -using namespace cv; int main(int argc, char **argv ) { @@ -59,9 +61,9 @@ int main(int argc, char **argv ) { IplImage *first_image = NULL; IplImage *output_image = NULL; - int i,j, k; - int height = 0; - int width = 0; + unsigned int i = 0; + unsigned int j = 0; + unsigned int k = 0; string filename; @@ -75,11 +77,12 @@ int main(int argc, char **argv ) { // Read first line for our first image and rewind - input_file>>filename; + getline(input_file, filename); first_image = cvLoadImage(filename.c_str(), CV_LOAD_IMAGE_UNCHANGED); if(!first_image) { + cerr << "couldn't read first image" << endl; exit(1); } @@ -100,7 +103,7 @@ int main(int argc, char **argv ) { input_file.clear(); input_file.seekg(0); - while(input_file>>filename) { + while (!getline(input_file, filename).eof()) { nImages++; } @@ -116,7 +119,7 @@ int main(int argc, char **argv ) { input_file.clear(); input_file.seekg(0); - while (input_file>>filename) { + while (!getline(input_file, filename).eof()) { IplImage *input_image = NULL; input_image = cvLoadImage(filename.c_str(), CV_LOAD_IMAGE_UNCHANGED); |