Launch an algorithm in several samples extracted from an image
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello, I would like to extract features of a raster image by using an active contour algorithm (see below). My goal is to obtain morphometry of each object. For each of them (92 features), I have created same size matrix (5 rows, 5 columns) with this code :
%svf is the name of the image
%xy_points are the center coordinates of each feature
For m=1:92;a(:,:,m)=svf(xy_points(m,1)-2:xy_points(m,1)+2,xy_points(m,2)-2:xy_points(m,2)+2);end
Thus, I obtained 92 matrix of 5x5.
This is my problem : I have succeeded in applying the active contour algorithm on 1 image (the whole image called "svf"). But I don't know how to apply it on my samples (matrix for each feature) and to repeat the process.
Thanks for your help.
댓글 수: 0
답변 (1개)
Thorsten
2015년 10월 13일
Why not
for m=1:92;
result = activecontour(svf(xy_points(m,1)-2:xy_points(m,1)+2,xy_points(m,2)-2:xy_points(m,2)+2));
% do something with result
end
댓글 수: 2
Thorsten
2015년 10월 14일
Your code has various issues:
. if you have swf as your image, why do you write it to a pgm image, then read it, instead on just working with swf
. why to you scale with 1, i.e., no scaling?
Besides this, my suggestion was to write a function activecontour with the image as an argument, that you then call in a loop over all your subimages.
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!