Launch an algorithm in several samples extracted from an image
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Thorsten
el 13 de Oct. de 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 comentarios
Thorsten
el 14 de Oct. de 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.
Ver también
Categorías
Más información sobre Image Processing Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!