Jump to content
  • Advertisement
Sign in to follow this  
soconne

GPU blob tracking

This topic is 3407 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to implement blob tracking on the GPU but am coming up short on how to achieve it. I found the following article in GPU Gems 2 which shows how to compute the centroid of a single blob: http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter40.html But it does not specify how to accomplish this when there are multiple blobs in the scene. Also, that method seems very expensive for a pixel shader given that it must iterate through every pixel in a given region. Obviously the entire image could be broken up into multiple regions, but there must be a better way. I'd like to implement this using GLSL shaders, have multiple blobs be detected and extracted, and hopefully get the following information out of it. struct blob { x, y, width, height, pixelCount, id; // id is unique per blob }

Share this post


Link to post
Share on other sites
Advertisement
Perhaps you could try something like this:

1. Do a full screen pass, thresholding against your blob color. This produces a black and white image only matching your objects.

2. Down sample the image by 2x repeatedly until you have something manageable, like 32x32 or whatever. Each pixel of this small image will only be greater than 0 if there is a blob in it's area.

3. Use the smaller images to determine what sectors the blobs are in, then only look in the right areas...

It may take some tweaking to get it tuned in correctly, but that should get you in the ball park...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!