且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

同时使用两个Kinect

更新时间:2023-11-19 15:03:16

您好,您可以使用多个Kinect捕获 图像流同一时间。


但是,您的初始化是 第二个Kinect失败了,原因可能是 您的两个Kinect设备都连接在一个USB控制器中。   Kinect设备连接到同一USB主控制器时可能无法正常工作


使用多个Kinect开发应用程序时,请确保设备连接不同的USB控制器和 两者都插上外接电源。


只需在论坛帖子中查看答案,
http://social.msdn.microsoft.com/Forums/en- US / kinectsdk / thread / 58644472-25ce-4378-aeab-424307440616 /#da320604-885a-4cb0-9ad8-6ec187dec2b7


 


以下是使用多个kinect设备开发的示例应用程序


http://abhijitjana.net/2011/09/23/develop with-kinect-net-sdk-part-v-developing-application-using-multiple-kinect-devices /


 


希望这会有所帮助!


干杯!


Abhijit


 


Hello

I would like to acquire image stream from two Kinect devices at the same time, however there is a problem.  Initialization of a second Kinect fails. Here is a simple code that shows the problem:

// Bug_report.cpp : Defines the entry point for the console application.
//
#pragma once

#include "stdafx.h"
#include "windows.h"

#include "MSR_NuiApi.h"


int _tmain(int argc, _TCHAR* argv[])
{
	
	printf("Connecting to Kinetics ...\n");

	HRESULT hr, hr0, hr1, hr_init_0, hr_init_1;
	int no_kinetics;

	hr = MSR_NUIGetDeviceCount(&no_kinetics);
	printf(" %d Kinetics found \n\n", no_kinetics);
	
	if (no_kinetics != 2) {
		
		printf ("Two kinetics are needed for this test! Aborting ...\n");
		return -1 ;
	}

	INuiInstance*  kinect_0=NULL;  
	hr_init_0 = MSR_NuiCreateInstanceByIndex(0, &kinect_0);
	
	if (hr_init_0 == S_OK) {
	
		printf("Created Kinetic instance 0, pointer addres:  %p \n",kinect_0);
	}
	else {

		printf("Creation of Kinetic instance 0 FAILED. \n");
	}
	hr0 = kinect_0->NuiInitialize(NUI_INITIALIZE_FLAG_USES_SKELETON);
	
	if (hr0 == S_OK) {	
		printf("Initialization of Kinect 0 was successful\n");
	}
	else {
		printf("Initialization of kinetic 0 failed ! Return code was %d\n",(int)hr0);
		//return -3;
	}
	
	printf("\n");
	INuiInstance*  kinect_1=NULL; 
	hr_init_1 = MSR_NuiCreateInstanceByIndex(1, &kinect_1);
	printf("Created Kinetic instance 1, pointer addres:  %p \n",kinect_1);
	
	hr1 = kinect_1->NuiInitialize(NUI_INITIALIZE_FLAG_USES_SKELETON); 
	
	if (hr1 == S_OK) {	
		printf("Initialization of Kinect 1 was successful\n");
	}
	else {
		printf("Initialization of kinetic 1 failed ! Return code was %d\n",(int)hr1);
		//return -3;
	}

	return 0;
}

Hi, You can use multiple Kinect to capture  Image Stream Same time.

However, your initialization is  second Kinect is failing because the reason could be  both of your Kinect device connected in a single USB Controller.   Kinect devices might not work reliably when they are connected to the same USB host controller .

While developing application using multiple Kinect, make sure devices are connected with different USB Controller and  both are plugged in with external power.

Just Checkout the answer in one of the forum post, http://social.msdn.microsoft.com/Forums/en-US/kinectsdk/thread/58644472-25ce-4378-aeab-424307440616/#da320604-885a-4cb0-9ad8-6ec187dec2b7

 

Here is a sample application developed using multiple kinect device

http://abhijitjana.net/2011/09/23/development-with-kinect-net-sdk-part-v-developing-application-using-multiple-kinect-devices/

 

Hope this will helps !

Cheers!

Abhijit

 


相关阅读

推荐文章