Active Contour algorithm applicated to Digital Elevation Model
조회 수: 1 (최근 30일)
이전 댓글 표시
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
채택된 답변
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
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.
추가 답변 (2개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Contour Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!