Mathematics of photography

502 Views Asked by At

From mathematics perspective, cameras do convert the 3d shapes into 2d shapes in the photos. If we consider a 3D coordinate system X-Y-Z which the origins is the camera (or its lens or things like that) and select direction like this:

enter image description here

Where Blue: X, Green: Y, Red: Z

And say this camera gives us an image with 2D coordination system of X'-Y' with origins at middle:

enter image description here

How it is possible to get a general equation that converts 3D location of every point in X-Y-Z coordination system into Y'-Z' coordination system? Of course the reverse is not simply possible (it is not simply possible to reconstruct 3D objects from 2D image). Hope it makes sense...

2

There are 2 best solutions below

1
On BEST ANSWER

The general equation for how a camera converts a 3D point (x,y,z) specified in the camera's coordinate system (where z is the optical axis), into a 2D point (u,v) are:

u = -fx/z
v = -fy/z

where f is the focal length of the lens. To get meaningful 2D coordinates you may have to multiply by another constant for the sensor size/resolution, you can roll this up into a single value of "f" that represents all linear scaling factors.

0
On

This you want to calculate is named projection. You can check here for the complete article about 3D projection on (in general) 2D.

P.S. And IMHO on the first picture Z should be blue. Because the projection is on X/Y plane and Z is usually used for depth (from point of view of sensor)