As a formal foray into Kinect, the previous period of time to learn things now forget, so began to record.
So far most of the study materials from Heresy's blog, written very good, clear, very grateful. The development language is C + + and should always be used, but it is also possible to replace it with C #.
The documentation is on MSDN, and all the usage can be found here.
First of all, you should download the SDK to Microsoft website and start configuring it after installation.
VS 2015 configuration:
Before writing the project, first configure the VS environment, I use the VS 2015 Community edition, the SDK version is 2.0, configured as follows:
- First, create a new project, and then right-click the project name in Solution Explorer and select Properties
- "$ (Kinectsdk20_dir) \inc" is included in "General" in "C + +" in "Additional Include Directories"
- In the "General" of the linker, add "$ (kinectsdk20_dir) \lib\x86" to the "Additional Library directory"
- In "input" of the linker, add "kinect20.lib" to "Additional dependencies"
The above should be ready to compile and run, but I found that the code does not appear in the "Kinect.h" in the function of the automatic completion, and the syntax check that "Kinect.h" is not found, if you also have this problem, in Solution Explorer, "header file" Right here, add "Kinect.h", which is located in "C:\Program Files\Microsoft Sdks\kinect\v2.0_1409\inc".
Configuration of the OpenCV:
I later used the OPENCV, so the OpenCV configuration method is also recorded. OpenCV configuration method There are many kinds of online, but each project has to add so many things, so I used to write it directly into the attribute table method, as follows:
- Download OpenCV and Unzip (I'm using version 3.0)
- Right-click this PC, select Properties, Advanced, environment variables
- Create a new variable inside the system variable named "OPENCV", with a value of the path to the build in the OPENCV folder, such as D:\opencv\build
- Edit the "Path" variable inside the system variable and add it at the end;%O Pencv%\x86\vc12\bin "
- Search for opencv300.props online and download
- In VS, choose View, other Windows Property manager, and in the property manager, right-click the project name, select Add Existing property sheet, and add Opencv300.props
One problem is that the online search for Opencv300.props may error, and note that Opencv300.props only applies to opencv3.0 versions. Error message is generally compiled when prompted to find XXX, the solution is to open the Opencv300.props, find the hint of the item and delete it, note that you may want to delete a lot of. If not, you can also give me a message or e-mail me to send you a copy.
OK, so far the environment is well-configured, plus a copy of the test OPENCV is configured to configure the correct code:
1#include <opencv2\opencv.hpp>2#include <iostream>3#include <string>4 using namespaceCV;5 using namespacestd;6 intMain ()7 {8Mat img = Imread ("img.jpg");//first, put a picture named Img.jpg in the project's folder to test9 if(Img.empty ())Ten { Onecout <<"Error"<<Endl; A return 0; - } -Imshow ("TEST", IMG); the Waitkey (); - - return 0; -}
View Code
Kinect for Windows V2 development log One: configuration of the development environment