Re: Line index [message #5957] |
Fri, 22 March 1996 00:00 |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
pit@asterix.kis.uni-freiburg.de (Peter Suetterlin) wrote:
>
> In article <31499FB9.2F6D@dlr.de>,
> Hermann Mannstein <H.Mannstein@dlr.de> writes:
>
>> is there a robust function which returns the indices within an image
>> (like the where function) belonging to a line defined by two or more
>> points.
>
> for shure there is, even built-in IDL:
> Index=polyfillv(xx,yy,xsize,ysize)
> Read the manpage for further reference.
>
According to the "manpage", POLLYFILLV() expects at least 3
points so it would never work for a simple line. Also, it
connects each successive line and the first with the last,
to make a polygon, and then returns the indices of the
points within this polygon.
You wouldn't be getting the indices of the points on the line(s),
but of the points within the polygon defined by the points.
Dave Foster
foster@bial1.ucsd.edu
|
|
|
Re: Line index [message #5959 is a reply to message #5957] |
Fri, 22 March 1996 00:00  |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
Hermann Mannstein <H.Mannstein@dlr.de> wrote:
>
> Hello,
> is there a robust function which returns the indices within an image
> (like the where function)
> belonging to a line defined by two or more points.
I don't have a function, but I can suggest a possible solution.
Given your two points, if you use the familiar Y = mX + B formula
to calculate the (X,Y) coordinate pairs for either each X or for
each Y along the "span" of the line (use the one that gives you
more points), and then convert these pairs to one-dimensional
indices using the formula
Indices = ( Y_coors * Xdim ) + X_coors
where the "image" is Xdim x Ydim. Obviously you'll have to do
some checking to make sure the points are within the image.
Hope this is useful.
Dave Foster
foster@bial1.ucsd.edu
|
|
|
Re: Line index [message #5989 is a reply to message #5957] |
Fri, 15 March 1996 00:00  |
pit
Messages: 92 Registered: January 1996
|
Member |
|
|
In article <31499FB9.2F6D@dlr.de>,
Hermann Mannstein <H.Mannstein@dlr.de> writes:
> Hello,
> is there a robust function which returns the indices within an image
> (like the where function) belonging to a line defined by two or more
> points.
for shure there is, even built-in IDL:
Index=polyfillv(xx,yy,xsize,ysize)
will give you the indices of the indices of the points surrounded by
the polygon given in the two vectors xx and yy for the x and y
coordinates, resp.
Read the manpage for further reference.
Peter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
Peter "Pit" Suetterlin http://www.kis.uni-freiburg.de/~ps
Kiepenheuer Institut fuer Sonnenphysik
Tel.: +49 761 3198-210 ps@kis.uni-freiburg.de
-- * -- * ...-- * -- * ...-- * -- * ...-- * -- * ...-- * -- * ...-- * --
Come and see the stars! http://www.kis.uni-freiburg.de/~ps/SFB
Sternfreunde Breisgau e.V.
Tel.: +49 761 73571 or 278588
____________________________________________________________ ______________
|
|
|