comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: connected component labeling problem in a graylevel image without background
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: connected component labeling problem in a graylevel image without background [message #32470] Tue, 15 October 2002 00:52 Go to next message
Karsten Rodenacker is currently offline  Karsten Rodenacker
Messages: 98
Registered: July 1997
Member
Julia schrieb:
>
> I am not quite familiar with watershed algorithm. But in my understanding,
> "considering the gray scale image
> as a surface, each local minimum can be thought of as the point to which
> water falling on the surrounding
> region drains. The boundaries of the watersheds lie on the tops of the
> ridges. This operator labels each
> watershed region with a unique index, and sets the boundaries to zero.
> Typically, morphological gradients,
> or images containing extracted edges are used for input to the watershed
> operator."
>
> If I use watershed operator on the image, since it labels some pixels as
> boundaries, it will eliminate some regions
> with one-pixel width and label them as boundaries. That is not what I want.
> Can watershed algorithm really solve this?

1 px width boundaries guarantee connected regions which can lateron
relabelled e.g. by label_region. However the algorithm implemented by
rsi generates boundaries, there are other watershed algorithms which
generate touching regions without boundaries. I have a pure idl
implementation under
http://www.gsf.de/ILIAD/Rodenacker/IDL/MM.html#Watershed designed in
times before morph_... and n-dim label_region existed which performs in
that way (doc. in German). (Still I wait for idl watershed on 3d data
which comprises a very simple extension of the original watershed
algorithm).

>
> Regards,
>

--
Karsten Rodenacker ()
------------------------------------------------------------ -------------:-)
GSF - Forschungszentrum Institute of Biomathematics and Biometry
D-85758 Oberschleissheim Postfach 11 29
Tel: +49 89 31873401 | FAX: ...3369 | rodena@gsf.de |
Karsten@Rodenacker.de
http://www.gsf.de/ibb/homepages/rodenacker
Re: connected component labeling problem in a graylevel image without background [message #32538 is a reply to message #32470] Wed, 16 October 2002 09:22 Go to previous message
Jaco van Gorkom is currently offline  Jaco van Gorkom
Messages: 97
Registered: November 2000
Member
"Julia" <julia65201@yahoo.com> wrote in message news:aok20m$efp$1@dipsy.missouri.edu...
> ...
> I tested the algorithm on a 1730*2210 image with 364 gray levels. If I use
> the label_region in IDL to mask and relabel, it takes about 80s. While if I
> use the watershed algorithm tm_wshe1.pro, it takes more than 4000s.

Hello Julia,

for this size of image and number of gray levels, a fast solution is
probably not possible in IDL. I am aware of a routine by Harvey Rhody at
http://www.cis.rit.edu/class/simg782/ that does exactly what you want.
(hr_label_region, this was a tip from Jason on this newsgroup sometime.) It
loops over the elements of the image and is therefore not very fast, but
may be quite instructive.

If speed of this operation is really important to you, then you should
consider writing it in C as a dlm. Or, if you do not want to learn how to do
that, find someone to do it for you. And who knows, maybe RSI can be
convinced that this is the one feature that would make IDL complete?

Good luck,
Jaco
Re: connected component labeling problem in a graylevel image without background [message #32539 is a reply to message #32470] Wed, 16 October 2002 08:55 Go to previous message
Julia is currently offline  Julia
Messages: 11
Registered: July 2002
Junior Member
Thanks for your suggestion.

I tested the algorithm on a 1730*2210 image with 364 gray levels. If I use
the label_region in IDL to mask and relabel, it takes about 80s. While if I
use the watershed algorithm tm_wshe1.pro, it takes more than 4000s. I saw on
your webpage that there is another version of watershed algorithm
implemented in C that can be called by IDL, I think that will be faster. Can
you send the file to me? My email address is: julia65201@yahoo.com.

Regards,

Julia

"Karsten Rodenacker" <rodena@gsf.de> wrote in message
news:3DABC92C.DB809DD9@gsf.de...
>
>
> Julia schrieb:
>>
>> I am not quite familiar with watershed algorithm. But in my
understanding,
>> "considering the gray scale image
>> as a surface, each local minimum can be thought of as the point to which
>> water falling on the surrounding
>> region drains. The boundaries of the watersheds lie on the tops of the
>> ridges. This operator labels each
>> watershed region with a unique index, and sets the boundaries to zero.
>> Typically, morphological gradients,
>> or images containing extracted edges are used for input to the watershed
>> operator."
>>
>> If I use watershed operator on the image, since it labels some pixels as
>> boundaries, it will eliminate some regions
>> with one-pixel width and label them as boundaries. That is not what I
want.
>> Can watershed algorithm really solve this?
>
> 1 px width boundaries guarantee connected regions which can lateron
> relabelled e.g. by label_region. However the algorithm implemented by
> rsi generates boundaries, there are other watershed algorithms which
> generate touching regions without boundaries. I have a pure idl
> implementation under
> http://www.gsf.de/ILIAD/Rodenacker/IDL/MM.html#Watershed designed in
> times before morph_... and n-dim label_region existed which performs in
> that way (doc. in German). (Still I wait for idl watershed on 3d data
> which comprises a very simple extension of the original watershed
> algorithm).
>
>>
>> Regards,
>>
>
> --
> Karsten Rodenacker ()
> ------------------------------------------------------------ -------------:
-)
> GSF - Forschungszentrum Institute of Biomathematics and Biometry
> D-85758 Oberschleissheim Postfach 11 29
> Tel: +49 89 31873401 | FAX: ...3369 | rodena@gsf.de |
> Karsten@Rodenacker.de
> http://www.gsf.de/ibb/homepages/rodenacker
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: X-windows locking up
Next Topic: ENVI batch to subset an image using a ROI

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:47:31 PDT 2025

Total time taken to generate the page: 0.00671 seconds