Sign in

username:

password:



Not a member?

Search compdsp



Search tips

comp.dsp by Keywords

Adaptive Filter | ADPCM | ADSP | ADSP-2181 | Aliasing | AMR | Anti-Aliasing | ARMA | Autocorrelation | AutoCovariance | Beamforming | Bessel | Blackfin | Butterworth | C6713 | CCS | Chebyshev | CIC Filter | Circular Convolution | Code Composer Studio | Comb Filter | Compression | Convolution | Cross Correlation | DCT | Decimation | Deconvolution | Demodulation | DM642 | DSP Boards | DSP/BIOS | DTMF | Echo Cancellation | Equalization | Equalizer | ETSI | EZLITE (Ez-kit Lite) | FFT | FFTW | FIR Filter | Fixed Point | FSK | G.711 | G.723 | G.729 | Gaussian Noise | Goertzel | GPIO | Hilbert Transform | IFFT | IIR Filter | Interpolation | Invariance | JTAG | Kalman | Laplace Transform | Levinson | LPC | McBSP | MIPS | Modulation | MPEG | Multirate | Notch Filter | Nyquist | OFDM | Oversampling | Pink Noise | Pitch | PLL | Polyphase | QAM | QDMA | Quantization | Quantizer | Radar | Random Noise | Reed Solomon | Remez | Resampling | RTDX | Sampling | Sharc | TI C6711 | Undersampling | Viterbi | Wavelets | White Noise | Wiener Filter | Windowing | XDS510PP | Z Transform

Ads

Discussion Groups

Free Online Books

See Also

Embedded SystemsFPGAElectronics

Discussion Groups | Comp.DSP | Lens focusing algorithm?

There are 21 messages in this thread.

You are currently looking at messages 0 to 10.


Lens focusing algorithm? - Sander Vesik - 2004-02-27 18:42:00

Does anybody have pointers to algorithms than can be used / 
are used to focus lens given input from a CCD ? 

-- 
	Sander

+++ Out of cheese error +++
______________________________
DSPRelated.com's 50,000th member announced! Details Here.

Re: Lens focusing algorithm? - Bhaskar Thiagarajan - 2004-02-27 19:50:00



"Sander Vesik" <s...@haldjas.folklore.ee> wrote in message
news:1...@haldjas.folklore.ee...
> Does anybody have pointers to algorithms than can be used /
> are used to focus lens given input from a CCD ?

I don't experience in doing this, but here is my guess on how it might work
(at a simple level).
You get to pick an area from the CCD image as your 'focus selection point' -
this would be a fairly small area on your image. You apply edge detection
algorithms to this small area and see if you can detect a sharp edge. If
not, then you are out of focus and you change the focal length by a certain
step and check for edge sharpness. You can get pretty creative on how you
'hunt' for focus.
I'm not sure how much this helps...
Cheers
Bhaskar


>
> --
> Sander
>
> +++ Out of cheese error +++


______________________________
DSPRelated.com's 50,000th member announced! Details Here.

Re: Lens focusing algorithm? - Sander Vesik - 2004-02-27 20:52:00

Bhaskar Thiagarajan <b...@deja.com> wrote:
> "Sander Vesik" <s...@haldjas.folklore.ee> wrote in message
> news:1...@haldjas.folklore.ee...
> > Does anybody have pointers to algorithms than can be used /
> > are used to focus lens given input from a CCD ?
> 
> I don't experience in doing this, but here is my guess on how it might work
> (at a simple level).
> You get to pick an area from the CCD image as your 'focus selection point' -
> this would be a fairly small area on your image. You apply edge detection
> algorithms to this small area and see if you can detect a sharp edge. If
> not, then you are out of focus and you change the focal length by a certain
> step and check for edge sharpness. You can get pretty creative on how you
> 'hunt' for focus.
> I'm not sure how much this helps...

Thanx - its at least an idea 8-) 

