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 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Repost of Vertex question... [message #25529] Thu, 28 June 2001 19:46 Go to next message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Brian Koss <bakoss@rainbow.uchicago.edu> writes:
>
> I have images of polygons connected edge to edge in a
> quasiperiodic array, like the one I
> have attached to this message...
> The images are black and white and the edges of the polygons are
> distinguisable because
> they are straight lines.
> I would love to be able to use IDL to find the vertices in this
> image.

Cute. Somehow I don't think this is a program that someone on the
newsgroup can knock out in ten minutes. Converting a raster image
into a vector image is not the easiest thing that can be done. In
fact, from what I found on the web, raster-to-vector is *very* hard.
If your images are computer-generated, can you get the original vector
data?

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: Repost of Vertex question... [message #25531 is a reply to message #25529] Thu, 28 June 2001 17:06 Go to previous messageGo to next message
david[2] is currently offline  david[2]
Messages: 100
Registered: June 2001
Senior Member
Brian Koss writes:

> I have images of polygons connected edge to edge in a
> quasiperiodic array, like this one.

Isn't science weird!? Why would anyone want to
be a business major?

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Repost of Vertex question... [message #25600 is a reply to message #25531] Mon, 02 July 2001 06:33 Go to previous messageGo to next message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Struan Gray <struan.gray@sljus.lu.se> writes:
> Of course, the hardcore quasicrystallographer will use
> MPFIT to find the higher-dimensional regular lattice of
> which the quasicrystal is the two-dimensional projection.
> I'll leave this as an exercise for the reader :-P.

Then thank goodness I'm not a hardocre quasicrystallographer! :-)

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: Repost of Vertex question... [message #25604 is a reply to message #25531] Mon, 02 July 2001 04:05 Go to previous messageGo to next message
Struan Gray is currently offline  Struan Gray
Messages: 178
Registered: December 1995
Senior Member
Craig Markwardt, craigmnet@cow.physics.wisc.edu writes:

> Cool ideas!

Quasicrystals are cool things. Back when I were a
nipper looking at options for a thesis project they were one
of the things that persuaded me that Solid state physics
could compete with Astronomy when it came to beauty,
mathmatical elegance and real-world physics wrapped up in
one image.

I was musing over the weekend on ways to automatically
detect the vertex types, but without seeing Brian's image
(some net-nanny seems to have auto-removed it before it got
to our newsservers) I don't know what sort of quasicrystal
he's dealing with. Something like a Penrose tiling, with
only a pair of polygonal units, would be pretty simple, but
more complex quasicrystals would make it a bit too involved,
and it's easier to just point at the screen.

Of course, the hardcore quasicrystallographer will use
MPFIT to find the higher-dimensional regular lattice of
which the quasicrystal is the two-dimensional projection.
I'll leave this as an exercise for the reader :-P.


Struan
Re: Repost of Vertex question... [message #25617 is a reply to message #25531] Fri, 29 June 2001 07:24 Go to previous messageGo to next message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Struan Gray <struan.gray@sljus.lu.se> writes:

> Craig Markwardt, craigmnet@cow.physics.wisc.edu writes:
>> Brian Koss <bakoss@rainbow.uchicago.edu> writes:
>>>
>>> I have images of polygons connected edge to edge in a
>>> quasiperiodic array, like the one I have attached to this
>>> message... The images are black and white and the edges of
>>> the polygons are distinguisable because they are straight
>>> lines. I would love to be able to use IDL to find the
>>> vertices in this image.
>>
>> Cute. Somehow I don't think this is a program that
>> someone on the newsgroup can knock out in ten minutes.
>
>
> Oh. I don't know.
>
> A quasicrystal will have a limited number of vertex
> orientations, which you can pick out by hand. Simply cut
> out one of each type of vertex into it's own sub-image, do a
> cross correlation between that and the whole image to find
> where that type of vertex occurs, and add up the resulting
> lists for each vertex type.
...

Cool ideas!

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: Repost of Vertex question... [message #25618 is a reply to message #25531] Fri, 29 June 2001 07:01 Go to previous messageGo to next message
Struan Gray is currently offline  Struan Gray
Messages: 178
Registered: December 1995
Senior Member
Craig Markwardt, craigmnet@cow.physics.wisc.edu writes:
> Brian Koss <bakoss@rainbow.uchicago.edu> writes:
>>
>> I have images of polygons connected edge to edge in a
>> quasiperiodic array, like the one I have attached to this
>> message... The images are black and white and the edges of
>> the polygons are distinguisable because they are straight
>> lines. I would love to be able to use IDL to find the
>> vertices in this image.
>
> Cute. Somehow I don't think this is a program that
> someone on the newsgroup can knock out in ten minutes.


Oh. I don't know.

A quasicrystal will have a limited number of vertex
orientations, which you can pick out by hand. Simply cut
out one of each type of vertex into it's own sub-image, do a
cross correlation between that and the whole image to find
where that type of vertex occurs, and add up the resulting
lists for each vertex type.

Alternately, if you know something about the scale
invariance of the quasicrystal, find the postions of the
edges or centres of the polygons in the same way, and then
use the quasicrystal's scaling properties to find the
vertices.


Struan
Re: Repost of Vertex question... [message #25624 is a reply to message #25531] Fri, 29 June 2001 03:55 Go to previous messageGo to next 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
Re: Repost of Vertex question... [message #25741 is a reply to message #25531] Thu, 12 July 2001 08:41 Go to previous message
Martin Downing is currently offline  Martin Downing
Messages: 136
Registered: September 1998
Senior Member
> (This is the same as my last post, but with a smaller image size
> and up-todate email contact
> Sorry for the confusion.)
>
> I have images of polygons connected edge to edge in a
> quasiperiodic array, like the one I
> have attached to this message...
> The images are black and white and the edges of the polygons are
> distinguisable because
> they are straight lines.

Brian

I clearly need much more coffee, as all I can see is a wavey black line over
a grey mosaic pattern. So what are the vertices you want to pick out? Had
the image looked different I was going to suggest (straight) line finding
using the Hough Transform, but now I think I will just up the ratio of
beans:water.

Martin
  Switch to threaded view of this topic Create a new topic Submit Reply
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: Wed Oct 08 14:52:39 PDT 2025

Total time taken to generate the page: 0.00510 seconds