mathlanguage-agnosticmatrixcamera-calibrationextrinsic-parameters# How to plot the camera and image positions from camera calibration data?

I have the intrisic and extrinsic parameters of the camera. The extrinsic is a 4 x 4 matrix with rotation and translation.

I have sample data as under, I have this one per camera image taken.

```
2.11e-001 -3.06e-001 -9.28e-001 7.89e-001
6.62e-001 7.42e-001 -9.47e-002 1.47e-001
7.18e-001 -5.95e-001 3.60e-001 3.26e+000
0.00e+000 0.00e+000 0.00e+000 1.00e+000
```

**I would like to plot the image as given on the Matlab calibration toolkit page or
However I'm unable to figure out the Math of how to plot these 2 images.**

The only lead I have is from this page http://en.wikipedia.org/wiki/Camera_resectioning. Which tells me that the camera position can be found by C = − R` . T

Any idea how to achieve this task?

Solution

Assume the corners of the plane that you want to draw are 3x1 column vectors, a = [0 0 0]', b = [w 0 0]', c = [w h 0]' and d = [0 h 0]'.

Assume that the calibration matrix that you provide is A and consists of a rotation matrix R = A(1:3, 1:3) and a translation T = A(1:3, 4).

**To draw the first view**
For every pose A_i with rotation R_i and translation T_i, transform each corner x_w (that is a, b, c or d) of the plane to its coordinates x_c in the camera by

x_c = R_i*x_w + T_i

Then draw the plane with transformed corners.

To draw the camera, its centre of projection in camera coordinates is [0 0 0]' and the camera x axis is [1 0 0]', y axis is [0 1 0]' and z axis is [0 0 1]'.

Note that in the drawing, the camera y-axis is pointing down, so you might want to apply an additional rotation on all the computed coordinates by multiplication with B = [1 0 0; 0 0 1; 0 -1 0].

**Draw the second view**
Drawing the plane is trivial since we are in world coordinates. Just draw the plane using a, b, c and d.

To draw the cameras, each camera centre is c = -R'*T. The camera axes are the rows of the rotation matrix R, so for instance, in the matrix you provided, the x-axis is [2.11e-001 -3.06e-001 -9.28e-001]'. You can also draw a camera by transforming each point x_c given in camera coordinates to world coordinates x_w by x_w = R'*(x_c - T) and draw it.

- Evaluating integral using Riemann sums
- How to use `scipy.integrate.quad` to compute integral of a function which depends on the integral of another function
- Polynomial which satisfies integral and two points
- "Array indices must be positive integers or logical values"
- Integration of sin x dx problem in python programming implementation
- Integration in Python Midpoint Calculation
- How to find arc that connects two segments?
- How to calculate percentage in Kotlin
- Unsupported operand types
- User input based circle drawing, then printing to paper with fixed sizes
- Float number division with 3 decimal places
- Inverting a real-valued index grid
- How to calculate with complex numbers in JavaScript?
- Solve matrix and vector multiplication with parameters instead of values (preferably in python)
- Determine new GPS position using roll, pitch, yaw and length
- Algorithm to locate local maxima
- unsigned long long int pow
- Simple statistics - Java packages for calculating mean, standard deviation, etc
- Arbitrary-precision arithmetic Explanation
- How do I calculate r-squared using Python and Numpy?
- Print all ways to sum n integers so that they total a given sum.
- Prove that (p → q) → ((r ∨ p) → (r ∨ q)) is a tautology without using truth table
- How to implement this Desmos roll function in Unity
- How to compute the centroid of a mesh with triangular faces?
- Different results for XIRR between Excel and ExcelFinancialFunctions 3.2.0
- Efficiently getting all divisors of a given number
- In JavaScript, why does zero divided by zero return NaN, but any other divided by zero return Infinity?
- Python fit line to high dimensional points and sample between them
- How can I compute a dual norm?
- How to pick between 2 numbers