Question
Create a MATLAB Code 1) Active Contours (60%) Implement the Greedy Algorithm described by Williams and Shah to evolve active contours. Your code should: a)
Create a MATLAB Code
1) Active Contours (60%)
Implement the Greedy Algorithm described by Williams and Shah to evolve active contours.
Your code should:
a) Read an image.
b) Compute the smoothed gradient of the image, and find the gradient magnitude at each pixel.
c) Obtain the initial position of a contour from the user (you can use the getline function of the MATLAB for this purpose), and round the positions obtained from the getline function to integers.
d) If the distance between the points in the user input is large, interpolate to add extra points. The distance between the points should be around 5 pixels.
e) Implement the rest of the Greedy Algorithm according to the paper by Williams and Shah
Pseudo-code for the Greedy Algorithm Index arithmetic is modulo n. Initialize ai, Bi, and yi to 1 for all i. do /* loop to move points to new locations */ for i = 0 ton /* point 0 is first and last one processed */ Emin = BIG for j = 0 to m - 1 /* m is size of neighborhood */ E; = a;Econ,j + B: Ecurv,; + y;Eimage.j if E; Ci-1 and c; > Citi /* if curvature is larger than neighbors */ and c; > thresholdi /* and curvature is larger than threshold */ and mag(v) > threshold2 /* and edge strength is above threshold */ then B; = 0 /* relax curvature at point i */ until ptsmoved Ci-1 and c; > Citi /* if curvature is larger than neighbors */ and c; > thresholdi /* and curvature is larger than threshold */ and mag(v) > threshold2 /* and edge strength is above threshold */ then B; = 0 /* relax curvature at point i */ until ptsmovedStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started