This project is read-only.

Centroids (weighted) & CCL in

Feb 2, 2015 at 5:47 PM
We have a 8bit greyscale image with lots of star-like objects. We are currently finding the weighted centroid with Matlab using:
mask = image(:,:) > threshold;
ccl = bwconncomp(mask);
ctroids= regionprops(ccl, image, {'Centroid', 'WeightedCentroid'});
centroids = cat(1, ctroids.WeightedCentroids);
We need to stop using Matlab, and go to a pure CUDA solution. The IMAGE array is already in GPU global memory (from earlier CUDA kernel process steps). So we are looking for open source code that we can use to do the rest of the centroiding.

Perhaps I am missing something but my searches are not turning up useful sources. Also These all seems to require libraries that are not present in
  1. GPU Gems ( ) just the CCL stuff, the FindRoot algorithm is not clear to me from pseudo code. But probably the best start (where is weighted centroiding? inGPU Gems?). I also see Google saying they have a faster solution. but their solution is completely opaque to me:
  2. ArrayFire ( ) I like the simplicity, but we need Weighted Centroids, and also, I would love to see a explanation of the algorithm. Also they seem to assume C++ arrays, and our data is already in the GPU. I don't want to copy it back and forth.
  3. OpenCV. I can't find the correct routines, and I don't need the full GPU library, just the CCL and centroids. Also it seems this library also expects the data to be in the host to begin with, and to return to the host. Can I just get a snippet of the source code?
Perhaps I am just not looking hard enough at the libs. Or perhaps there is a better place too look?