From 189eb7af124ecc1b1f9666781f566b8b01678af3 Mon Sep 17 00:00:00 2001 From: mutantturkey Date: Mon, 24 Sep 2012 16:42:11 -0400 Subject: clean up FlyTrackingMain a little, still needs eons of work --- fly-tools/FlyTrackingMain.cpp | 44 +++++++------------------------------------ 1 file changed, 7 insertions(+), 37 deletions(-) (limited to 'fly-tools') diff --git a/fly-tools/FlyTrackingMain.cpp b/fly-tools/FlyTrackingMain.cpp index 76dfa5c..7f7e77e 100644 --- a/fly-tools/FlyTrackingMain.cpp +++ b/fly-tools/FlyTrackingMain.cpp @@ -467,7 +467,7 @@ if (inWhite) // if the line started as a white pixel then discard the line fragment if (startedWhite == false) { int val = roundT(dist(x_init, y_init, x, y)); -//*output<<" val is = " << val << " at (x0,y0) = " << x_init << "," << y_init << " to (x1,y1) = " << x << "," << y < 1) { @@ -2203,25 +2194,13 @@ int main(int argc, char **argv) string cDDistFileName = finalOutputPath + outputFilePrefix + "_centroidDist.txt"; - string hDAngleDistFileName = finalOutputPath + outputFilePrefix + "_headDist.txt"; - string speedDistFileName = finalOutputPath + outputFilePrefix + "_speedDist.txt"; writeHist(cDDistFileName.c_str(), centroidDistanceMap); - writeHist(hDAngleDistFileName.c_str(), headDirAngleMap); - writeHist(speedDistFileName.c_str(), speedMap); - - //double percentageLookingAt = static_cast(totalMaleLookingAtFemale)/static_cast (fileCounter-totalUnprocessedFrame); - //percentageLookingAt *= 100.0; - - //double percentageSingleBlob = static_cast(totalSingleBlob)/static_cast(fileCounter); - //percentageSingleBlob *= 100.0; - - // new calculation of percentage look at should consider only those frames where the flies are separated double percentageLookingAt = static_cast(totalMaleLookingAtFemale+totalFemaleLookingAtMale)/static_cast(totalSeparated); percentageLookingAt *= 100.0; @@ -2240,19 +2219,15 @@ int main(int argc, char **argv) foutSt<<"Percentage of frame in looking at mode "<pixelColor(point.first, point.second,"white"); } - int hits = draw_line_bm(maskImage, x1, y1, x0, y0); + /*int hits= */ draw_line_bm(maskImage, x1, y1, x0, y0); //maskImage->strokeColor("red"); @@ -2475,13 +2450,11 @@ void findTheStartPoint(string fileName, int desiredSize, int otherSize, int cen_ delete residual; - delete image; - delete maskImage; - } + void calculateStatistics(FrameInfo currentFI, string fileName, int isFirst, bool singleBlob, bool isHitting, bool isHittingFemaleToMale, bool unprocessed) { foutSt<< "Statistics generation for "< maleCentroid = maleFO.getCentroid(); - - pair maleMajorAxisEV = maleFO.getMajorAxisEV(); - - bool maleEVDir = maleFO.getHeadIsInDirectionMAEV(); - pair femaleCentroid = femaleFO.getCentroid(); + pair maleMajorAxisEV = maleFO.getMajorAxisEV(); pair femaleMajorAxisEV = femaleFO.getMajorAxisEV(); + bool maleEVDir = maleFO.getHeadIsInDirectionMAEV(); bool femaleEVDir = femaleFO.getHeadIsInDirectionMAEV(); -- cgit v1.2.3