Region growing

조회 수: 26 (최근 30일)
Marlene
Marlene 2011년 12월 16일
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?

답변 (2개)

Sean de Wolski
Sean de Wolski 2011년 12월 16일
It looks like all() might be your friend. Perhaps blockproc() as well.

Image Analyst
Image Analyst 2011년 12월 16일
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