ArticleslgStudy

mathematics

Camera matrix

Camera matrix is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Camera matrix rather than just read about it. In short: In computer vision a camera matrix or (camera) projection matrix is a 3×4 matrix which describes the mapping of a pinhole camera from 3D points in the world to 2D points in an image. Let 𝐱 be a representation of a 3D point in homogeneous coordinates (a 4-dimensional vector), and let 𝐲 be a representation of the image of this point in the pinhole camera (a 3-dimensional vector).

Key takeaways

  • Camera matrix belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Camera matrix to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Camera matrix from memory before moving on to harder problems.

Reference excerpt

In computer vision a camera matrix or (camera) projection matrix is a 3×4 matrix which describes the mapping of a pinhole camera from 3D points in the world to 2D points in an image. Let 𝐱 be a representation of a 3D point in homogeneous coordinates (a 4-dimensional vector), and let 𝐲 be a representation of the image of this point in the pinhole camera (a 3-dimensional vector). Then the following relation holds

𝐲∼𝐂𝐱 where 𝐂 is the camera matrix and the ∼ sign implies that the left and right hand sides are equal except for a multiplication by a non-zero scalar k≠0:

𝐲=k𝐂𝐱. Since the camera matrix 𝐂 is involved in the mapping between elements of two projective spaces, it too can be regarded as a projective element. This means that it has only 11 degrees of freedom since any multiplication by a non-zero scalar results in an equivalent camera matrix.

Derivation The mapping from the coordinates of a 3D point P to the 2D image coordinates of the point's projection onto the image plane, according to the pinhole camera model, is given by

(y1y2)=fx3(x1x2) where (x1,x2,x3) are the 3D coordinates of P relative to a camera centered coordinate system, (y1,y2) are the resulting image coordinates, and f is the camera's focal length for which we assume f > 0. Furthermore, we also assume that x3 > 0. To derive the camera matrix, the expression above is rewritten in terms of homogeneous coordinates. Instead of the 2D vector (y1,y2) we consider the projective element (a 3D vector) 𝐲=(y1,y2,1) and instead of equality we consider equality up to scaling by a non-zero number, denoted ∼. First, we write the homogeneous image coordinates as expressions in the usual 3D coordinates.

(y1y21)=(fx3x1fx3x21)∼(x1x2x3f) Finally, also the 3D coordinates are expressed in a homogeneous representation 𝐱 and this is how the camera matrix appears:

(y1y21)∼(10000100001f0)(x1x2x31) or 𝐲∼𝐂𝐱 where 𝐂 is the camera matrix, which here is given by

𝐂=(10000100001f0), and the corresponding camera matrix now becomes

𝐂=(10000100001f0)∼(f0000f000010) The last step is a consequence of 𝐂 itself being a projective element. The camera matrix derived here may appear trivial in the sense that it contains very few non-zero elements. This depends to a large extent on the particular coordinate systems which have been chosen for the 3D and 2D points. In practice, however, other forms of camera matrices are common, as will be shown below.

Camera position The camera matrix 𝐂 derived in the previous section has a null space which is spanned by the vector

𝐧=(0001) This is also the homogeneous representation of the 3D point which has coordinates (0,0,0), that is, the "camera center" (aka the entrance pupil; the position of the pinhole of a pinhole camera) is at O. This means that the camera center (and only this point) cannot be mapped to a point in the image plane by the camera (or equivalently, it maps to all points on the image as every ray on the image goes through this point). For any other 3D point with x3=0, the result 𝐲∼𝐂𝐱 is well-defined and has the form 𝐲=(y1y20)⊤. This corresponds to a point at infinity in the projective image plane (even though, if the image plane is taken to be a Euclidean plane, no corresponding intersection point exists).

Normalized camera matrix and normalized image coordinates The camera matrix derived above can be simplified even further if we assume that f = 1:

𝐂0=(100001000010)=(𝐈𝟎) where 𝐈 here denotes a 3×3 identity matrix. Note that 3×4 matrix 𝐂 here is divided into a concatenation of a 3×3 matrix and a 3-dimensional vector. The camera matrix 𝐂0 is sometimes referred to as a canonical form. So far all points in the 3D world have been represented in a camera centered coordinate system, that is, a coordinate system which has its origin at the camera center (the location of the pinhole of a pinhole camera). In practice however, the 3D points may be represented in terms of coordinates relative to an arbitrary coordinate system (X1', X2', X3'). Assuming that the camera coordinate axes (X1, X2, X3) and the axes (X1', X2', X3') are of Euclidean type (orthogonal and isotropic), there is a unique Euclidean 3D transformation (rotation and translation) between the two coordinate systems. In other words, the camera is not necessarily at the origin looking along the z axis. The two operations of rotation and translation of 3D coordinates can be represented as the two 4×4 matrices

(𝐑𝟎𝟎1) and (𝐈𝐭𝟎1) where 𝐑 is a 3×3 rotation matrix and 𝐭 is a 3-dimensional translation vector. When the first matrix is multiplied onto the homogeneous representation of a 3D point, the result is the homogeneous representation of the rotated point, and the second matrix performs instead a translation. Performing the two operations in sequence, i.e. first the rotation and then the translation (with translation vector given in the already rotated coordinate system), gives a combined rotation and translation matrix

(𝐑𝐭𝟎1) Assuming that 𝐑 and 𝐭 are precisely the rotation and translations which relate the two coordinate system (X1,X2,X3) and (X1',X2',X3') above, this implies that

𝐱=(𝐑𝐭𝟎1)𝐱′ where 𝐱′ is the homogeneous representation of the point P in the coordinate system (X1',X2',X3'). Assuming also that the camera matrix is given by 𝐂0, the mapping from the coordinates in the (X1,X2,X3) system to homogeneous image coordinates becomes

𝐲∼𝐂0𝐱=(𝐈𝟎)(𝐑𝐭𝟎1)𝐱′=(𝐑𝐭)𝐱′ Consequently, the camera matrix which relates points in the coordinate system (X1',X2',X3') to image coordinates is

𝐂N=(𝐑𝐭) a concatenation of a 3D rotation matrix and a 3-dimensional translation vector. This type of camera matrix is referred to as a normalized camera matrix, it assumes focal length = 1 and that image coordinates are measured in a coordinate system where the origin is located at the intersection between axis X3 and the image plane and has the same units as the 3D coordinate system. The resulting image coordinates are referred to as normalized image coordinates.

The camera position Again, the null space of the normalized camera matrix, 𝐂N described above, is spanned by the 4-dimensional vector

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Camera matrix

Start with the simplest possible case. Write down what Camera matrix claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Camera matrix before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Camera matrix ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Camera matrix

In research
Camera matrix appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Camera matrix in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Camera matrix is common in secondary-school and first-year university syllabi. It links to neighbouring topics Geometry in computer vision, so understanding it makes those chapters shorter.
In everyday life
Look for Camera matrix outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Camera matrix” →

How to study Camera matrix in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Camera matrix means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Camera matrix out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Camera matrix in simple terms?

In computer vision a camera matrix or (camera) projection matrix is a 3×4 matrix which describes the mapping of a pinhole camera from 3D points in the world to 2D points in an image. Let 𝐱 be a representation of a 3D point in homogeneous coordinates (a 4-dimensional vector), and let 𝐲 be a repres…

Why does Camera matrix matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Camera matrix?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Camera matrix.

Tags

  • Geometry in computer vision

Keep exploring