Launch an algorithm in several samples extracted from an image
2 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Thorsten
on 13 Oct 2015
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 Comments
Thorsten
on 14 Oct 2015
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.
See Also
Categories
Find more on Image Processing Toolbox 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!