Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Initial kinect compatability

  • Loading branch information...
commit 75d38d767384b0bee0a6f5fcb252e3b5593aa07a 1 parent 7c57716
Avin authored December 09, 2010
73  Platform/Win32/Build/Engine.sln
... ...
@@ -1,36 +1,49 @@
1  
-Microsoft Visual Studio Solution File, Format Version 10.00
2  
-# Visual Studio 2008
3  
-Project("{19091980-2008-4CFA-1491-04CC20D8BCF9}") = "XnCore", "XnCore\XnCore.vcproj", "{7410A46D-8120-4C95-B7B4-BC8AFEBBBD5A}"
  1
+Microsoft Visual Studio Solution File, Format Version 11.00
  2
+# Visual Studio 2010
  3
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XnCore", "XnCore\XnCore.vcxproj", "{7410A46D-8120-4C95-B7B4-BC8AFEBBBD5A}"
4 4
 EndProject
5  
-Project("{19091980-2008-4CFA-1491-04CC20D8BCF9}") = "XnFormats", "XnFormats\XnFormats.vcproj", "{9CAEC325-EEE6-4A91-8819-004E20C419C0}"
6  
-	ProjectSection(ProjectDependencies) = postProject
7  
-		{7410A46D-8120-4C95-B7B4-BC8AFEBBBD5A} = {7410A46D-8120-4C95-B7B4-BC8AFEBBBD5A}
8  
-	EndProjectSection
  5
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XnFormats", "XnFormats\XnFormats.vcxproj", "{9CAEC325-EEE6-4A91-8819-004E20C419C0}"
9 6
 EndProject
10  
-Project("{19091980-2008-4CFA-1491-04CC20D8BCF9}") = "XnDDK", "XnDDK\XnDDK.vcproj", "{FB08A9D1-10AF-418D-8786-F58FDF11254D}"
11  
-	ProjectSection(ProjectDependencies) = postProject
12  
-		{7410A46D-8120-4C95-B7B4-BC8AFEBBBD5A} = {7410A46D-8120-4C95-B7B4-BC8AFEBBBD5A}
13  
-		{9CAEC325-EEE6-4A91-8819-004E20C419C0} = {9CAEC325-EEE6-4A91-8819-004E20C419C0}
14  
-	EndProjectSection
  7
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XnDDK", "XnDDK\XnDDK.vcxproj", "{FB08A9D1-10AF-418D-8786-F58FDF11254D}"
15 8
 EndProject
16  
-Project("{19091980-2008-4CFA-1491-04CC20D8BCF9}") = "XnDeviceSensorV2", "XnDeviceSensorV2\XnDeviceSensorV2.vcproj", "{1653839A-ABA5-4c0e-9EA2-2640B0275894}"
17  
-	ProjectSection(ProjectDependencies) = postProject
18  
-		{FB08A9D1-10AF-418D-8786-F58FDF11254D} = {FB08A9D1-10AF-418D-8786-F58FDF11254D}
19  
-		{9CAEC325-EEE6-4A91-8819-004E20C419C0} = {9CAEC325-EEE6-4A91-8819-004E20C419C0}
20  
-		{7410A46D-8120-4C95-B7B4-BC8AFEBBBD5A} = {7410A46D-8120-4C95-B7B4-BC8AFEBBBD5A}
21  
-	EndProjectSection
  9
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XnDeviceSensorV2", "XnDeviceSensorV2\XnDeviceSensorV2.vcxproj", "{1653839A-ABA5-4C0E-9EA2-2640B0275894}"
22 10
 EndProject
23  
-Project("{19091980-2008-4CFA-1491-04CC20D8BCF9}") = "Utils\XnSensorServer", "Utils\XnSensorServer\XnSensorServer.vcproj", "{F68C824E-EA49-4A3C-A233-ADE2B3ECC375}"
24  
-	ProjectSection(ProjectDependencies) = postProject
25  
-		{FB08A9D1-10AF-418D-8786-F58FDF11254D} = {FB08A9D1-10AF-418D-8786-F58FDF11254D}
26  
-		{1653839A-ABA5-4c0e-9EA2-2640B0275894} = {1653839A-ABA5-4c0e-9EA2-2640B0275894}
27  
-		{9CAEC325-EEE6-4A91-8819-004E20C419C0} = {9CAEC325-EEE6-4A91-8819-004E20C419C0}
28  
-	EndProjectSection
  11
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XnSensorServer", "Utils\XnSensorServer\XnSensorServer.vcxproj", "{F68C824E-EA49-4A3C-A233-ADE2B3ECC375}"
29 12
 EndProject
