Is it a result of k-means clustering? If so, you can count each color pixel easily by using the output variable of kmeans function.
How to count each colour pixel of an image?
조회 수: 1 (최근 30일)
이전 댓글 표시
I am trying to quantify the value of of each matter of the brain using matlab. I have segmented the image and result as shown below.
댓글 수: 2
채택된 답변
Image Analyst
2018년 9월 30일
Take the histogram of your segmented/classified image
counts = imhist(classifiedImage);
Each class will have a certain value, like gray matter is 1, background is 0, white material is 2, etc. imhist() simply counts the pixels in each class.
댓글 수: 3
Image Analyst
2018년 10월 1일
imhist() will do it. You pass in the classified image, not an RGB image, but the image you got from kmeans. See attached demo.
Image Analyst
2018년 10월 2일
Do you still not understand? If so, give me the script you used to create that image along with the original image.
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!