Measure person's length/height reliably

Hi,

I’m working on an implementation to measure a person’s height/length. Does the SDK provide a “native” option for this?

The camera is on a fixed position as well as the person.

Currently tried to measure it using an Astra 1, Astra 2 and Kinect, but results seem to be unstable.

Any ideas?

Kind regards,
Rob

Hi @rob,

I’m working on an implementation to measure a person’s height/length. Does the SDK provide a “native” option for this?

At the moment we don’t have such a feature, but we will discuss it internally and consider adding it as a native feature.

The code snippet below is a sample of how to implement this function in C++:

	// ... inside a processing loop
	
	static Vector3 floor, floorNormal;
	static float eps = std::numeric_limits<float>::epsilon();
	static auto dot = [](Vector3 v1, Vector3 v2) -> float 
	{  
		return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z;
	};
	static auto diff = [](Vector3 v1, Vector3 v2) -> Vector3 
	{ 
		return Vector3(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z);
	};

	if (_userFrame)
	{
		Vector3 _floor = _userFrame->getFloor();
		Vector3 _floorNormal = _userFrame->getFloorNormal();

		if (_floor.z > eps)
		{
			floor = _floor;
			floorNormal = _floorNormal;
		}
		
		if (floor.z > eps)
		{
			auto users = _userFrame->getUsers();
			for (auto &user: users)
			{
				int top = user.box.top * show.rows;
				Vector3 userHeight = user.proj;
				userHeight.y = top;
				Vector3 userHeight3D = depth->convertProjToRealCoords(userHeight);

				float userHeight = dot(floorNormal, diff(userHeight3D, floor));

				// ... use height
			}
		}
	}

Hi @rob, actually we have a more stable estimate for a person height inside Nuitrack (which couldn’t be directly calculated based solely on tracking results from API).
As there is a number of similar requests, we had a long-term plan to make height estimate available directly from API (also for bone lengths).
As @vadim said, we’ll revisit these plans and will get back with a reply on whether/when this should be expected.

@rob In the meatime - could you please share expected level of accuracy which could be useful for your application (in terms of a maximum absolute error in cm) ?

That sounds great. I’d be happy to test or evaluate it. Please let me know what timeline you are planning.

Regarding accuracy, we’re aiming for a 1-2 cm deviation, taking the following into account:

  • Camera is mounted at a fixed position, 110 cm from the ground, properly leveled
  • The subject is positioned 220 cm away from the camera
  • The subject remains stationary during measurement
  • We apply averaging/mean filters on the results to obtain a reliable average, smoothing out any deviations

As expected, accuracy may decrease when the subject is moving.

Additionally, when reporting the height measurement, it would be beneficial to for example consider hair vs. no hair (found this hard to measure), since many people know their actual height and might question the accuracy based on their expectations.

If possible, we should validate our results against real-life measurements to ensure accuracy.

1 Like

I am also interested in this solution, ideally scaled out to joint-pairs so that tracked clothes can be scaled per-segment for the best fit to the user.

Any update on this?
@TAG

Hi @rob, I’m really sorry for lack of timely reply.
I could confirm we are working right now on bringing this to in mainstream version as a feature.
But it’s significantly complicated by :

  1. hardware differences/parameter errors in certain sensors (as you know we have to support a large list of 3D sensors),
  2. differences between classical and AI tracking engines

So it’ll take at least a few months for this to appear in mainstream version and most probably it’ll take a few additional revisions for this estimation to “mature”/stabilize.

One more important thing - if you have a calibrated static setup (as you described), “manual” height estimation (directly from depth data / user segment) could be done more precisely than our dynamical estimation from statistical models “in motion”, so we really recommend to stick with this option as a baseline (that’s what we would be doing in such case).
If you have certain difficulties with depth data interpretation / parameters on specific sensors (that’s the issue mentioned above) - please message us additionally (directly), we’ll help specifically with that (it’s not as complex as completing general estimation feature for all sensors).

Thanks for getting back to me. We’ll try the static approach you recommended. If we need assistance implementing it, I’ll reach out again.