Can anyone help me to segment the stone from the kidney image

6 visualizaciones (últimos 30 días)
MINO GEORGE
MINO GEORGE el 22 de Jun. de 2021
Comentada: Image Analyst el 28 de Abr. de 2022
Hi
I am using k means clustering algorithm and this is code i have used
grayLevels = double(grayImage(:));
[clusterIndexes, clusterCenters] = kmeans(grayLevels, numberOfClusters,...
'distance', 'sqEuclidean', ...
'Replicates', 2);
labeledImage = reshape(clusterIndexes, rows, columns);
subplot(2, 2, 2);
figure,imshow(labeledImage,[]);
caption = sprintf('k-means with %d clusters', numberOfClusters);
title(caption,'FontSize', fontSize);
axis on image;
colorbar
hp = impixelinfo();
And the input and output image are attached here. Can anyone help me to segment the stone region(the white dot) from the image.
Any help is aapreciated.

Respuestas (1)

Saurabh Gund
Saurabh Gund el 27 de Abr. de 2022
clc
clear all
close all
warning off
[filename,pathname]=uigetfile('*.*','Pick a MATLAB code file');
filename=strcat(pathname,filename);
a=imread(filename);
%subplot(3,4,1),
imshow(a);
%Convert to grayscale image
%b=rgb2gray(a);
b=im2gray(a);
%subplot(3,4,2),
imshow(b);
impixelinfo;
c=imbinarize(b,20/255);
%c=b>50;
%subplot(3,4,3),
imshow(c);
%Fill the holes in the image
d=imfill(c,'holes');
%subplot(3,4,4),
imshow(d);
%delete writings
e=bwareaopen(d,1000);
%subplot(3,4,5),
imshow(e);
PreprocessedImage=uint8(double(a).*repmat(e,[1 1 3]));
%subplot(3,4,6),
imshow(PreprocessedImage);
  1 comentario
Image Analyst
Image Analyst el 28 de Abr. de 2022
Here is what your code produces. Where is the kidney?
clc
clear all
close all
warning off
% [filename,pathname]=uigetfile('*.*','Pick a MATLAB code file');
filename = '\st1.png';
pathname = pwd;
filename=strcat(pathname,filename);
a=imread(filename);
%subplot(3,4,1),
imshow(a);
%Convert to grayscale image
%b=rgb2gray(a);
b=im2gray(a);
%subplot(3,4,2),
imshow(b);
impixelinfo;
c=imbinarize(b,20/255);
%c=b>50;
%subplot(3,4,3),
imshow(c);
%Fill the holes in the image
d=imfill(c,'holes');
%subplot(3,4,4),
imshow(d);
%delete writings
e=bwareaopen(d,1000);
%subplot(3,4,5),
imshow(e);
PreprocessedImage=uint8(double(a).*repmat(e,[1 1 3]));
%subplot(3,4,6),
imshow(PreprocessedImage);

Iniciar sesión para comentar.

Categorías

Más información sobre Images en Help Center y File Exchange.

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by