comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Image analysis and ring identification
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Image analysis and ring identification [message #30311] Wed, 17 April 2002 06:55 Go to next message
Rachel Pepper is currently offline  Rachel Pepper
Messages: 3
Registered: April 2002
Junior Member
I am a fairly new IDL user trying to use image analysis to determine
particle positions in my images. After filtering the images, they
appear to be bright rings around a dark center. I was wondering if
anyone knew a routine to fit these sorts of images to a circle so that
the center of the ring could be determined. Thanks for any help!

Rachel
Re: Image analysis and ring identification [message #30343 is a reply to message #30311] Fri, 19 April 2002 00:14 Go to previous messageGo to next message
Karsten Rodenacker is currently offline  Karsten Rodenacker
Messages: 98
Registered: July 1997
Member
Without proposing completly ready written routines. Maybe you do:
1. Contour with path_xy on you (binary) image. You get pathes for the
outer and inner border (thers is a flag in path_info)
2. Take the outer border path say xy from one 'ring' and calculate a
normalized contour path, by:

nxy=fft_norcur(xy,centr=av,size=sz,perim=p)

as far as I remind me in av you will find the centroid coordinates, in
sz the radius and in p the perimeter.

FUNCTION sh_dist, xy
L = sqrt(sh_diff(reform(xy[0, *]))^2+ $
sh_diff(reform(xy[1, *]))^2)
return,L
end
FUNCTION fft_norcur, xy, CENTROID=cav, FACTOR=av, SIZE=sz, PERIMETER=p
dim=(size(xy))[1]
n=(size(xy))[2]
d=sh_dist(xy)
vd=fltarr(dim,n)
FOR i=0,dim-1 DO vd[i,*]=d
cav=total(xy*vd,2)/total(vd,2)
oxy=xy
oxy[0,*]=reform(xy[0,*])-cav[0]
oxy[1,*]=reform(xy[1,*])-cav[1]
p=total(d)
tt=oxy[0,*]^2+oxy[1,*]^2
sz=sqrt(total(tt))
av=total(sqrt(tt)*d)/p
return,oxy/av
END

Regards

Rachel Pepper wrote:

> I am a fairly new IDL user trying to use image analysis to determine
> particle positions in my images. After filtering the images, they
> appear to be bright rings around a dark center. I was wondering if
> anyone knew a routine to fit these sorts of images to a circle so that
> the center of the ring could be determined. Thanks for any help!
>
> Rachel
>
>


--
Karsten Rodenacker ()
------------------------------------------------------------ -------------:-)
GSF - Forschungszentrum Institute of Biomathematics and Biometry
D-85758 Oberschleissheim Postfach 11 29
Tel: +49 89 31873401 | FAX: ...3369 | rodena@gsf.de |
Karsten@Rodenacker.de
http://www.gsf.de/ibb/homepages/rodenacker
Re: Image analysis and ring identification [message #30352 is a reply to message #30311] Thu, 18 April 2002 11:47 Go to previous messageGo to next message
Rachel Pepper is currently offline  Rachel Pepper
Messages: 3
Registered: April 2002
Junior Member
Sorry to be so confusing! I want the center of the circle (ie the bright ring)
and the bright spots are messing up the centroid-based method (James is right).

Rachel

David Fanning wrote:

> James Kuyper (kuyper@gscmail.gsfc.nasa.gov) writes:
>
>> Yes, but I didn't get the impression that he wants to find the bright
>> spot. He asked how to determine the center of the circle, and complained
>> about the fact that the bright spot would mess up the centroid-based
>> method of calculating the center, because the bright spot was off-center.
>
> Isn't language odd? I thought she asked how to find the
> center of the ring, but then realized she wasn't interested
> in the center, but in the bright spot, which wasn't necessarily
> in the center. I think she might be able to have her cake
> and eat it too, depending upon the values she uses to
> calculate the centroid. In fact, she might even learn
> something fascinating about her rings by measuringg how
> the centroid changes between the two different calculations.
>
> But, hang on a minute! We don't have to be Aristotle and
> his friends arguing endlessly about how many teeth a
> horse has, we can ask the source. Rachel, what in the
> world are you asking about?
>
> 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
Re: Image analysis and ring identification [message #30462 is a reply to message #30352] Mon, 22 April 2002 11:56 Go to previous message
Jonathan Joseph is currently offline  Jonathan Joseph
Messages: 69
Registered: September 1998
Member
How large are these rings that you are talking about?

I have some IDL code that will fit an ellipse to a group of points.
It requires at least 6 input points. The center is readily available.

I hesitate to just post it because it's not my own code.
I found the code on the web written in java and took the bits that
were relevant to me and converted them to IDL. It's publicly
available code - but very few comments, no warranty, etc. I
believe the original author's name is Maurizio Pilu (see
http://vision.dai.ed.ac.uk/maurizp/ElliFitDemo/ for a demo)

If it looks useful, I can post my IDL code.

-Jonathan

Rachel Pepper wrote:
>
> Sorry to be so confusing! I want the center of the circle (ie the bright ring)
> and the bright spots are messing up the centroid-based method (James is right).
>
> Rachel
>
> David Fanning wrote:
>
>> James Kuyper (kuyper@gscmail.gsfc.nasa.gov) writes:
>>
>>> Yes, but I didn't get the impression that he wants to find the bright
>>> spot. He asked how to determine the center of the circle, and complained
>>> about the fact that the bright spot would mess up the centroid-based
>>> method of calculating the center, because the bright spot was off-center.
>>
>> Isn't language odd? I thought she asked how to find the
>> center of the ring, but then realized she wasn't interested
>> in the center, but in the bright spot, which wasn't necessarily
>> in the center. I think she might be able to have her cake
>> and eat it too, depending upon the values she uses to
>> calculate the centroid. In fact, she might even learn
>> something fascinating about her rings by measuringg how
>> the centroid changes between the two different calculations.
>>
>> But, hang on a minute! We don't have to be Aristotle and
>> his friends arguing endlessly about how many teeth a
>> horse has, we can ask the source. Rachel, what in the
>> world are you asking about?
>>
>> 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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: How to keep x-axis and y-axis ratio consistant?
Next Topic: Re: Testing the type of the structure?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:05:23 PDT 2025

Total time taken to generate the page: 0.00596 seconds