PIXELBANKv9.1.0
Menu

Full Pinhole Camera Projection

Project a 3D world point onto 2D image coordinates using the full pinhole camera model with both intrinsic and extrinsic parameters.

The full projection is:

x=K[R∣t]Xwx = K [R | t] X_w

Where:

  • KK is the 3×33 \times 3 intrinsic matrix
  • RR is the 3×33 \times 3 rotation matrix (world to camera)
  • tt is the 3×13 \times 1 translation vector
  • XwX_w is the 3D world point in homogeneous coordinates [X,Y,Z,1]T[X, Y, Z, 1]^T

Steps:

  1. Form the 3×43 \times 4 extrinsic matrix [R∣t][R | t]
  2. Compute the 3×43 \times 4 projection matrix P=K[R∣t]P = K [R | t]
  3. Project: x′=P⋅Xwx' = P \cdot X_w
  4. Normalize: [u,v]=[x′/w′,y′/w′][u, v] = [x'/w', y'/w']

Return [u,v][u, v] rounded to 2 decimal places.

Example:

Input:
world_point = [10.0, 5.0, 20.0]
intrinsic_lambda = [[1000, 0, 500], [0, 1000, 400], [0, 0, 1]]
rotation_omega = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]  # Identity
translation_tau = [0, 0, 5]
Output:
[900.0, 600.0]
Reasoning:
  1. Form extrinsic [R∣t][R|t] as 3×43 \times 4 matrix
  2. Compute P=K⋅[R∣t]P = K \cdot [R|t]
  3. Project: x′=P⋅[5,3,10,1]Tx' = P \cdot [5, 3, 10, 1]^T
  4. Normalize by the third component

Constraints:

  • The world point w will always result in a non-zero lambda after projection
  • Lambda is a valid 3x3 intrinsic matrix
  • Omega is a 3x3 rotation matrix
  • Tau is a 3x1 translation vector
  • All inputs are floating-point numbers
  • Output must be rounded to 4 decimal places
solution.py

Test Results

0/0
Run code to see test results.
Full Pinhole Camera Projection - Medium | PixelBank