Skip to content

Add Microsoft Kinect v2 sensor driver#33

Closed
mvm9289 wants to merge 10 commits intostructureio:masterfrom
mvm9289:dev
Closed

Add Microsoft Kinect v2 sensor driver#33
mvm9289 wants to merge 10 commits intostructureio:masterfrom
mvm9289:dev

Conversation

@mvm9289
Copy link

@mvm9289 mvm9289 commented Dec 4, 2014

This pull requests includes different commits which add Microsoft Kinect v2 support in OpenNI 2. It implements a new OpenNI 2 driver based on the official Microsoft SDK.

Videomodes supported by this driver:

  • Color: RGB888 1920x1080 30fps
  • Color: RGB888 960x540 30fps
  • Depth: DepthPixel 512x424 30fps
  • IR: Gray16 (ushort) 512x424 30fps

Features supported by this driver:

  • DEPTH_TO_COLOR_REGISTRATION

mvm9289 added 9 commits April 18, 2014 16:50
First driver port based on the Kinect OpenNI2 driver (first version of the
sensor)

Videomodes supported:
*Color: RGB888          1920x1080 30fps
*Depth: DepthPixel      512x424   30fps
*IR:    Gray16 (ushort) 512x424   30fps

Features supported:
-Depth & color registration mode
The color stream (1920x1080) is too big to be handled by the OpenNI player.

This change partially fixes this issue adding a videomode of size 960x540.
Making use of such videomode both OpenNI recorder and player works fine.
This change initializes a base timestamp at device creation time. Such timestamp
is used in the stream implementation constructor so all the different streams
uses the same timestamp basis.
The code has been refactored and cleaned-up. It seems the driver works well now
and does not make the GPU driver to crash.
When using DEPTH_TO_COLOR_REGISTRATION some vertical gaps remains due to the
different aspect ratio between color and depth images. This change solves the
problem adding a vertical interpolation on those empty pixels using a kernel
of diameter 1 cell.
…sor to let the

                          Kinect service to start

Open() call on an IKinectSensor starts the Kinect service, but it takes some
time to initialize. If get_IsAvailable() is called right away, it will return
false. Waiting half a second after calling Open() is enough to let the Kinect
service properly initialize and get_IsAvailable() will return true if an actual
Kinect v2 sensor is connected.
@mvm9289 mvm9289 force-pushed the dev branch 3 times, most recently from 64482e7 to 7024856 Compare December 4, 2014 13:02
@ntx-80
Copy link

ntx-80 commented Dec 22, 2014

Hello Miguel, Nice work!

I could build with Visual Studio 2013 and run the samples using the new driver.

3 things, though:

  1. The commits are on top of master, I'd rather have them on develop, for the time being.

  2. When the Kinect2 project is present in the solution, the entire solution needs to be upgraded to MSVC12 or it won't build cleanly.

  3. Minor: The first lines of some commit messages appear really funkily in Sourcetree:
    (https://www.dropbox.com/s/nx53ylh81qt4nwk/Screenshot%202014-12-22%2001.41.52.png?dl=0)

In order to solve these while keeping your current work, I created a kinect2 branch, forked from develop, using your commits verbatim (with only the occasional first-line funkyness fixed), and with the MSVC12 solution upgrade applied on top.

It's here: https://github.com/occipital/OpenNI2/commits/kinect2

If it works for you too, you can use it as a base for further pull requests. This is until we decide what to do regarding the minimum visual studio versions required by the checked-in projects.

Thanks again for the great work!

NT

@ntx-80 ntx-80 closed this Dec 22, 2014
@mvm9289
Copy link
Author

mvm9289 commented Dec 23, 2014

Thanks Nicolas for your comments!

I didn't upgrade the whole OpenNI solution to MSVC12 because I wanted to touch the least as possible. Thanks for doing it.

I'll clone the new branch you just created and I'll use it for future pull requests.

@ani-rudh
Copy link

Hello guys,

maybe a little too late to ask this, but I really need help:
I am trying to build the OpenNI2.sln with visual studio 2013 (x64) on windows 10. I am getting the following errors:

Error 1 error C1083: Cannot open include file: 'NuiApi.h': No such file or directory f:\edu_software\openni2-kinect2\openni2-kinect2\source\drivers\kinect\BaseKinectStream.h 27 1 Kinect
Error 2 error C1083: Cannot open include file: 'NuiApi.h': No such file or directory f:\edu_software\openni2-kinect2\openni2-kinect2\source\drivers\kinect\BaseKinectStream.h 27 1 Kinect
Error 3 error C1083: Cannot open include file: 'NuiApi.h': No such file or directory f:\edu_software\openni2-kinect2\openni2-kinect2\source\drivers\kinect\BaseKinectStream.h 27 1 Kinect
Error 4 error C1083: Cannot open include file: 'NuiApi.h': No such file or directory f:\edu_software\openni2-kinect2\openni2-kinect2\source\drivers\kinect\BaseKinectStream.h 27 1 Kinect
Error 6 error C1083: Cannot open include file: 'NuiApi.h': No such file or directory f:\edu_software\openni2-kinect2\openni2-kinect2\source\drivers\kinect\KinectDriver.h 27 1 Kinect
Error 7 error C1083: Cannot open include file: 'NuiApi.h': No such file or directory f:\edu_software\openni2-kinect2\openni2-kinect2\source\drivers\kinect\BaseKinectStream.h 27 1 Kinect
Error 8 error C1083: Cannot open include file: 'NuiApi.h': No such file or directory f:\edu_software\openni2-kinect2\openni2-kinect2\source\drivers\kinect\BaseKinectStream.h 27 1 Kinect
Warning 5 warning RC4011: identifier truncated to 'CRT_USE_WINAPI_FAMILY_DESKTOP' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\malloc.h 168 1 OpenNI
openni

Is there something i am doing wrong, could you please guide me .
Also, Does the OpenNI2.2.0.33 hosted on the structure.io website come with the Kinect v2.0 functionality?

@harry19902002
Copy link

I have the same question with @ani-rudh . How can I solve it?

@ani-rudh
Copy link

ani-rudh commented Mar 1, 2016

@harry19902002 : unload the "kinect" project under drivers. It's for kinect version 1. If you do not have the kinect 1.x sdk, then this error is encountered

1 similar comment
@ani-rudh
Copy link

ani-rudh commented Mar 1, 2016

@harry19902002 : unload the "kinect" project under drivers. It's for kinect version 1. If you do not have the kinect 1.x sdk, then this error is encountered

@harry19902002
Copy link

@ani-rudh Thanks you very much.I can compile the project. But it still explains "no device found". I have not found the reason.

@ani-rudh
Copy link

ani-rudh commented Mar 1, 2016

Copy the kinect2.dll file to same directory as the simpleviewer.exe, it
works for me.
On 01-Mar-2016 12:36, "Harry" notifications@github.com wrote:

@ani-rudh https://github.com/ani-rudh Thanks you very much.I can
compile the project. But it still explains "no device found". I have not
found the reason.


Reply to this email directly or view it on GitHub
#33 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants