title: Unpad / remove borders from filtered image
body: <p>I applied a Gabor filter of a specific size and orientation to a greyscale Image. So i get new  filtered image by using the 2-D convolution "conv2". I saw some persons who tried to remove the borders from the filtered image, in other words, to unpad the filtered image. What does these borders ?</p>
  
  <p>For example:</p>
  
  <pre><code>    %if length(amount==1) , unpad equal on each side.
      %if length(amount==2) , first amount is left right, second amount is up down.
      %if length(amount==4) , then [left top right bottom].
  
  switch (length(amount))
  case 1
  sx=size(i,2) - 2 * amount;  % i is the filtered image
  sy=size(i,1) - 2 * amount;
  left=amount + 1;
  right=size(i,2) - amount;
  top=amount + 1;
  bottom = size(i,1) - amount;
  
  case 2
  sx=size(i,2) - 2 * amount(1);
  sy=size(i,1) - 2 * amount(2);
  left=amount(1) + 1;
  right = size(i,2) - amount(2);
  top= amount(2) +1;
  bottom = size(i,1) - amount(2);
  
  case 4
  sx=size(i,2) - (amount(1) + amount(3));
  sy= size(i,1) - (amount(2) + amount(4));
  left = amount(1) + 1;
  right = size(i,2) - amount(3);
  top = amount(2) + 1;
  bottom = size(i,1) - amount(4);
  
  otherwise
  error('illegal unpad amount\n');
  
  end
  </code></pre>
  
  <p>I didn't understand this code, what are the left, right, top and bottom ? do they differ from sx and sy ?? please can someone help me and explain to me in details what happens in this code please.</p>