title: Divide image into 8x8 block : Python
body: <pre><code>import numpy as np
  import numpy as numpy
  import cv2
  
  windowsize_r = 8
  windowsize_c = 8
  
  img = cv2.imread('image test.jpg')
  gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
  for r in range(0,gray.shape[0] - windowsize_r, windowsize_r):
  for c in range(0,gray.shape[0] - windowsize_c, windowsize_c):
      window = gray[r:r+windowsize_r,c:c+windowsize_c]
      hist = numpy.histogram(window,bins=256)
  k = cv2.waitKey(0)
      if k == 27:
          cv2.destroyAllWindows()
  </code></pre>
  
  <p>I am trying to divide am image into 8x8 blocks. My image size is 320x240. So at the end there should be 1200 blocks.my code is not showing any error but nothing is observed as output. Can anyone suggest a better solution</p>