Alternate Methods for Detecting Blobs in a Binary Image

2 visualizzazioni (ultimi 30 giorni)
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 Commento
Jacob Mevorach
Jacob Mevorach il 9 Mag 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));

Accedi per commentare.

Risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by