Today, I’m going to show you how to detect a jump using Kinect and Vitruvius. Jumping is one of the most challenging actions to detect.

In this tutorial, you’ll also learn how to measure the vertical distance between the person and the floor. To have a better visualization, we are also going to animate a 3D model while the person is moving. Sounds complex? Don’t worry! Using Vitruvius, we can do it in a few minutes.

Why detecting a jump is difficult?

Detecting and measuring a jump is not trivial. Why? Because jumping is a complex action. Jumping is not about body joints only. We need to consider various parameters from the human body and the environment. As a result, we need two types of data:

  1. The position of the lower body joints.
  2. The position & orientation of the floor.

Let’s see how Kinect, Unity and Vitruvius can solve this problem.

Prerequisites

To run the demos, you’ll need the following software and hardware:

Jump Detection in Unity

Since we want to animate a 3D model, we’ll be using Unity3D. Here is a step-by-step guide:

Step #1 – Download Vitruvius

The Jump gesture/action is available in the Academic, Premium, and Platinum packages of Vitruvius. When you download the package, unzip the compressed folder and launch Unity3D.

Step #2 – Open the Sample projects

Vitruvius comes with 11 sample projects, so you can get started immediately. Open LightBuzz.Vitruvius.3.6.0.unitypackage and extract their contents into a new Unity project. Check the official Unity Documentation on how to import a custom Unity package.

Step #3 – Open the Jump Scene

The scene is loaded with a 3D avatar:

Jump detection with Kinect, Unity and Vitruvius

Step #4 – Add the JumpFBX script

Select the avatar in the Hierarchy window and check its properties in the Inspector window. Add the script named “JumpFBX.cs”. The JumpFBX script will add jump capabilities to any FBX 3D model.

Jump detection with Kinect, Unity and Vitruvius (Avateering)Step #4 – Move around!

When Kinect is connected, stand in front of the sensor and move 2 times back-and-forth within the field of view. This is an essential step, since Kinect will be scanning the floor while you are moving.

Check this video to see how:

Step #5 – Get the height of the jump

To detect the exact height of a jump, all you have to do is call the JumpHeight property of the model object. It’s measured in meters:

var height = model.JumpHeight;

The sample project will automatically notify you when someone is jumping. Here is a snapshot of myself, jumping really high:

Jump detection using Kinect (demo)

This is it! You can now create amazing apps using Kinect and Vitruvius motion analysis tools.

‘Til the next time, keep Kinecting.

Download Vitruvius
Michail Moiropoulos

Author Michail Moiropoulos

Michail is a Unity Specialist with significant experience in game development and motion technology. His professional experience includes Kinect, HoloLens, Oculus, Leap Motion, and RealSense.

More posts by Michail Moiropoulos

Join the discussion 6 Comments

  • harish damodaran says:

    Hello Michail,

    I am interested to know if I could use this with the kinect camera not horizontal to the floor. I would like to mount it on top of the television set and facing down. Would that affect my floor detection and body detection ? Also I am planning to track the face of the user. Would it have issue with perspective?

    What part of the code actually enables this ? How do I find out what is my sensor angle to check for accuracy of the floor ( considering anyone can change the angle of the sensor )

    Harish

    • Michail Moiropoulos says:

      Hello Harish. Thank you for your comment. Unfortunately, it is not possible to use Kinect at a different position. The camera needs to be horizontal to the floor. Otherwise, neither skeleton tracking nor face tracking work.

      Microsoft suggests placing the sensor as described here. There is no way to control the tilt using code.

      Hope this information helped you!

  • harish damodaran says:

    Hi Michail,
    Thank You for the quick response. I am not sure if I asked the question correctly. My sensor would be on a flat surface but angled down from a 6ft height.

    When angled down to look at the floor, how does it enable floor detection and users tracking. Would it cause issues with perspective and face tracking.
    What part of the code / Kinect SDK enables this option. I am not trying to control angle using the code. Just read the current angle of the sensor and use it if I can.

    Thank you
    Harish

    • Michail Moiropoulos says:

      Hello Harish,

      Placing the sensor differently would affect the measurements (e.g. the floor could seem closer or further than its real position). Depending on the tilting angle, the results may vary. What is the tilt in degrees?

      Thanks!

  • harish damodaran says:

    Hi Michail,

    Its tilted all the way down. I would estimate it at negative 45 degrees facing the floor from 6feet height.
    Thanks

    Harish

Leave a Reply