Skip to content

Commit cc3dd7c

Browse files
committed
Added support for high-res 1280x1024 IR and Image (at ~10 FPS)
1 parent d02b58c commit cc3dd7c

File tree

7 files changed

+95
-3
lines changed

7 files changed

+95
-3
lines changed

Bin/SensorKinect-Win32-5.0.0.exe

-54 Bytes
Binary file not shown.

OpenNI/Data/SamplesConfig.xml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<OpenNI>
2+
<Licenses>
3+
<!-- Add licenses here
4+
<License vendor="vendor" key="key"/>
5+
-->
6+
</Licenses>
7+
<Log writeToConsole="true" writeToFile="false">
8+
<!-- 0 - Verbose, 1 - Info, 2 - Warning, 3 - Error (default) -->
9+
<LogLevel value="3"/>
10+
<Masks>
11+
<Mask name="ALL" on="false"/>
12+
</Masks>
13+
<Dumps>
14+
</Dumps>
15+
</Log>
16+
<ProductionNodes>
17+
<!-- Normal Image -->
18+
<Node type="Image" name="Image1">
19+
<Configuration>
20+
<MapOutputMode xRes="640" yRes="480" FPS="30"/>
21+
<Mirror on="true"/>
22+
</Configuration>
23+
</Node>
24+
25+
<!-- HighRes Image -->
26+
<!--
27+
<Node type="Image" name="Image1">
28+
<Configuration>
29+
<MapOutputMode xRes="1280" yRes="1024" FPS="15"/>
30+
<Mirror on="true"/>
31+
</Configuration>
32+
</Node>
33+
-->
34+
35+
<!-- Normal IR -->
36+
<!--
37+
<Node type="IR" name="IR1">
38+
<Configuration>
39+
<MapOutputMode xRes="640" yRes="480" FPS="30"/>
40+
<Mirror on="true"/>
41+
</Configuration>
42+
</Node>
43+
-->
44+
45+
<!-- HighRes IR -->
46+
<!--
47+
<Node type="IR" name="IR1">
48+
<Configuration>
49+
<MapOutputMode xRes="1280" yRes="1024" FPS="15"/>
50+
<Mirror on="true"/>
51+
</Configuration>
52+
</Node>
53+
-->
54+
55+
<Node type="Depth" name="Depth1">
56+
<Configuration>
57+
<MapOutputMode xRes="640" yRes="480" FPS="30"/>
58+
<Mirror on="true"/>
59+
</Configuration>
60+
</Node>
61+
<!--
62+
<Node type="Audio" name="Audio1">
63+
</Node>
64+
-->
65+
</ProductionNodes>
66+
</OpenNI>

README

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ Kinect Mod:
55
-----------
66

77
Changes:
8+
v0.3:
9+
1) Added support for high-res 1280x1024 IR and Image (at ~10 FPS)
10+
Checkout the file OPENNI\Data\SamplesConfig.xml for usage example.
11+
(Copy it to your OpenNI\Data dir and use NiViewer to test the different resolutions)
12+
813
v0.2:
914
1) VS2010 redist will now be installed automatically.
1015
2) The driver will now also be installed automatically on both x86 and x64 machines.

Source/XnDeviceSensorV2/XnDeviceSensorIO.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@
3434
//---------------------------------------------------------------------------
3535
// Defines
3636
//---------------------------------------------------------------------------
37-
#define XN_SENSOR_VENDOR_ID 0x045E
37+
#define XN_SENSOR_VENDOR_ID 0x1D27
38+
#define XN_SENSOR_VENDOR_ID_KINECT 0x045E
3839
#define XN_SENSOR_2_0_PRODUCT_ID 0x0200
3940
#define XN_SENSOR_5_0_PRODUCT_ID 0x0500
40-
#define XN_SENSOR_6_0_PRODUCT_ID 0x02AE
41+
#define XN_SENSOR_6_0_PRODUCT_ID 0x0600
42+
#define XN_SENSOR_KINECT_PRODUCT_ID 0x02AE
4143

