add keyboard controls
This commit is contained in:
parent
bda914fff5
commit
d1c42ccaef
2 changed files with 37 additions and 5 deletions
30
README.txt
Normal file
30
README.txt
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
## Controls ##
|
||||||
|
|
||||||
|
Arrow up: tilt angle ++ NOT USED
|
||||||
|
Arrow down: tilt angle -- NOT USED
|
||||||
|
|
||||||
|
y: decrease minDepth
|
||||||
|
x: increase minDepth
|
||||||
|
c: decrease maxDepth
|
||||||
|
v: increase maxDepth
|
||||||
|
|
||||||
|
s: save boxconfig
|
||||||
|
l: load boxconfig
|
||||||
|
|
||||||
|
u: toggle left view between depth and image
|
||||||
|
m: toggle mirror
|
||||||
|
i: toggle IR
|
||||||
|
k: toggle colordepth
|
||||||
|
w: switch box modes
|
||||||
|
|
||||||
|
|
||||||
|
e: toogle box edit mode
|
||||||
|
In edit mode:
|
||||||
|
+: boxedit id++
|
||||||
|
-: boxedit id--
|
||||||
|
4: decrease box width
|
||||||
|
6: increase box width
|
||||||
|
2: decrease box height
|
||||||
|
8: increase box height
|
||||||
|
arrow keys: move box
|
||||||
|
mouse click in richt view: center box at mouse position
|
|
@ -40,8 +40,9 @@ PVector boxsize[] = new PVector[boxnum]; //size of box (width,height)
|
||||||
boolean boxenabled[] = new boolean[boxnum];
|
boolean boxenabled[] = new boolean[boxnum];
|
||||||
float[] depthLookUp = new float[2048];
|
float[] depthLookUp = new float[2048];
|
||||||
|
|
||||||
static int FRAMERATE=10;
|
static int FRAMERATE=20;
|
||||||
int fadetime=1000/FRAMERATE /10; //fadetime in centiseconds
|
//int fadetime=1000/FRAMERATE /10; //fadetime in centiseconds
|
||||||
|
int fadetime=1000/FRAMERATE /10 *4; //fadetime in centiseconds SMOOOOTH
|
||||||
|
|
||||||
int editbox=0; //num of box
|
int editbox=0; //num of box
|
||||||
boolean editboxpos=false; //editmode
|
boolean editboxpos=false; //editmode
|
||||||
|
@ -230,7 +231,8 @@ void draw() {
|
||||||
|
|
||||||
int brightness=0;
|
int brightness=0;
|
||||||
if (cpmax>0){
|
if (cpmax>0){
|
||||||
brightness=255;
|
//brightness=255;
|
||||||
|
brightness=int(255-(cpmax-cpmean));
|
||||||
}
|
}
|
||||||
if (mode.equals(Mode.DEPTHCOLOR)){ //depth color
|
if (mode.equals(Mode.DEPTHCOLOR)){ //depth color
|
||||||
box[i]=color(map(cpmax,0,255, 0,255),255,brightness);
|
box[i]=color(map(cpmax,0,255, 0,255),255,brightness);
|
||||||
|
@ -290,7 +292,7 @@ void keyPressed() {
|
||||||
saveBoxConfig();
|
saveBoxConfig();
|
||||||
} else if (key =='l') { //load boxes
|
} else if (key =='l') { //load boxes
|
||||||
loadBoxConfig();
|
loadBoxConfig();
|
||||||
} else if (key =='u') { //switch left view
|
} else if (key =='u') { //toggle left view
|
||||||
leftview_depth=!leftview_depth;
|
leftview_depth=!leftview_depth;
|
||||||
} else if (key =='m') { // mirror
|
} else if (key =='m') { // mirror
|
||||||
enable_mirrorImage=!enable_mirrorImage;
|
enable_mirrorImage=!enable_mirrorImage;
|
||||||
|
@ -298,7 +300,7 @@ void keyPressed() {
|
||||||
} else if (key =='i') { // toggle IR
|
} else if (key =='i') { // toggle IR
|
||||||
enable_IRImage=!enable_IRImage;
|
enable_IRImage=!enable_IRImage;
|
||||||
kinect.enableIR(enable_IRImage);
|
kinect.enableIR(enable_IRImage);
|
||||||
} else if (key =='k') { // toggle IR
|
} else if (key =='k') { // toggle color as depth
|
||||||
enable_colordepth=!enable_colordepth;
|
enable_colordepth=!enable_colordepth;
|
||||||
kinect.enableColorDepth(enable_colordepth);
|
kinect.enableColorDepth(enable_colordepth);
|
||||||
} else if (key =='w') { // switch mode
|
} else if (key =='w') { // switch mode
|
||||||
|
|
Loading…
Reference in a new issue