Kinect / tutorial

Tutorial on the v2 Kinect platform. Walk thru the whole thing at http://kinect.github.io/tutorial
MIT License
173 stars 62 forks source link

Lab8 black sreen #31

Open alexlck opened 7 years ago

alexlck commented 7 years ago

when I run the code of lab 8,it was built successfully,but the mainwindow is black , I don't know what to do and anyone met the same problem with me?

EthanRay commented 7 years ago

I met the same problem with you. Waiting for someone help us....

duranreloaded commented 7 years ago

I ran into the same problem, but after some digging I managed to find what was the problem for me.

At some point you're asked to add SetupCurrentDisplay (DEFAULT_DISPLAYFRAMETYPE) to your newly declared MainPage_Loaded.

void MainPage_Loaded(object sender, RoutedEventArgs e)
{
    SetupCurrentDisplay(DEFAULT_DISPLAYFRAMETYPE);
}

When you do this you this you also need to make sure that you remove the SetupCurrentDisplay (DEFAULT_DISPLAYFRAMETYPE) from the MainPage() (as mentioned in Lab8). I, sadly enough, forgot to do this and ended up declaring it twice.

That means that your MainPage() should go from this:

public MainPage()
        {
            this.kinectSensor = KinectSensor.GetDefault();

            SetupCurrentDisplay(DEFAULT_DISPLAYFRAMETYPE);

            this.coordinateMapper = this.kinectSensor.CoordinateMapper;

            this.multiSourceFrameReader = this.kinectSensor.OpenMultiSourceFrameReader(
                FrameSourceTypes.Infrared
                | FrameSourceTypes.Color
                | FrameSourceTypes.Depth
                | FrameSourceTypes.BodyIndex
                | FrameSourceTypes.Body);

// ...

To this:

 public MainPage()
        {
            this.kinectSensor = KinectSensor.GetDefault();

            this.coordinateMapper = this.kinectSensor.CoordinateMapper;

            this.multiSourceFrameReader = this.kinectSensor.OpenMultiSourceFrameReader(
                FrameSourceTypes.Infrared
                | FrameSourceTypes.Color
                | FrameSourceTypes.Depth
                | FrameSourceTypes.BodyIndex
                | FrameSourceTypes.Body);

// ...

If this was the case, then after changing this, everything should work as intended.

I hope this helps!

alexlck commented 7 years ago

I think I have already removed it ...And I used the code offered by the author, the same problem happened..