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

Home » Public Forums » archive » about label_region
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
about label_region [message #25610] Sun, 01 July 2001 15:02 Go to next message
julia65201 is currently offline  julia65201
Messages: 9
Registered: July 2001
Junior Member
hi, there,

Yesterday, I post a message. Since it has the same subject of the
previous one. It got confused. So I bother to post it again. Wish I
can get good results.

The ones who used label_region in IDL must be suprised at the
efficieny of this function. But how can I find out what algorithm is
used in LABEL_REGION? Since I do not see this function in the library,
I assume it is written in C somewhere.

Julia
Re: about label_region [message #25636 is a reply to message #25610] Thu, 05 July 2001 09:22 Go to previous messageGo to next message
Amar Nayegandhi is currently offline  Amar Nayegandhi
Messages: 15
Registered: May 2001
Junior Member
> The ones who used label_region in IDL must be suprised at the
> efficieny of this function. But how can I find out what algorithm is
> used in LABEL_REGION? Since I do not see this function in the library,
> I assume it is written in C somewhere.
[
label_region uses a 'connected components' algorithm that is described
in any good Image Processing text book. It has the option of using 4
neighbors or 8 neighbors. I have used labe_region often, and I have a
strong feeling i get the same results using the 4 or 8-neighbor
approach. I dont think the 8-neighbor approach gives any better results
than the 4-neighbor approach.
- amar
]

--
*************************************************
Murphy's Law of Research:
Enough research will tend to support your theory.
*************************************************
Amar Nayegandhi
Graduate Student
Department of Computer Science,
University of South Florida, Tampa.
Re: about label_region [message #25682 is a reply to message #25610] Wed, 11 July 2001 04:25 Go to previous message
Martin Downing is currently offline  Martin Downing
Messages: 136
Registered: September 1998
Senior Member
Julia,

The algorithm will be written in C as it requires a raster search through
the image for connected blobs. I cant find a reference right now but it goes
something like this psuedo code (considering the raster order to be left to
right working through rows down to up):

-------------------------------------
label _image, IMAGE

create a long image LAB_IM for output
for each pixel:
;check IMAGE to see if background pixel
if background then continue
; else check LAB_IMAGE for connectivity and labelling
if connected to labelled pixel BELOW or LEFT (also BELOW-LEFT,
BELOW-RIGHT if 8 connected) then begin
if connected to more than one label add label pairs to an equivalent
list, ie [1,5] means LABEL 1 = = LABEL 5
assign (first) label to pixel in lab_image
else assign new label to pixel in lab_image
endfor

use equivalent list to create a lookup table reducing all used labels to a
unique set starting from 1

now run through label image replacing each label with its reduced value
----------------------------------------------------

hope this make some sense

Martin


--
----------------------------------------
Mr. Martin Downing,
Clinical Research Physicist,
Orthopaedic RSA Research Centre,
Woodend Hospital,
Aberdeen, AB15 6LS.
"Julia" <julia65201@usa.net> wrote in message
news:f5bebc4d.0107100654.5c89f298@posting.google.com...
>> Amar Nayegandhi said,
>> [
>> label_region uses a 'connected components' algorithm that is described
>> in any good Image Processing text book. It has the option of using 4
>> neighbors or 8 neighbors. I have used labe_region often, and I have a
>> strong feeling i get the same results using the 4 or 8-neighbor
>> approach. I dont think the 8-neighbor approach gives any better results
>> than the 4-neighbor approach.
>> - amar
>> ]
>
> Thanks for your information!
>
> I just wonder where IDL put all these functions in. Is it written in
> IDL or C? I tried to realized it in IDL. As you know, since
> connectivity algorithm is not a parallel algorithm, it should be done
> on pixels one by one. And to keep the equivalent region information, I
> assign a very big matrix even it is very sparse. So the algorithm is
> very slow. Can you give me some hint to improve it, such as how to
> keep the equivalent region information efficiently?
>
> Julia
Re: about label_region [message #25696 is a reply to message #25636] Tue, 10 July 2001 07:54 Go to previous message
julia65201 is currently offline  julia65201
Messages: 9
Registered: July 2001
Junior Member
> Amar Nayegandhi said,
> [
> label_region uses a 'connected components' algorithm that is described
> in any good Image Processing text book. It has the option of using 4
> neighbors or 8 neighbors. I have used labe_region often, and I have a
> strong feeling i get the same results using the 4 or 8-neighbor
> approach. I dont think the 8-neighbor approach gives any better results
> than the 4-neighbor approach.
> - amar
> ]

Thanks for your information!

I just wonder where IDL put all these functions in. Is it written in
IDL or C? I tried to realized it in IDL. As you know, since
connectivity algorithm is not a parallel algorithm, it should be done
on pixels one by one. And to keep the equivalent region information, I
assign a very big matrix even it is very sparse. So the algorithm is
very slow. Can you give me some hint to improve it, such as how to
keep the equivalent region information efficiently?

Julia
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Source Code into latex
Next Topic: Practical IDL Programming: Now In Print!

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

Current Time: Wed Oct 08 15:21:21 PDT 2025

Total time taken to generate the page: 0.00564 seconds