ofxkinect Exampleメモ(1)
void testApp::setup() {
ofSetLogLevel(OF_LOG_VERBOSE);
// enable depth->video image calibration
kinect.setRegistration(true);
//kinect初期化
kinect.init();
//kinect.init(true); // shows infrared instead of RGB video image
//代わりにRGB映像から赤外線示す
//kinect.init(false, false); // disable video image (faster fps)
//ビデオ画像を無効にする(速いFPS)
kinect.open(); // opens first available kinect
//最初に利用可能なオンラインショップをオープンします
//kinect.open(1); // open a kinect by id, starting with 0 (sorted by serial # lexicographically))
//を皮切りに、idでのKinectを開く0(シリアル#の辞書順の並 び順))
//kinect.open("A00362A08602047A"); // open a kinect using it's unique serial #
//使用してオンラインショップを開くには、固有のシリアルです
// print the intrinsic IR sensor values
//真性IRセンサ値を印刷
if(kinect.isConnected()) {
ofLogNotice() << "sensor-emitter dist: " << kinect.getSensorEmitterDistance() << "cm";
ofLogNotice() << "sensor-camera dist: " << kinect.getSensorCameraDistance() << "cm";
ofLogNotice() << "zero plane pixel size: " << kinect.getZeroPlanePixelSize() << "mm";
ofLogNotice() << "zero plane dist: " << kinect.getZeroPlaneDistance() << "mm";
}
//キネクト2台使う
#ifdef USE_TWO_KINECTS
kinect2.init();
kinect2.open();
#endif
//メモリ確保
colorImg.allocate(kinect.width, kinect.height);
grayImage.allocate(kinect.width, kinect.height);
grayThreshNear.allocate(kinect.width, kinect.height);//ofxCvGrayscaleImage
grayThreshFar.allocate(kinect.width, kinect.height);
//閾値設定
nearThreshold = 230;
farThreshold = 70;
bThreshWithOpenCV = true;
ofSetFrameRate(60);
// zero the tilt on startup
// 起動時に傾きをゼロに
angle = 0;
kinect.setCameraTiltAngle(angle);
// start from the front
// 正面から開始
bDrawPointCloud = false;
}