title: Cropping image in matlab
body: <p>I need to do the following for an image in the matlab:</p>
  
  <ol>
  <li>Load the image.</li>
  <li>compute FFT ( Fast Fourier Transform ) of the image.</li>
  <li>shift frequency components to the center.</li>
  <li>crop the image like follow ( if the image res. is 1000x1000 , the needed part of the image is like the following Coordinates: 100,100,800,800. which is a smaller image. (The idea of applying filter to remove high frequencies).</li>
  <li>inverse shift.</li>
  <li>inverse fourier transform.</li>
  </ol>
  
  <p>.
  .
  .</p>
  
  <p>My code look like this:</p>
  
  <pre><code>I = imread('2.jpg'); %loading
  
  ID = im2double(I);
  FID = fft2(ID); %FFT
  F = fftshift(FID); %shifting
  
  F = imcrop(F,[100, 100, 800, 800]);
  
  FID = ifftshift(F); %inverse of shifting
  IFID = ifft2(FID); %inverse of FFT
  
  I8 = im2uint8(IFID);
  </code></pre>
  
  <p>The problem is when i want to Crop the image, imcrop function couldn't crop an image of type "complex double" , as i think ..</p>
  
  <p>Error:</p>
  
  <blockquote>
    <p>Error using imcrop>checkCData (line 410)
    Invalid input image.</p>
    
    <p>Error in imcrop>parseInputs (line 256)
                checkCData(a);</p>
    
    <p>Error in imcrop (line 93)
    [x,y,a,cm,spatial_rect,h_image,placement_cancelled] = parseInputs(varargin{:});</p>
  </blockquote>
  
  <p>ِAny help ? .. also are there another function for cropping?</p>