OpenCV Homography, Transform a point, what is this code doing?

前端 未结 2 622
梦谈多话
梦谈多话 2020-12-23 22:35

I\'m working with a homography calculated by OpenCV. I currently use this homography to transform points using the function below. This function performs the task I require

2条回答
  •  失恋的感觉
    2020-12-23 23:14

    OpenCV Python implementation following @Ben answer

    p = np.array((x,y,1)).reshape((3,1))
    temp_p = M.dot(p)
    sum = np.sum(temp_p ,1)
    px = int(round(sum[0]/sum[2]))
    py = int(round(sum[1]/sum[2]))
    

提交回复
热议问题