Re: perimeter of a blob [message #18628] |
Wed, 26 January 2000 00:00 |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Kenneth P. Bowman (bowman@null.tamu.edu) writes:
> I think that TRIANGULATE returns the convex hull of a set of points. If
> the boundary of the region is concave, the perimeter is different from the
> perimeter of the convex hull.
Ah, yes. Now I remember why I haven't yet written that
article. :-)
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: perimeter of a blob [message #18630 is a reply to message #18628] |
Wed, 26 January 2000 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Ben Tupper (tupper@seadas.bigelow.org) writes:
> I am looking for an efficient means of finding the perimeter of
> contiguous blobs of pixels within an image. These blobs are the
> regions returned by the LABEL_REGION function. I have been using the
> trusty brute-force-and-ignorance appraoch where I scan rows and columns
> within each blob, recording the min and max coordinates of each
> row/column. It is a cumbersome task and leaves gaps in certain areas
> (especially concavities in the blob.)
I don't know why I haven't written an article about this,
since this is about the 10th time I've needed to look this
up, but maybe I will. :-)
Anyway, the easiest way to get a perimeter, I think is to
use the Triangulate function. An optional fourth positional
parameter returns the perimeter points. You will probably
have to figure out how to get the 2D indices from the
1D array of indices returned by Label_Region, but *that*
is on my web page for sure:
http://www.dfanning.com/tips/where_to_2d.html
IDL> Triangulate, xpts, ypts, tri, boundaryPts
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
|
|
|