Re: Repost of Vertex question... [message #25529] |
Thu, 28 June 2001 19:46  |
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 #25617 is a reply to message #25531] |
Fri, 29 June 2001 07:24   |
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 #25624 is a reply to message #25531] |
Fri, 29 June 2001 03:55   |
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  |
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
|
|
|