title: convertTo not working in opencv
body: <p>I am trying to use convertTo() in opencv C++. But an error pops saying</p>
  
  <blockquote>
    <p>left of:convertTo must have class/struct/union</p>
  </blockquote>
  
  <p>the program is below:</p>
  
  <pre><code>for (i = 0; i &lt; height; i += 8)
  {
      for (j = 0; j &lt; width; j += 8)
      {
          Mat block = dctImage(Rect(j, i, 8, 8));
          vector&lt;Mat&gt; planes;
          split(block, planes);
          vector&lt;Mat&gt; outplanes(planes.size());
          for (k = 0; k &lt; planes.size(); k++) {
              planes[k].convertTo(planes[k], CV_32FC1);
              dct(planes[k], outplanes[k]);
              outplanes[k].convertTo(outplanes[k], CV_8UC1);
          }
      }
  }
  </code></pre>