Commit 8bd67d71 authored by Pierre Bürki's avatar Pierre Bürki
Browse files

Remove calibration methods, update UI, and major clean up

parent f7df4d2e
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -2,19 +2,8 @@

void PointCloudManager::drawPointCloud()
{
	//ofLog(OF_LOG_NOTICE) << "Drawing cloud point (" << pointCloud.getVertices().size() << ") points)";
	ofPushMatrix();
	ofNoFill();
	pointCloud.draw();
	auto vs = pointCloud.getVertices();
	if (vs.size() > 0) {
		auto v = vs[12000];
		ofLog(OF_LOG_NOTICE) << "Color at vertex 12000 (of " << vs.size() << "): \n"
			<< "R " << v.r << "\n"
			<< "G " << v.g << "\n"
			<< "B " << v.b;
	}
	ofPopMatrix();
}

void PointCloudManager::drawRGB(const ofRectangle& viewRect) {
+50 −660

File changed.

Preview size limit exceeded, changes collapsed.

+25 −112
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@

#include <ofMatrix4x4.h>

#define N_CAMERAS 6
#define N_CAMERAS 3

#define VIEWGRID_WIDTH  132
#define MENU_WIDTH      1000
@@ -64,7 +64,6 @@ class ofApp : public ofBaseApp{
	ofTrueTypeFont  monosm;
	vector<ofPoint> stroke;


    bool bShowVisuals = false;

    //////////////////
@@ -97,16 +96,16 @@ class ofApp : public ofBaseApp{
    ofTexture render;
    
    /////////////
    //RealSense//
    //Nuitrack //
    /////////////

    void initNuitrack();

    void reloadTransformMatrix();
        
    TrackerRef tracker;
    PointCloudManager pointCloudManager;    

    ofMatrix4x4 unprojection;

    bool dispRaw;

    bool bPreviewPointCloud;
@@ -115,21 +114,8 @@ class ofApp : public ofBaseApp{
    
    CaptureMeshArray capMesh;
	
    Frustum realSenseFrustum;
	
	/**
	Changes operation of application
	@param _index 0=normal, 1= recording to file, 2=playback from file
	*/
	void changeOperation(int& _index);

    void drawPreview();
    void drawCapturePointCloud(bool _mask);

	void createGUIDeviceParams();

    void createFrustumCone();
    void updateFrustumCone(int& val);

    /////////////////
    //COLOR CONTOUR//
@@ -140,98 +126,25 @@ class ofApp : public ofBaseApp{
    // used for viewing the point cloud
    ofEasyCam previewCam;
    
	ofShader shader;

    ///////////////
    //CALCULATION//
    ///////////////

    void updateCalc();
    void updateMatrix();
    void measurementCycleRaw();
    void measurementCycleFine();

    void drawCalibrationPoints();
	glm::vec3 calcPlanePoint(ofParameter<ofVec2f> & cpoint, int _size, int _step);
    
    bool bUpdateCalc = false;
    bool bUpdateMeasurment = false;
	bool bUpdateMeasurmentFine = false;
	bool bUpdateImageMask = false;
	char  bUpdateSetMesurmentPoint = -1;
    
    int cycleCounter = 0;
   
    ofVec3f planePoint1Meas[N_MEASURMENT_CYCLES];
    ofVec3f planePoint2Meas[N_MEASURMENT_CYCLES];
    ofVec3f planePoint3Meas[N_MEASURMENT_CYCLES];
    
    ofVec3f planePoint_X;
    ofVec3f planePoint_Y;
    ofVec3f planePoint_Z;

    ofVec3f planeCenterPoint;

    ofSpherePrimitive sphere_X;
    ofSpherePrimitive sphere_Y;
    ofSpherePrimitive sphere_Z;
    
    ofSpherePrimitive frustumCenterSphere;
    ofSpherePrimitive frustumTopSphere;

    ofVboMesh geometry;
        
    ofMatrix4x4 deviceTransform;
    
    string calcdata;
    
    bool bShowCalcData;
    bool bShowSkeletonData = true;

    //////////////
    //PROPERTIES//
    //////////////
    void setupCalibGui();
    void setupTransformGui();

    ofxGui gui;
    
    ofxGuiPanel *setupCalib;
	ofxGuiPanel *device;
	ofxGuiPanel *post;
	ofxGuiPanel *guitransform;
	ofxGuiPanel *operating;

	//mode panel
	ofxGuiGroup *operatingToggles;

	ofParameterGroup operatingModes;
	ofParameter<bool> mode0Capture;
	ofParameter<bool> mode1Record;
	ofParameter<bool> mode2Playback;

    ofParameter<ofVec2f> calibPoint_X;
    ofParameter<ofVec2f> calibPoint_Y;
    ofParameter<ofVec2f> calibPoint_Z;
 
	ofParameterGroup transformationGuiGroup;

    ofParameter<ofMatrix4x4> transformation;
    
    ofParameterGroup frustumGuiGroup;

    ofParameter<int> nearFrustum;
    ofParameter<int> farFrustum;

    ofParameterGroup intrinsicGuiGroup;

    ofParameter<float> depthCorrectionBase;
    ofParameter<float> depthCorrectionDivisor;
    ofParameter<float> pixelSizeCorrector;

    ofParameter<int> blobGrain;

    ofParameter<bool> captureVideo;

    //////////
    // HELP //
    //////////