MATLAB Answers

how to calculate the no. of pixel?

조회 수: 1(최근 30일)
mohd akmal masud
mohd akmal masud 2020년 11월 11일
댓글: mohd akmal masud 2020년 11월 12일
hi all,
i done convert gray image to binary image. but how i want to calculate the how much no pixel in red circle as picture attached??
my image name is spect128x128
I15 = dicomread('spect128x128', 'frame', 15);
T15 = graythresh(level);
BW15 = imbinarize(I15,T15);
imshowpair(I15, BW15, 'montage')

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 11월 11일
See bwconncomp(): It returns a struct. You can check the number of elements in PixelIdxList property to count the pixels.
  댓글 수: 5
mohd akmal masud
mohd akmal masud 2020년 11월 12일
ok, thank you so much sir.
then how to to fill the color in every object. lets say i want fill blue color in object no.4?

댓글을 달려면 로그인하십시오.

추가 답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by