Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

is it possible to find the distance between the legs of a walking person using MATLAB?

Asked by Sivakumaran Chandrasekaran on 26 Apr 2013

is it possible to find the distance between the legs of a walking person using MATLAB? human walking video is the input..


Walter Roberson on 26 Apr 2013

Is the walking person a fixed distance away? Are they walking at a fixed angle? Are there ground markings that could be used to determine the distance?

Cedric Wannaz on 26 Apr 2013

Could you put color patches or e.g. infra red LEDs on their legs, or are these random persons?

Sivakumaran Chandrasekaran

3 Answers

Answer by Anchit Dhar on 26 Apr 2013
Accepted answer

As an alternative, you can use Skeletal tracking with the Kinect for Windows sensor. This problem will get reduced to distance computation between the ankle/Knee joints(3D points), whichever fits your definition for distance.

Note: Kinect for Windows is supported in MATLAB through Image Acquisition Toolbox, R2013a onwards.


Walter Roberson on 26 Apr 2013

I wonder how well Kinect does on calculating distance away?

@ Anchit.. Kinect looks cool. I dont have much details about the integration of MATLAB with it, but the device is good.but more costlier.

Anchit Dhar on 1 May 2013

@Walter: From what I have observed while working with Kinect for Windows, it does a very good job of localizing the joint coordinates. But then, it all depends on what accuracy are you looking for.

@Siva: Here is a link to the example for getting the joint coordinates from a Kinect for Windows sensor using MATLAB & Image Acquisition Toolbox:

Anchit Dhar
Answer by Walter Roberson on 26 Apr 2013

No. You cannot determine the distance between legs of someone in a hoop skirt with a sufficiently long train.

See, e.g.,


Cedric Wannaz on 26 Apr 2013

And there are a few limit cases where it is irrelevant anyway..

Walter Roberson on 26 Apr 2013

Hee, yes, that is called "walking" in English :)

Cedric Wannaz on 26 Apr 2013

In French too actually ;-) "marcher sur les mains"

Walter Roberson
Answer by Jan Simon on 26 Apr 2013

How is "distance between legs" mathematically defined? Legs consists of at least 3 rigid segments (simulating the 26 bones of the feet seems to be over-doing here) with a spatial extent. While the distnace between the hip-joint centers is (almost) constant, the "distance" between the lower leg segments or the feet needs a meaningful definition before we can discuss, if this can be determined by a 2D-projected movie.


you can find two image. input is a color video in which a man is walking. how to compare the extracted patterns by measuring the distance.

Walter Roberson on 27 Apr 2013

Unfortunately imageshack is requiring an account in order to view the images.

Jan Simon on 27 Apr 2013

@Sivakumaran Chandrasekaran: The problem of the "distance" is still not cleared: Do you mean the 3D-distance between the center of the feet in each frame of the movie? Or the distance between the points on the floor, where the heels get ground contact during walking? While the first distances varies from frame to frame, the second distance varies from stride to stride.

Note that it is very hard to define the center of a foot exactly, most of all in 3D.

Jan Simon

Contact us