Coordinate Systems

OpenNI defines two types of coordinate systems:

- Projective Coordinates - a two-dimentional map of depth values
- Real World Coordinates - A collection of three-dimentional points.

Those two coordinate systems are defined as below:

Feature | Projective Coordinates | Real World Coordinates
--- | --- | ---
X-Y Units | pixels | millimeters
Z Units | millimeters | millimeters
X-Y Origin | upper-left corner of the FOV | center of FOV
Z Origin | sensor's plane | sensor's plane
X Direction | left to right | left to right
Y Direction | top to bottom | bottom to top
Z Direction | away from sensor | away from sensor

A main difference between the two is that in projective coordinates, a real-world object (person, chair) gets bigger (in pixels) as it gets closer to the sensor, whereas its real-world size remains the same.

Note
  Some data in OpenNI is returned in projective coordinates (for example, depth maps), and some is returned in real-world coordinates (for example, skeleton joints). Pay attention when comparing the two.

A depth generator creates the depth value of each pixel. By knowing the distance of the object and some geometrical information about the sensor (like its FOV), translation can be made between the two systems. see xn::DepthGenerator::ConvertProjectiveToRealWorld() and xn::DepthGenerator::ConvertRealWorldToProjective().