Active Contour algorithm applicated to Digital Elevation Model

1 view (last 30 days)
Hello, I am using Chenyang Xu and Jerry Prince active contour algorithm in order to obtain the geometry of bomb craters from a digital elevation model. I have extracted central points of each crater (circular structures - see image) and I want to draw the contour line of those craters from the central points.
I try to use this code (see below) but I want to draw the contour line from coordinates of my central points (Not from clicked coordinates. I already have extracted the coordinates of the central points). How can I do that?
Thanks
% My image is called "svf.pgm"
imwrite(svf,'../images/svf.pgm');
[I,map] = rawread('../images/svf.pgm');
I=imresize(I,1);
disp(' Compute edge map ...');
f = 1 - I/255;
f0 = gaussianBlur(f,1);
[px,py] = gradient(f0);
figure(1);
subplot(121); imdisp(-f); title('snake potential');
subplot(122); quiver(px,py);
axis('image', 'ij', 'off');
title('traditional force');
disp(' ');
disp(' Press any key to start the deformation');
pause;
figure(1); subplot(121);
colormap(gray(64));
image(((1-f)+1)*40); axis('square', 'off');
figure, imshow(I,map); [x,y] = getpts;
colormap(gray(64));
t = 0:0.5:1;
[x,y] = snakeinterp(x,y,2,0.5);
snakedisp(x,y,'r')
pause(1);
for i=1:20,
[x,y] = snakedeform2(x,y,0.05,0,1, 2, 0.15,px,py,5);
[x,y] = snakeinterp(x,y,2,0.5);
snakedisp(x,y,'r')
title(['Deformation in progress, iter = ' num2str(i*5)])
pause(0.1);
end
disp(' ');
disp(' Press any key to display the final result');
pause;
figure(1); subplot(121);
colormap(gray(64));
image(((1-f)+1)*40); axis('square', 'off');
snakedisp(x,y,'r');
title(['Final result, iter = ' num2str(i*5)]);

Accepted Answer

Image Analyst
Image Analyst on 12 Oct 2015
Can't you just use contour() on your topographic image? You can mask out the non-crater background region if you want so that you see contours only within the craters.
  3 Comments
Image Analyst
Image Analyst on 12 Oct 2015
Oh, okay. So when you use activecontour() and get your binary image, then just use regionprops() to get those measurements. See my Image Segmentation Tutorial: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862 for how to get those measurements.
See my activecontour demo, attached, if you or anyone needs a demo of that.

Sign in to comment.

More Answers (2)

Abdalla Artaime
Abdalla Artaime on 18 Aug 2016
Hi dear, How you got the local minimum points Thanks

Abdalla Artaime
Abdalla Artaime on 18 Aug 2016
please let me know. Can you help me

Categories

Find more on Contour Plots 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!