Re: Image outline [message #30998 is a reply to message #30996] |
Wed, 29 May 2002 14:18  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Akhila (idlfreak@yahoo.com) writes:
> I have an image of a vertebra. The image is posted in the link below:
>
> www.geocities.com/r_akhila/final.tif
>
> I have been trying to get a good sigle pixel wide contour of the
> vertebra from the image. I tried different methods like edge
> detection, thresholding, erosion, dilation and thinning. I still did
> not get a good one. Can anybody please suggest some techniques that
> will be helpful to obtain a contour of the image. Please help me.
I have a little routine named FIND_BOUNDARY that I wrote based
on some code sent to me by Richard Adams and written by his
graduate student Guy Blanchard. The idea is to find a one
pixel wide boundary around a region of interest given by
a set of indices.
http://www.dfanning.com/misc/find_boundary.pro
It happens to work particularly well with your image.
I did this:
image = Read_Tiff('final.tif')
s = Size(image, /Dimensions)
indices = Where(image GT 0)
pts = Find_Boundary(indices, XSize=s[0], YSize=s[1])
Window, XSize=s[0], YSize=s[1]
PLOTS, pts, /Device
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|