# histcImLoc

## PURPOSE Creates a series of locally position dependent histograms.

## DESCRIPTION ``` Creates a series of locally position dependent histograms.

Inspired by David Lowe's SIFT descriptor.  Takes I, divides it into a
number of regions, and creates a histogram for each region. I is divided
into approximately equally sized hyper-rectangular regions so that
together these hyper-rectangles cover I.  The hyper-rectangles are
actually 'soft', in that each region is actually defined by a gaussian
Optionally, each value in I may have associated weight given by wtMask,
which should have the same exact dimensions as each channel of I.

If multCh is set to true, then:
I is an [M1xM2x...xMkxnd] array of nd channels
otherwise
I is an [M1xM2x...xMk] array of 1 channel
If nd==1, histcImLoc creates a 1D histogram using histc2.  More
generally, histcImLoc creates an nd dimensional histogram (again using
which have dimension nBins^nd.  So if nd==1 the output of this function
is [nBins x nMasks], and for example if nd==2 the output is [nBins x
nBins x nMasks].  If nd is large computing the histograms is time
consuming.

USAGE

INPUTS
I           - M1xM2x...xMkxnd array, (nd channels each of M1xM2x...xMk)
edges       - quantization bounds, see histc2
wtMask      - [] M1xM2x...xMk numeric array of weights
multCh      -  if 1 last dimension of I is number of channels

OUTPUTS
h           - nd-histograms [nBins^nd x nMasks]

EXAMPLE - multCh==0
I = filterGauss([100 100],[],[],0);
h = histcImLoc(I,10,{2,.6,.1,1},[],0);
figure(1); im(h)

EXAMPLE - multCh==1
I = filterGauss([100 100],[],[],0);
h1 = histcImLoc( cat(3,I,I), 10, {2,.6,.1,0},[],1);
h2 = histcImLoc( cat(3,I,randn(size(I))),10,{2,.6,.1,0},[],1);
figure(1); montage2(h1); figure(2); montage2(h2);