From: Chris Russ Subject: Re: auto-focus function Date: 13 Sep 1999 00:00:00 GMT Message-ID: <37DD6710.6A5B981A@aol.com> Content-Transfer-Encoding: 7bit References: <37DC0B5E.2A14DC7E@physik.uni-ulm.de> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii; x-mac-type="54455854"; x-mac-creator="4D4F5353" X-Complaints-To: abuse@prserv.net X-Trace: 13 Sep 1999 21:06:22 GMT, 32.100.213.153 Organization: Reindeer Games, Inc. MIME-Version: 1.0 Reply-To: jcr6@aol.com Newsgroups: sci.image.processing,sci.techniques.microscopy Ralf Kemkemer wrote: > Does anyone have experience with an "optical" (based on image > processing) auto-focus function in light microscopy? > I use a simple one-dimensional Laplace filter (NIH-Image) to get the the > maximum of the greyscale dynamic of the picture (cell culture) but it is > slow and does not work very accurately. > I am grateful for any information. > Ralf There are two common ways to define "in-focus." (As opposed to INFS INFOCUS the company.) 1) That state where the image is the sharpest (how do you define sharpest? - below) -or- 2) That state where the image contrast is greatest When I manually focus a camera, I try to find some lines or edges in the center of the field of view and make them sharp. If you consider being out-of-focus a blur function, the edges are skinniest when the image is focussed. So, how do you implement this? * You could have several 1-D FFTs (taking a few milliseconds each) and maximize the power in the high frequencies (Some horizontal, some vertical, hopefully one or more will be an "interesting" area of the image...) This is one way to define "sharpest." * You could have several lines where we look at the "Range" in the image. The range is the difference between the darkest pixel and the brightest pixel. (Thus you are maximizing the contrast of the image.) Bear in mind that you do not have to process the ENTIRE image in order to focus it. Also, be careful of the Laplacian as it is a wonderful noise amplifier. If the noise function is electronic (as opposed to texture in the image) then you won't be able to autofocus at all. -Chris Russ