# dumpNeg

## PURPOSE

dumpNeg - Precompute Gabor response maps on background/negative images.

## SYNOPSIS

This is a script file.

## DESCRIPTION

     dumpNeg - Precompute Gabor response maps on background/negative images.

## CROSS-REFERENCE INFORMATION

This function calls:

- GaborFilter GaborFilter - generate Gabor filter at fixed scale and orientation.
- applyfilterMultiScale applyfilterMultiScale - Filter image by a bank of multiscale filters, with local normalization.

This function is called by:

- StartFromHere StartFromHere - The entry point of this project.

## SOURCE CODE

    0001 % dumpNeg - Precompute Gabor response maps on background/negative images.
    0002
    0003 imageNames = dir('../image/neg/*.jpg');
    0004 n = length(imageNames);
    0005 load ../template_params GaborFilter nGaborOri
    0006 mkdir ../feature
    0007 mkdir ../feature/neg/
    0008 for i = 1:min(5,n)
    0009     im = imread(sprintf('../image/neg/%s',imageNames(i).name));
    0010     if size(im,3) == 3
    0011         im = rgb2gray(im);
    0012     end
    0013     im = single(im);
    0014     if size(im,1) * size(im,2) > 512 * 512
    0015         im = imresize(im, 512/sqrt(size(im,1)*size(im,2)), 'nearest');
    0016     end
    0017     S1Map = applyfilterMultiScale({im},GaborFilter, nGaborOri);
    0018     save(sprintf('../feature/neg/%s.mat',imageNames(i).name),'S1Map');
    0019     clear S1Map
    0020 end
    0021