Re: Perimeter or Vertices from the return of search_2D?? [message #6238] |
Wed, 15 May 1996 00:00 |
David.Steele
Messages: 8 Registered: April 1996
|
Junior Member |
|
|
In article <Pine.sola.3.91.960514123444.7234C-100000@sparky.ic.sunysb.edu>,
sbarrkum@ic.sunysb.edu says...
>
>
> Has anyone developed some code that would find the perimeter or vertices
> of pixels returned by the search_2d routine. I have done a search on
> Peter Rileys web page using keywords such as "vertices" and "perimeter".
> Only get a procedure that apparently want a inputs of vertices and will
> then compute the perimeter etc. I have not been able to find a routine
> that can find either the vertices or perimeter given a a set of contigous
> pixels (as returned by search_2d).
>
> Any suggestions, algorithms known would be welcome
>
> Barr-Kum
> ____________________________________________________________ ________
> | Sereno A. Barr-Kumarakulasinghe | sbarrkum@ic.sunysb.edu |
> | Marine Sciences Research Center | |
> | State University of New York | |
> | Stony Brook, NY 11794-5000 | |
> |___________________________________________________________ ________ |
A suggestion:
If the dimensions of the 2d region to be searched are WxL, try the following.
IDL> s2d_out=SEARCH2D(.......)
IDL> bin=BYTARR(W,L)
IDL> bin(s2d_out)=1
IDL> sbin=(SOBEL(bin) GT 1)
IDL> wedge=WHERE((sbin GT 0) AND (bin GT 0))
Then WEDGE should contain the 1-d subscripts of the pixels on the perimeter of
the region identified by SEARCH2D.
I've tried the above on a simple region with a piecewise linear perimeter, and
it did OK. I hope it helps.
Dave
------------------------------------------------------------ ------------
David P. Steele
Institute of Space and Atmospheric Studies Ph: (306) 966-6447
University of Saskatchewan
Saskatoon, Saskatchewan, CANADA
|
|
|