: RE Stack focuser etc IMAGEJ Digest - 12 Apr 2007 to 13 Apr 2007 (#2007-99)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

: RE Stack focuser etc IMAGEJ Digest - 12 Apr 2007 to 13 Apr 2007 (#2007-99)

Goldsmith, Noel
Mikhail,
There are several methods to detect focus, ie edge detectors of many sorts,
differential filters, variance filters or you  could even use a high pass
FFT, or wavelets.
And for translucent objects one must understand the full 3-D nature of image
formation at and near to the focal spot. Which is complex. (And I don't).
But Bob Dougherty does, look at his plug-in. But of course this does not
include light being differentially refracted in the object by regions of
different refractive index.

We (I and my colleagues are looking at solid metallic surfaces and find that
the simplest (read computationally quick)  and most  robust (well almost)
criterion is based on energy. Simply put the energy in an image is at a
maximum when the differences between adjacent pixels is maximized. (This is
also true in a noisy image). It is impossible to stress too much that before
you work on an image you need to work on getting good images. There should
be no saturation and little or no noise. For good depth resolution one must
employ lenses of the highest possible numerical aperture.

A simple way of calculating that quantity (the local energy in an image) is
simply to subtract the value of the central pixel (in a 3x3 block) from the
adjacent 8 pixels, and discard the sign (ie use the absolute value), and
then add the 8 numbers up.
If you wish to be refined, you may also scale the 4 diagonal corner values
down to account for their further distance from the middle pixel (by the
ratio of 1/sqrt(2) or 0.707.) (or scale the edge pixel values up by the
ratio sqrt(2)  or 1.414).
Noise free images are of course better. This is a sharpness detector.
For less speed and more robustness (sensitivity to noise), extend the
processing to 5x5 or 7x7 etc.
Note that there are some refinements possible.
We use generate two  images in the process, a composite image and a depth or
range image. We then use a median smoothed range image as a mask on the
original source images in the series to cut out the "sharp" parts of each in
turn, copying these sharp parts and pasting each sharp piece into a final
image.

Another criterion is actually the energy in each pixel, the
brightness/darkness of each pixel will rise to a maximum/minimum and then
decrease/increase as focus is passed. There may be interactions between
local very bright/very dark places in images which may make this statement
not true. So then all you need is to look for the local brightest/darkest
pixels as a function of focus. Then build an image using the
brightest/darkest pixels in each step of the focus series.
Hope this helps

--
Noel Goldsmith
DSTO
506 Lorimer Street
Port Melbourne
Victoria
Australia
3207

Phone 613 96267527
Fax   613 96267718
Email [hidden email]



On 14/4/07 2:00 PM, "IMAGEJ automatic digest system" <[hidden email]>
wrote:

> Date:    Fri, 13 Apr 2007 10:49:23 -0500
> From:    Mikhail Umorin <[hidden email]>
> Subject: Re: StereoView after StackFocuser
>
> I am going to work on Stack_Focuser. I shall try to introduce a different edge
> detector. If you have any questions or suggestions -- let me know.
>
> Mikhail Umorin.
>


IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914.  If you have received this email in error, you are requested to contact the sender and delete the email.