mw::mo::mocam::autofocus::Handle::Get Member Function

Syntax

ErrorCodes Get(
    f32  dampingFactor,
    f32& focus
);

Arguments

Name Description
in dampingFactor damping factor used to interpolate internal autofocus value (see below).
out focus Output interpolated autofocus value between 0 and maxParallax (see Calculate).

Return Values

Return OK if no error.

Description

This function interpolate internal autofocus value calculated by Calculate.
You will typically call it for every frame while the internal autofocus calculation will be done once in a while.
Calculate calculates a new autofocus value for each frame pair, independently of the previous images.
Keeping this value "as is" would create a rather "erratic" and "jumping" behavior of the autofocus.
To make it smoother, we use a classic damping formula :

This formula will typically "spread" the (possibly quick-changing) results into a "smoother" behavior.
To have an idea of the "typical speed" of this system, if the system is moving from a focus value A to a new focus value B,
it takes about "dampingFactor" iterations to move about half the "distance" between A and B (it behaves like an "exponential decay" with a "dampingFactor" half-life).

This function returns the horizontal translation in pixel to be applied between 2 images to have a correct visual focus.
To display correctly the 2 images (by applying the autofocus) you should:
To combinate this value with the calibration in right-handed coordinate, you will have to substract the autofocus value from translationX value (newTranslationX=translationX-autofocus).

Revision History

2011/03/15
Initial version.

CONFIDENTIAL