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

Moderator: Computer Vision

Flix
Erstie
Beiträge: 20
Registriert: 14. Jan 2013 12:37

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

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) 1648 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.

lustiz
Mausschubser
Beiträge: 70
Registriert: 29. Apr 2009 10:28

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

Well, you do not just concatenate those cells, but you normalize within each block. The benefit is invariance to illumination and contrast.

Flix
Erstie
Beiträge: 20
Registriert: 14. Jan 2013 12:37

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

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}]$$

lustiz
Mausschubser
Beiträge: 70
Registriert: 29. Apr 2009 10:28

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

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.