30  
-Project("{19091980-2008-4CFA-1491-04CC20D8BCF9}") = "XnDeviceFile", "XnDeviceFile\XnDeviceFile.vcproj", "{7410A46D-8120-4C95-B7B4-BC8AFEBBBD5B}"
31  
-	ProjectSection(ProjectDependencies) = postProject
32  
-		{7410A46D-8120-4C95-B7B4-BC8AFEBBBD5A} = {7410A46D-8120-4C95-B7B4-BC8AFEBBBD5A}
33  
-		{FB08A9D1-10AF-418D-8786-F58FDF11254D} = {FB08A9D1-10AF-418D-8786-F58FDF11254D}
34  
-		{9CAEC325-EEE6-4A91-8819-004E20C419C0} = {9CAEC325-EEE6-4A91-8819-004E20C419C0}
35  
-	EndProjectSection
  13
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XnDeviceFile", "XnDeviceFile\XnDeviceFile.vcxproj", "{7410A46D-8120-4C95-B7B4-BC8AFEBBBD5B}"
36 14
 EndProject
  15
+Global
  16
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
  17
+		Debug|Win32 = Debug|Win32
  18
+		Release|Win32 = Release|Win32
  19
+	EndGlobalSection
  20
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
  21
+		{7410A46D-8120-4C95-B7B4-BC8AFEBBBD5A}.Debug|Win32.ActiveCfg = Debug|Win32
  22
+		{7410A46D-8120-4C95-B7B4-BC8AFEBBBD5A}.Debug|Win32.Build.0 = Debug|Win32
  23
+		{7410A46D-8120-4C95-B7B4-BC8AFEBBBD5A}.Release|Win32.ActiveCfg = Release|Win32
  24
+		{7410A46D-8120-4C95-B7B4-BC8AFEBBBD5A}.Release|Win32.Build.0 = Release|Win32
  25
+		{9CAEC325-EEE6-4A91-8819-004E20C419C0}.Debug|Win32.ActiveCfg = Debug|Win32
  26
+		{9CAEC325-EEE6-4A91-8819-004E20C419C0}.Debug|Win32.Build.0 = Debug|Win32
  27
+		{9CAEC325-EEE6-4A91-8819-004E20C419C0}.Release|Win32.ActiveCfg = Release|Win32
  28
+		{9CAEC325-EEE6-4A91-8819-004E20C419C0}.Release|Win32.Build.0 = Release|Win32
  29
+		{FB08A9D1-10AF-418D-8786-F58FDF11254D}.Debug|Win32.ActiveCfg = Debug|Win32
  30
+		{FB08A9D1-10AF-418D-8786-F58FDF11254D}.Debug|Win32.Build.0 = Debug|Win32
  31
+		{FB08A9D1-10AF-418D-8786-F58FDF11254D}.Release|Win32.ActiveCfg = Release|Win32
  32
+		{FB08A9D1-10AF-418D-8786-F58FDF11254D}.Release|Win32.Build.0 = Release|Win32
  33
+		{1653839A-ABA5-4C0E-9EA2-2640B0275894}.Debug|Win32.ActiveCfg = Debug|Win32
  34
+		{1653839A-ABA5-4C0E-9EA2-2640B0275894}.Debug|Win32.Build.0 = Debug|Win32
  35
+		{1653839A-ABA5-4C0E-9EA2-2640B0275894}.Release|Win32.ActiveCfg = Release|Win32
  36
+		{1653839A-ABA5-4C0E-9EA2-2640B0275894}.Release|Win32.Build.0 = Release|Win32
  37
+		{F68C824E-EA49-4A3C-A233-ADE2B3ECC375}.Debug|Win32.ActiveCfg = Debug|Win32
  38
+		{F68C824E-EA49-4A3C-A233-ADE2B3ECC375}.Debug|Win32.Build.0 = Debug|Win32
  39
+		{F68C824E-EA49-4A3C-A233-ADE2B3ECC375}.Release|Win32.ActiveCfg = Release|Win32
  40
+		{F68C824E-EA49-4A3C-A233-ADE2B3ECC375}.Release|Win32.Build.0 = Release|Win32
  41
+		{7410A46D-8120-4C95-B7B4-BC8AFEBBBD5B}.Debug|Win32.ActiveCfg = Debug|Win32
  42
+		{7410A46D-8120-4C95-B7B4-BC8AFEBBBD5B}.Debug|Win32.Build.0 = Debug|Win32
  43
+		{7410A46D-8120-4C95-B7B4-BC8AFEBBBD5B}.Release|Win32.ActiveCfg = Release|Win32
  44
+		{7410A46D-8120-4C95-B7B4-BC8AFEBBBD5B}.Release|Win32.Build.0 = Release|Win32
  45
+	EndGlobalSection
  46
+	GlobalSection(SolutionProperties) = preSolution
  47
+		HideSolutionNode = FALSE
  48
+	EndGlobalSection
  49
+EndGlobal
29  README
... ...
@@ -1,6 +1,31 @@
1  
-PrimeSensor Modules for OpenNI
  1
+SensorKinect Module for OpenNI
2 2
 ------------------------------
3  
-Website: www.primesense.com
  3
+
  4
+Kinect Mod:
  5
+-----------
  6
+
  7
+It seems that the PrimeSensor and the Kinect are almost 100% identical!
  8
+
  9
+Changes:
  10
+	1) Added the kinect USB VID/PID to the PSDrv3 driver and to the code.
  11
+	2) Changed the packet sequence field from 16-bit to 8-bit (don't know why it's different...)
  12
