title: Iterating over multidimensional arrays(images) with numpy array - python
body: <p>Hy!
  I have two images(same dimension) as numpy array imgA - imgB
  i would like to iterate each row and column and get somenthing like that:</p>
  
  <pre><code>for i in range(0, h-1):
    for j in range(0, w-1):
      final[i][j]= imgA[i,j] - imgB[i-k[i],j]
  </code></pre>
  
  <p>where h and w are the height and the width of the image and k is and array with dimension[h*w]. </p>
  
  <p>i have seen this topic:
  <a href="https://stackoverflow.com/questions/6967463/iterating-over-a-numpy-array">Iterating over a numpy array</a>
  but it doens't work with images, i get the error: too many values to unpack
  Is there any way to do that with numpy and python 2.7?</p>
  
  <p>thanks</p>
  
  <p>edit
  I try to explain better myself.
  I have 2 images in LAB color space.
  these images are (288,384,3).
  Now I would like to make deltaE so I could do like that(spitting the 2 arrays):</p>
  
  <pre><code> imgLabL=np.dsplit(imgL,3)
   imgLabR=np.dsplit(imgR,3)
   imgLl=imgLabL[0]
   imgLa=imgLabL[1]
   imgLb=imgLabL[2]
   imgRl=imgLabR[0]
   imgRa=imgLabR[1]
   imgRb=imgLabR[2]
  delta=np.sqrt(((imgLl-imgRl)**2) + ((imgLa - imgRa)**2) + ((imgLb - imgRb)**2)   )
  </code></pre>
  
  <p>Till now everything is fine. 
  But now i have this array k of size (288,384).
  So now i need a new delta but with different x axis,like the pixel in imgRl(0,0) i want to add the pixel in imgLl(0+k,0)</p>
  
  <p>do you get more my problems?</p>