- Binarize the image so that it's logical. binaryImage = grayImage > 128
- Call binaryImage = imclearborder(binaryImage) to get rid of the single line around the perimeter.
- Invert the image: binaryImage = ~binaryImage, so now black circles are white
- Call binaryImage = imclearborder(binaryImage) to get rid of the large (now white) background
- Call bwlabel: [labeledImage, numberOfCircles] = bwlabel(binaryImage). This gives you the count.
- Call measurements = regionprops(labeledImage) if you want other measurements
Counting objects in an image
221 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
subrajeet
am 7 Jan. 2013
Kommentiert: Beenish Ishtiaq
am 5 Aug. 2021
Dear Researchers, I have a problem of counting objects in an image. Suppose I have the below image (below link)
which i got after segmentation.
how can I count the small circles in the middle of the image. Kindly suggest
Subrajeet
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 7 Jan. 2013
Bearbeitet: Image Analyst
am 7 Jan. 2013
2 Kommentare
Image Analyst
am 7 Jan. 2013
Bearbeitet: Image Analyst
am 7 Jan. 2013
It's just basic, elementary image segmentation via intensity thresholding. Nothing fancy at all. See updated instructions above.
Weitere Antworten (3)
Thomas
am 7 Jan. 2013
Bearbeitet: John Kelly
am 8 Nov. 2017
You could use techniques shown in many MATLAB image processing demos.
SANAHA PATHAN
am 25 Jul. 2016
i want to count number of silkworm eggs from this figure, i used L=Count(binaryfig) this command for counting number of objects ,this command works but i actually dont know what actually this command count,and result of this command is different every time
Beenish Ishtiaq
am 3 Aug. 2021
Need code for counting different shapes separatelly which shows each shape result respectively in different edit boxes in GUI matlab..
2 Kommentare
Siehe auch
Kategorien
Find more on Image Processing Toolbox in Help Center and File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!