Re: Inverse of POLYFILLV [message #7400] |
Wed, 13 November 1996 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Larry Busse writes <ljb@shell.one.net> writes:
> I'm a newbie to IDL and am trying to implement some Region Of Interest (ROI)
> tools for image processing.
>
> I'm using DEFROI to generate the list of pixels in the ROI. I'm then
> modifying the list to include pixels which are close to the average pixel
> intensity. Given this modified list of pixels, I'd like to generate the
> coordinates of the polygon which bounds this region. I'm asking to do
> something which is the inverse of POLYFILLV.
>
> Some sort of "hulling" algorithm
> comes to mind.
You can use the IDL TRIANGULATE procedure to return the indices on the
points of the convex hull that surrounds a set of points. For example,
like this:
x = RANDOMU(seed, 100) * 5 + 2.5
y = RANDOMU(seed, 100) * 5 + 2.5
TRIANGULATE, x, y, triangles, hullPoints
PLOT, x, y, PSYM=1, XRANGE=[0,10], YRANGE=[0,10]
hullPoints = [hullPoints, hullPoints(0)]
PLOTS, x(hullPoints), y(hullPoints)
I learned this from David Stern himself! :-)
David
*************************************************
* David Fanning, Ph.D.
* 2642 Bradbury Court, Fort Collins, CO 80521
* Phone: 970-221-0438 Fax: 970-221-4762
* E-Mail: davidf@dfanning.com
*
* Sometimes I go about pitying myself, and all along my
* soul is being blown by great winds across the sky.
* -- Ojibway saying
************************************************
|
|
|