Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to recover little movement of an electric board during optical inspection

Good day to all.

I'm developing a software for an optical inspection task of the PTH mounted components. My software can already recover little deviations of the position of the PCB, thanks to the presence of a pair of fiducials, and so reposition the ROIs. Due to new requests from the customer i need to inspect the PCB at variables levels of zoom.

Therefore the software must work in two steps:

1 - Zoom the camera at a level that guarantee the vision of the two fiducials at the same time and computing of the deviation in the position (shift and rotation).

2 - Zoom the camera to a more pronounced level to arrive at the "inspection level" of zoom and repositioning the ROIs due to the informations gained at point one.

My question is: how can i accomplish the passage from point 1 to 2? Can i use the deviation at "zoom level 1" to correct positioning the ROIs at "zoom level 2"?

 

Thank you, Francesco.

0 Kudos
Message 1 of 10
(5,168 Views)

Hello,

 

when you use optical zoom, the focal lenght changes as does the optical magnification. So you cannot use the deviation form 1. to 2. directly.

 

I am just throwing out ideas here, maybe someone has a better solution...

 

I would say that the easiest way is to measure an object of known size in scenario 1 and calculate the deviation. Then go to scenario 2 and measure the same object. Assuming that the magnification is linear, calculate deviation using the object size ratio.

 

You could probably also solve the problem by calibrating the camera at both focal lenghts...

 

Let's see if anybody else has something to say.

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 2 of 10
(5,161 Views)

Correct, but the magnification is a simple scaling of the reference system so i think that the problem is to know how to relate the scale to the zoom of the camera. My problem is that i control the camera via software setting the zoom from 0 to 100, but the zooming factor is non linear but exponential.

0 Kudos
Message 3 of 10
(5,156 Views)

You could measure the object ratio (object magnification) between zoomed object for x% of zoom and the reference object for 0% of zoom. You could do this by incrementing the zoom factor by (for example) 1% and measuring the object ratio. Create a lookup table, which you can later read for any zoom value of factor 1%.

 

The object size would be determined best using sub-pixel edge detection algorithms

 

Would this work?

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 4 of 10
(5,153 Views)

I was thinking of using graph paper. It's a bit tricky method, hope it will work...


Klemen ha scritto:

You could measure the object ratio (object magnification) between zoomed object for x% of zoom and the reference object for 0% of zoom. You could do this by incrementing the zoom factor by (for example) 1% and measuring the object ratio. Create a lookup table, which you can later read for any zoom value of factor 1%.

 

The object size would be determined best using sub-pixel edge detection algorithms

 

Would this work?

 

Best regards,

K




0 Kudos
Message 5 of 10
(5,150 Views)

Don't mind this...

 

Sorry.

 

Thinking...  🙂

 


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 6 of 10
(5,146 Views)

For accurate positioning you need to know the rotation and offsets of the board.  In the first zoom image with both fiducials, you can get both of these pieces of information.  Once you zoom in to the second image, you can still use the same rotation information, but you don't know your offsets.  The only way to figure out the offsets is to locate something that you know the position of, such as a fiducial.  A single reference point is enough.  If you are using an XY table for the part, I would center on one of the fiducials, zoom in, verify offset, then move to the part you need to inspect.

 

The other difficulty is scaling.  If the camera zoom is highly repeatable, you can calibrate the camera at the different zoom settings you will be using.  You could print a dot grid and use NI calibration, which would be the easiest method.  If you don't calibrate at each zoom setting, you won't know what size anything is or what position it is in.

 

Bruce

Bruce Ammons
Ammons Engineering
Message 7 of 10
(5,133 Views)

Yes, forgot to mention the calibration. Surely, for accurate measurements, you need to consider lens and perspective distortion...

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 8 of 10
(5,130 Views)

But in case of different zoom i obtain different distorsion. Due to this i must calibrate the camera for all possible level of zoom? This could be a big trouble...

0 Kudos
Message 9 of 10
(5,104 Views)

Hello,

 

that's why you should probably make some constraints about the zoom factor.

Determine a couple of zoom values and calibrate. You would need to do on-site calibration.

Considering (like Mr. Ammons said) that the zoom is repeatable, you could probably achieve reasonable accuracy.

 

Browsing quickly on the web, there are some techniques for real-time distortion of zoomable lens, but would probably take some time to implement.

 

Best regards,

K

 


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 10 of 10
(5,096 Views)