Region growing
Show older comments
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?
Answers (2)
Sean de Wolski
on 16 Dec 2011
0 votes
It looks like all() might be your friend. Perhaps blockproc() as well.
Image Analyst
on 16 Dec 2011
0 votes
And why aren't you simply using imreconstruct()?
Categories
Find more on Image Segmentation 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!