Kinect - Map (x, y) pixel coordinates to “real world” coordinates using depth

后端 未结 3 1056
陌清茗
陌清茗 2021-01-01 08:02

I\'m working on a project that uses the Kinect and OpenCV to export fintertip coordinates to Flash for use in games and other programs. Currently, our setup works based on

3条回答
  •  灰色年华
    2021-01-01 08:14

    Vector subtraction should get you the distance between any two points given by the Kinect. You'll have to look up the best way to perform Vector subtraction in your specific environment, but I hope this helps anyway. In Processing, which I use, there's a PVector class, where to subtract you simply go PVector difference = PVector.sub(vector1, vector2), where vector1 and vector2 are the vectors representing your two points, and difference is the new vector between the two points. You then require the magnitude of the difference vector. Again, in processing, this is simply found by magnitude = difference.mag(). That magnitude should be your desired distance.

    Here's a great rundown of both vectors in processing, and vectors in general: https://processing.org/tutorials/pvector/

提交回复
热议问题