> Cheers
> Bhaskar
> 

-- 
	Sander

+++ Out of cheese error +++
______________________________
DSPRelated.com's 50,000th member announced! Details Here.

Re: Lens focusing algorithm? - Steve Underwood - 2004-02-28 00:14:00

Sander Vesik <s...@haldjas.folklore.ee> wrote in message
news:<1...@haldjas.folklore.ee>...
> Does anybody have pointers to algorithms than can be used / 
> are used to focus lens given input from a CCD ?

If you mean how do you make an autofocusing camera, there are two
common techniques. One is echo ranging with an infra red beam. The
other is sweeping through the focus range, looking for the maximum
contrast in the image. Usually you use just the central area, as that
is generally the part you want to be in sharp focus (it cuts the
compute load too). If yuo try using some cam-corders in dim light, or
in very bland featureless scenes yuo will see them going into this
sweeping mode repeatedly, as they cannot find a nice peak on the
contrast calculation.

The infra red approach may seem crude compared to the fancy signal
processing approach, but it does work well in poor light.

Regards,
Steve
______________________________
DSPRelated.com's 50,000th member announced! Details Here.

Re: Lens focusing algorithm? - Jerry Avins - 2004-02-28 10:47:00

Steve Underwood wrote:

> Sander Vesik <s...@haldjas.folklore.ee> wrote in message
news:<1...@haldjas.folklore.ee>...
> 
>>Does anybody have pointers to algorithms than can be used / 
>>are used to focus lens given input from a CCD ?
> 
> 
> If you mean how do you make an autofocusing camera, there are two
> common techniques. One is echo ranging with an infra red beam. The
> other is sweeping through the focus range, looking for the maximum
> contrast in the image. Usually you use just the central area, as that
> is generally the part you want to be in sharp focus (it cuts the
> compute load too). If yuo try using some cam-corders in dim light, or
> in very bland featureless scenes yuo will see them going into this
> sweeping mode repeatedly, as they cannot find a nice peak on the
> contrast calculation.
> 
> The infra red approach may seem crude compared to the fancy signal
> processing approach, but it does work well in poor light.

Although they tend to vary together, maximizing the high-frequency
content is usually more productive than creating the greatest difference
between bright and dark.

Jerry
-- 
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

______________________________
DSPRelated.com's 50,000th member announced! Details Here.

Re: Lens focusing algorithm? - Kevin Neilson - 2004-02-28 14:52:00

You could perform DCTs and use a feedback loop to get the maximize the
high-freq content.  I'm not sure how you decide which element of the picture
you want to focus on, unless you assume it's the middle.
-Kevin

"Sander Vesik" <s...@haldjas.folklore.ee> wrote in message
news:1...@haldjas.folklore.ee...
> Does anybody have pointers to algorithms than can be used /
> are used to focus lens given input from a CCD ?
>
> --
> Sander
>
> +++ Out of cheese error +++


______________________________
DSPRelated.com's 50,000th member announced! Details Here.

Re: Lens focusing algorithm? - Steve Underwood - 2004-02-28 23:38:00

Hi Jerry,

I focussed on the "are used" part of the question. Cameras have been
doing this for over 20 years. The compute power they could bring to
bear on the problem was very limited then. The early ones I saw just
used contrast, yet worked very well. I think this is still how they
work, as the battery consumption of those machines is still very low.

If you focus on what you *could* do, then things are different. I
think an entropy analysis would generally give the best results. Much
more so than a simple peaking of the overall high frequency content,
or a more focussed detection of the sharpest edge transitions. If you
are focussing on a face, there are not too many distinct transitions
to focus on. Entropy works very well, though.

Regards,
Steve


