Extraction of blood vessel using entropic thresholding
조회 수: 3 (최근 30일)
이전 댓글 표시
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
Image Analyst
2013년 11월 29일
I don't know what you did, but if you fixed it, then you are doing the right thing.
Priya Natarajan
2013년 12월 23일
since the values are in double try converting the output to uint8 im2uint8(image) or use mat2gray(image).
답변 (1개)
Image Analyst
2013년 11월 25일
Evidently no pixels are above your threshold. What is the threshold that your code chose?
댓글 수: 3
Image Analyst
2013년 11월 26일
What you posted seems to start past the beginning of your code. Please attach your m-file.
참고 항목
카테고리
Help Center 및 File Exchange에서 Neuroimaging에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!