Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a Bird-Eye-View of image to a given plane?

Tags:

c++

opencv

I'm given a plane (support vector and plane's normal vector), an image which was taken by a camera of which i know the intrinsic parameters (fx,fy,cx,cy). How do i obtain the transformation of this image to a bird-eye-view like image (so that birds view is collinear to the plane's normal vector). I'm confused with the coordinate systems i have to use, some matrices are in world coordinates and some in local. I know that there is warpPerspective() in OpenCV, would this do the job?

Im using OpenCV: 2.4.9

Thanks alot!

Update: Do I have to calculate 4 points with the camera facing normal, then 4 points from the bird eye view and pass them to findHomography() to obtain the transformation matrix?

Update: Solved. Got it to work!

like image 855
Sean M. Avatar asked Dec 06 '14 15:12

Sean M.


People also ask

What is an example of a bird's eye view?

a view from a very high place that allows you to see a large area: Climb to the top of the Eiffel Tower if you want a bird's eye view of Paris.

What is bird's eye view in perspective drawing?

A bird's-eye view is an elevated view of an object or location from a very steep viewing angle, creating a perspective as if the observer were a bird in flight looking downwards. Bird's-eye views can be an aerial photograph, but also a drawing, and are often used in the making of blueprints, floor plans and maps.

What is the bird's eye view called?

An overhead shot is when the camera is placed directly above the subject. It's somewhere around a 90-degree angle above the scene taking place. Overhead shots are also called a bird view, bird's eye view, or elevated shot.


1 Answers

A rectangle on the world plane will appear as a quadrangle in your image.
In a bird's eye view, you want it to appear as a rectangle again. You must know at least the aspect ratio of this world rectangle for the top view to be correctly and equally scaled along both axes.

Given the 4 quadrangle 2D points in your image, and the destination rectangle corners (for which you essentially choose the 2D coordinates) you can calculate the homography from your quadrangle to a rectangle and use warpPerspective() to render it.

This is often the easiest way to do it.

You can also go through the camera and matrices themselves. For this you will need to rotate the camera to be above the plane with orthographic projection. See the homography decomposition here.

like image 199
Adi Shavit Avatar answered Sep 23 '22 13:09

Adi Shavit