depth_from_focus ( MultiFocusImage : Depth, Confidence : Filter, Selection : )

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) -> object : byte
Multichannel gray image consisting of multiple focus levels.

Depth (output_object)
singlechannelimage(-array) -> object : byte
Depth image.

Confidence (output_object)
singlechannelimage(-array) -> object : byte
Confidence of depth estimation.

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

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


Example (Syntax: C++)
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);

Parallelization Information

depth_from_focus is reentrant and automatically parallelized (on tuple level).


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

3D Metrology



Copyright © 1996-2008 MVTec Software GmbH