Kinect meets ミブリ・テブリ

17
Kinect meets ミミミ ミミミ 2013/1/25 Kinect ミミミミ ミミミミ @ignote a.k.a. ミミミ

Transcript of Kinect meets ミブリ・テブリ

Page 1: Kinect meets ミブリ・テブリ

Kinect meets ミブリ・テブリ

2013/1/25 Kinect 開発合宿なかにし @ignote a.k.a. もや

Page 2: Kinect meets ミブリ・テブリ

スケルトントラッキング

Page 3: Kinect meets ミブリ・テブリ

スケルトンのポジション

• スケルトン20 点の座標

頭~肩~腰肘~手首~指先膝~かかと~つま先

Page 4: Kinect meets ミブリ・テブリ

Kinect for Windows 固有

• 着座モード腰から下をトラッキングしない

• 近距離モードリビングではなく、PC 利用想定

Page 5: Kinect meets ミブリ・テブリ
Page 6: Kinect meets ミブリ・テブリ

いよいよアレ

Page 7: Kinect meets ミブリ・テブリ

まるPoint h = GetDisplayPosition(

joints[ JointType.Head ], depthFrame );Point sl = GetDisplayPosition(

joints[ JointType.ShoulderLeft ], depthFrame );Point sr = GetDisplayPosition(

joints[ JointType.ShoulderRight ], depthFrame );Point el = GetDisplayPosition(

joints[ JointType.ElbowLeft ], depthFrame );Point er = GetDisplayPosition(

joints[ JointType.ElbowRight ], depthFrame );Point hl = GetDisplayPosition(

joints[ JointType.HandLeft ], depthFrame );Point hr = GetDisplayPosition(

joints[ JointType.HandRight ], depthFrame );

bool lHandIn = hl.X > el.X;bool lHandUp = hl.Y < h.Y;bool lElbowOut = el.X < sl.X;bool lElbowUp = el.Y < sl.Y;

bool rHandIn = hr.X < er.X;bool rHandUp = hr.Y < h.Y;bool rElbowOut = er.X > sr.X;bool rElbowUp = er.Y < sr.Y;

return ( lHandIn && lHandUp && lElbowOut && lElbowUp &&rHandIn && rHandUp && rElbowOut && rElbowUp );

Page 8: Kinect meets ミブリ・テブリ

まる - 詳説 1Point h = GetDisplayPosition(

joints[ JointType.Head ], depthFrame );Point sl = GetDisplayPosition(

joints[ JointType.ShoulderLeft ], depthFrame );Point sr = GetDisplayPosition(

joints[ JointType.ShoulderRight ], depthFrame );Point el = GetDisplayPosition(

joints[ JointType.ElbowLeft ], depthFrame );Point er = GetDisplayPosition(

joints[ JointType.ElbowRight ], depthFrame );Point hl = GetDisplayPosition(

joints[ JointType.HandLeft ], depthFrame );Point hr = GetDisplayPosition(

joints[ JointType.HandRight ], depthFrame );

bool lHandIn = hl.X > el.X;bool lHandUp = hl.Y < h.Y;bool lElbowOut = el.X < sl.X;bool lElbowUp = el.Y < sl.Y;

bool rHandIn = hr.X < er.X;bool rHandUp = hr.Y < h.Y;bool rElbowOut = er.X > sr.X;bool rElbowUp = er.Y < sr.Y;

return ( lHandIn && lHandUp && lElbowOut && lElbowUp &&rHandIn && rHandUp && rElbowOut && rElbowUp );

bool lHandIn = hl.X > el.X;

Page 9: Kinect meets ミブリ・テブリ

まる - 詳説 2Point h = GetDisplayPosition(

joints[ JointType.Head ], depthFrame );Point sl = GetDisplayPosition(

joints[ JointType.ShoulderLeft ], depthFrame );Point sr = GetDisplayPosition(

joints[ JointType.ShoulderRight ], depthFrame );Point el = GetDisplayPosition(

joints[ JointType.ElbowLeft ], depthFrame );Point er = GetDisplayPosition(

joints[ JointType.ElbowRight ], depthFrame );Point hl = GetDisplayPosition(

joints[ JointType.HandLeft ], depthFrame );Point hr = GetDisplayPosition(

joints[ JointType.HandRight ], depthFrame );

bool lHandIn = hl.X > el.X;

bool lHandUp = hl.Y < h.Y;bool lElbowOut = el.X < sl.X;bool lElbowUp = el.Y < sl.Y;

bool rHandIn = hr.X < er.X;bool rHandUp = hr.Y < h.Y;bool rElbowOut = er.X > sr.X;bool rElbowUp = er.Y < sr.Y;

return ( lHandIn && lHandUp && lElbowOut && lElbowUp &&rHandIn && rHandUp && rElbowOut && rElbowUp );

bool lHandUp = hl.Y < h.Y;

Page 10: Kinect meets ミブリ・テブリ

まる - 詳説 3Point h = GetDisplayPosition(

joints[ JointType.Head ], depthFrame );Point sl = GetDisplayPosition(

joints[ JointType.ShoulderLeft ], depthFrame );Point sr = GetDisplayPosition(

joints[ JointType.ShoulderRight ], depthFrame );Point el = GetDisplayPosition(

joints[ JointType.ElbowLeft ], depthFrame );Point er = GetDisplayPosition(

joints[ JointType.ElbowRight ], depthFrame );Point hl = GetDisplayPosition(

joints[ JointType.HandLeft ], depthFrame );Point hr = GetDisplayPosition(

joints[ JointType.HandRight ], depthFrame );

