Region growing

27 visualizaciones (últimos 30 días)
Marlene
Marlene el 16 de Dic. de 2011
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?

Respuestas (2)

Sean de Wolski
Sean de Wolski el 16 de Dic. de 2011
It looks like all() might be your friend. Perhaps blockproc() as well.

Image Analyst
Image Analyst el 16 de Dic. de 2011
And why aren't you simply using imreconstruct()?

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by