BODY Kinect y z Kinect x 3 D
BODY Kinect 第4回目
y z Kinectの座標系 x
3 D座標の取得 class Kinect. App { void draw. Ellipse( cv: : Mat& body. Image, const Joint& joint, int r, const cv: : Scalar& color ) { private: // カメラ座標系をDepth座標系に変換する ………………… CCom. Ptr<ICoordinate. Mapper> mapper; int joint_no; ERROR_CHECK( kinect->get_Coordinate. Mapper( &mapper ) ); Int gamenx[25], gameny[25]; double d 3 x[25], d 3 y[25], d 3 z[25]; Depth. Space. Point point; …………… mapper->Map. Camera. Point. To. Depth. Space( joint. Position, &point ); void draw. Body. Frame() cv: : circle( body. Image, cv: : Point( point. X, point. Y ), r, color, -1 ); { //画面座標を保存 ………… gamenx[joint_no] = point. X; joint_no = -1; gameny[joint_no] = point. Y; // 関節の位置を表示する Joint joints[Joint. Type: : Joint. Type_Count]; //3次元座標にする body->Get. Joints( Joint. Type: : Joint. Type_Count, joints ); d 3 x[joint_no] = joint. Position. X * 100; // [cm] for ( auto joint : joints ) { d 3 y[joint_no] = joint. Position. Y * 100; joint_no++; draw. Ellipse( body. Image, joint, 10, cv: : Scalar( 255, 0, 0 ) ); } } d 3 z[joint_no] = joint. Position. Z * 100; }
- Slides: 7