+	3) Changed the image format from YUV to 8-bit uncompressed bayer in the GlobalDefaults.ini file.
  13
+	4) Fixed the software depth-to-RGB registration. (Thanks ROS.org for that!)
  14
+
  15
+Notes:
  16
+	1) The precompiled windows version is inside the BIN directory. Since the driver is not signed, you might have to install it manually.
  17
+	2) Since I've used VS2010 to build the driver, you will need to have the VS2010 redist installed.
  18
+	3) Many resolutions/formats are not working yet... For example: The kinect will only agree to output VGA resolution.
  19
+	4) I don't have a linux machine so I didn't try it, but my guess is that it would work just fine...
  20
+
  21
+PrimeSense NITE algorithim:
  22
+	If you want to try it please do the following:
  23
+	1) Install OpenNI (from www.openni.org)
  24
+	2) Install Sensor (this version...)
  25
+	3) Install NITE (from www.openni.org)
  26
+	4) Run the NiViewer sample to make sure depth & image streams are working.
  27
+	5) Run the NiUserTracker sample play with the skeleton.
  28
+
4 29
 
5 30
 Release Notes:
6 31
 --------------
35  Source/XnDeviceSensorV2/Registration.cpp
@@ -480,17 +480,29 @@ void XnRegistration::Apply1000(XnDepthPixel* pInput, XnDepthPixel* pOutput)
480 480
 			nNewX = (XnInt32)(XnDouble(*pRegTable)/XN_REG_X_SCALE + XnInt32(pDepth2ShiftTable[nValue]/XN_REG_PARAB_COEFF - nConstShift) * dShiftFactor);
481 481
 			nNewY = *(pRegTable+1);
482 482
 
483  
-			if ((XnUInt32)nNewX-1 < (XnUInt32)nDepthXRes-1)
  483
+			if ( nNewX < nDepthXRes && nNewY < nDepthYRes )
484 484
 			{
485 485
 				nArrPos = nNewY * nDepthXRes + nNewX;
486 486
 				nOutValue = pOutput[nArrPos];
487 487
 
488 488
 				if (nOutValue == 0 || nOutValue > nValue)
489 489
 				{
  490
+					if ( nNewX > 0 && nNewY > 0 )
  491
+					{
  492
+						pOutput[nArrPos-nDepthXRes] = nValue;
  493
+						pOutput[nArrPos-nDepthXRes-1] = nValue;
  494
+						pOutput[nArrPos-1] = nValue;
  495
+					}
  496
+					else if( nNewY > 0 )
  497
+					{
  498
+						pOutput[nArrPos-nDepthXRes] = nValue;
  499
+					}
  500
+					else if( nNewX > 0 )
  501
+					{
  502
+						pOutput[nArrPos-1] = nValue;
  503
+					}
  504
+					
490 505
 					pOutput[nArrPos] = nValue;
491  
-					pOutput[nArrPos-1] = nValue;
492  
-					pOutput[nArrPos-nDepthXRes] = nValue;
493  
-					pOutput[nArrPos-nDepthXRes-1] = nValue;
494 506
 				}
495 507
 			}
496 508
 		}
@@ -533,7 +545,7 @@ void XnRegistration::Apply1080(XnDepthPixel* pInput, XnDepthPixel* pOutput)
533 545
 				nNewX = (XnUInt32)(*pRegTable + pRGBRegDepthToShiftTable[nValue]) / RGB_REG_X_VAL_SCALE;
534 546
 				nNewY = *(pRegTable+1);
535 547
 
536  
-				if (nNewX < nDepthXRes)
  548
+				if (nNewX < nDepthXRes && nNewY < nDepthYRes )
537 549
 				{
538 550
 					nArrPos = bMirror ? (nNewY+1)*nDepthXRes - nNewX - 2 : (nNewY*nDepthXRes) + nNewX;
539 551
 					nArrPos -= nConstOffset;
@@ -542,12 +554,21 @@ void XnRegistration::Apply1080(XnDepthPixel* pInput, XnDepthPixel* pOutput)
542 554
 
543 555
 					if ((nOutValue == XN_DEVICE_SENSOR_NO_DEPTH_VALUE) || (nOutValue > nValue))
544 556
 					{
545  
-						if (nArrPos > nDepthXRes+1)
  557
+						if ( nNewX > 0 && nNewY > 0 )
546 558
 						{
  559
+							pOutput[nArrPos-nDepthXRes] = nValue;
547 560
 							pOutput[nArrPos-nDepthXRes-1] = nValue;
  561
+							pOutput[nArrPos-1] = nValue;
  562
+						}
  563
+						else if( nNewY > 0 )
  564
+						{
548 565
 							pOutput[nArrPos-nDepthXRes] = nValue;
549 566
 						}
550  
-						pOutput[nArrPos-1] = nValue;
  567
+						else if( nNewX > 0 )
  568
+						{
  569
+							pOutput[nArrPos-1] = nValue;
  570
+						}
  571
+						
551 572
 						pOutput[nArrPos] = nValue;
552 573
 					}
553 574
 				}

0 notes on commit 75d38d7

Please sign in to comment.
Something went wrong with that request. Please try again.