blob detection in matlab

I am new to Matlab. My Gray scale image has Blobs and Lines. How to detect blobs?. Using 8-connctivity rules. Need to log the sizes of each blob followed by x,y of pixel?. I read about bwlabel. Is it possible to detect Blobs and lines separately?.

1 件のコメント

Erik S.
Erik S. 2015 年 2 月 9 日
can you provide an example image?

サインインしてコメントする。

回答 (1 件)

Alexey Gordienko
Alexey Gordienko 2017 年 8 月 17 日
編集済み: Alexey Gordienko 2017 年 8 月 17 日

0 投票

Hello! Here is my example of processing a binary image for highlighting license plates of cars using blob analysis
function [BBOX_OUT, NUM_BLOBS, LABEL] = CCA(Image)
BBOX_OUT = [];
NUM_BLOBS = [];
LABEL = [];
%%connected component analisys
hblob = vision.BlobAnalysis;
hblob.CentroidOutputPort = false;
hblob.MaximumCount = 3500;
hblob.Connectivity = 4;
hblob.MaximumBlobArea = 6500;
hblob.MinimumBlobArea = 200;
hblob.LabelMatrixOutputPort = true;
hblob.OrientationOutputPort = true;
hblob.MajorAxisLengthOutputPort = true;
hblob.MinorAxisLengthOutputPort = true;
hblob.EccentricityOutputPort = true;
hblob.ExtentOutputPort = true;
hblob.BoundingBoxOutputPort = true;
[AREA,BBOX,MAJOR,MINOR,ORIENT,ECCEN,EXTENT,LABEL] = step(hblob,Image);
imshow(LABEL*2^16)
numberOfBlobs = length(AREA);
allowableAxis = (((MAJOR./MINOR) > 3.8) & (AREA > 200) & (abs(rad2deg(ORIENT))<10) & (EXTENT> 0.6));
idx = find(allowableAxis);
keeperBlobsImage = ismember(LABEL, idx);
imshow(keeperBlobsImage)
LABEL = bwlabel(keeperBlobsImage, 4);
for i =1:length(idx)
BBOX_OUT((i),1:4) = BBOX(idx(i),1:4);
end
NUM_BLOBS = length(idx);
end

3 件のコメント

Yosef Asseaf
Yosef Asseaf 2018 年 6 月 6 日
when I run your code an error 'Not enough input arguments' has appear.what shall I do.
Stephen23
Stephen23 2018 年 6 月 6 日
編集済み: Stephen23 2018 年 6 月 6 日
@Yosef Asseaf: the function CCA requires one input argument: did you call it with one input argument?
Image Analyst
Image Analyst 2018 年 6 月 6 日
Yusef, see my Image Segmentation Tutorial https://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862&sort=downloads_desc I think it will help you.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeImage Processing Toolbox についてさらに検索

タグ

質問済み:

mW
2015 年 2 月 9 日

コメント済み:

2018 年 6 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by