Kinect Object tracking

edbraund's icon

Hey guys,

I am having a problem with my kinect patch. I'm designing a patch whereby i'm using the RGB from the kinect to track the coordinates of two different LEDs, this if fine for the X & Y but i need to track the Z axis. I have no idea how i can do this so any help would be very greatly received.

Cheers Ed

dtr's icon

well that's gonna be hard with just the RGB image... that's what the depth map is for, no?

not that i can't think of some ways, like relating the size of the tracked dots in pixels to distance, although that's probably not gonna be very accurate at 640x480.

what you probably rather wanna do is combine the RGB and depth images, then do your color tracking and get the depth.

not entirely sure if it will work without more effort to superimpose RGB and depth correctly but you could try getting the Z from the depth map at the same XY coordinate as your dot is in the RGB image.

what are you using to read out the kinect?

edbraund's icon

Cheers for the response,

I'm using jit.freenect.grab. That makes sense but how do i get a coordinate out of the depth map?

Cheers Ed

dtr's icon

store the depth map in a jit.matrix
send message: getcell x y
where x and y are your coordinates
your z value comes out the right outlet in the format 'cell x y val z'
(these really are jit.matrix basics)

akash's icon

@DTR can you post an example patch?