# displaySelectedFilters

## PURPOSE

displaySelectedFilters - For display of selected weak classifiers by adaboost.

## SYNOPSIS

function toDisplay = displaySelectedFilters(allsymbol, lambdas,selectedPolars,selectedXs,selectedYs,selectedOs,patch_size)

## DESCRIPTION

     displaySelectedFilters - For display of selected weak classifiers by adaboost.

## CROSS-REFERENCE INFORMATION

This function calls:

- drawGaborSymbol drawGaborSymbol - Render one Gabor symbol on image.

This function is called by:

- adaboostLearn LearnAdaboostTemplate - Learns an adaboost "template", i.e. strong classifier.

## SOURCE CODE

    0001 function toDisplay = displaySelectedFilters(allsymbol, lambdas,selectedPolars,selectedXs,selectedYs,selectedOs,patch_size)
    0002 % displaySelectedFilters - For display of selected weak classifiers by adaboost.
    0003 %
    0004
    0005 imPos = zeros(patch_size); % show basis where lambdas are positive
    0006 imNeg = zeros(patch_size);
    0007 imAll = zeros(patch_size);
    0008
    0009 maxLambda = max(abs(lambdas));
    0010 lambdas = floor(lambdas / maxLambda * 254);
    0011
    0012 for k = 1:length(selectedXs)
    0013     orientationIndex = selectedOs(k) + 1; % starts from 1
    0014     col = selectedYs(k)+1;
    0015     row = selectedXs(k)+1;
    0016     if selectedPolars(k) > 0.5
    0017         imPos = drawGaborSymbol(imPos, allsymbol, row, col, orientationIndex, lambdas(k));
    0018         imAll = drawGaborSymbol(imAll, allsymbol, row, col, orientationIndex, lambdas(k));
    0019     else
    0020         imNeg = drawGaborSymbol(imNeg, allsymbol, row, col, orientationIndex, lambdas(k));
    0021         imAll = drawGaborSymbol(imAll, allsymbol, row, col, orientationIndex, lambdas(k));
    0022     end
    0023 end
    0024
    0025 toDisplay = uint8(zeros(patch_size(1),patch_size(2),3));
    0026 toDisplay(:,:,2) = uint8(255-imPos);
    0027 toDisplay(:,:,1) = uint8(255-imNeg);
    0028 toDisplay(:,:,3) = 255;