Re: perimeter measurement in idl [message #14045 is a reply to message #14040] |
Mon, 18 January 1999 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
L. Charles Burgwardt (burgward@kodak.com) writes:
> I'm looking for a perimeter measurement routine written in IDL. I have a
> binary image. The output could be in any units such as pixel perimeter,
> crack perimeter, or line segment. A boundary following routine would be
> good also, ie ordered list of boundary pixels.
The Triangulate command in IDL can give you an ordered list
of boundary pixels, arranged in counterclockwise order.
(This is also known as the "convex hull".)
Triangulate, x, y, triangles, boundaryPoints
You may have to convert the pixel locations of your
selected region into 2D coordinates to make this work.
You can use this article on my web page to see
how to turn 1D indices (i.e., like those returned
by the WHERE function) into 2D locations:
http://www.dfanning.com/tips/where_to_2d.html
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Progamming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Note: This follow-up was e-mailed to the cited author.]
|
|
|