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.