segment a color image into regions based on intensity homogenity

2 visualizaciones (últimos 30 días)
TAUSEEF KHAN
TAUSEEF KHAN el 4 de Jul. de 2018
Respondida: Gautam el 24 de Oct. de 2024
I want to segment a color image into multiple regions based on intensity homogeneity and color each region with different colors. I have attached a color image. Please suggest me with proper code.

Respuestas (1)

Gautam
Gautam el 24 de Oct. de 2024
You can use K-Means clustering to segment you image
img = imread('IMG_2505.jpg'); % Replace with your image file
numColors = 5;
L = imsegkmeans(img,numColors);
imagesc(L)
colormap("parula")
This is the output the code generates
You can refer to the below MathWorks page for more examples and methods used for image segmentation

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by