title: How can I convert a camera view to a top view cartesian plane in opencv python?
body: <p>I have a video stream coming from a camera from an angle, I want to have a top view of the frame but only for a moving point. The image doesn't necessarily be wrapped or stretched. 
  All I want is mapping the range of pointer from the original image to cartesian plane (top view)
  Refer to the images below. </p>
  
  <p>code so far</p>
  
  <pre><code>import cv2
  import numpy as np
  ix = 0
  iy = 0
  
  
  def draw_circle(event, x, y, flags, param):
      global ix, iy
      if event == cv2.EVENT_MOUSEMOVE:
          ix = x
          iy = y
  
  
  img = cv2.imread("./maxresdefault.jpg")
  h, w, c = img.shape
  ones = np.zeros((h, w))
  left, top = 50, 50
  right, bottom = w - 50, h - 50
  cv2.namedWindow('main_image')
  while True:
      ones_copy = ones.copy()
      cv2.setMouseCallback('main_image', draw_circle)
      cv2.rectangle(ones, (left, top), (right, bottom), (255, 255, 255), 2)
      cv2.circle(ones_copy, (ix, iy), 2, (255, 255, 255), 2)
      cv2.imshow("main_image", img)
      cv2.imshow("ones", ones_copy)
      cv2.waitKey(32)
  # coords = [[54, 199], [520, 336], [542, 177], [233, 121]]
  # coords = [[233, 121]]
  # y = ((x / 99.0) * 2) - 1
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/yqCme.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yqCme.jpg" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/WQZ9Q.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WQZ9Q.jpg" alt="enter image description here"></a></p>