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

Home » Public Forums » archive » Re: filling holes in blobs quickly
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: filling holes in blobs quickly [message #30224] Tue, 16 April 2002 02:50 Go to next message
the_cacc is currently offline  the_cacc
Messages: 104
Registered: October 2001
Senior Member
DILATE

Not much experience with it, but it seems like a good candidate.
Re: filling holes in blobs quickly [message #30225 is a reply to message #30224] Tue, 16 April 2002 02:33 Go to previous messageGo to next message
anne.martel is currently offline  anne.martel
Messages: 6
Registered: April 2002
Junior Member
You could find the connected dark region outside of the bright blobs.
Anything that doesn't belong to that region is either a bright object
or a dark hole completely surrounded by bright pixels.

r = search2d(mask,0,0,0,0)
if(r(0) ge 0) then begin
mask(*)=1
mask(r)=0
endif

This assumes that [0,0] always lies outside a blob.

Anne



dmartin@chaos.ph.utexas.edu (Doug Martin) wrote in message news:<d2bf73f3.0204151417.6e64bf7d@posting.google.com>...
> I'm sure this is a well solved problem, but:
> I'm trying to fill in holes inside of domains (blobs) quickly. The
> domains are in a binary image, and are bright.
>
> Right now, I search for dark regions - the holes (label_region);
> pick out those of a small size (histogram and where);
> and then fill them in (a FOR loop through the where values, since I
> don't know how to get where to compare to every value in a vector).
>
> This is slow, and I strongly suspect there is an intelligent way to do
> this: fill in all dark blobs up to a certain size.
>
> Thanks for any help,
>
> Doug Martin
> University of Texas at Austin
Re: filling holes in blobs quickly [message #30228 is a reply to message #30225] Mon, 15 April 2002 17:42 Go to previous messageGo to next message
Ted Cary is currently offline  Ted Cary
Messages: 53
Registered: October 2001
Member
Doug Martin wrote:

>
> I strongly suspect there is an intelligent way to do
> this: fill in all dark blobs up to a certain size.
>

Hi Doug,

MORPH_CLOSE will fill in all the dark holes that are smaller than the
size of its structuring element. It will also fill small inlets in your
domain boundaries, so use it if you don't mind closing boundary
concavities along with your holes.

Hope this helps,

TC
Re: filling holes in blobs quickly [message #30291 is a reply to message #30224] Wed, 17 April 2002 14:05 Go to previous message
dmartin is currently offline  dmartin
Messages: 5
Registered: April 2002
Junior Member
the_cacc@hotmail.com (trouble) wrote in message news:<5f9f0a23.0204160150.33d49a69@posting.google.com>...
> DILATE
>
> Not much experience with it, but it seems like a good candidate.

Thanks for all of your suggestions (incl Morph_Close and search2d).
Search2d seems to work well, but is somewhat slow (?), especially when
compared to label_region.
I'm using 5.2.1, so Morph_close isn't on there, but I have been using
a combination of dilate and erode functions to do something similar (I
think).
One problem is that this does fill in small channels.

Does anyone know how to intelligently design structuring elements to
remove round-ish objects only?

Thanks again,

Doug
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: IDL procedure / function to orthorectify with DEM satellite images
Next Topic: Re: generalized eigenvectors

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

Current Time: Wed Oct 08 13:05:03 PDT 2025

Total time taken to generate the page: 0.00863 seconds