# getPrmDflt

## PURPOSE

Helper to set default values (if not already set) of parameter struct.

## SYNOPSIS

function varargout = getPrmDflt( prm, dfs, checkExtra )

## DESCRIPTION

     Helper to set default values (if not already set) of parameter struct.

     Takes input parameters and a list of 'name'/default pairs, and for each
     'name' for which prm has no value (prm.(name) is not a field or 'name'
     does not appear in prm list), getPrmDflt assigns the given default
     value. If default value for variable 'name' is 'REQ', and value for
     'name' is not given, an error is thrown. See below for usage details.

     USAGE (nargout==1)
      prm = getPrmDflt( prm, dfs, [checkExtra] )

     USAGE (nargout>1)
      [ param1 ... paramN ] = getPrmDflt( prm, dfs, [checkExtra] )

     INPUTS
      prm          - param struct or cell of form {'name1' v1 'name2' v2 ...}
      dfs          - cell of form {'name1' def1 'name2' def2 ...}
      checkExtra   - [0] if 1 throw error if prm contains params not in dfs

     OUTPUTS (nargout==1)
      prm    - parameter struct with fields 'name1' through 'nameN' assigned

     OUTPUTS (nargout>1)
      param1 - value assigned to parameter with 'name1'
       ...
      paramN - value assigned to parameter with 'nameN'

     EXAMPLE
      dfs = { 'x','REQ', 'y',0, 'z',[], 'eps',1e-3 };
      prm = getPrmDflt( struct('x',1,'y',1), dfs )
      [ x y z eps ] = getPrmDflt( {'x',2,'y',1}, dfs )

     See also INPUTPARSER

     Piotr's Image&Video Toolbox      Version 2.42
     Copyright 2010 Piotr Dollar.  [pdollar-at-caltech.edu]
     Please email me if you find bugs, or have suggestions or questions!
     Licensed under the Lesser GPL [see external/lgpl.txt]

## CROSS-REFERENCE INFORMATION

This function calls:

This function is called by:

- fernsClfTrain Train random fern classifier.
- fernsRegTrain Train boosted fern regressor.
- kmeans2 Fast version of kmeans clustering.
- bbApply Functions for manipulating bounding boxes (bb).
- bbGt Bounding box (bb) annotations struct, evaluation and sampling routines.
- bbNms Bounding box (bb) non-maximal suppression (nms).
- imRectRot Create a draggable, resizable, rotatable rectangle or ellipse.
- jitterImage Creates multiple, slightly jittered versions of an image.
- kernelTracker Kernel Tracker from Comaniciu, Ramesh and Meer PAMI 2003.
- makeGif Writes a matlab movie to an animated GIF.
- montage2 Used to display collections of images and videos.
- playMovie Shows/makes an/several movie(s) from an image sequence.
- seqIo Utilities for reading and writing seq files.
- dispMatrixIm Display a Matrix with non-negative entries in image form.
- fevalDistr Run simple jobs locally or in distributed fashion using queue.
- plotRoc Function for display of rocs (receiver operator characteristic curves).