How to randomly choose three pixels and use their values in kmeans
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
1 comentario
KALYAN ACHARJYA
el 26 de En. de 2022
Editada: KALYAN ACHARJYA
el 26 de En. de 2022
Please refer the below link for your reference
Respuestas (1)
Image Analyst
el 26 de En. de 2022
Editada: Image Analyst
el 26 de En. de 2022
See my attached example for how to do kmeans on a color image. In general kmeans is not a good color segmentation method. You'd probably be better off using discriminant analysis (like the other attached demo).
You might also be interested in the color frequency image code from the File Exchange:
6 comentarios
Image Analyst
el 27 de En. de 2022
kmeans starts its process with starting locations. If you don't specify them, I believe it picks them at random. So if you want random starting locations, you don't need to do anything. Of course you can specify starting locations if you have a good idea of where to start, but if you just pick random ones, it's just like the function picking random ones. So why pick random ones yourself when the function will do it for you if you don't specify the starting location?
The final image should be a classified image with 3 values: 1, 2, and 3, which you can map to any colors you want. It should not be a single scalar. Again, see my full demo for instructions.
Make sure you build Z like I did, not like you did.
Attach your image and m-file if you need more help.
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!