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

Home » Public Forums » archive » plots?
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: plots [message #52918 is a reply to message #52821] Tue, 06 March 2007 07:59 Go to previous messageGo to previous message
ashraf is currently offline  ashraf
Messages: 4
Registered: March 2007
Junior Member
again I must strees that these are noncontiguous but discreet
coordinates which form a closed polygon, for example let
x = [0,1,1,0,0,2,2,2]
y = [0,1,2,2,1,0,1,2]
These points can be uniquely re-arranged as
x = [0,1,2,2,2,1,0,0]
y = [0,1,0,1,2,2,2,1]
to form a closed non-intersecting outline. My question is how can I re-
arrange these points effeciently?
Thanks.

David Fanning wrote:

> David Fanning writes:
>
>>
>>> These are integer pixel coordinates which form a closed boundary of an
>>> object, so each pixel will have at least two neighbours. I guess my
>>> question is how do you trace the boundary of an object if the all you
>>> have is an 2D array of noncontiguous pixel coordinates.
>>
>> I think the answer was, you don't. At least not in
>> any unique way. If you DO want a unique path, you
>> are going to have to come up with something other than
>> this. :-)
>
> One possibility might be to find the convex hull of these
> points. This is not the polygon formed by the points, but rather
> the polygon that encloses all the points. Maybe that's good
> enough for what you have in mind.
>
> If so, here is an article:
>
> http://www.dfanning.com/tips/convex_hull.html
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: make and read a subset of a tiff image
Next Topic: plots

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

Current Time: Fri Oct 10 05:43:40 PDT 2025

Total time taken to generate the page: 0.08693 seconds