Deo
Posts:
50
Registered:
2/13/08
|
|
Re: connected components in a grey scale image
Posted:
May 15, 2008 11:01 AM
|
|
"us " <us@neurol.unizh.ch> wrote in message <g0hf2r$an4 $1@fred.mathworks.com>... > "Deo ": > <SNIP flip-flopping with every new post... > > you should THINK before you waste CSSMers time... > and, why don't you start playing with what we showed you > > % the data > m=[ > 0.09 0.09 0.09 > 0.01 8.00 0.07 > 0.01 9.00 0.06 > 0.09 0.01 7.00 % <- value 1 has changed > ]; > % the engine > [mu,mx,mx]=unique(m); > r=reshape(mx,size(m)); > % the result > % - note: <mu> contains the unique abs value(s) > disp(r); > %{ > 4.00 4.00 4.00 % re-indexed mat > 1.00 6.00 3.00 > 1.00 7.00 2.00 > 4.00 1.00 5.00 % value 1 is now a 4 > %} > % -now- > lab4=bwlabel(r==4) > % -or- > labx=bwlabel(r==1|r==4) > %{ > lab4= > 1 1 1 % <- connected 4s > 0 0 0 > 0 0 0 > 2 0 0 % <- another 4 > labx= > 1 1 1 > 1 0 0 > 1 0 0 > 1 1 0 > %} > > us Dude am very sorry for having wasted your time. But thanks alot for your help, I have then made the code that finds and labels connected components in grey scale image.
|
|