How to draw a Perspective-Correct Grid in 2D

后端 未结 9 1224
滥情空心
滥情空心 2020-12-25 08:43

I have an application that defines a real world rectangle on top of an image/photograph, of course in 2D it may not be a rectangle because you are looking at it from an angl

9条回答
  •  一个人的身影
    2020-12-25 09:12

    The most elegant and fastest solution would be to find the homography matrix, which maps rectangle coordinates to photo coordinates.

    With a decent matrix library it should not be a difficult task, as long as you know your math.

    Keywords: Collineation, Homography, Direct Linear Transformation

    However, the recursive algorithm above should work, but probably if your resources are limited, projective geometry is the only way to go.

提交回复
热议问题