none
kinect v2 bodies BodyFrameSource when body.IsTracked count ==0 body leaves the scene RRS feed

  • Question

  • tracking bodyCount and I need to be notified when BodyFrameSource has the last tracked body leave the scene.

    aka: when

    public void bodyFrameReader_FrameArrived(object sender, BodyFrameArrivedEventArgs e)
       {
    ...
       bodyFrame.GetAndRefreshBodyData(this.bodies);
       int c = bodies.Count(x => x.IsTracked );

    but this count only occurs when bodyFrameReader event is fired.

    Is there an event for bodyFrameReader stopped?

    Is there any sample code for using:

    bodyFrameSource.onpropertychanged = onPropertyChanged;

    ?



    Ken

    Tuesday, September 16, 2014 5:00 PM

Answers

  • bodyFrameSource will typically only change if the underlying sensor is changed, ie. when switching to KinectStudio as the sensor, but usually not something you would need to concern yourself with. The source will not provide you any of that information. The only way to be notified is from acquiring the frame and counting the bodies.IsTracked as you have it.

    You can create your own internal event based on your tracker so when that count is 0, fire the event.


    Carmine Sirignano - MSFT


    Tuesday, September 16, 2014 8:53 PM

All replies

  • bodyFrameSource will typically only change if the underlying sensor is changed, ie. when switching to KinectStudio as the sensor, but usually not something you would need to concern yourself with. The source will not provide you any of that information. The only way to be notified is from acquiring the frame and counting the bodies.IsTracked as you have it.

    You can create your own internal event based on your tracker so when that count is 0, fire the event.


    Carmine Sirignano - MSFT


    Tuesday, September 16, 2014 8:53 PM
  • Right, but the frames don't fire if there no bodies.

    Ahh, here's the problem.  I was using KinectStudio and just stopping the video replay.

    If you walk out and in again. then it works. stupid me.

    Note to self: Stopping the KinectStudio feed != walking out of scene.


    Ken

    Tuesday, September 16, 2014 10:08 PM