ofxkinect Exampleメモ(3)
//--------------------------------------------------------------
void testApp::draw() {
ofSetColor(255, 255, 255);
if(bDrawPointCloud) {
easyCam.begin();
//※
drawPointCloud();
easyCam.end();
} else {
// draw from the live kinect
//イブのオンラインショップから描く
//Kinect深度情報付き映像
kinect.drawDepth(10, 10, 400, 300);
kinect.draw(420, 10, 400, 300);
grayImage.draw(10, 320, 400, 300);
contourFinder.draw(10, 320, 400, 300);
#ifdef USE_TWO_KINECTS
kinect2.draw(420, 320, 400, 300);
#endif
}
// draw instructions
ofSetColor(255, 255, 255);
stringstream reportStream;
if(kinect.hasAccelControl()) {
reportStream << "accel is: " << ofToString(kinect.getMksAccel().x, 2) << " / "
<< ofToString(kinect.getMksAccel().y, 2) << " / "
<< ofToString(kinect.getMksAccel().z, 2) << endl;
} else {
reportStream << "Note: this is a newer Xbox Kinect or Kinect For Windows device," << endl
<< "motor / led / accel controls are not currently supported" << endl << endl;
}
//注:これは、Windowsデバイスの新しいのXboxのKinectやKinectのある、
//モーター/ LED/アクセルコントロールは現在サポートされていません
reportStream << "press p to switch between images and point cloud, rotate the point cloud with the mouse" << endl
<< "using opencv threshold = " << bThreshWithOpenCV <<" (press spacebar)" << endl
<< "set near threshold " << nearThreshold << " (press: + -)" << endl
<< "set far threshold " << farThreshold << " (press: < >) num blobs found " << contourFinder.nBlobs
<< ", fps: " << ofGetFrameRate() << endl
<< "press c to close the connection and o to open it again, connection is: " << kinect.isConnected() << endl;
ofDrawBitmapString(reportStream.str(), 20, 652);
//画像と点群を切り替えるにはpを押し、マウスで点群を回転させる
//OpenCVのしきい値を使用して="<< bThreshWithOpenCV<<"(Spaceキーを押し)
//近くにしきい値を設定し、「<< nearThreshold<< "(プレス:+ - )
//num個のBLOBは見つかりました:遠いしきい値"<< farThreshold<<"(<>を押します)を設定
//もう一度開くには、接続やOを閉鎖するプレスC、接続がされています
}