-17

Hello im struggling with an implementation of this article: https://goo.gl/8mpIuq

I performed bilinear interpolation over the histogram bins and the results are better with this interpolation, however on page 2 its also mentioned that a trilinear interpolation is added when the pyramid level reaches level 2. I have read this answer HOG Trilinear Interpolation of Histogram Bins and I completely understand the formula behind trilinear interpolation over 2x2 block sizes, but in this article we have a 3x3 block size and 7x7 on pyramid level 3, because these block sizes yield the best results.

The main point about trilinear interpolation is that each pixel in a cell contributes to its local cell by a weight which is defined as the position in each block. I don't know how to represent the location of a pixel in 3x3 block size or what kind of formula should i use.

Thank you for all your help!

EDIT: Another explanation with 2x2 block size http://pep.ijieee.org.in/journal_pdf/11-126-142960909718-22.pdf

Community
  • 1
  • 1
box
  • 4,450
  • 2
  • 38
  • 38

1 Answers1

2

Short answer is: you can't apply Trilinear Inerpolation.

Let's start with 2x2x2 blocks. Each block, is represented by it's centre pixel ( 1,2,3,4 in ugly yellow on my sketch). Each pixel is located at the corner of a cell.

A pixel (the red dot), will be shared by up to 4 blocks that overlap.

enter image description here

With 3x3x2 block each block centre pixel will be also a cell centre pixel. And each cell pixel will be shared with up to 9 blocks.

enter image description here

You can't use Trilinear interpolation. multilinear interpolations require 2^D samples. So you'll need to choose a different way to assign the weights.

Remember that we're not interested in interpolating values, but using the interpolation coefficients as weights.

Some options that you may use (haven't tested them).

  • Inverse distance weighting: (trivial and easy, but I remember Euclidean norms didn't work work well with images, still give it a chance)

  • Go 4x4x2 and use bicubic interpolation + linear for the 3rd dimension.

  • Check if it's possible to obtain weight out of Lagrange or cubic spline polynomials.

  • Use QR decomposition to find a linear solution for the overfitted problem.

xvan
  • 4,554
  • 1
  • 22
  • 37
  • I have a 2 dimensional representation of my samples.I understand that i need interpolation coefficients for the weights, i was just asking how can i obtain them for block sizes of more than 2x2 cells. Thank you for the effort nontheless...I will definitely try the Inverse distance weighting, seems computationaly easy :) – box Mar 12 '16 at 15:08
  • Glad to help. It's 3 dimensional on HOG, the 3rd dimension being the pixel's gradient orientation. Say you have bins separated by 20°, if a pixel has 50° It should be split equally between the 40° and the 60° bins, thus all your blocks are NxNx2. – xvan Mar 12 '16 at 17:10