title: HOG Feature Implementation with SVM in MATLAB
body: <p>I would like to do classification based on HOG Features using SVM.  </p>
  
  <p>I understand that HOG features is the combination of all the histograms in every cell (i.e. it becomes one aggregate histogram).</p>
  
  <p>I extract HOG features using MATLAB code in this <a href="http://www.vlfeat.org/overview/hog.html" rel="nofollow">page</a> for the <strong>Dalal-Triggs variant</strong>.</p>
  
  <p>For example, I have grayscale image with size of 384 x 512, then I extracted the HOG features at 9 orientations and a cell-size of 8. By doing this, I get <strong>48 x 64 x 36</strong> features.</p>
  
  <p>How can I make this a histogram and use it toward a SVM classifier?</p>
  
  <p>Because for example, I'll have 7 classes of images and I want to do training (total images would be 700 for training) and then classify new data based on the model generated from the training phase.</p>
  
  <p>I read that for multiclass, we can train our SVM with ONE vs ALL, that means that I have to train 7 classifier for my 7 classes.</p>
  
  <p>So for the 1st train, I'll consider the 1st class to be labelled with +1 and the reast class will be 0.
  And the 2nd train, I'll consider the 2nd class to be labelled with +1 and the reast class will be 0. And so on..</p>
  
  <p>For example, I have classes of colors :
  Red, green, blue, yellow, white, black and pink.</p>
  
  <p>So for the 1st training, I make only 2 binary which is red and not red..   </p>
  
  <p>For the 2nd training, I make label green and not green..
  Is it like that??</p>
  
  <p>The syntax to train SVM is:</p>
  
  <pre><code>          SVMStruct = svmtrain(Training,Group)
  </code></pre>
  
  <p>But in this case, I'll have 7 SVMStruct.. </p>
  
  <p>The syntax to classify / testing</p>
  
  <pre><code>          Group = svmclassify(SVMStruct,Sample)
  </code></pre>
  
  <p>how to declare 7 SVMStruct in here??</p>
  
  <p>Is that right??
  Or there are another concept or syntaks that I have to know??</p>
  
  <p>And for training, I'll have 48 x 64 x 36 features, howw I can train these features in SVM??
  because as what I read, they just have 1xN matrix of features..</p>
  
  <p>Please help me...</p>