v9.1.1
Menu

Stereo Rectification Check

easyPRODepth EstimationComputer Vision 1

Verify that pairs of corresponding epipolar points from stereo images lie on the same horizontal scanline.

In a properly rectified stereo pair, all epipolar lines are horizontal, meaning corresponding points in the left and right images should have the same (or very close) y-coordinates. This is a fundamental requirement for efficient stereo matching.

Given two lists of corresponding points from the left and right images, check whether each pair satisfies the horizontal alignment condition within a given tolerance ϵ\epsilon:

∣yleft−yright∣≤ϵ|y_{\text{left}} - y_{\text{right}}| \leq \epsilon

Return a list of boolean values, one per pair, indicating whether the pair is properly rectified.

Example

Input
left_points = [[100, 200], [150, 300], [200, 400]]
right_points = [[80, 200], [130, 301], [180, 410]]
tolerance = 2.0
Output
[True, True, False]
Reasoning
  • Inputs: left_points and right_points are matched lists of (x,y)(x, y) pixel coordinates: pair kk is the same 3D point seen by the left and the right camera. tolerance is ϵ=2.0\epsilon = 2.0 pixels of allowed vertical misalignment.
  • Only the yy values matter. The xx values differ by 2020 in every pair (100→80100 \to 80, 150→130150 \to 130, 200→180200 \to 180); that horizontal shift is disparity, which encodes depth and is expected.
  • Pair 1: ∣200−200∣=0≤2.0|200 - 200| = 0 \le 2.0, so it is rectified → True.
  • Pair 2: ∣300−301∣=1≤2.0|300 - 301| = 1 \le 2.0, a one-pixel drift within tolerance → True.
  • Pair 3: ∣400−410∣=10>2.0|400 - 410| = 10 > 2.0, the points sit on different scanlines → False.
  • Output: one boolean per pair, in input order: [True, True, False]. Notice the test is inclusive: a gap of exactly ϵ\epsilon still passes, so with ϵ=0\epsilon = 0 only identical yy values count as rectified.

Constraints

  • left_points: List of [x, y] coordinates from left image
  • right_points: List of [x, y] coordinates from right image
  • tolerance: float (maximum allowed y-coordinate difference)
  • Return: List of True/False values
  • Use pure Python

Learn this in

More from Computer Vision 1

PRO

Editor locked

The code editor is locked for Pro problems. It is only available for free problems. Please upgrade to gain access to the code editor for all problems.

solution.py

Test results

Sign in to run your code against the test cases.