Source

kinect-viewer / utility.h

Diff from to

File utility.h

 	return cross_product(a, b);
 }
 
-// Converts depth image coordinates to color image coordinates
-// using |xform|, given the linearized depth image reading |z|.
-static inline void apply_projective_transform(const projective_transform_t *xform, float z, int *x, int *y) {
-  static const float farScaleZ = 10.F;
-  
-  // Center the coordinates around the origin.
-  vec2f_t centered = { *x - 320, *y - 240 };
-
-  // Shift the origin.
-  vec2f_t displaced = {
-    centered.x + xform->offset.x,// / zRat,
-    centered.y + xform->offset.y,// / zRat,
-  };
-  float shiftedZ = z + xform->offset.z;
-
-  // Correct the field of view
-  vec2f_t scale = {
-    (shiftedZ / farScaleZ) * xform->scale.x,
-    (shiftedZ / farScaleZ) * xform->scale.y,
-  };
-  vec2f_t scaled = {
-    displaced.x * scale.x,
-    displaced.y * scale.y,
-  };
-  
-  *x = ((int) scaled.x) + 320;
-  *y = ((int) scaled.y) + 240;
-}
-
 #endif __utility_h__