title: How can I calculate histograms with merged bins?
body: <p>I want to ask you about calculating the histogram in Python using OpenCV. I used this code:</p>
  
  <pre class="lang-py prettyprint-override"><code>hist = cv2.calcHist(im, [0, 1, 2], None, [8, 8, 8], [0, 256, 0, 256, 0, 256])
  </code></pre>
  
  <p>The result gave me the histogram of each color channel with 8 bins, but what I want to get is:</p>
  
  <ul>
  <li>1st bin (<strong>R=0-32,G=0-32,B=0-32</strong>), </li>
  <li>2nd bin (<strong>R=33-64,G=0-32,B=0-32</strong>),</li>
  <li>and so on,</li>
  </ul>
  
  <p>so I will have 512 bins in total.</p>