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


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

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


在下文中一共展示了Kinect::getCameraElevationAngle方法的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();

//.........这里部分代码省略.........
开发者ID:DaeYoungKim,项目名称:Recogbot,代码行数:101,代码来源:test_kinect.cpp


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