Perspective transformation, How to locate the 4 points in the original image so that the viewing angle would be right above the scene

北城余情 提交于 2020-01-07 09:04:12

问题


What I am trying to do is to make the people's sizes in the output image all the same. So I performed a perspective transformation so that the viewing angle is right above the scene. The scene picture is showing below:

The functions I am using is cv2.getPerspectiveTransform and cv2.warpPerspective, and this method need 4 points on the input image and corresponding points on the output image. For the 4 points on the output image, i always choose the four corners. However it's very hard to choose the 4 points on the input image.My mentor told me the 4 points must choose from the vanishing lines(parallel to each other), Below is an example of how i chose the 4 points on the input image in this way:

However, the people's sizes are still different, the people on the upper side of the image are larger and they are blur. Then I tried to change the 4 points by looking at the output image(not following the vanishing lines,just change the points based on the output), here is what i got:

It's better but it's too complicated, it took me quite a long time to adjust the four points. Are there any easier ways to locate the 4 points on the input image so that the people's sizes on the output image is the same? Your help is greatly appreciated. Thanks!

来源:https://stackoverflow.com/questions/32413383/perspective-transformation-how-to-locate-the-4-points-in-the-original-image-so

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!