shaikh105
Member level 1
matlab using graythresh
Here is a matlab code i am using for ecg image analysis. actually i am capturing an image named s2.png in 1D;
i have 10 images like s1,s2,,,,,,,,,s10,.............or more
if i wanna read all of them at once not one by one and then find the program processed output plot of all those 10 images at once. can anybody help.
the code below is processing only s2.png but to process remaining i have to change s2 to s3 or so and then run the code again. i want to process all 10 images at once how can i do that with this code
clear
[I,map]=imread('s2.png');
j=im2double(I);
level=graythresh(j); % finding threshold using 'otsu method'
k=im2bw(j,level);
[M,N]=size(k);
z=1;
xx=zeros([N,1]);
yy=zeros([N,1]);
for y= 1:N
for x= 1:M
if k(x,y)==0
xx(z)=x;
yy(z)=y;
z=z+1;
end
end
end
t=mean(xx);
ecg=-xx+t;
plot(yy,ecg)
Here is a matlab code i am using for ecg image analysis. actually i am capturing an image named s2.png in 1D;
i have 10 images like s1,s2,,,,,,,,,s10,.............or more
if i wanna read all of them at once not one by one and then find the program processed output plot of all those 10 images at once. can anybody help.
the code below is processing only s2.png but to process remaining i have to change s2 to s3 or so and then run the code again. i want to process all 10 images at once how can i do that with this code
clear
[I,map]=imread('s2.png');
j=im2double(I);
level=graythresh(j); % finding threshold using 'otsu method'
k=im2bw(j,level);
[M,N]=size(k);
z=1;
xx=zeros([N,1]);
yy=zeros([N,1]);
for y= 1:N
for x= 1:M
if k(x,y)==0
xx(z)=x;
yy(z)=y;
z=z+1;
end
end
end
t=mean(xx);
ecg=-xx+t;
plot(yy,ecg)