ofxKinectCalibration::ofxKinectCalibration():
	T_rgb( 1.9985242312092553e-02f, -7.4423738761617583e-04f, -1.0916736334336222e-02f ),
	R_rgb(9.9984628826577793e-01f, 1.2635359098409581e-03f, -1.7487233004436643e-02f, 0,
		 -1.4779096108364480e-03f, 9.9992385683542895e-01f, -1.2251380107679535e-02f, 0,
		  1.7470421412464927e-02f, 1.2275341476520762e-02f, 9.9977202419716948e-01f, 0,
		  0,0,0,1)
{
	depthPixels				= NULL;
	calibratedRGBPixels		= NULL;
	distancePixels 			= NULL;
	bDepthNearValueWhite	= false;
	calculateLookups();
	R_rgb.preMultTranslate(-T_rgb);
	R_rgb = ofxMatrix4x4::getTransposedOf(R_rgb);
}
예제 #2
0
//--------------------------------------------------------------------
ofxKinect::ofxKinect(){
	ofLog(OF_LOG_VERBOSE, "Creating ofxKinect.");

	//TODO: reset the right ones of these on close
	// common
	bVerbose 				= false;
	bGrabberInited 			= false;
	bUseTexture				= true;
	depthPixels				= NULL;
	depthPixelsRaw			= NULL;
	depthPixelsBack			= NULL;
	videoPixels		  		= NULL;
	videoPixelsBack			= NULL;
	calibratedRGBPixels		= NULL;
	distancePixels 			= NULL;

	bNeedsUpdate			= false;
	bUpdateTex				= false;
	
	bDepthNearValueWhite	= false;

	kinectContext			= NULL;
	kinectDevice			= NULL;
	
	targetTiltAngleDeg		= 0;
	bTiltNeedsApplying		= false;

	thisKinect = this;

	rgbDepthMatrix.getPtr()[0]=0.942040;
	rgbDepthMatrix.getPtr()[1]=-0.005672;
	rgbDepthMatrix.getPtr()[2]=0.000000;
	rgbDepthMatrix.getPtr()[3]=23.953022;
	rgbDepthMatrix.getPtr()[4]=0.004628;
	rgbDepthMatrix.getPtr()[5]=0.939875;
	rgbDepthMatrix.getPtr()[6]=0.000000;
	rgbDepthMatrix.getPtr()[7]=31.486654;
	rgbDepthMatrix.getPtr()[8]=0.000000;
	rgbDepthMatrix.getPtr()[9]=0.000000;
	rgbDepthMatrix.getPtr()[10]=0.000000;
	rgbDepthMatrix.getPtr()[11]=0.000000;
	rgbDepthMatrix.getPtr()[12]=0.000005;
	rgbDepthMatrix.getPtr()[13]=0.000003;
	rgbDepthMatrix.getPtr()[14]=0.000000;
	rgbDepthMatrix.getPtr()[15]=1.000000;
	
	calculateLookups();
}
예제 #3
0
//--------------------------------------------------------------------
ofxKinect::ofxKinect(){
	ofLog(OF_LOG_VERBOSE, "Creating ofxKinect.");

	//TODO: reset the right ones of these on close
	// common
	bVerbose 				= false;
	bGrabberInited 			= false;
	bUseTexture				= true;
	depthPixels				= NULL;
	depthPixelsRaw			= NULL;
	depthPixelsBack			= NULL;
	videoPixels		  		= NULL;
	videoPixelsBack			= NULL;
	calibratedRGBPixels		= NULL;
	distancePixels 			= NULL;

	bNeedsUpdate			= false;
	bUpdateTex				= false;

	bDepthNearValueWhite	= false;

	bImage=false;

	ofxKinect::thisKinect = this;

	rgbDepthMatrix.getPtr()[0]=0.942040;
	rgbDepthMatrix.getPtr()[1]=-0.005672;
	rgbDepthMatrix.getPtr()[2]=0.000000;
	rgbDepthMatrix.getPtr()[3]=23.953022;
	rgbDepthMatrix.getPtr()[4]=0.004628;
	rgbDepthMatrix.getPtr()[5]=0.939875;
	rgbDepthMatrix.getPtr()[6]=0.000000;
	rgbDepthMatrix.getPtr()[7]=31.486654;
	rgbDepthMatrix.getPtr()[8]=0.000000;
	rgbDepthMatrix.getPtr()[9]=0.000000;
	rgbDepthMatrix.getPtr()[10]=0.000000;
	rgbDepthMatrix.getPtr()[11]=0.000000;
	rgbDepthMatrix.getPtr()[12]=0.000005;
	rgbDepthMatrix.getPtr()[13]=0.000003;
	rgbDepthMatrix.getPtr()[14]=0.000000;
	rgbDepthMatrix.getPtr()[15]=1.000000;

	calculateLookups();

    xml_path= "data/Sample-User.xml";
	cutOffFar=4096.0f;
}
void ofxKinectCalibration::setClippingInCentimeters(float nearClipping, float farClipping) {
	ofxKinectCalibration::nearClipping = nearClipping;
	ofxKinectCalibration::farClipping = farClipping;
	lookupsCalculated = false;
	calculateLookups();
}
예제 #5
0
void KinectHandler::setup()
{
    int i;
    int j;
    
  
    triangleCount1 =0;
   
   
    
    wait =0;
	kinect.init();
	kinect.setVerbose(true);
	kinect.open();
	
	kinect1.init();
    kinect1.setVerbose(true);
    kinect1.open();
    
	kinect.setCameraTiltAngle(0);
    kinect1.setCameraTiltAngle(0);
	    // set real depth lookup
    calculateLookups();
    
    
    
    
    //prep marching cube points
    
    int count=0;
	
   
    blobFinder =new BlobFinder();
   
   
    sw =width/stepSize;
    sh  = height/stepSize;
    numPoints =sw*sh;

  	points1 =new mcPoint[numPoints]; 
       
    for(i=0;i<sh;i++)
	{
        for (j=0; j<sw;j++) 
        {
            
            //points
            points1[count].y = i*stepSize ;
            points1[count].x = j*stepSize ;
            
                     
            count++;
            
        }
        
        
	} 
     
    cubes1 =new mcCube[(sw-1) *(sh-1)];
       count =0;
	for(i=0;i<sh-1;i++)
	{
        for (j=0; j<sw-1;j++) 
        {
            
            
            int pos = i*sw +j;
            cubes1[count].tl = &points1[pos];
            cubes1[count].tr = &points1[pos+1];
            
            cubes1[count].bl = &points1[pos+sw];
            cubes1[count].br = &points1[pos+1+sw];
           
        
            
            count++;
            
        }
        
        
	}
    
    
    kinectShaderProgram =new KinectShaderProgram();
   
   
}