Herror ::depth_from_focus (
    Hobject MultiFocusImage,
    Hobject *Depth,
    Hobject *Confidence,
    const HTuple &Filter,
    const HTuple &Selection
)
HImage HImage::DepthFromFocus (
    HImage *Confidence,
    const HTuple &Filter,
    const HTuple &Selection
) const
HImage HImageArray::DepthFromFocus (
    HImage *Confidence,
    const HTuple &Filter,
    const HTuple &Selection
) const

Extract depth using mutiple focus levels.

The operator ::depth_from_focus extracts the depth using a focus sequence. The images of the focus sequence have to passed as a multi channel image (MultiFocusImage). The depth for each pixel will be returned in Depth as the channel number. The parameter Confidence returns a confidence value for each depth estimation: The larger this value, the higher the confidence of the depth estimation is.

::depth_from_focus selects the pixels with the best focus of all focus levels. The method used to extract these pixels is specified by the parameters Filter and Selection:

  'highpass'
   The value of the focus is estimated by a highpass filter.

  'bandpass'
   The value of the focus is estimated by a bandpass filter.

  'next_maximum'
   To decide which focus level has be selected, the pixel in the
   neighborhood with the best confidence is used to determine this
   value.

  'local'
   The decision for a focus level is based only on the locally
   calculated focus values.


Parameters

MultiFocusImage (input_object)
multichannel-image(-array) -> Hobject: HImage(Array) ( byte )
Multichannel gray image consisting of multiple focus levels.

Depth (output_object)
singlechannelimage -> Hobject * : HImage ( byte )
Depth image.

Confidence (output_object)
singlechannelimage -> Hobject * : HImage ( byte )
Confidence of depth estimation.

Filter (input_control)
string -> HTuple.char *
Filter used to find sharp pixels.
Default value: 'highpass'
List of values: 'highpass', 'bandpass'

Selection (input_control)
string -> HTuple.char *
Method used to find sharp pixels.
Default value: 'next_maximum'
List of values: 'next_maximum', 'local'


Example
compose3(Focus0,Focus1,Focus2,&MultiFocus);
depth_from_focus(MultiFocus,&Depth,&Confidence,'highpass','next_maximum');
mean_image(Depth,&Smooth,15,15);
select_grayvalues_from_channels(MultiChannel,Smooth,SharpImage);
threshold(Confidence,HighConfidence,10,255);
reduce_domain(SharpImage,HighConfidence,ConfidentSharp);

Possible Predecessors

::compose2, ::compose3, ::compose4, ::add_channels, ::read_image, ::read_sequence


Possible Successors

::select_grayvalues_from_channels, ::mean_image, ::gauss_image, ::threshold


See also

::count_channels


Module

Tools



Copyright © 1996-2002 MVTec Software GmbH