bwlabel does not count objects in the image
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I wrote a code to count lymphocites but numObjects always says zero
IL = imread('Lymphocytes.jpg');
imshow(IL, [])
imhist(IL)
Thresh = multithresh(IL,2);
seg_I2 = imquantize(IL,Thresh);
imshow(seg_I2, [])
for i=1:size(seg_I2,1)
for j=1:size(seg_I2,2)
if seg_I2(i,j)==1
seg_I2(i,j)=3;
end
end
end
imshow(seg_I2,[])
J = imcomplement(seg_I2);
imshow(J,[])
binaryImage = J > 128;
[labeled,numObjects]=bwlabel(binaryImage,8);

1 Kommentar
Image Analyst
am 19 Apr. 2022
You're not showing us seg_I2 or J or binaryImage. Not only that, but you forgot to attach 'Lymphocytes.jpg' so we can't do anything but assume it's doing what you told it to do. Chances are binaryImage is all false. Check
maxValue = max(binaryImage)
Antworten (0)
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!