![](https://www.mathworks.com/matlabcentral/images/broken_image.png)
Counting objects doesn't hit the correct value
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Carlos
am 2 Apr. 2014
Beantwortet: Image Analyst
am 2 Apr. 2014
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/160014/image.jpeg)
Hello, I need to count objects from different images, they are seem as this one: There are 3 objects, but when I do my code, it sais there are 7 objects. I have more photos, sometimes it hit the value, and other times doesn't. Any idea to correct this?
I=imread('imgPM101');
imshow(I)
I2=imadjust(I);
level=graythresh(I);
bw = im2bw (I, level);
bw = bwareaopen (bw, 50);
bw = ~bw;
imshow(bw)
[labeled,numObjects] = bwlabel(bw,8);
numObjects
Thank you.
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 2 Apr. 2014
Try the attached test.m (below in blue text), which will produce the 3 blobs:
![](https://www.mathworks.com/matlabcentral/images/broken_image.png)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!