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

Home » Public Forums » archive » perimeter of a blob
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: perimeter of a blob [message #18768 is a reply to message #18634] Thu, 27 January 2000 00:00 Go to previous message
Richard Adams is currently offline  Richard Adams
Messages: 9
Registered: January 2000
Junior Member
Dear Ben, if you just need the indices and not the indices in order around
the perimeter then you could use an imaging method like this:

a = your image; assume it is one blob and has value 255 as object
otherwise 0
bb = convol(a, replicate(1,3,3), 9, /center); change the kernel if you
want some other connectivity
edges = where(bb gt 0 and bb lt 255); these are edges of your blob both
inside and out

bb[*] = 0
bb[edges] = 255 ; make this new image just edges
bb = A AND BB ; now keep just those edges inside your object
perimeter = where(bb eq 255); these are indices to final outline


I think this works - does at least on dumb test images. If you want them in
order then I guess you could trace around with a maze-search algorithm. Big
disadvantage is that you need to isolate a blob at a time, I think.
Interested to hear if it works around all your corners.

Richard.


--
Richard J Adams }<}}}}�> e: r.j.adams@bath.ac.uk
MRC Senior Research Fellow t: +44 1225 826436
Department of Biology and Biochemistry f: +44 1225 826779
University of Bath, Bath, BA2 7AY, UK
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: TVRD() and WRITE_GIF
Next Topic: Map image with a sparse array

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

Current Time: Sat Oct 11 22:00:47 PDT 2025

Total time taken to generate the page: 1.11699 seconds