필터 지우기
필터 지우기

How can the center be determined by the Kmeans method?

조회 수: 1 (최근 30일)
Ansam Nazar
Ansam Nazar 2020년 6월 24일
답변: Aakash Mehta 2020년 6월 24일

Hello
I am trying to use the Kmeans algorithm of the classification process to separate the diseases in the rays from the normal, but every time the colors resulting from the Kmeans process change. I want to know how I can confirm the colors resulting from each implementation so that each color is specific to a particular class in the xray.
indexes = kmeans(grayImage(:), numberOfClasses);

채택된 답변

KSSV
KSSV 2020년 6월 24일
[idx,C,D] = kmeans(grayImge(:),numberOfclasses) ;
C is your cneter.
Read about kmeans. You can your center along with the function. The output is random..the classe indices change for every run.
  댓글 수: 1
Ansam Nazar
Ansam Nazar 2020년 6월 24일
Thank you so much
But I am looking for a way to stabilize the resulting colors and cancel random with each implementation

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

추가 답변 (1개)

Aakash Mehta
Aakash Mehta 2020년 6월 24일
Due to the random starting value of the kmeans algorithm you are getting the different results with each implementation.
In order to get the results closer in each implementation,
  • Use the 'Start' property of kmeans algorithm. here, you can speecify the start points for your algorithm.so, each time kmeans algorithm starts from those points.
  • Also increase the no of iterations using the 'MaxIter' property.
For more help regarding name-value pair, please go to kmeans name-value pair.

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by