Active Contour algorithm applicated to Digital Elevation Model

조회 수: 1 (최근 30일)
Rdmato33
Rdmato33 2015년 10월 12일
답변: Abdalla Artaime 2016년 8월 18일
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)]);
  댓글 수: 2
Abdalla Artaime
Abdalla Artaime 2016년 8월 18일
Hi dear, How you got the local minimum points Thanks
Abdalla Artaime
Abdalla Artaime 2016년 8월 18일
please let me know Can you help me

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2015년 10월 12일
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
Image Analyst
Image Analyst 2015년 10월 12일
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.
Rdmato33
Rdmato33 2015년 10월 12일
Great explanation. Thank you for your help.

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Abdalla Artaime
Abdalla Artaime 2016년 8월 18일
Hi dear, How you got the local minimum points Thanks

Abdalla Artaime
Abdalla Artaime 2016년 8월 18일
please let me know. Can you help me

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by