bool lHandIn = hl.X > el.X;bool lHandUp = hl.Y < h.Y;

bool lElbowOut = el.X < sl.X;bool lElbowUp = el.Y < sl.Y;

bool rHandIn = hr.X < er.X;bool rHandUp = hr.Y < h.Y;bool rElbowOut = er.X > sr.X;bool rElbowUp = er.Y < sr.Y;

return ( lHandIn && lHandUp && lElbowOut && lElbowUp &&rHandIn && rHandUp && rElbowOut && rElbowUp );

bool lElbowOut = el.X < sl.X;

Page 11: Kinect meets ミブリ・テブリ

まる - 詳説 4Point h = GetDisplayPosition(

joints[ JointType.Head ], depthFrame );Point sl = GetDisplayPosition(

joints[ JointType.ShoulderLeft ], depthFrame );Point sr = GetDisplayPosition(

joints[ JointType.ShoulderRight ], depthFrame );Point el = GetDisplayPosition(

joints[ JointType.ElbowLeft ], depthFrame );Point er = GetDisplayPosition(

joints[ JointType.ElbowRight ], depthFrame );Point hl = GetDisplayPosition(

joints[ JointType.HandLeft ], depthFrame );Point hr = GetDisplayPosition(

joints[ JointType.HandRight ], depthFrame );

bool lHandIn = hl.X > el.X;bool lHandUp = hl.Y < h.Y;bool lElbowOut = el.X < sl.X;

bool lElbowUp = el.Y < sl.Y;

bool rHandIn = hr.X < er.X;bool rHandUp = hr.Y < h.Y;bool rElbowOut = er.X > sr.X;bool rElbowUp = er.Y < sr.Y;

return ( lHandIn && lHandUp && lElbowOut && lElbowUp &&rHandIn && rHandUp && rElbowOut && rElbowUp );

bool lElbowUp = el.Y < sl.Y;

Page 12: Kinect meets ミブリ・テブリ

ばつPoint h = GetDisplayPosition(

joints[ JointType.Head ], depthFrame );Point sp = GetDisplayPosition(

joints[ JointType.Spine ], depthFrame );Point el = GetDisplayPosition(

joints[ JointType.ElbowLeft ], depthFrame );Point er = GetDisplayPosition(

joints[ JointType.ElbowRight ], depthFrame );Point hl = GetDisplayPosition(

joints[ JointType.HandLeft ], depthFrame );Point hr = GetDisplayPosition(

joints[ JointType.HandRight ], depthFrame );

bool lheight = h.Y < hl.Y && hl.Y < sp.Y;bool rheight = h.Y < hr.Y && hr.Y < sp.Y;

bool lHandIn = hl.X > el.X;bool rHandIn = hr.X < er.X;

return ( lheight && rheight && lHandIn && rHandIn );

Page 13: Kinect meets ミブリ・テブリ

Point h = GetDisplayPosition( joints[ JointType.Head ], depthFrame );

Point sp = GetDisplayPosition( joints[ JointType.Spine ], depthFrame );

Point el = GetDisplayPosition( joints[ JointType.ElbowLeft ], depthFrame );

Point er = GetDisplayPosition( joints[ JointType.ElbowRight ], depthFrame );

Point hl = GetDisplayPosition( joints[ JointType.HandLeft ], depthFrame );

Point hr = GetDisplayPosition( joints[ JointType.HandRight ], depthFrame );

bool lheight = h.Y < hl.Y && hl.Y < sp.Y;bool lHandIn = hl.X > el.X;

bool rheight = h.Y < hr.Y && hr.Y < sp.Y;bool rHandIn = hr.X < er.X;

return ( lheight && rheight && lHandIn && rHandIn );

ばつ - 詳説 1

bool lheight = h.Y < hl.Y && hl.Y < sp.Y;

Page 14: Kinect meets ミブリ・テブリ

ばつ - 詳説 2Point h = GetDisplayPosition(

joints[ JointType.Head ], depthFrame );Point sp = GetDisplayPosition(

joints[ JointType.Spine ], depthFrame );Point el = GetDisplayPosition(

joints[ JointType.ElbowLeft ], depthFrame );Point er = GetDisplayPosition(

joints[ JointType.ElbowRight ], depthFrame );Point hl = GetDisplayPosition(

joints[ JointType.HandLeft ], depthFrame );Point hr = GetDisplayPosition(

joints[ JointType.HandRight ], depthFrame );

bool lheight = h.Y < hl.Y && hl.Y < sp.Y;

bool lHandIn = hl.X > el.X;

bool rheight = h.Y < hr.Y && hr.Y < sp.Y;bool rHandIn = hr.X < er.X;

return ( lheight && rheight && lHandIn && rHandIn );

bool lHandIn = hl.X > el.X;

Page 15: Kinect meets ミブリ・テブリ

簡単でしょ?

Page 16: Kinect meets ミブリ・テブリ

アカウント間違えました(´ ・ _ ・` )

Page 17: Kinect meets ミブリ・テブリ

Kinect やろうぜ!