本文整理汇总了C++中Kinect::depthPlayerImage方法的典型用法代码示例。如果您正苦于以下问题:C++ Kinect::depthPlayerImage方法的具体用法?C++ Kinect::depthPlayerImage怎么用?C++ Kinect::depthPlayerImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kinect
的用法示例。
在下文中一共展示了Kinect::depthPlayerImage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
void main(void) {
unsigned char menu =0;
unsigned total_n_pose = 12;
unsigned pose_n_frames = 100;
unsigned feature_dimension = 60; // 특징 차원 수
double *features = new double[feature_dimension]; // 특징벡터
float gamma[12] = {0.1, 0.1, 0.1, 0.1,
0.1, 0.1, 0.1, 0.1,
0.1, 0.1, 0.1, 0.1};
Kinect kinect;
if(!kinect.init()) {
cout << "Kinect is not working";
return;
}
long angle = kinect.getCameraElevationAngle();
IplImage *frame = cvCreateImage(cvSize(640,480),8,3);
IplImage *frame_masked = cvCreateImage(cvSize(640,480),8,3);
IplImage *depth8 = cvCreateImage(cvSize(320,240),8,1);
IplImage *depth8_masked = cvCreateImage(cvSize(320,240),8,1);
IplImage *depthPlayer = cvCreateImage(cvSize(320,240),8,3);
char text[256],text2[256];;
while(1) {
cvDestroyAllWindows();
cout << " 1 : 키넥트 연결 확인 " << endl;
cout << " 2 : 포즈 저장하기 " << endl;
cout << " 3 : 포즈 확인하기 " << endl;
cout << " 4 : SVM 학습 및 검증 집합 만들기 " << endl;
cout << " 5 : SVM 학습하기 " << endl;
cout << " 6 : SVM 검증집합 인식결과 " << endl;
cout << " 7 : 실시간 포즈 인식 " << endl;
cout << " u : 카메라 각도 올리기" << endl;
cout << " d : 카메라 각도 내리기" << endl;
cout << " 종료 : ctrl+c"<<endl;
cout << " > ";
cin >> menu;
getchar();
/*
키넥트 영상 보기
*/
if(menu == '1') {
cout << "메뉴복귀 : esc 키 누르기 (opencv 윈도우 활성화된 상태에서) " << endl;
int key = 0;
while(1) {
kinect.videoImage(frame);
kinect.depth8BitImage(depth8);
kinect.depthPlayerImage(depthPlayer);
//cout << "Number of Players : " << kinect.numOfPlayers() << endl;
for(int i=0; i<NUI_SKELETON_COUNT; i++)
if(kinect.getPlayer(i).isInitialized())
kinect.getPlayer(i).drawSkeletonInDepthCoordinates(depthPlayer);
cvShowImage("depth",depth8);
cvShowImage("depthPlayer",depthPlayer);
cvShowImage("color",frame);
key = cvWaitKey(10);
if(key==27 || key=='q' || key=='Q')
break;
}
}
/*
포즈 저장하기
*/
else if(menu == '2') {
int key = 0;
cout << " 몇개의 포즈를 찍으시겠습니까 ? > " ;
cin >> total_n_pose;
cout << " 포즈당 몇 프레임을 찍으시겠습니까 ? > " ;
cin >> pose_n_frames;
DBforKinect db;
for(int i=0; i<total_n_pose; i++) {
key =0;
while(key != 1) {
cout << i << "번째 포즈 저장 시작 [1 엔터] " << endl;
cin >> key;
}
Sleep(5000);
sprintf(text,"%d_pose",i);
db.createFolder(text);
db.locateFolder(text);
db.initCnt();
//.........这里部分代码省略.........