Effacer les filtres
Effacer les filtres

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

5 vues (au cours des 30 derniers jours)
MINO GEORGE
MINO GEORGE le 22 Juin 2021
Commenté : Image Analyst le 28 Avr 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.

Réponses (1)

Saurabh Gund
Saurabh Gund le 27 Avr 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 commentaire
Image Analyst
Image Analyst le 28 Avr 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);

Connectez-vous pour commenter.

Catégories

En savoir plus sur Images dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by