Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
skin lesion segmentation matlab
#1

skin lesion segmentation matlab

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
%--

clear all
close all
clc
%k parameter can be changed to adjust intensity of image
ei=25;
st=35;
%k=10
k=ei*st;
I = imread('1.jpg');
%h=filter matrx
h = ones(ei,st) / k;
I1 = imfilter(I,h,'symmetric');
figure
subplot(2,2,1),imshow(I), title('Original image');
subplot(2,2,2), imshow(I1), title('Filtered Image');
IG=rgb2gray(I1);
%Converting to BW
I11 = imadjust(IG,stretchlim(IG),[]);
level = graythresh(I11);
BWJ = im2bw(I11,level);
dim = size(BWJ)
IN=ones(dim(1),dim(2));
BW=xor(BWJ,IN); %inverting
subplot(2,2,3), imshow(BW), title('Black and White');
%Finding of initial point
row = round(dim(1)/2);
col = min(find(BW(row,Smile)
%Tracing
boundary = bwtraceboundary(BW,[row, col],'W');
subplot(2,2,4),imshow(I), title('Traced');
hold on;
%Display traced boundary
plot(boundary(:,2),boundary(:,1),'g','LineWidth',2);
hold off
% figure
% plot(boundary(:,2),boundary(:,1),'black','LineWidth',2);

nn=size(boundary);
KM=zeros(dim(1),dim(2));
ii=0;
%Create new matrix with boundary points. there fore we can get rid off
%other distortions outside boundaries
while ii<nn(1)
ii=ii+1;
KM(boundary(ii,1),boundary(ii,2))=1;
end
figure
subplot(2,2,1),plot(boundary(:,2),boundary(:,1),'black','LineWidth',2);
subplot(2,2,2),imshow(KM)
%Fill inner boundaries where lesion is located
KM2 = imfill(KM,'holes');
subplot(2,2,3),imshow(KM2)
KM1=xor(KM2,IN);
% subplot(2,2,4),imshow(KM1)
%Geometrical center
IVx=[1:dim(2)];
IVy=[1:dim(1)];
IMx=ones(dim(1),1)*IVx;
IMy=ones(dim(2),1)*IVy;
IMy = imrotate(IMy,-90);
Koordx=IMx.*KM2;
Koordy=IMy.*KM2;
xmean=mean(Koordx,2);
yc=round(sum(xmean.*IMy(:,1))/sum(xmean));
ymean=mean(Koordy);
xc=round(sum(ymean.*IVx)/sum(ymean));
figure
imshow(I)
hold on
plot(boundary(:,2),boundary(:,1),'green','LineWidth',2);
hold on
plot(xc,1:dim(1),'red','LineWidth',2);
plot(1:dim(2),yc,'red','LineWidth',2);
hold off
% ID=im2double(I);
ID1(:,:,1)=im2double(I(:,:,1));
ID1(:,:,2)=im2double(I(:,:,2));
ID1(:,:,3)=im2double(I(:,:,3));
figure
subplot(2,2,1), imshow(ID1);
subplot(2,2,2), imshow(ID1(:,:,1));
hold on
plot(xc,1:dim(1),'red','LineWidth',2);
plot(1:dim(2),yc,'red','LineWidth',2);
hold off
subplot(2,2,3), imshow(ID1(:,:,2));
subplot(2,2,4), imshow(ID1(:,:,3));

%--
Reply

#2
sir i am interested in this project..so please send me the matlab code..and a brief explanation of texture representation from input image
my email is" [email protected]"
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Powered By MyBB, © 2002-2024 iAndrew & Melroy van den Berg.