2012-04-12 10:21:37 +01:00
|
|
|
/*
|
2012-01-24 15:13:07 +01:00
|
|
|
~ author: dviid
|
|
|
|
|
~ contact: dviid@labs.ciid.dk
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "AbstractAnalysis.h"
|
|
|
|
|
|
|
|
|
|
#include "Poco/Timer.h"
|
|
|
|
|
|
2012-02-21 17:26:16 +01:00
|
|
|
#include "ofxOpenCv.h"
|
|
|
|
|
|
|
|
|
|
|
2012-01-24 15:13:07 +01:00
|
|
|
class ColorSingleAnalysis : public AbstractAnalysis
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
ColorSingleAnalysis(): AbstractAnalysis("COLOR_SINGLE"){;}
|
|
|
|
|
virtual ~ColorSingleAnalysis(){;}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
void setup(int camWidth, int camHeight);
|
2012-02-15 08:43:43 +01:00
|
|
|
void acquire();
|
2012-02-21 01:34:24 +01:00
|
|
|
void synthesise();
|
|
|
|
|
void displayresults();
|
2012-01-24 15:13:07 +01:00
|
|
|
void draw();
|
|
|
|
|
|
|
|
|
|
void save_cb(Poco::Timer& timer);
|
|
|
|
|
|
|
|
|
|
protected:
|
2012-02-18 20:37:22 +01:00
|
|
|
|
2012-01-24 15:13:07 +01:00
|
|
|
bool _RUN_DONE;
|
2012-02-18 20:37:22 +01:00
|
|
|
string fileNameTag;
|
2012-05-07 21:59:50 +02:00
|
|
|
string fileNameColor;
|
2012-02-20 03:40:38 +01:00
|
|
|
float r,g,b;
|
|
|
|
|
|
2012-02-22 02:09:19 +01:00
|
|
|
int _run_cnt, _save_cnt, _fade_cnt, _synth_save_cnt, _anim_cnt;
|
2012-02-20 03:40:38 +01:00
|
|
|
float c, _frame_cnt, _frame_cnt_max, _anim_cnt_max;
|
2012-02-21 01:34:24 +01:00
|
|
|
|
|
|
|
|
bool _show_image, _image_shown;
|
2012-02-22 02:09:19 +01:00
|
|
|
ofImage image1;
|
|
|
|
|
ofImage image2;
|
|
|
|
|
ofImage image3;
|
|
|
|
|
ofImage image4;
|
|
|
|
|
ofImage image5;
|
|
|
|
|
ofImage image6;
|
|
|
|
|
|
|
|
|
|
ofxCvColorImage cvColorImage1;
|
|
|
|
|
ofxCvColorImage cvColorImage2;
|
|
|
|
|
ofxCvColorImage cvColorImage3;
|
|
|
|
|
ofxCvColorImage cvColorImage4;
|
|
|
|
|
ofxCvColorImage cvColorImage5;
|
|
|
|
|
ofxCvColorImage cvColorImage6;
|
|
|
|
|
|
|
|
|
|
ofxCvGrayscaleImage cvGrayDiff1;
|
|
|
|
|
ofxCvGrayscaleImage cvGrayDiff2;
|
|
|
|
|
|
|
|
|
|
ofxCvGrayscaleImage cvGrayImage1;
|
|
|
|
|
ofxCvGrayscaleImage cvGrayImage2;
|
|
|
|
|
ofxCvGrayscaleImage cvGrayImage3;
|
|
|
|
|
ofxCvGrayscaleImage cvGrayImage4;
|
|
|
|
|
|
2012-05-06 22:47:06 +02:00
|
|
|
ofxCvFloatImage cvFloatImage1;
|
|
|
|
|
|
2012-02-22 02:09:19 +01:00
|
|
|
ofxCvContourFinder cvContourFinder1;
|
2012-02-28 20:13:08 +01:00
|
|
|
|
|
|
|
|
//this is the temporary container to allow us to convert and save out greyscale images
|
|
|
|
|
ofxCvColorImage cvConvertorImage;
|
|
|
|
|
|
2012-05-06 22:47:06 +02:00
|
|
|
|
|
|
|
|
//mesh making function
|
|
|
|
|
void setMeshFromPixels(vector<float> sPixels, ofImage currentFirstImage, ofImage currentSecondImage, ofMesh & mesh);
|
|
|
|
|
|
|
|
|
|
//depth map function
|
|
|
|
|
vector<float> _returnDepthsAtEachPixel(ofImage &image1, ofImage &image2, ofImage &backgroundImage);
|
|
|
|
|
|
2012-05-08 01:11:31 +02:00
|
|
|
int vertexSubsampling;
|
|
|
|
|
int chooseColour;
|
|
|
|
|
|
2012-05-06 22:47:06 +02:00
|
|
|
bool _gotFirstImage;
|
|
|
|
|
ofImage _background;
|
2012-02-21 01:34:24 +01:00
|
|
|
|
2012-01-24 15:13:07 +01:00
|
|
|
};
|