How to detect unstructered objects in an image ?

1 回表示 (過去 30 日間)
Ender Rencuzogullari
Ender Rencuzogullari 2018 年 5 月 19 日
編集済み: Ender Rencuzogullari 2018 年 5 月 20 日
Hi,
I have an RGB image which has black objects on it to detect, find center of it and label with a circle. I applied some proccesses on it but cannot achieve. Here is the steps that I have applied:
Original Image:
Step 1:
image = imread('Im_005.jpg');
I = rgb2gray(image);
J = imresize(I, 0.5);
E = histeq(J);
figure(4), imshow(E)
Step 2:
bw = imbinarize(E);
se3 = strel('disk',1);
dilation = imdilate(bw,se3);
figure(5),imshow(dilation)
cc = bwconncomp(dilation, 8);
cc.NumObjects;
However, although I have tried lots of method (morphological etc.), I could not figure out how to find the center points of black objects and label them with a circle. Also,
cc = bwconncomp(dilation, 4);
gives output as "number of objects: 1" although there are two objects. How can I solve this problem?
Best.

採用された回答

Image Analyst
Image Analyst 2018 年 5 月 19 日
Use regionprops():
dilation = ~imdilate(bw,se3);
props = regionprops(dilation, 'Centroid');
  1 件のコメント
Ender Rencuzogullari
Ender Rencuzogullari 2018 年 5 月 20 日
編集済み: Ender Rencuzogullari 2018 年 5 月 20 日
Thank you. regionprops() function and "~" gave me an idea to solve my problem.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by