Archimaredes
Archimaredes

Reputation: 1427

Mapping body index points (depth space) to color space

I'm trying to take coordinates from a body index frame and map them into colour space to find out whether they lie within a certain region of colour space.

However, the CoordinateMapper.MapDepthPointToCameraSpace method (and related methods) depend on actual depth data - which the body index frame does not provide.

What solution does the API provide here?

Upvotes: 0

Views: 554

Answers (2)

16per9
16per9

Reputation: 502

HenningJ already gave you the answer. You don't actually need the depth frame, because this is a resolution problem.

What you need is to calibrate the resolution of the bodyindex/infrared/depth/ (512x424) to the color resolution (1920x1080). I don't know a proper way to do this for Kinect v2 yet (this problem didn't occur in Kinect v1 because the resolution was the same), but by heart, I think you should map some points in the color and bodyindex space (1,1) and then re-calculate what the point should be in one and other spaces. I think one solution.

The perfect solution would be to save this information - https://msdn.microsoft.com/en-us/library/windowspreview.kinect.coordinatemapper.mapdepthframetocolorspace.aspx

This way you have the perfect alignment from the SDK itself.

Upvotes: 0

HenningJ
HenningJ

Reputation: 3149

You will definitely need the depth frame in addition to the body index frame. But they are closely related: the body index frame is based on the depth frame. Receiving the depth frame in addition to the body index frame should not add any overhead, since the depth frame is calculated internally already anyways.

And mapping between them is easy as well: each pixel in the body index frame directly corresponds to the same pixel in the depth frame.

So, to map pixel (1,1) from the body index frame to color space, you just map the same pixel (1,1) from the depth frame to color space.

Upvotes: 1

Related Questions