Alternate Methods for Detecting Blobs in a Binary Image

2 vues (au cours des 30 derniers jours)
Jacob Mevorach
Jacob Mevorach le 8 Mai 2017
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 commentaire
Jacob Mevorach
Jacob Mevorach le 9 Mai 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));

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Get Started with Image Processing Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by