title: memory error when using cv::dct of opencv
body: <p>I have a function using opencv.</p>
  
  <pre><code>Mat CalPHashCode(Mat image)
  {
      Mat floatImage, imageDct,temp;
      resize(image, temp, Size(32, 32));  
      temp.convertTo(floatImage, CV_32FC1);
      dct(floatImage, imageDct);
      Rect roi(0, 0, 8, 8);
      Scalar imageMean = mean(imageDct(roi));
      return (imageDct(roi) &gt; imageMean[0]);
  }
  </code></pre>
  
  <p>When it runs to the dct function "dct(floatImage, imageDct)", I got a error message: "Unhandled exception at at 0x76DA2EEC in PerceptualHash.exe: Microsoft C++ exception: cv::Exception at memory location 0x00C3E108."</p>
  
  <p>I don't know why. Can anyone help?
  It's opencv2.4.7, visual studio 2012, windows 8 64, project is Win32,Debug mode.</p>