当前位置: 首页>>代码示例>>C++>>正文


C++ Kinect::findNearestPlayerNum方法代码示例

本文整理汇总了C++中Kinect::findNearestPlayerNum方法的典型用法代码示例。如果您正苦于以下问题:C++ Kinect::findNearestPlayerNum方法的具体用法?C++ Kinect::findNearestPlayerNum怎么用?C++ Kinect::findNearestPlayerNum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Kinect的用法示例。


在下文中一共展示了Kinect::findNearestPlayerNum方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main


//.........这里部分代码省略.........
		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();

				for(int j=0; j<pose_n_frames; ) {
					
					kinect.videoImage(frame);
					kinect.depth8BitImage(depth8);
					kinect.depthPlayerImage(depthPlayer);
					cvShowImage("players",depthPlayer);
				
					int index = kinect.findNearestPlayerNum();

					if(index != -1 && kinect.getPlayer(index).isInitialized()) {
						cout << i << "pose , " << j << " frame " << endl;
						KinectPlayer player = kinect.getPlayer(index);
						cvShowImage("player",player.getDepthMask());
						sprintf(text,"player",i);
						db.savePlayer(player,text);
						db.saveImg(frame,"color");
						db.saveImg(depth8,"depth");
						db.increaseCnt();
						++j;
						player.drawSkeletonInColorCoordinates(frame);
						cvShowImage("check",frame);
						cvWaitKey(10);
					}					
					key = cvWaitKey(10);
					if(key==27 || key=='q' || key=='Q')
						break;
				}
				cout << i<< "번째 포즈를 저장 완료" << endl;
				cvDestroyAllWindows();
			}
			cout << " 모든 포즈를 저장하였습니다. " << endl;
			
		}

		/*
			포즈 저장된 것 확인
		*/
		else if(menu == '3') {
开发者ID:DaeYoungKim,项目名称:Recogbot,代码行数:101,代码来源:test_kinect.cpp


注:本文中的Kinect::findNearestPlayerNum方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。