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