Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Auto-Focus & Depth Measurement to Measuring Microscope

Solved!
Go to solution

Hello,

This is my first post and I consider myself a newbie with LabView, but I hope I can get some answers.  Here it goes.

 

I have a measuring microscope with X & Y stages driven by drive motors.  The CCD camera and objective lens assembly are mounted on a stage with the focus (Z-stage) and magnification stage driven by step motors.

 

My objectives are the following:

-Add autofocusing capability to my existing VI, such that the image will focus on a user selected region of interest (ROI).

-Calculate the depth between two part features that appear in separate ROIs.  

 

Any assistance would be greatly appreciated!!!!

Closeup_Microscope.jpg

 

0 Kudos
Message 1 of 3
(8,721 Views)
Solution
Accepted by topic author srecco

My first bit of advice:  Only post your question once.  Repeated posts are annoying...

 

The first step is to select a method for measuring the focus.  Over the years several methods have been posted to this forum (search the forum!!!).  My favorite is to find edges, then use quantify to get the standard deviation.  It is a fast and accurate focus indicator, and it will work fairly well on ROIs as long as they aren't too small.

 

The second step is to develop an algorithm to figure out where your best focus position is.  The simplest method is to take pictures at a series of Z positions, then measure the focus in each one.  Typically the measurements will behave like a parabola, where the best focus is at the peak of the parabola.  If you don't have a peak, you haven't reached the focus position yet.  Once you know about where the focus position is, you can move in smaller steps until you get a precise value.  Depending on your application, there may be other algorithms that could get there faster.

 

Once you have focused on the first object, record your Z position.  Focus on the second object and record the difference in the Z positions.  That is your depth difference between the two objects.

 

Bruce

Bruce Ammons
Ammons Engineering
Message 2 of 3
(8,715 Views)

A tricky zoom calibration I have seen on a professional optical 3D MC (probably patented, however for educational use.... )

place a beamsplitter after the zoom optic with some known cycles (DIA) light by an LED 

 

If your targets don't have a lot of contrast: Use your beamsplitter for light injection  to inject a light pattern with a very low focus length

 

 

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 3 of 3
(8,700 Views)