title: How to make multiple size of detection on sliding window?
body: <p>I am doing a research on people detection using HOG and LBP. I would like to detect multiple size people on image. I am using a loop on scale for the window size of detection then it will proceed by sliding window detection to detect the matching features on images. However, my code shows error due to different dimensions of matrices. Here is my code :</p>
  
  <pre><code>win_size = [32, 32];  %the window size of detection
  
  %loop on scale of window size
  for s=0.8:0.2:1
  
      X=win_size(1)*s;
      Y=win_size(2)*s;
  
      %loop on column of image
      for y = 1:X/4:lastRightCol-Y
  
          %loop on row of image
          for x   = 1:Y/4:lastRightRow-X
  
              p1  = [x,y];
              p2  = [x+(X-1), y+(Y-1)];
              po  = [p1; p2] ;
  
  
              % CROPPED IMAGE
              crop_px    = [po(1,1) po(2,1)];
              crop_py    = [po(1,2) po(2,2)];
  
              topLeftRow = ceil(min(crop_px));
              topLeftCol = ceil(min(crop_py));
  
              bottomRightRow = ceil(max(crop_px));
              bottomRightCol = ceil(max(crop_py));
  
              cropedImage    = im(topLeftCol:bottomRightCol,topLeftRow:bottomRightRow,:);
  
              %Get the feature vector from croped image
              HOGfeatureVector{counter}= getHOG(double(cropedImage));
              LBPfeatureVector{counter}= getLBP(cropedImage);
              LBPfeatureVector{counter}= LBPfeatureVector{counter}';
              boxPoint{counter} = [x,y,X,Y];
              counter = counter+1;
              x = x+2;
  
          end
      end
  end
  </code></pre>
  
  <p>I noticed the problem is on <code>HOGfeatureVector{counter}</code>, since i am using different window size, the features that I got from HOG also has different dimension. For example, the original scale of my window size is <code>32x32</code>, then it will give me the dimension after extracting features from HOG as <code>&lt;6256x324&gt;</code>. Then, if I put the scale on window size, for example : <code>0.8:0.2:1</code>, it will give me different dimension, since the scale of 0.8, it will give me <code>&lt;6256x144&gt;</code> and the scale of 32, <code>&lt;6256x324&gt;</code>. I noticed, it is impossible to combine this two different matrices dimension by using simple concatenation.</p>
  
  <p>Any one has idea how to solve my problem? At least, how to combine two different dimensions of matrices?</p>
  
  <p>Thank you</p>