Implementation of homography algorithm in python using numpy