title: Error in image warping code
body: <pre><code>import cv2
  import numpy as np
  
  point=np.zeros((32,2),np.float32)
  point2=np.zeros((32,2),np.float32)
  count=0
  
  def click(event, x, y, flags, param):  
      global count
      global x1,x2,y1,y2
  
      if event == cv2.EVENT_LBUTTONDOWN:
          if count%2==0:
              point[count,0] = x
              point[count,1] = y
              print (x,y)
              x1=x
              y1=y
              count+=1
  
          else:
              point2[count,0] = x
              point2[count,1] = y
              print (x,y)
              x2=x
              y2=y
              count+=1
              mophing()
  
  def mophing():
  
      height,width,channel = img.shape
  
      for y in range (height):
          for x in range (1,width):
              if(x&lt;x1):
                  xratio=x/x1
              else:
                  xratio=(width-x)/(width-x1)
  
              dx=int((xratio)*(x2-x1))
              img[x,y]=img[x+dx,y]
  
      #Result      
      cv2.imshow('change', img)
  
  img = cv2.imread('messigray.png')
  
  cv2.namedWindow('original')  
  cv2.setMouseCallback('original', click )
  cv2.imshow('original', img)
  
  cv2.waitKey()
  </code></pre>
  
  <p>It's my Python code
  I check point1 and point2 in someones example picture using mouseEvent,
  I would like to Warping between the two clicked pointers.
  Then I wrote a program that changes the value of X tab only.
  However, when you run this code, the results at the bottom are printed.</p>
  
  <pre><code>77 96
  374 290
  Traceback (most recent call last):
    File "C:\Users\open7\Desktop\MouseWarping.py", line 28, in click
      mophing()
    File "C:\Users\open7\Desktop\MouseWarping.py", line 42, in mophing
      img[x,y]=img[x+dx,y]
  IndexError: index 480 is out of bounds for axis 0 with size 480
  </code></pre>
  
  <p>Among the result, The above two values are coordinates of the two clicked points
  I would like to know the problem and solution to the last line code.
  And I would like to know whether this code is a NumPy issue or OpenCV problem.</p>