Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Circle fit functions return smaller then expected radius if noise is present

OK, I am going to try and be brief, but also cover the salient points.

I am trying to find the center of a 200 mm silicon wafer. This wafer sits on a stage that can move in the XY and Z directions. Z is fixed to the focus height for the camera that sits above the stage. The camera field of view is much less the the wafer. (About 11 or 12 mm on each side.)

So what I do is move the stage so that various edges of the wafer are visible under the camera. I adjust the camera to produce a high contrast image. I use a rake to look for the wafer's edge. The rake is rotated to be 'tangential' to the wafer edge.

The resulting pixel coordinates are converted to wafer coordinates. (So given the stage position and the pixel location, what stage position would put that pixel smack in the middle of the camera field of view?)

The final resulting numbers are then fed into Fit to Sphere. Which then prombtly returns a radius that I know is smaller then the wafer I am measureing. (Silicon wafer have to meet a SEMI spec which gives the diameter as 200 +/- 0.2 mm.)

I have checked from all sides, so it is not that my wafer is not truly round. I have tried several wafers, so it is not that I have a weird wafer.

So I did an experiment to see how much uncertainty in the measurements screws over the sphere fit. Basically it calculates an ideal set of pixel coordinates for a wafer edge. It then applies noise to these coordinates. Noise in the stage position is hardly noticed. Noise in the original pixel coordinates makes Fit to Sphere return smaller radii then expected. The more noise, the smaller the radius.

Hit me over the head with a stick, but it seems like noise evenly distributed around the actual coordinates should not cause the radius returned to shrink.

I have attached the experimental code so you can see what I am talking about. I think all the labels are pretty clear. The upper image is the ideal coordinates. The lower is the noise injected wafer coordinates. (The image y-axis is reverse the wafer y-axis.)



0 Kudos
Message 1 of 8
(4,857 Views)

2verb:

Your code did not attach.

And I'm not going to hit you over the head with a stick for that wink smiley

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 2 of 8
(4,850 Views)
OK so this time I think I have the proggy attached.
0 Kudos
Message 3 of 8
(4,848 Views)

Unfortunetely I can not read your VI since I have LV7.1 only.

Nevertheless, I can see why adding linear noise to X & Y components of data points (Xj, Yj) changes statistics for the Radius R.

Let Xj = R*cosFj + Aj and Yj = R*sinFj + Bj , where A and B are zero-mean noise <A>=<B>=0. Note that (R*cosFj , R*sinFj) , j=1,..,N are points located exactly on the circle of radius R.

New radii of perturbed data points are:

Rj ^2 = Xj^2 + Yj^2 = R^2*( cosFj ^2  + sinFj ^2) + 2*Aj *R*cosFj + Aj^2 + 2*Bj *R*cosFj + Bj^2

And the mean (for zero-mean noise):

<R^2> = R^2 + <A^2> + <B^2> which is larger than nominal value of R^2.

To properly simulate noise to data points without changing statistics for R, one has to do that in polar coordinates similar to the following:

Xj = (R + Cj) * cos(Fj + Dj), Yj = (R+Cj) * sin(Fj + Dj), where <C>=<D>=0 and Dj shall be uniformly distributed in 0, 2*pi range.

 

All the above apply to computer simulations only. In real life noise that one gets in experimental data is specific to the measurement setup. I can not tell what is the noise in your particular setup and how it affects accuracy of circle fitting function. 

0 Kudos
Message 4 of 8
(4,813 Views)
I guess the part I found confusing is that as the noise went up the radius went down. This consistancy in a supposedly random system seems odd.

In my case the system set up is a hi-res camera looking down on a circular wafer. The wafer has high contrast to it's background. The image has roughly 15 degrees of arc visible.

The X-Y values are generated using NIs Vision package. Specifically the rake function. The way this works is that it draws hypothetical lines across the image. If the contrast of the pixels under the line changes dramatically, then that is an edge. The lines are usually spaced so many pixels apart.

The simulation is attempting to simulate the noise seen in this kind of setup, which is why it is restricted to the X and Y axis instead of polar as you suggest.


0 Kudos
Message 5 of 8
(4,808 Views)
I would recommend isolating simulation section of your VI and checking that adding linear zero-mean noise to X & Y produces larger R that nominal. The fact that inscrease in noise leads to smaller R tells me that something is not right either in input data or VI logic. If you can, try to generate noise in polar coordinates also and see if your simulation returns mean R close to nominal.
0 Kudos
Message 6 of 8
(4,804 Views)
2verb,
 
    Thanks for attaching the program.  The fact that the noise is affecting the radius doesn't surprise me.  The way our rake function works is it looks for the appropriate amount of contrast between two points.  The line it sees could be at either edge of the noise (depending on the changes the noise makes, background color, direction of the rake etc.), which would alter the radius.  If you send me a sample image I can check it out on my end.  Also, how big of differences are you getting in the radius?  Small differences I would think are expected.  Let me know what you think, thanks!
-Allison S.
Calibration Services
Product Support Engineer
0 Kudos
Message 7 of 8
(4,793 Views)
Hi Allison,

I can see getting a different radius. I just think it should not be consistantly smaller. It's like the inner pixels are given more weight.

The wafer is supposed to be 200 mm diameter +/- 200 micron. I consistantly measure 99.6 mm radius (199.2 mm diameter)on every wafer I try.

For my application, 200 to 600 micron is a big deal.

I think I have attached an image. Cross fingers.


0 Kudos
Message 8 of 8
(4,790 Views)