4244
#if XN_PLATFORM == XN_PLATFORM_WIN32
4345
#include <initguid.h>
@@ -102,7 +104,13 @@ XnStatus XnSensorIO::OpenDevice(const XnChar* strPath)
102104
xnLogVerbose(XN_MASK_DEVICE_IO, "Can't find 5.0. Trying to open an older sensor...");
103105
nRetVal = xnUSBOpenDevice(XN_SENSOR_VENDOR_ID, XN_SENSOR_2_0_PRODUCT_ID, USB_DEVICE_EXTRA_PARAM, (void*)strPath, &m_pSensorHandle->USBDevice);
104106
}
105-
107+
if (nRetVal == XN_STATUS_USB_DEVICE_NOT_FOUND)
108+
{
109+
// if not found, try the kinect
110+
xnLogVerbose(XN_MASK_DEVICE_IO, "Can't find 2.0 - 4.0. Trying to open a kinect sensor...");
111+
nRetVal = xnUSBOpenDevice(XN_SENSOR_VENDOR_ID_KINECT, XN_SENSOR_KINECT_PRODUCT_ID, USB_DEVICE_EXTRA_PARAM, (void*)strPath, &m_pSensorHandle->USBDevice);
112+
}
113+
106114
XN_IS_STATUS_OK(nRetVal);
107115

108116
nRetVal = xnUSBGetDeviceSpeed(m_pSensorHandle->USBDevice, &DevSpeed);

Source/XnDeviceSensorV2/XnFirmwareStreams.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,14 @@ XnStatus XnFirmwareStreams::CheckClaimStream(const XnChar* strType, XnResolution
117117
XN_LOG_WARNING_RETURN(XN_STATUS_DEVICE_BAD_PARAM, XN_MASK_DEVICE_SENSOR, "Cannot set depth stream to resolution %d when IR is set to resolution %d!", nRes, pIRStreamData->nRes);
118118
}
119119

120+
// Avin: Removed to enable 1280x1024 IR
121+
/*
120122
// check FPS
121123
if (pIRStreamData->nFPS != nFPS)
122124
{
123125
XN_LOG_WARNING_RETURN(XN_STATUS_DEVICE_BAD_PARAM, XN_MASK_DEVICE_SENSOR, "Depth and IR streams must have the same FPS!");
124126
}
127+
*/
125128
}
126129
}
127130
else if (strcmp(strType, XN_STREAM_TYPE_IR) == 0)
@@ -150,10 +153,14 @@ XnStatus XnFirmwareStreams::CheckClaimStream(const XnChar* strType, XnResolution
150153
}
151154

152155
// check FPS
156+
// Avin: Removed to enable 1280x1024 IR
157+
/*
158+
153159
if (pDepthStreamData->nFPS != nFPS)
154160
{
155161
XN_LOG_WARNING_RETURN(XN_STATUS_DEVICE_BAD_PARAM, XN_MASK_DEVICE_SENSOR, "Depth and IR streams must have the same FPS!");
156162
}
163+
*/
157164
}
158165
}
159166
else if (strcmp(strType, XN_STREAM_TYPE_IMAGE) == 0)

Source/XnDeviceSensorV2/XnSensorFirmwareParams.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,10 +451,13 @@ XnStatus XnSensorFirmwareParams::SetImageResolution(XnUInt64 nValue)
451451
case XN_RESOLUTION_VGA:
452452
break;
453453
case XN_RESOLUTION_SXGA:
454+
// Avin: Removed to enable 1280x1024 Image
455+
/*
454456
if (m_pInfo->nFWVer < XN_SENSOR_FW_VER_5_3)
455457
{
456458
XN_LOG_WARNING_RETURN(XN_STATUS_IO_INVALID_STREAM_IMAGE_RESOLUTION, XN_MASK_DEVICE_SENSOR, "Image resolution is not supported by this firmware!");
457459
}
460+
*/
458461
break;
459462
case XN_RESOLUTION_UXGA:
460463
if (m_pInfo->nFWVer < XN_SENSOR_FW_VER_5_1)

Source/XnDeviceSensorV2/XnSensorImageStream.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,14 @@ XnStatus XnSensorImageStream::ValidateMode()
168168
XnOutputFormats nOutputFormat = GetOutputFormat();
169169
XnResolutions nResolution = GetResolution();
170170

171+
// Avin: Removed to enable 1280x1024 Image
171172
// check resolution
173+
/*
172174
if ((nResolution == XN_RESOLUTION_UXGA || nResolution == XN_RESOLUTION_SXGA) && nInputFormat != XN_IO_IMAGE_FORMAT_BAYER)
173175
{
174176
XN_LOG_WARNING_RETURN(XN_STATUS_DEVICE_BAD_PARAM, XN_MASK_DEVICE_SENSOR, "UXGA resolution is only supported with BAYER input!");
175177
}
178+
*/
176179

177180
// check output format
178181
if (nOutputFormat == XN_OUTPUT_FORMAT_GRAYSCALE8 && nInputFormat != XN_IO_IMAGE_FORMAT_BAYER)

0 commit comments

Comments
 (0)