Alternate Methods for Detecting Blobs in a Binary Image

8 views (last 30 days)
For a project I've been working on I've been detecting blobs in a binary image. Unfortunately because I've been doing this tens of thousands of times times every time I run my script I've been trying to find a way to speed things up. Does anyone know of a way I can detect blobs in a binary image aside from using the blob analyzer function?
Currently I've been detecting blobs by using the blob analyzer and calling. [centroids, bboxes]=step(h,bw); But I'd like to speed up the process.
I'm preferably looking for a method whereby I'd be able to rewrite things to work with parfor or preferably with calculations on the GPU.
If anyone had any advice or guidance in this regard I'd greatly appreciate it.
  1 Comment
Jacob Mevorach
Jacob Mevorach on 9 May 2017
Found a solution using regionprops(). Simply feed it a black and white image in the following manner to achieve the desired result.
%like this
props = regionprops(mask,'centroid','BoundingBox');
centroids = int32(cat(1, props.Centroid));
bboxes = int32(cat(1, props.BoundingBox));

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!