From 117eaca2326631e2846049923fbff7f0fef2c23e Mon Sep 17 00:00:00 2001 From: Jamie Allen Date: Tue, 21 Feb 2012 17:51:14 +0100 Subject: [PATCH] commit for david tues 21st 17:51 --- example/main.cpp | 4 ++-- src/CamNoiseAnalysis.cpp | 7 +++++-- src/ColorMultiAnalysis.cpp | 4 +++- src/ColorSingleAnalysis.cpp | 4 +++- src/DiffNoiseAnalysis.cpp | 4 +++- src/IResponseAnalysis.cpp | 2 +- src/RelaxRateAnalysis.cpp | 5 +++-- src/ShadowScapesAnalysis.cpp | 7 ++++--- src/ShapeFromShadingAnalysis.cpp | 4 +++- src/StrobeAnalysis.cpp | 6 ++++-- 10 files changed, 31 insertions(+), 16 deletions(-) diff --git a/example/main.cpp b/example/main.cpp index 5235338..5eab23e 100755 --- a/example/main.cpp +++ b/example/main.cpp @@ -12,8 +12,8 @@ int main() { bool fullscreen; - fullscreen = true; - //fullscreen = false; + //fullscreen = true; + fullscreen = false; cout << "> display configuration" << endl; cout << "* fullscreen: " << (fullscreen ? "yes" : "no") << endl; diff --git a/src/CamNoiseAnalysis.cpp b/src/CamNoiseAnalysis.cpp index 4ffff3f..24b84a0 100755 --- a/src/CamNoiseAnalysis.cpp +++ b/src/CamNoiseAnalysis.cpp @@ -18,8 +18,9 @@ void CamNoiseAnalysis::setup(int camWidth, int camHeight) int acq_run_time = 20; // 20 seconds of acquiring per run - DELTA_T_SAVE = 10*acq_run_time/2; // for 20 seconds, we want this to be around 200 files - // or 10 times per second = every 100 ms + DELTA_T_SAVE = 2*(10*acq_run_time/2); + // for 20 seconds, we want this to be around 200 files + // or 10 times per second = every 100 ms _frame_cnt_max = acq_run_time*ofGetFrameRate(); // e.g.: 30 frames per second * 20 seconds = 600 frames @@ -303,6 +304,8 @@ void CamNoiseAnalysis::save_cb(Timer& timer) if (RefractiveIndex::_vidGrabber.isFrameNew()) { RefractiveIndex::_pixels = RefractiveIndex::_vidGrabber.getPixelsRef(); //get ofPixels from the camera + } else { + return; } //cout << "CamNoiseAnalysis::saving...\n"; diff --git a/src/ColorMultiAnalysis.cpp b/src/ColorMultiAnalysis.cpp index 5d3ef71..7721f35 100755 --- a/src/ColorMultiAnalysis.cpp +++ b/src/ColorMultiAnalysis.cpp @@ -19,7 +19,7 @@ void ColorMultiAnalysis::setup(int camWidth, int camHeight) int acq_run_time = 35; - DELTA_T_SAVE = 10*acq_run_time/2; // for 20 seconds, we want this to be around 200 files + DELTA_T_SAVE = 2*(10*acq_run_time/2); // for 20 seconds, we want this to be around 200 files // or 10 times per second = every 100 ms _frame_cnt_max = acq_run_time*ofGetFrameRate(); // e.g.: 30 frames per second * 20 seconds = 600 frames @@ -298,6 +298,8 @@ void ColorMultiAnalysis::save_cb(Timer& timer) if (RefractiveIndex::_vidGrabber.isFrameNew()) { RefractiveIndex::_pixels = RefractiveIndex::_vidGrabber.getPixelsRef(); //get ofPixels from the camera + } else { + return; } //cout << "ColorMultiAnalysis::saving...\n"; diff --git a/src/ColorSingleAnalysis.cpp b/src/ColorSingleAnalysis.cpp index 76c3df4..4f161bd 100755 --- a/src/ColorSingleAnalysis.cpp +++ b/src/ColorSingleAnalysis.cpp @@ -18,7 +18,7 @@ void ColorSingleAnalysis::setup(int camWidth, int camHeight) int acq_run_time = 20; // 20 seconds of acquiring per run - DELTA_T_SAVE = 10*acq_run_time/2; // for 20 seconds, we want this to be around 200 files + DELTA_T_SAVE = 2*(10*acq_run_time/2); // for 20 seconds, we want this to be around 200 files // or 10 times per second = every 100 ms _frame_cnt_max = acq_run_time*ofGetFrameRate(); // e.g.: 30 frames per second * 20 seconds = 600 frames @@ -311,6 +311,8 @@ void ColorSingleAnalysis::save_cb(Timer& timer) if (RefractiveIndex::_vidGrabber.isFrameNew()) { RefractiveIndex::_pixels = RefractiveIndex::_vidGrabber.getPixelsRef(); //get ofPixels from the camera + } else { + return; } //cout << "ColorSingleAnalysis::saving...\n"; diff --git a/src/DiffNoiseAnalysis.cpp b/src/DiffNoiseAnalysis.cpp index 404ec80..42783a0 100755 --- a/src/DiffNoiseAnalysis.cpp +++ b/src/DiffNoiseAnalysis.cpp @@ -18,7 +18,7 @@ void DiffNoiseAnalysis::setup(int camWidth, int camHeight) int acq_run_time = 20; // 20 seconds of acquiring per run - DELTA_T_SAVE = 10*acq_run_time/2; // for 20 seconds, we want this to be around 200 files + DELTA_T_SAVE = 2*(10*acq_run_time/2); // for 20 seconds, we want this to be around 200 files // or 10 times per second = every 100 ms _frame_cnt_max = acq_run_time*ofGetFrameRate(); // e.g.: 30 frames per second * 20 seconds = 600 frames @@ -317,6 +317,8 @@ void DiffNoiseAnalysis::save_cb(Timer& timer) if (RefractiveIndex::_vidGrabber.isFrameNew()) { RefractiveIndex::_pixels = RefractiveIndex::_vidGrabber.getPixelsRef(); //get ofPixels from the camera + } else { + return; } //cout << "DiffNoiseAnalysis::saving...\n"; diff --git a/src/IResponseAnalysis.cpp b/src/IResponseAnalysis.cpp index 1cd8315..c18757d 100755 --- a/src/IResponseAnalysis.cpp +++ b/src/IResponseAnalysis.cpp @@ -17,7 +17,7 @@ void IResponseAnalysis::setup(int camWidth, int camHeight) int acq_run_time = 20; // 20 seconds of acquiring per run - DELTA_T_SAVE = 10*acq_run_time/2; // for 20 seconds, we want this to be around 200 files + DELTA_T_SAVE = 2*(10*acq_run_time/2); // for 20 seconds, we want this to be around 200 files // or 10 times per second = every 100 ms _frame_cnt_max = acq_run_time*ofGetFrameRate(); // e.g.: 30 frames per second * 20 seconds = 600 frames diff --git a/src/RelaxRateAnalysis.cpp b/src/RelaxRateAnalysis.cpp index 3998f59..8b65ce3 100755 --- a/src/RelaxRateAnalysis.cpp +++ b/src/RelaxRateAnalysis.cpp @@ -17,7 +17,7 @@ void RelaxRateAnalysis::setup(int camWidth, int camHeight) int acq_run_time = 20; // 20 seconds of acquiring per run - DELTA_T_SAVE = 10*acq_run_time/2; // for 20 seconds, we want this to be around 200 files + DELTA_T_SAVE = 2*(10*acq_run_time/2); // for 20 seconds, we want this to be around 200 files // or 10 times per second = every 100 ms _frame_cnt_max = acq_run_time*ofGetFrameRate(); // e.g.: 30 frames per second * 20 seconds = 600 frames @@ -279,8 +279,9 @@ void RelaxRateAnalysis::save_cb(Timer& timer) if (RefractiveIndex::_vidGrabber.isFrameNew()) { RefractiveIndex::_pixels = RefractiveIndex::_vidGrabber.getPixelsRef(); //get ofPixels from the camera + } else { + return; } - //cout << "RelaxRateAnalysis::saving...\n"; string file_name = ofToString(_save_cnt,2)+"_"+ ofToString(c,2)+"_"+ofToString(_run_cnt,2)+".jpg"; diff --git a/src/ShadowScapesAnalysis.cpp b/src/ShadowScapesAnalysis.cpp index a67c834..458cf0b 100755 --- a/src/ShadowScapesAnalysis.cpp +++ b/src/ShadowScapesAnalysis.cpp @@ -16,7 +16,7 @@ void ShadowScapesAnalysis::setup(int camWidth, int camHeight) { NUM_RUN = 1; - int acq_run_time = 15; // 10 seconds of acquiring per run + int acq_run_time = 20; // 10 seconds of acquiring per run int screenSpan; if (_dir == V) screenSpan = ofGetHeight(); @@ -28,7 +28,7 @@ void ShadowScapesAnalysis::setup(int camWidth, int camHeight) // 40 pixels per second should give us a 20 second scan at 800 pixels wide - DELTA_T_SAVE = 10*acq_run_time/2; // for 20 seconds, we want this to be around 200 files + DELTA_T_SAVE = 2*(10*acq_run_time/2); // for 20 seconds, we want this to be around 200 files // or 10 times per second = every 100 ms create_dir(); @@ -78,7 +78,6 @@ void ShadowScapesAnalysis::acquire() void ShadowScapesAnalysis::synthesise() { - //cvImage1.allocate(image2.getWidth(), image2.getHeight()); //cvImage1.setFromPixels(image2); @@ -337,6 +336,8 @@ void ShadowScapesAnalysis::save_cb(Timer& timer) if (RefractiveIndex::_vidGrabber.isFrameNew()) { RefractiveIndex::_pixels = RefractiveIndex::_vidGrabber.getPixelsRef(); //get ofPixels from the camera + } else { + return; } //cout << "ShadowScapesAnalysis::saving...\n"; diff --git a/src/ShapeFromShadingAnalysis.cpp b/src/ShapeFromShadingAnalysis.cpp index 980c1a0..bec4205 100755 --- a/src/ShapeFromShadingAnalysis.cpp +++ b/src/ShapeFromShadingAnalysis.cpp @@ -16,7 +16,7 @@ void ShapeFromShadingAnalysis::setup(int camWidth, int camHeight) int acq_run_time = 20; // 20 seconds of acquiring per run - DELTA_T_SAVE = 10*acq_run_time/2; // for 20 seconds, we want this to be around 200 files + DELTA_T_SAVE = 2*(10*acq_run_time/2); // for 20 seconds, we want this to be around 200 files // or 10 times per second = every 100 ms _frame_cnt_max = acq_run_time*ofGetFrameRate(); // e.g.: 30 frames per second * 20 seconds = 600 frames @@ -470,6 +470,8 @@ void ShapeFromShadingAnalysis::save_cb(Timer& timer) if (RefractiveIndex::_vidGrabber.isFrameNew()) { RefractiveIndex::_pixels = RefractiveIndex::_vidGrabber.getPixelsRef(); //get ofPixels from the camera + } else { + return; } //cout << "ShapeFromShadingAnalysis::saving...\n"; diff --git a/src/StrobeAnalysis.cpp b/src/StrobeAnalysis.cpp index ece309b..fa80380 100755 --- a/src/StrobeAnalysis.cpp +++ b/src/StrobeAnalysis.cpp @@ -16,8 +16,8 @@ void StrobeAnalysis::setup(int camWidth, int camHeight) int acq_run_time = 20; // 20 seconds of acquiring per run - DELTA_T_SAVE = 10*acq_run_time/2; // for 20 seconds, we want this to be around 200 files - // or 10 times per second = every 100 ms + DELTA_T_SAVE = 2*(10*acq_run_time/2); // for 20 seconds, we want this to be around 200 files + // or 10 times per second = every 100 ms _frame_cnt_max = acq_run_time*ofGetFrameRate(); // e.g.: 30 frames per second * 20 seconds = 600 frames @@ -301,6 +301,8 @@ void StrobeAnalysis::save_cb(Timer& timer) if (RefractiveIndex::_vidGrabber.isFrameNew()) { RefractiveIndex::_pixels = RefractiveIndex::_vidGrabber.getPixelsRef(); //get ofPixels from the camera + } else { + return; } //cout << "StrobeAnalysis::saving...\n";