Kinect: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 28: Line 28:
|}
|}
== Presentation software ==
== Presentation software ==
<nocms>
 
  begin;
  begin;


Line 44: Line 44:
  }arrayJoints;
  }arrayJoints;


picture {
picture {
text { font = "Arial"; font_size = 20; caption = "move a bit:)"; } cap;
text { font = "Arial"; font_size = 20; caption = "move a bit:)"; } cap;
x = 0; y = -400;
x = 0; y = -400;
} pic;
} pic;


begin_pcl;
begin_pcl;


array<vector> data[0]; # in centimeters
array<vector> data[0]; # in centimeters
array<int> body_ids[0];
array<int> body_ids[0];
int counter = 0, dataBody;
int counter = 0, dataBody;
string toScreen;
string toScreen;


sub change_caption( string caption ) begin
sub change_caption( string caption ) begin
cap.set_caption( caption, true );
cap.set_caption( caption, true );
pic.present()
pic.present()
end;
end;


sub showJoint( int joint , int partNr) begin
sub showJoint( int joint , int partNr) begin
pic.set_part_x(partNr+1,data[joint].x() * 10);
pic.set_part_x(partNr+1,data[joint].x() * 10);
pic.set_part_y(partNr+1,data[joint].y() * 10);
pic.set_part_y(partNr+1,data[joint].y() * 10);
Line 68: Line 68:
arrayJoints[partNr].redraw();
arrayJoints[partNr].redraw();
end;
end;
end;
end;


kinect k = new kinect();
kinect k = new kinect();
depth_data dd = k.depth();
depth_data dd = k.depth();
dd.RES_512x424;
dd.RES_512x424;


body_tracker tracker = k.body();
body_tracker tracker = k.body();
tracker.set_seated( true );
tracker.set_seated( true );
tracker.start();
tracker.start();


pic.present();
pic.present();
body_data bd;
body_data bd;
loop until !is_null( bd ) begin
loop until !is_null( bd ) begin
bd = tracker.get_new_body();
bd = tracker.get_new_body();
end;
end;


#add the joints to picture
#add the joints to picture
loop
loop
int count = 1;
int count = 1;
until count > 6 begin
until count > 6 begin
pic.add_part(arrayJoints[count],0,0);
pic.add_part(arrayJoints[count],0,0);
count = count + 1;
count = count + 1;
end;
end;


dd.start();
dd.start();
loop until false begin
loop until false begin
   if (dd.new_data()) then
   if (dd.new_data()) then
counter = counter + 1;
counter = counter + 1;
Line 111: Line 111:
end;
end;
   end;
   end;
end;
end;
</nocms>