beginning to integrate dviid's code
This commit is contained in:
parent
877123a2db
commit
327830a581
@ -27,8 +27,10 @@
|
|||||||
#define ISTATE_TRANSITION 0xCCCC
|
#define ISTATE_TRANSITION 0xCCCC
|
||||||
#define ISTATE_END 0xDDDD
|
#define ISTATE_END 0xDDDD
|
||||||
|
|
||||||
|
|
||||||
int _state = ISTATE_UNDEF;
|
int _state = ISTATE_UNDEF;
|
||||||
|
|
||||||
|
int RefractiveIndex::_mode;
|
||||||
ofPixels RefractiveIndex::_pixels;
|
ofPixels RefractiveIndex::_pixels;
|
||||||
ofVideoGrabber RefractiveIndex::_vidGrabber;
|
ofVideoGrabber RefractiveIndex::_vidGrabber;
|
||||||
int RefractiveIndex::_vid_w, RefractiveIndex::_vid_h, RefractiveIndex::_vid_id;
|
int RefractiveIndex::_vid_w, RefractiveIndex::_vid_h, RefractiveIndex::_vid_id;
|
||||||
@ -50,6 +52,10 @@ void RefractiveIndex::setup()
|
|||||||
XML.loadFile("config.refindx");
|
XML.loadFile("config.refindx");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// <mode>
|
||||||
|
string m = XML.getValue("config:mode", "analysing");
|
||||||
|
_mode = (m == "analysing" ? MODE_ANALYSING : (m == "drawing" ? MODE_DRAWING : MODE_ANALYSING));
|
||||||
|
|
||||||
// <camera>
|
// <camera>
|
||||||
_vid_id = XML.getValue("config:camera:id", CAMERA_ID);
|
_vid_id = XML.getValue("config:camera:id", CAMERA_ID);
|
||||||
cout << "_vid_id: " << _vid_id << endl;
|
cout << "_vid_id: " << _vid_id << endl;
|
||||||
@ -82,8 +88,10 @@ void RefractiveIndex::setup()
|
|||||||
cout << "* cam width = " << _vid_w << endl;
|
cout << "* cam width = " << _vid_w << endl;
|
||||||
cout << "* cam height = " << _vid_h << endl;
|
cout << "* cam height = " << _vid_h << endl;
|
||||||
|
|
||||||
|
if(_mode == MODE_ANALYSING) {
|
||||||
_vid_stream_open = false;
|
_vid_stream_open = false;
|
||||||
setup_camera();
|
setup_camera();
|
||||||
|
}
|
||||||
|
|
||||||
cout << "RRRRRREADY!" << endl;
|
cout << "RRRRRREADY!" << endl;
|
||||||
|
|
||||||
@ -173,9 +181,13 @@ void RefractiveIndex::state_analysis()
|
|||||||
break;
|
break;
|
||||||
case ISTATE_STOP:
|
case ISTATE_STOP:
|
||||||
stop_analysis(); // blocking
|
stop_analysis(); // blocking
|
||||||
|
if(_mode == MODE_DRAWING)
|
||||||
|
_state = ISTATE_UNDEF;
|
||||||
|
else
|
||||||
_state = ISTATE_TRANSITION;
|
_state = ISTATE_TRANSITION;
|
||||||
break;
|
break;
|
||||||
case ISTATE_END:
|
case ISTATE_END:
|
||||||
|
if(_mode == MODE_ANALYSING)
|
||||||
stop_camera();
|
stop_camera();
|
||||||
::exit(1);
|
::exit(1);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -11,6 +11,9 @@
|
|||||||
#include "ofxOpenCv.h"
|
#include "ofxOpenCv.h"
|
||||||
#include "ofxXmlSettings.h"
|
#include "ofxXmlSettings.h"
|
||||||
|
|
||||||
|
#define MODE_DRAWING 0xEEFF
|
||||||
|
#define MODE_ANALYSING 0xFFEE
|
||||||
|
|
||||||
class RefractiveIndex : public ofBaseApp
|
class RefractiveIndex : public ofBaseApp
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -55,6 +58,8 @@ public:
|
|||||||
// acquisition
|
// acquisition
|
||||||
static ofPixels _pixels;
|
static ofPixels _pixels;
|
||||||
static ofVideoGrabber _vidGrabber;
|
static ofVideoGrabber _vidGrabber;
|
||||||
|
static int _mode;
|
||||||
|
|
||||||
vector<string> videoSourceList;
|
vector<string> videoSourceList;
|
||||||
static int _vid_w, _vid_h, _vid_id;
|
static int _vid_w, _vid_h, _vid_id;
|
||||||
static bool _vid_stream_open;
|
static bool _vid_stream_open;
|
||||||
|
|||||||
@ -525,6 +525,7 @@ void ColorSingleAnalysis::draw()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//this is where we save the full-frame software output to file... after the vectors, etc. are rendered...
|
||||||
//saveImageSynthesis(file_name, &cvColorImage1, OF_IMAGE_COLOR);
|
//saveImageSynthesis(file_name, &cvColorImage1, OF_IMAGE_COLOR);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user