Alternate Methods for Detecting Blobs in a Binary Image

2 次查看(过去 30 天)
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 个评论
Jacob Mevorach
Jacob Mevorach 2017-5-9
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));

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with Image Processing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by