title: splitting an RGB image to R,G,B channels - python
body: <p>I'm working on image processing, I want to know whether this code will split a color image into different channels, and give me the mean. Because when I tried its giving me the image what I'm reading, its giving me the blue, green, red values, and also the mean value. When i try to append it to a list, and try to print it, then the list contains only Zeros'.</p>
  
  <p>This is my code:</p>
  
  <pre><code>b, g, r = cv2.split(re_img1)
  ttl = re_img1.size
  B = sum(b) / ttl
  G = sum(g) / ttl
  R = sum(r) / ttl
  B_mean1.append(B)
  G_mean1.append(G)
  R_mean1.append(R)
  </code></pre>
  
  <p><code>re_img1</code> is the resized image(i.e 256x256). Image can be anything. And I'm using the same code in 2 different function, and I'm facing the same problem.</p>
  
  <p>Any suggestions are welcome! Thanks in advance!</p>