From 401c419d4d3f2fa408353faf8b1d3c7370e1df67 Mon Sep 17 00:00:00 2001 From: John Morrison Date: Fri, 15 Jun 2012 12:37:03 -0400 Subject: fixed process name in process-video-beta, removed pointless mem-limits on FlyTrackingMain --- fly-tools/FlyTrackingMain.cpp | 32 ++++++++++++-------------------- process-video-beta | 3 +-- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/fly-tools/FlyTrackingMain.cpp b/fly-tools/FlyTrackingMain.cpp index 4114a08..ba678a1 100644 --- a/fly-tools/FlyTrackingMain.cpp +++ b/fly-tools/FlyTrackingMain.cpp @@ -1976,7 +1976,7 @@ void processASequence(int startOfATrackSequence, int endOfATrackSequence) { vector fOVector = currentFI.getFOVector(); FlyObject cFFirstFO = fOVector[0]; FlyObject cFSecondFO = fOVector[1]; - + sequenceFirstAverage += cFFirstFO.getArea(); sequenceSecondAverage += cFSecondFO.getArea(); @@ -2030,12 +2030,12 @@ int main(int argc, char* argv[]) return -1; } - MagickCore::SetMagickResourceLimit(MagickCore::MemoryResource, 1536); - MagickCore::SetMagickResourceLimit(MagickCore::MapResource, 4092); + //MagickCore::SetMagickResourceLimit(MagickCore::MemoryResource, 1536); + //MagickCore::SetMagickResourceLimit(MagickCore::MapResource, 4092); string ifns(argv[1]); inputFileName = ifns; -// cout << "input file name is "<>fileName) { -// Image* img = new Image(argv[1]);// = new Image(argv[1]); + // Image* img = new Image(argv[1]);// = new Image(argv[1]); int fi = fileName.find("_"); // current sequence numbers spans from 0 - 18019, so 5 digits are needed @@ -2136,7 +2129,7 @@ int main(int argc, char* argv[]) cout << "Reading file "<columns(),height = img->rows(); - diagLength= static_cast ( sqrt( (height*height) + (width*width) ) ); + diagLength= static_cast ( sqrt( (height*height) + (width*width) ) ); //cout << "Diagonal length is "< Date: Fri, 15 Jun 2012 13:37:18 -0400 Subject: implemented Getopts for sanity, removed some unused variables as well --- fly-tools/FlyTrackingMain.cpp | 78 +++++++++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 28 deletions(-) diff --git a/fly-tools/FlyTrackingMain.cpp b/fly-tools/FlyTrackingMain.cpp index ba678a1..2e963a8 100644 --- a/fly-tools/FlyTrackingMain.cpp +++ b/fly-tools/FlyTrackingMain.cpp @@ -2021,22 +2021,55 @@ ofstream foutSt; ofstream foutDebugCen; ofstream foutDebugSpeed; -int main(int argc, char* argv[]) +int main(int argc, char **argv) { - if (argc < 5) - { - cerr << "Usage: executablename " << endl; // input file contains name of the - // input image files - return -1; - } - + int c; + int writeFinalImages; + string usage = "Usage: FlyTracking -i -o -f -m -O "; + string origImagePath; + string finalOutputPath; + string outputFilePrefix; + string maskImagePath; + string inputFileName; + opterr = 0; + + while ((c = getopt (argc, argv, "i:f:m:p:o:hx")) != -1) + switch (c) + { + case 'i': + inputFileName = optarg; + break; + case 'o': + origImagePath = optarg; + break; + case 'f': + finalOutputPath = optarg; + break; + case 'm': + maskImagePath = optarg; + break; + case 'p': + outputFilePrefix = optarg; + break; + case 'h': + cout << usage << endl; + exit(1); + break; + case 'x': + writeFinalImages; + break; + default: + break; + } + //MagickCore::SetMagickResourceLimit(MagickCore::MemoryResource, 1536); //MagickCore::SetMagickResourceLimit(MagickCore::MapResource, 4092); - string ifns(argv[1]); - inputFileName = ifns; - // cout << "input file name is "<