Seite 1 von 1

### HOG - What's the point of blocks?

Verfasst: 18. Aug 2013 13:21
Hi,

I don't understand the point of separating the image into overlapping blocks of the HOG descriptor.

Let's assume we devided an image into 3x3 cells and have already calculated the gradient histograms $$h_1, ..., h_9$$ for each cell. Now we further devide the image into overlapping blocks of 2x2 cells. This should look something like this, cells are black boxes, blocks are colored boxes:
hog.png (4.58 KiB) 1798 mal betrachtet
The resulting descriptors now is:

$$(b_1, b_2, b_3, b_4) = (h_1, h_2, h_4, h_5, h_2, h_3, h_5, h_6, h_4, h_5, h_7, h_8, h_5, h_6, h_8, h_9)$$

If I got that right, I don't understand why it is useful to have every histogram appear in the descriptor multiple times.

### Re: HOG - What's the point of blocks?

Verfasst: 19. Aug 2013 16:46
Well, you do not just concatenate those cells, but you normalize within each block. The benefit is invariance to illumination and contrast.

### Re: HOG - What's the point of blocks?

Verfasst: 19. Aug 2013 19:35
Somehow I overlooked that part. So basically for my example the descriptor would be calculated like this (for L2-norm):

$$b_1 = [h_1; h_2; h_4; h_5]$$
$$b_1^{normed} = \frac{b_1}{\sqrt{|b_1|^2 + e}}$$
$$...$$
$$descriptor = [b_1^{normed}; ...; b_4^{normed}]$$

### Re: HOG - What's the point of blocks?

Verfasst: 19. Aug 2013 20:30
Each cell contibutes multiple times, namly once for each normalization as part of the various blocks. So take your first one, but normalize all the h's w.r.t. to the block they came from.