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

Home » Public Forums » archive » about label regions
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: about label regions [message #30603 is a reply to message #30523] Mon, 06 May 2002 17:00 Go to previous messageGo to previous message
Ted Cary is currently offline  Ted Cary
Messages: 53
Registered: October 2001
Member
Xiaoying Jin wrote:

> In my case, I think this method helps. But there are thousands of regions in
> the image and the image is
> big (such as 2000*2000). If I use this method, will it be very slow since it
> will do LABEL_REGION
> on the image thousands of times. Is there any other method I can label the
> whole image at one operation?
>

If the gray levels of the regions are fairly uniform, do some type of edge
detection. Mask anything that is not an edge, then you will have a mask of
only region interiors. This mask is a bi-level image that you can analyze with
one call to LABEL_REGION.

For edge detection of regions of uniform gray level, you might try a grayscale
analog of a gradient morph to find the margins. Try something like this for
your image:

rad = 1 ; Radius of structuring element. Change for fatter margins.
disk = Shift(Distance(2*rad+1), rad, rad) LE rad ; Create a disk structuring
element.
imageDilated = Dilate(image, disk, /GRAY) ; Dilate the image with the disk.

wh = Where(image NE imageDilated) ; Find subscripts of margins.

marginMask = image ; Just create another image of same size as original.
marginMask[*] = 255 ; Pretend everything is in the interior.
marginMask[wh] = 0 ; Set margins to 0.

If you TVSCL the marginMask, you should see all regions of white with black
borders. This is a bi-level image that can be used with LABEL_REGION.

The disadvantage of this technique is that "brighter" region margins will
intrude by one pixel into dimmer regions because of the dilation, but at least
it illustrates the method. Keep in mind that this assumes your regions are
each monotone, as stated in the original post.

Good luck,

TC
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Mac OS X
Next Topic: suppressing carriage return in PRINT

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

Current Time: Fri Oct 10 13:42:43 PDT 2025

Total time taken to generate the page: 0.64222 seconds