cl depth blob tracking with kinect (Composition by dust)

Author: dust
License: MIT
Date: 2011.01.10
Compatibility: 10.6
Categories:
Required plugins:
(none)

this patch uses open cl to derive monochrome pixel blob structure from the a kinect depth camera image or any other blob image for that matter. i'm doing a quick and dirty blob size calculation. see comments for explanation.

there is a variable blob image resolution that will enable you get much faster track but at the expense of accuracy. so you might want to play with that operand if you want a faster track.

there are some xy offsets to offset the blob from center if you want as well as variable depth input so you can track from the kinect at different depths.

the rgb mask and depth image is calibrated to my right hand you will see a red overlay of the blob image in red even though i'm using white to track.

PreviewAttachmentSize
depthBlobTracker.qtz49.1 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

dust's picture
Re: cl depth blob tracking with kinect (Composition by dust)

this is an early test.

here is an early implementation patch tracking 2 blobs using js to create a blob position index.

all the components are here to derive your multiple blobs.

this is basically just taking the first white pixel after a black pixel as a tracking point. the idea is to store these points and use the center area to report position as well as use the data to derive blob size as well.

right now i'm using a 1D blob structure from cl to derive index's in 2D so the logic is a bit harder to follow.

im thinking i might be able to do all this in one cl loop by % my index count to get an odd even count to differentiate between blobs ?

PreviewAttachmentSize
blob-tracker-2p.qtz54.25 KB

gtoledo3's picture
Re: cl depth blob tracking with kinect (Composition by dust)

If one crosses y, with "blob-tracker-2p.qtz", indices flip.

PreviewAttachmentSize
blob-tracker-2p_index mix up.qtz54.29 KB

dust's picture
Re: cl depth blob tracking with kinect (Composition by dust)

this 2p js version is just experimental. i noticed some conversation over break about multiple blobs and centroids and stuff so i thought i would post this.

i have some code that works from a first person augmented perceptive which is much easier to figure out for me because i don't need to flip or invert anything so its a bit easier. not able to share it at the moment as its my first top secret patch.

actually have a few different versions of this blob tracking object manipulation hit testing stuff in qc. i'm using ofx cv less and less. as having the rgb image and depth image in qc is a real plus. so most of them are for kinect.

dust's picture
Re: cl depth blob tracking with kinect (Composition by dust)

here this seems to patch fix the index switching problem when tracking y. the problem was fixed by using a conditional on the x axis's and inverting the indexes when the blob crosses x, the confusing part is why it happens when you add y influence. either way this invert helps.

like i said this one is just experimental so not sure if this works in all axis. got tired of holding my hands up to test with the kinect so made some rii blobs.

posted this just to see if anybodies interested in getting 2 blobs at the same depth tracking without cropping the image to l/r pairs.

PreviewAttachmentSize
blob-tracker-2p_index fix up.qtz55.71 KB

jersmi's picture
Re: cl depth blob tracking with kinect (Composition by dust)

I'm paying attention -- thanks, dust. It's all adding up to something.