PIXELBANKv9.1.0
Menu

Essential Matrix Epipolar Constraint Check

The Essential Matrix EE encodes the geometric relationship between two calibrated camera views. For perfectly corresponding points x1x_1 and x2x_2 (in normalized camera coordinates), the epipolar constraint states:

x2Tβ‹…Eβ‹…x1=0x_2^T \cdot E \cdot x_1 = 0

In practice, due to noise, this product is rarely exactly zero. Your task is to compute this constraint value for given point correspondences.

Given:

  • Essential matrix EE (3Γ—3)
  • Point x1x_1 in normalized coordinates from camera 1: [x,y,1][x, y, 1]
  • Point x2x_2 in normalized coordinates from camera 2: [x,y,1][x, y, 1]

Compute: x2Tβ‹…Eβ‹…x1x_2^T \cdot E \cdot x_1

Return the scalar result rounded to 6 decimal places.

Example:

Input:
E = [[0, 0, -4], [0, 0, 2], [4, -2, 0]]
x1 = [1, 0, 1]
x2 = [1, 0, 1]
Output:
(0.0, True)
Reasoning:
  1. Compute Eβ‹…x1E \cdot x_1: matrix-vector multiplication
  2. Compute x2Tβ‹…(Eβ‹…x1)x_2^T \cdot (E \cdot x_1): dot product
  3. Result is a scalar measuring how well points satisfy epipolar geometry

Constraints:

  • E is a 3Γ—33 \times 3 matrix of floats
  • x1 and x2 are 3x1 vectors in homogeneous coordinates [x, y, 1]
  • Use tolerance of 1e-4 to determine if constraint holds
  • Round scalar result to 4 decimal places
solution.py

Test Results

0/0
Run code to see test results.
Essential Matrix Epipolar Constraint Check - Medium | PixelBank