How to count the number of object present in binary image?

58 ビュー (過去 30 日間)
Hanuman Wable
Hanuman Wable 2013 年 12 月 20 日
移動済み: DGM 2023 年 2 月 13 日
Hello sir, i am going to count the number of object present in binary image. so any of you please suggest me regarding counting object.because i have problem during count such object. thank you
  1 件のコメント
sanhita das
sanhita das 2018 年 4 月 7 日
移動済み: DGM 2023 年 2 月 13 日
sir,i want to show paragraphs from document image.pls tell the algoritm name. I attach a input file.and how to extract paragraph from this image.please help me

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

回答 (3 件)

Sabarinathan Vadivelu
Sabarinathan Vadivelu 2013 年 12 月 20 日
編集済み: Sabarinathan Vadivelu 2013 年 12 月 20 日
You can use bwconncomp.
cc = bwconncomp(yourBinaryImage,4);
number = cc.NumObjects;

Image Analyst
Image Analyst 2013 年 12 月 20 日
Here's yet another way
[labeledImage, numberOfObject] = bwlabel(binaryImage);
  3 件のコメント
romaisa sabih
romaisa sabih 2016 年 5 月 18 日
sir,i have to count the active fingers in my image.how can i do this ? please help.

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


David Sanchez
David Sanchez 2013 年 12 月 20 日
If you are planning to do something with those objects, you could be interested in using regionprops. Besides the number of objects within the image, you can retrieve any other property of the objects, such as the area, centroid, orientation,....
BW = imread('text.png');
s = regionprops(BW, 'Area');
N_objects = numel(C);
For all the options, take a look at
doc regionprops
  2 件のコメント
muhamad zulhairi zailan
muhamad zulhairi zailan 2018 年 11 月 7 日
hello sir, how to count the object using area parameter, which mean i have the image and i want to count the object in that image using range of area parameter and i want to count the object refer to it area parameter? thanks sir your reply very appreciated.
Image Analyst
Image Analyst 2018 年 11 月 7 日
I don't know what you want. By the way, the code above is not correct. It should say
N_objects = length(s)
That number will be the same regardless which attributes you measure (area, perimeter, or whatever).

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

Community Treasure Hunt

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

Start Hunting!

Translated by