フィルターのクリア

Active Contour algorithm applicated to Digital Elevation Model

2 ビュー (過去 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

Community Treasure Hunt

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

Start Hunting!

Translated by