Jerry Avins <j...@ieee.org> wrote in message news:<4040b817$0$3099$6...@news.rcn.com>...
> Steve Underwood wrote:
> 
> > Sander Vesik <s...@haldjas.folklore.ee> wrote in message
news:<1...@haldjas.folklore.ee>...
> > 
> >>Does anybody have pointers to algorithms than can be used / 
> >>are used to focus lens given input from a CCD ?
> > 
> > 
> > If you mean how do you make an autofocusing camera, there are two
> > common techniques. One is echo ranging with an infra red beam. The
> > other is sweeping through the focus range, looking for the maximum
> > contrast in the image. Usually you use just the central area, as that
> > is generally the part you want to be in sharp focus (it cuts the
> > compute load too). If yuo try using some cam-corders in dim light, or
> > in very bland featureless scenes yuo will see them going into this
> > sweeping mode repeatedly, as they cannot find a nice peak on the
> > contrast calculation.
> > 
> > The infra red approach may seem crude compared to the fancy signal
> > processing approach, but it does work well in poor light.
> 
> Although they tend to vary together, maximizing the high-frequency
> content is usually more productive than creating the greatest difference
> between bright and dark.
> 
> Jerry
______________________________
DSPRelated.com's 50,000th member announced! Details Here.

Re: Lens focusing algorithm? - Rick Armstrong - 2004-02-29 14:51:00

Hi Sander,

> Does anybody have pointers to algorithms than can be used /
> are used to focus lens given input from a CCD ?

This probably isn't exactly what you're after, but here's a brief
description of how auto-focus is done in CD players:
http://www.repairfaq.org/sam/laserlia.htm#liarfdm

 I was involved in a project once that used a similar technique in a
non-contact standoff-distance "probe" for a coordinate measurement machine.
The system used a CCD camera the way photodiodes are used in CD players
(i.e., we just looked at the eccentricity of the laser spot). Worked
surprisingly well (_I_ was surprised, at least).

Of course, if you don't have a laser handy, this won't work. :)

HTH

Rick Armstrong
(note: reply address is bogus



______________________________
DSPRelated.com's 50,000th member announced! Details Here.

Re: Lens focusing algorithm? - Sander Vesik - 2004-02-29 15:19:00

Steve Underwood <s...@coppice.org> wrote:
> Hi Jerry,
> 
> I focussed on the "are used" part of the question. Cameras have been
> doing this for over 20 years. The compute power they could bring to
> bear on the problem was very limited then. The early ones I saw just
> used contrast, yet worked very well. I think this is still how they
> work, as the battery consumption of those machines is still very low.

It appears to be mostly driven by energy consumed by mechanical processes
even in latest cameras.

> 
> If you focus on what you *could* do, then things are different. I
> think an entropy analysis would generally give the best results. Much
> more so than a simple peaking of the overall high frequency content,
> or a more focussed detection of the sharpest edge transitions. If you
> are focussing on a face, there are not too many distinct transitions
> to focus on. Entropy works very well, though.

Any pointers to getting more information on this? I didn't manage to 
turn up too much in a fast search on citeseer. 

> 
> Regards,
> Steve
> 

-- 
	Sander

+++ Out of cheese error +++
______________________________
DSPRelated.com's 50,000th member announced! Details Here.

Re: Lens focusing algorithm? - Clay S. Turner - 2004-03-01 11:51:00

Hello Sander,

Here is how the Nikon D2H does it. And it currently has the best autofocus
in digital SLRs.

http://www.digitalreview.ca/cams/NikonD2Hpg_2.shtml

Clay

-- 
Clay S. Turner, V.P.
Wireless Systems Engineering, Inc.
Satellite Beach, Florida 32937
(321) 777-7889
www.wse.biz
c...@wse.biz



"Sander Vesik" <s...@haldjas.folklore.ee> wrote in message
news:1...@haldjas.folklore.ee...
> Does anybody have pointers to algorithms than can be used /
> are used to focus lens given input from a CCD ?
>
> -- 
> Sander
>
> +++ Out of cheese error +++


______________________________
DSPRelated.com's 50,000th member announced! Details Here.

| 1 | 2 | 3 | next