put the RefractiveIndex::_vidGrabber.grabFrame(); // in each class
david's solution for the black frames...
This commit is contained in:
parent
e1e4e15529
commit
2bd7704f38
@ -189,13 +189,15 @@ void RefractiveIndex::state_analysis()
|
||||
void RefractiveIndex::update()
|
||||
{
|
||||
state_analysis();
|
||||
|
||||
/*
|
||||
RefractiveIndex::_vidGrabber.grabFrame(); // get a new frame from the camera
|
||||
|
||||
if (_vidGrabber.isFrameNew())
|
||||
{
|
||||
_pixels = _vidGrabber.getPixelsRef(); //get ofPixels from the camera
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
void RefractiveIndex::draw()
|
||||
@ -213,7 +215,8 @@ void RefractiveIndex::setup_camera()
|
||||
ofLog(OF_LOG_ERROR) << "RefractiveIndex::setup_camera - could not initialise grabber";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
_vidGrabber.setUseTexture(false);
|
||||
_vidGrabber.listDevices();
|
||||
_vidGrabber.setVerbose(true);
|
||||
_vid_stream_open = true;
|
||||
|
||||
@ -240,8 +240,14 @@ void CamNoiseAnalysis::draw()
|
||||
// this runs at save_cb timer rate = DELTA_T_SAVE
|
||||
void CamNoiseAnalysis::save_cb(Timer& timer)
|
||||
{
|
||||
|
||||
_save_cnt++;
|
||||
|
||||
RefractiveIndex::_vidGrabber.grabFrame(); // get a new frame from the camera
|
||||
|
||||
if (RefractiveIndex::_vidGrabber.isFrameNew())
|
||||
{
|
||||
RefractiveIndex::_pixels = RefractiveIndex::_vidGrabber.getPixelsRef(); //get ofPixels from the camera
|
||||
}
|
||||
|
||||
cout << "CamNoiseAnalysis::saving...\n";
|
||||
|
||||
|
||||
@ -235,6 +235,13 @@ void ColorMultiAnalysis::save_cb(Timer& timer)
|
||||
|
||||
_save_cnt++;
|
||||
|
||||
RefractiveIndex::_vidGrabber.grabFrame(); // get a new frame from the camera
|
||||
|
||||
if (RefractiveIndex::_vidGrabber.isFrameNew())
|
||||
{
|
||||
RefractiveIndex::_pixels = RefractiveIndex::_vidGrabber.getPixelsRef(); //get ofPixels from the camera
|
||||
}
|
||||
|
||||
cout << "ColorMultiAnalysis::saving...\n";
|
||||
|
||||
string file_name = ofToString(_save_cnt,2)+"_"+ofToString(c,2)+"_"+ofToString(_run_cnt,2)+".jpg";
|
||||
|
||||
@ -249,6 +249,13 @@ void ColorSingleAnalysis::save_cb(Timer& timer)
|
||||
{
|
||||
_save_cnt++;
|
||||
|
||||
RefractiveIndex::_vidGrabber.grabFrame(); // get a new frame from the camera
|
||||
|
||||
if (RefractiveIndex::_vidGrabber.isFrameNew())
|
||||
{
|
||||
RefractiveIndex::_pixels = RefractiveIndex::_vidGrabber.getPixelsRef(); //get ofPixels from the camera
|
||||
}
|
||||
|
||||
cout << "ColorSingleAnalysis::saving...\n";
|
||||
|
||||
string file_name =ofToString(_save_cnt,2)+"_"+fileNameTag+"_"+ofToString(_run_cnt,2)+".jpg";
|
||||
|
||||
@ -254,6 +254,13 @@ void DiffNoiseAnalysis::save_cb(Timer& timer)
|
||||
{
|
||||
_save_cnt++;
|
||||
|
||||
RefractiveIndex::_vidGrabber.grabFrame(); // get a new frame from the camera
|
||||
|
||||
if (RefractiveIndex::_vidGrabber.isFrameNew())
|
||||
{
|
||||
RefractiveIndex::_pixels = RefractiveIndex::_vidGrabber.getPixelsRef(); //get ofPixels from the camera
|
||||
}
|
||||
|
||||
cout << "DiffNoiseAnalysis::saving...\n";
|
||||
|
||||
string file_name = ofToString(_save_cnt,2)+"_"+ ofToString(c,2)+"_"+ofToString(_run_cnt,2)+".jpg";
|
||||
|
||||
@ -220,6 +220,13 @@ void RelaxRateAnalysis::save_cb(Timer& timer)
|
||||
{
|
||||
_save_cnt++;
|
||||
|
||||
RefractiveIndex::_vidGrabber.grabFrame(); // get a new frame from the camera
|
||||
|
||||
if (RefractiveIndex::_vidGrabber.isFrameNew())
|
||||
{
|
||||
RefractiveIndex::_pixels = RefractiveIndex::_vidGrabber.getPixelsRef(); //get ofPixels from the camera
|
||||
}
|
||||
|
||||
cout << "RelaxRateAnalysis::saving...\n";
|
||||
|
||||
string file_name = ofToString(_save_cnt,2)+"_"+ ofToString(c,2)+"_"+ofToString(_run_cnt,2)+".jpg";
|
||||
|
||||
@ -271,6 +271,14 @@ void ShadowScapesAnalysis::save_cb(Timer& timer)
|
||||
|
||||
_save_cnt++;
|
||||
|
||||
RefractiveIndex::_vidGrabber.grabFrame(); // get a new frame from the camera
|
||||
|
||||
if (RefractiveIndex::_vidGrabber.isFrameNew())
|
||||
{
|
||||
RefractiveIndex::_pixels = RefractiveIndex::_vidGrabber.getPixelsRef(); //get ofPixels from the camera
|
||||
}
|
||||
|
||||
|
||||
cout << "ShadowScapesAnalysis::saving...\n";
|
||||
|
||||
string file_name;
|
||||
|
||||
@ -427,6 +427,13 @@ void ShapeFromShadingAnalysis::draw()
|
||||
void ShapeFromShadingAnalysis::save_cb(Timer& timer)
|
||||
{
|
||||
_save_cnt++;
|
||||
|
||||
RefractiveIndex::_vidGrabber.grabFrame(); // get a new frame from the camera
|
||||
|
||||
if (RefractiveIndex::_vidGrabber.isFrameNew())
|
||||
{
|
||||
RefractiveIndex::_pixels = RefractiveIndex::_vidGrabber.getPixelsRef(); //get ofPixels from the camera
|
||||
}
|
||||
|
||||
cout << "ShapeFromShadingAnalysis::saving...\n";
|
||||
|
||||
|
||||
@ -235,9 +235,15 @@ void StrobeAnalysis::draw()
|
||||
// this runs at save_cb timer rate = DELTA_T_SAVE
|
||||
void StrobeAnalysis::save_cb(Timer& timer)
|
||||
{
|
||||
|
||||
_save_cnt++;
|
||||
|
||||
RefractiveIndex::_vidGrabber.grabFrame(); // get a new frame from the camera
|
||||
|
||||
if (RefractiveIndex::_vidGrabber.isFrameNew())
|
||||
{
|
||||
RefractiveIndex::_pixels = RefractiveIndex::_vidGrabber.getPixelsRef(); //get ofPixels from the camera
|
||||
}
|
||||
|
||||
cout << "StrobeAnalysis::saving...\n";
|
||||
|
||||
string file_name = ofToString(_save_cnt,2)+"_"+ ofToString(_strobe_on) +"_"+ofToString(_run_cnt,2)+".jpg";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user