From c2eefdd85b4b093f29ab9e83ad76a6e62c388da1 Mon Sep 17 00:00:00 2001 From: mutantturkey Date: Tue, 2 Oct 2012 20:12:12 -0400 Subject: cleaning up FlyTrackingMain --- fly-tools/FlyTrackingMain.cpp | 50 ++++++++++++++++--------------------------- 1 file changed, 18 insertions(+), 32 deletions(-) (limited to 'fly-tools/FlyTrackingMain.cpp') diff --git a/fly-tools/FlyTrackingMain.cpp b/fly-tools/FlyTrackingMain.cpp index 7ae34f8..c68fe3c 100644 --- a/fly-tools/FlyTrackingMain.cpp +++ b/fly-tools/FlyTrackingMain.cpp @@ -38,10 +38,12 @@ vector fIForHeadVector; // since for the first time the head is automatically need to be set int startIndexToFindNewHead=0; int endIndexToFindNewHead; + double initLargeLocationX=-1; double initLargeLocationY=-1; double initSmallLocationX=-1; double initSmallLocationY=-1; + pair largeCollisionBeforeDirection; pair smallCollisionBeforeDirection; @@ -144,24 +146,21 @@ void writeHist(const char* filename, map dataMap) unsigned int first = front->first, last = back->first; *output << "Min: " << first << " " << "Max: " << last << " " << "Count: " << last-first << endl; - //vector hist(last-first, 0); vector hist(last+1, 0); -// *output << "hist size: " << hist.size() << endl; - try{ - for(unsigned int j = 0; j dataMap) fout << first << " " << last << " " << hist.size() << endl; fout.close(); } - catch (...) - { cerr << "Bad memory loc for opening file" << endl; } + catch (...) { + cerr << "Bad memory loc for opening file" << endl; + } + } void findObj(Image* img, int x, int y, vector > & shape ,bool eightCon=true, bool colorLookingFor=true); @@ -735,7 +736,6 @@ int draw_line_bm(Image* maskImage, int x0, int y0, int x1, int y1) { putPixel(maskImage,x, y); if (isInFemaleBlob == true) return 1; - } break; @@ -1001,32 +1001,24 @@ int sequenceCondition(FrameInfo prevFI,FrameInfo currentFI) { void drawTheSequence(int startIndex, int endIndex, int isFirst, bool singleBlob, bool unprocessed) { *output << "Should draw "<>fileName; - //inputFileName = "*output/identified/"+fileName; FrameInfo prevFI = fIVector[startIndex]; - cout << "Extracting information for image "<< fnVector[startIndex] << endl; + + *output << "Extracting information for image "<< fnVector[startIndex] << endl; + *output<>fileName; fileName = fnVector[i]; - // inputFileName = "*output/identified/"+fileName; drawTheFlyObject(nextFI, fileName, isFirst, singleBlob, unprocessed); } - //inputFile.close(); } @@ -1253,12 +1245,6 @@ void velocityDirections(int stIndex, int endIndex) { *output << "From index "< velDirectionF; -- cgit v1.2.3