title: cvGetSize gives bad argument error
body: <p>I'm trying to reduce the glare and light reflections from an image to then continue with some more image processing. I found a snippet of code online that supposedly works to select pixels in a range but when I insert into my algorithm, it gives me an error. I've verified that my image data is not <code>NULL</code>, so that is not causing the problem. Why am I getting an assertion failure?</p>
  
  <p><strong>Error:</strong></p>
  
  <blockquote>
    <p>OpenCV Error: Bad argument (Array should be CvMat or IplImage) in cvGetSize, file /Users/user/slave/builds/ios_framework/src/opencv/modules/core/src/array.cpp, line 1238
    libc++abi.dylib: terminate called throwing an exception.</p>
  </blockquote>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>cv::Mat eye1 = [self cvMatFromUIImage:eye];
  cv::Mat eye2;
  
  IplImage imgHSV = *cvCreateImage(cvGetSize(&amp;eye1), 8, 3);    //Assertion fails here
  IplImage imgThreshold = *cvCreateImage(cvGetSize(&amp;imgHSV), 8, 1);
  cvInRangeS(&amp;imgHSV, cvScalar(0, 0, 90, 0), cvScalar(0, 0, 100, 0) , &amp;imgThreshold);
  cv::Mat eye3(&amp;imgThreshold);
  </code></pre>
  
  <p>The original code didn't include the <code>*</code> and <code>&amp;</code> symbols but Xcode suggested that I place them but the function still doesn't work.</p>