title: Reduce function to calculate sum of each column
body: <p>I got stuck with OpenCV while trying to calculate the sum of each column for a thresholded (binary) image.</p>
  
  <p>This code</p>
  
  <pre><code>Mat thrs;
  threshold(roi, thrs, 252, 255, THRESH_BINARY);
  Mat dy;
  reduce(thrs, dy, 1, CV_REDUCE_SUM);
  </code></pre>
  
  <p>gives me a runtime error stating</p>
  
  <pre><code>OpenCV Error: Unsupported format or combination of formats
  </code></pre>
  
  <p>I assume this is due to the binary image being in CV_8UC1 format, therefore dy is in the same format and cannot hold the summed up values. Is this correct? Whats the way around it?</p>