Kinect development tutorial 6: Introduction to openn2, installation, and vs Development Environment Configuration

Source: Internet
Author: User

Introduction

In the recent release of open, Xiao Jin also needs to remove and weed out more blogs, and make some sample programs in his spare time. From the experience of a few days of trial, we can see that opennickel has brought about great changes:

[1] The program interface is greatly updated. For more information, see openni migration guide and workshop.

[2] driver changes. Children's shoes that have used openni1.x should have known about the sensorkinect driver. However, in the openn2's environment, currently, Kinect can only be driven by Microsoft's official Kinect for Windows SDK. We expect cameras of other brands, there should also be different driving methods. The advantage of using the official driver is the ease of installation.
The SDK also comes with some development tools that can be tested and used, and the disadvantages are obvious. Because the Kinect for Windows SDK only supports Windows 7 and later operating systems, let those children's shoes that want to turn on the Kinect on Linux end up with disappointment.

[3] third-party middleware support. In the openni1.x world, nite is always the same. Currently, opennickel is only responsible for operating hardware, providing application data and maintaining independence from middleware. In addition to nite2, you can also find other middleware to use on the official website.


Let's get started with installation!

Install the driver

First, make sure that the OS is win7 or later. Download the installation package from the official website of the Kinect for Windows SDK: http://www.microsoft.com/en-us/kinectforwindows/develop/overview.aspx.

Xiao Jin has not encountered any problems during the installation process. After the installation is complete, plug in the Kinect and you will find that the lamp can be driven.

Open the Kinect for Windows developer toolkit in the Start menu. You can find some samples to run and check whether the tool is correctly installed. Face Tracking visualization is an interesting example.

Next, we will download the latest openn2sdk at http://www.openni.org/to install it. After the installation is complete, you can run the opennickel/niviewer and other sample programs in the Start menu to check.

Vs Development Environment


The configuration of the vs development environment is similar to that of openni1.x, or include and library.

Xiao Jin installed 32-bit openn2, and the installation directory is c: \ openn2\. After openn2is installed, the installer automatically adds the following environment variables: (Note: If 64-bit is installed, the variable name has a 64 suffix, And the configuration needs to be changed accordingly)

Openni2_include = c: \ openn2\ include \

Openni2_lib = c: \ openn2\ Lib \

Openni2_redist = c: \ openn2\ redist \


After creating a vs C ++ project, right-click the project and choose project properties. Configure the project as follows:

[1] configuration properties, C/C ++, Gerenal. Add $ (openni2_include) in the additiaonal include directories item ).

[2] configuration properties, linker, Gerenal. Add $ (openni2_lib) to the additiaonal library directories item ).

[3] configuration properties, linker, input, add $ (openni2_lib) to the additiaonal dependencies item ).


Note that you also need to copy all the files under the \ openn2\ redist directory to the working directory of vs (if it is not started through vs, it will be copied to the program execution directory) can run properly, including the dynamic link library required for openn2boot. For details, see the following explanation (copied
From openni document ):

Copy all the files from openni's redist directory (see environment variable "$ (openni2_redist)" or "$ (openni2_redist64)") to your working directory. (The defaults are c: \ Program Files \ openn2\ redist
Or C: \ Program Files (x86) \ openn2\ redist ). be aware that when you run from command line, the working directory is the directory where the executable can be found, and where you run from Visual Studio the default directory is where the project file (. vcproj,
. Vcxproj) can be found.


----------------------------------

Author: Chen Jin)

Sina bib: @ Xiao Jin Chen

This article is an original article. If you need to repost and quote it, please specify the original author and link. Thank you.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.