Region growing
Afficher commentaires plus anciens
Hi I need a function to region growing (functions posted here do not serve in my case). Given these data, i) given the original image, I (gray) ii) given an image with the seeds, S (binary) iii) given an image with the limits of what can grow the seeds, T (binary)
I want the algorithm analyzes the neighbors of seed and if they are below a threshold t, the seed grows. I wrote these lines of code
for i=2:u-1
% for j=2:t-1
% if (D(i,j)==1 & BW2(i,j)==1)
%
% if ((imgm(i-1,j-1)-imgm(i,j))<=0.2 & (imgm(i-1,j)-imgm(i,j))<=0.2 & ...
% (imgm(i-1,j+1)-imgm(i,j))<=0.2 & (imgm(i,j-1)-imgm(i,j))<=0.2 &...
% (imgm(i,j+1)-imgm(i,j))<=0.2 & (imgm(i+1,j-1)-imgm(i,j))<=0.2 & ...
% (imgm(i+1,j-1)-imgm(i,j))<=0.2 & (imgm(i+1,j+1)-imgm(i,j))<=0.2)
% A(i,j)=1;
%
% %end
% end
% end
% end
but is not working ... Anyone can help me?
Réponses (2)
Sean de Wolski
le 16 Déc 2011
0 votes
It looks like all() might be your friend. Perhaps blockproc() as well.
Image Analyst
le 16 Déc 2011
0 votes
And why aren't you simply using imreconstruct()?
Catégories
En savoir plus sur Image Segmentation dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!