Clear Filters
Clear Filters

Extraction of blood vessel using entropic thresholding

1 view (last 30 days)
hello sir m working with extraction of blood vessels..i want to extract the blood vessels using entropic thresholding method .I also have a code..but when i execute it i get a plain blank image i tried varying the values but still its the same.can somebody please help me on this..please?
Heres my entire code
function GABOR_Callback(hObject, eventdata, handles)
% hObject handle to GABOR (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
A = getimage();
I = A(:,:,2);
%A(:,:,1) =0;
%A(:,:,3) =0;
N = 12;
Sx = 8;
Sy = 2;
f = 0.1;
nf = 1;
theta = 0;
I = im2double(I);
img_out = zeros(size(I,1),size(I,2),N);
for i = 1:12
theta = (i*15*pi)/180;
for x = -fix(Sx):fix(Sx)
for y = -fix(Sy):fix(Sy)
xPrime = x * cos(theta) + y * sin(theta);
yPrime = y * cos(theta) - x * sin(theta);
G(fix(Sx)+x+1,fix(Sy)+y+1) = exp(-nf*pi*((xPrime/Sx)^2+(yPrime/Sy)^2))*cos(2*pi*f*xPrime);
end
end
%G = max(G(:))-G;
%s=sum(G(:));
%mn=s/357;
%G=G-mn;
%figure;
%imshow(real(G));
%title('real image');
c = conv2(I,real(G),'same');
%figure;
%imshow(c);
%title('convo image');
img_out=zeros(size(c,1),size(c,2),N);
img_out(:,:,i)= c;
image3D = cat(3,img_out(:,:,1),img_out(:,:,2), img_out(:,:,3),img_out(:,:,4),img_out(:,:,5), img_out(:,:,6),img_out(:,:,7),img_out(:,:,8), img_out(:,:,9),img_out(:,:,10),img_out(:,:,11),img_out(:,:,12));
% Find the max along dimension #3.
maxG = max(image3D, [], 3);
end
figure;
imshow(maxG);
title('convoluted image');
rt = fix(maxG);
[M,N] =size(rt);
cmtx = zeros(256,256);
for m = 1:M-1
for n = 1:N-1
cmtx(rt(m,n)+1,rt(m,n+1)+1) = cmtx(rt(m,n)+1,rt(m+1,n+1)+1) + 1;
end
end
scmtx = sum(cmtx(:));
prob = cmtx/scmtx;
emax = -100;
for i=1:255
probA = 0;
probC = 0;
subProbA = prob(1:i,1:i);
probA = sum(subProbA(:));
HA(i) = -0.5*(probA*log2(probA+0.0000001));
subProbC = prob(i+1:256,i+1:256);
probC = sum(subProbC(:));
HC(i) = -0.5*(probC*log2(probC+0.0000001));
e1(i) = HA(i) + HC(i);
if e1(i) >= emax
emax = e1(i);
tt1 = i;
end
end
figure;
imshow(e1(i));
and my image for thresholding is (this image is the output of convolution)
%
  7 Comments
Image Analyst
Image Analyst on 29 Nov 2013
I don't know what you did, but if you fixed it, then you are doing the right thing.
Priya Natarajan
Priya Natarajan on 23 Dec 2013
since the values are in double try converting the output to uint8 im2uint8(image) or use mat2gray(image).

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 25 Nov 2013
Evidently no pixels are above your threshold. What is the threshold that your code chose?
  3 Comments
Image Analyst
Image Analyst on 26 Nov 2013
What you posted seems to start past the beginning of your code. Please attach your m-file.

Sign in to comment.

Categories

Find more on Images in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!