Edge image computation algoritm,Urgent plz reply

Algorithm: (edge image computation) 1. Read the image and convert it to gray scale. 2. Blur the image using a Gaussian filter. 3. Compute the gradient map of the blurred image. 4. Compute GVF. (100 iterations and ? = 0.2 ) 5. Filter out only strong edge responses using ks , where s is the standard deviation of the GVF. (k – value used is 2.5). 6. Converge onto edge pixels satisfying the force balance condition yielding edge image.
I found GVF i mean upto 4th step,but how to perform 5 th step,6th step,and any one please tell me how to find internal force.Plz provide code for 5th and 6th steps

Answers (2)

Show us what you've done and what the MATLAB-related errors are. We won't do your homework assignment for you.
function Fext = AM_GVF(f, mu, in, normalize)
fmin = min(f(:));
fmax = max(f(:));
f = (f-fmin)/(fmax-fmin); % Normalize f to the range [0,1]
if ndims(f)==2,
[fx,fy] = AM_gradient(f); % Calculate the gradient of the edge map
fz = 0;
else
[fx,fy,fz] = AM_gradient(f); % Calculate the gradient of the edge map
end
u = fx; v = fy; w = fz; % Initialize GVF to the gradient
SqrMagf = fx.*fx + fy.*fy + fz.*fz; % Squared magnitude of the gradient field
% Iteratively solve for the GVF u,v,w
for i=1:in,
u = u + mu*AM_laplacian(u) - SqrMagf.*(u-fx);
v = v + mu*AM_laplacian(v) - SqrMagf.*(v-fy);
if ndims(f)==3,
w = w + mu*AM_laplacian(w) - SqrMagf.*(w-fz);
end
end
if ndims(f)==2,
Fext = cat(3,u,v);
else
Fext = cat(4,u,v,w);
end
if normalize,
Fmag = sqrt(sum(Fext.^2,ndims(f)+1));
if ndims(f)==2,
Fext = Fext./(Fmag(:,:,[1 1])+eps);
else
Fext = Fext./(Fmag(:,:,:,[1 1 1])+eps);
end
end
I am getting GVF of an image,but i am unable to undestand how to filter strong edge responses and how to find internal force in a force balance condition,where GVF is external force.

Asked:

on 31 Mar 2011

Community Treasure Hunt

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

Start Hunting!