user1857375
user1857375

Reputation: 31

How to get birds eye view of an road image using opencv?

I want to know how can i get the birds eye view of an road image using opencv functions cvGetPerspectiveTransform() and cvWarpPerspective(). I searched a lot to find some tutorials and examples but found nothing.I need help to understand these functions. thanks

Upvotes: 2

Views: 3190

Answers (1)

Hammer
Hammer

Reputation: 10329

If you mean you want to remove perspective and affine effects from the image then you technically need to move the line at infinty and the circular points of your image to their canonical positions with a transform. Investigating those terms is the best place to start for an understanding of the math behind what you are asking.

On the other hand you can probably just use openCV's findHomography to get the transform you want and not worry about the math. The homography matrix can then be plugged into WarpPerspective() to warp your image. An example of removing perspective distortion with a homography can be found at the end of this paper. You will need to know the rectified image coordinates of at least 4 points in your road image and their corresponding coordinates in the warped image. Rectangular markings on the road would be great candidates to use as points.

Upvotes: 1

Related Questions