Kinect Development -- hello, Kinect

Source: Internet
Author: User

Console output deep data:

Using system; using system. collections. generic; using system. LINQ; using system. text; using Microsoft. kinect; namespace hellokinectmatrix {class program {static void _ kinect_depthframeready (Object sender, depthimageframereadyeventargs e) {// obtain the depth data of Kinect, and print the depth value to using (depthimageframe depthframe = E. opendepthimageframe () {If (depthframe! = NULL) {short [] depthpixeldata = new short [depthframe. pixeldatalength]; depthframe. copypixeldatato (depthpixeldata); foreach (short pixel in depthpixeldata) {console. write (pixel) ;}}} static void main (string [] ARGs) {If (kinectsensor. kinectsensors. count> 0) {// set the console foreground view. foregroundcolor = consolecolor. green; console. writeline ("welcome to the Kinect matrix... "); // The first Kinect sensor Ki is selected by default. Nectsensor _ Kinect = kinectsensor. kinectsensors [0]; _ Kinect. depthstream. enable (); _ Kinect. depthframeready + = new eventhandler <depthimageframereadyeventargs> (_ kinect_depthframeready); _ Kinect. start (); // press the Enter key to exit while (console. readkey (). key! = Consolekey. enter) {} // turn off the Kinect sensor _ Kinect. stop (); console. writeline ("exit the Kinect matrix... ");} else {console. writeline ("Please check the Kinect sensor ");}}}}

I am still not familiar with C # And know the meaning of each code, but I cannot write it myself-lack of overall architecture

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.