Opencv homography to find global xy coordinates from pixel xy coordinates
I am trying to find the transformation matrix H so that i can multiply the (x,y) pixel coordinates and get the (x,y) real world coordinates. Here is my code: import cv2 import numpy as np from numpy.linalg import inv if __name__ == '__main__' : D=[159.1,34.2] I=[497.3,37.5] G=[639.3,479.7] A=[0,478.2] # Read source image. im_src = cv2.imread('/home/vivek/june_14.png') # Four corners of the book in source image pts_src = np.array([D,I,G,A]) # Read destination image. im_dst = cv2.imread('/home/vivek/june_14.png') # Four corners of the book in destination image. print "img1 shape:",im_dst.shape