Forums > Jitter

cv.jit.blob.centroids defaults to "0"

August 25, 2009 | 3:37 pm

Hello-

I am using the cv.jit.blob.centroids object to track finger positions on a homemade multi-touch table. If someone is touching the table, the patch works perfectly. The fingers
are tracked as blobs and I am able to attach shapes and trails
to the positions of the fingers. The problem I’m having is that if the person lifts their fingers off the table, the first blob defaults to "0", causing the shape and trail to jump to the corner. This makes for a rather jagged user experience.

My goal is to have the x,y position stay where the last finger was positioned rather than the "0" effect.

Below is a striped down version of the patch I’m using. It might be difficult to recreate what is happening unless you
have a dark object with 1 point of white on it. (I’ve been using a CD case with a piece of white tape for testing). The image I’m tracking from the multi-touch table is basically dark blue except for where the fingers are and those spots are bright white.

Any help would be greatly appreciated!!
Lisa Marie

– Pasted Max Patch, click to expand. –

August 25, 2009 | 4:27 pm

Hi Lisa Marie,

Here’s the way I often do this, considering you’re using jit.iter. Look inside the filterZeros subpatch.

best,
Zachary

– Pasted Max Patch, click to expand. –

August 28, 2009 | 1:26 am

Thank you for the simple fix Zachary!
Your project at the ZKM looks to have been a big success.
Congratulations!


Viewing 3 posts - 1 through 3 (of 3 total)