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

Home » Public Forums » archive » Re: Repost of Vertex question...
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: Repost of Vertex question... [message #25624 is a reply to message #25531] Fri, 29 June 2001 03:55 Go to previous messageGo to previous message
Richard French is currently offline  Richard French
Messages: 173
Registered: December 2000
Senior Member
> I would love to be able to use IDL to find the vertices in this
> image.
> Essentially this will give me all the corners in the image. Is
> there a
> function in IDL that does such a thing (find intersections or
> verticies)?


Here's an idea that might get you started.

1) Find a way to sort the pixels that contain the 'line' information so
that
they are contiguous - i.e., so that they are ordered in such a way that
if
you used 'plots,/dev,xvals,yvals' on this set of xvals and yvals, they
would
follow the edges of a given polygon as if you were drawing it with a pen
on
the screen - there are several ways of doing this, but the details
depend on
the nature of your images, so I leave this part to you. If you can't do
this
on your image immediately, then you can set up a test image that has
this
information in it - that is, simplify your image so that it contains a
single
polygon with known pixel coordinates in order.

2) Given this list of pixels, compute the slope of the line containing
each
contiguous pair of pixels - something like
theta_vals = atan(yvals-shift(yvals,1), xvals-shift(xvals,1))
(syntax is close but may not be perfect here)

3) Now you can search for vertices by defining them as successive values
in
the array theta_vals whose difference (in absolute value) exceeds some
threshold
level. You may have some wrap-around modulo two-pi problems when theta
goes between
0 and 2*!pi, but this is the general idea.

If you have a very low resolution image, this approach might not work
very well,
due to the granularity of the pixel locations, but it is a start. If you
are only
after vertices with very sharp angles, though, this might be close to
what you want.

Hope this sparks some ideas from others,

Dick French
Astronomy Dept, Wellesley College
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Easy way to do superscripts, greek letters, etc.?
Next Topic: Re: Easy way to do superscripts, greek letters, etc.?

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

Current Time: Sat Oct 11 10:13:38 PDT 2025

Total time taken to generate the page: 1.03682 seconds