Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding center in a picture with rings

Status
Not open for further replies.

Hermanator

Technical User
Jan 16, 2002
30
NL
Hello,

I'm using a program called DigitalMicrograph that is used to analyse pictures from microscopes. The program supports scripts that are based on C.
One particular type of pictures I'm using is diffraction patterns, which contain several rings around a bright center spot. (An example image can be found here: )

For calculations, I'm trying to make a script which automatically finds the center of the rings. So far, I didn't succeed.
Does anyone know of an algorithm that I can use for this problem ?

Thank you in advance.
 
You are talking about pattern recognition here, which I really don't think it can be handled properly with just a simple C script.

However, if the circles are concentric and they are perfect circles, you can give it a try.
The simplest method would be to scan the image line by line and see when the pixel color changes (as I could see, the circles are emphasized over a black background, right?). You can follow an algorithm to see each pixel to which circle belongs.

The best method would be, again if the circles are concentric or contained within each other: if you find a point that could belong to a circle, try to follow the circle drawing algorithm (do a google search for that) and follow the outer path.

Also a good thing is to define a method that scans the lines of the image and calculates some differences between adjacent pixels, to catch the circles like the inner-most ones from your image - which are separated not by black, but by some gray level.

I don't know if this helps you in any way, but I hope it does. [red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top