LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

help with virtual piano (Labview Project using Kinect)

i have to create a virtual piano on a flat surface using the kinect as camera to detect the skeleton image while having to set the coordinates on the floor for the "virtual piano keys". 

the thing is im lost as to how to set the coordinates for the piano.


ps: this project is given without me having any background knowledge on 
pps: im really need help or guidance in this. thank you any kind soul

0 Kudos
Message 1 of 3
(2,907 Views)

Let's assume that you are trying to implement the simplest form of a piano, and only need to produce a single note at a time.

 

Let's also assume that you are not going to try and make this an 88 key piano, with white and black keys.  Let say our piano will be one octave, eight keys, C D E F G A B C.

 

Assuming you already have a way to read values from the Kinect, these are going to most likely be in millimeters, three axis.  So (X,Y,Z), where X measures left to right, Y measures front to back, and Z measures up and down.

 

You only need to move your hand left to right, and see the range of X values that the device returns.  This will be your X-Range.  Lets say that on the left, you get a value of -500, and on the right you get a value of 480.  Your X-Range is 480 - (-500) = 980.  Divide 980 by 8 to get your key spacing 122.5.  122.5 now becomes your key multiplier

 

If X <= -500 + (122.5 * 1), then C

If X <= -500 + (122.5 * 2), then D

If X <= -500 + (122.5 * 3), then E

If X <= -500 + (122.5 * 4), then F

If X <= -500 + (122.5 * 5), then G

If X <= -500 + (122.5 * 6), then A

If X <= -500 + (122.5 * 7), then B

If X <= -500 + (122.5 * 8), then C

 

Now you just need to look at Z values, to determine when the hand has touched the table.  Since you probably want to give a little wiggle room, set the Key Touch Z heigh a little bit higher than the highest sensor value you get when you move your hand On the table left to right.

 

If Z <= -10 and X <= -500 + (122.5 * 1), then C

If Z <= -10 and X <= -500 + (122.5 * 2), then D

If Z <= -10 and X <= -500 + (122.5 * 3), then E

If Z <= -10 and X <= -500 + (122.5 * 4), then F

If Z <= -10 and X <= -500 + (122.5 * 5), then G

If Z <= -10 and X <= -500 + (122.5 * 6), then A

If Z <= -10 and X <= -500 + (122.5 * 7), then B

If Z <= -10 and X <= -500 + (122.5 * 8), then C

 

 

Machine Vision, Robotics, Embedded Systems, Surveillance

www.movimed.com - Custom Imaging Solutions
0 Kudos
Message 2 of 3
(2,838 Views)

Thank you for responding !! i really appricate it! 

but im having problems connecting kinect with the code from labview. 

 

is there a way to go about it?

0 Kudos
Message 3 of 3
(2,825 Views)