[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: perimeter of a blob
- Subject: Re: perimeter of a blob
- From: Richard Adams <r.j.adams(at)bath.ac.uk>
- Date: Thu, 27 Jan 2000 15:59:20 GMT
- Newsgroups: comp.lang.idl-pvwave
- Organization: School of Biological Sciences, University of Bath, UK
- References: <388F629B.B9146BB5@seadas.bigelow.org>
- Sender: bssrja(at)bath.ac.uk (Verified by Kerberos)
- User-Agent: Microsoft Outlook Express Macintosh Edition - 5.0 (1513)
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:18151
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