LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

determine center and radius of circles

Solved!
Go to solution

I want to determine the center and radius of circles in the attached picture.

I have tried using "IMAQ Fit Circle 2", but I could not figure out how to use the vi.

Is there anybody can give me an example how to use "IMAQ Fit Circle 2" for the attached image?

Or tell me any alternative method to determine the center and radius.

0 Kudos
Message 1 of 6
(5,404 Views)

Use NI Example Finder.  You should be able to find examples on your computer if you installed IMAQ.

 

 

George Zou
0 Kudos
Message 2 of 6
(5,359 Views)

@zou wrote:

Use NI Example Finder.  You should be able to find examples on your computer if you installed IMAQ.


 

I looked, not sure I found anything immediately suitable for solving the Original Poster's question.  The Examples are also not that easy to find -- look under Toolkits and Modules, where you'll find the Vision folder.

 

Bob Schor

 

0 Kudos
Message 3 of 6
(5,337 Views)

Thank you for advice.

I searched the example library, but I could not find any examples.

Fourtunately, I found that I can use IMAQ Select Point.vi and for loop to select several points on my image.

Then I sent these points to IMAQ Fit Circle 2.vi to complete my task.

 

I still wonder if Labview can automatically fit the circles. Maybe it's too difficult.

0 Kudos
Message 4 of 6
(5,303 Views)

Congratulations on coming up with an interactive method of finding a circle.

 

I looked again at your example, and have some questions/suggestions.  The Question is are all your images similar to this, that is, a series of concentric light/dark circular bands, centered near the middle of the image, with a rectangular obstructing grid running horizontally and vertically?  If so, I have some ideas for an algorithm that might (you'd have to test it!) work.

 

First, you want to find the center of the circles.  If you did a histogram along the X axis, and another histogram along the Y axis, I'd expect it to show a pattern that you could use estimate the center.  I'd also consider doing a histogram along a line running from the lower left to upper right corner, and from upper left to lower right corner -- that should minimize the effect of the grid.

 

If the above procedure lets you make a reasonable guess for the center, you might be able to refine your guess by the following procedure -- instead of using the entire picture to form the histogram, just plot the intensity along lines going through what you suspect is the center.  Plot from the putative Origin along a fixed-length radius using angles of 0, 45, 90, 135, 180, 215, 270, and 315° -- if you really have started from the origin, these 8 traces should be very similar (have a low standard deviation).  You could now move the Origin slightly and see if this measure increases or decreases -- you are looking for a minimum.

 

Once you have the center, you can use similar "radial intensity plots" to find where the intensity changes on the majority of your 8 radial directions -- this is likely to be a radius of your circle.

 

I have no idea if this algorithm will actually work, but it seems like something to try.  I'd be interested in hearing how it works out for you.

 

Bob Schor

 

0 Kudos
Message 5 of 6
(5,289 Views)
Solution
Accepted by topic author Xiang00

You didn't found this example?

Untitled.png

 

 

George Zou
0 Kudos
Message 6 of 6
(5,241 Views)