PIXELBANKv9.1.0
Menu

Stereo Rectification Check

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:
  • We iterate over the pairs of corresponding points from the left and right images: left_points and right_points.
  • For each pair, we calculate the absolute difference in y-coordinates: ∣yleft−yright∣|y_{\text{left}} - y_{\text{right}}|.
  • We compare this difference to the given tolerance of 2.0 and check if it satisfies the condition: ∣yleft−yright∣≤ϵ|y_{\text{left}} - y_{\text{right}}| \leq \epsilon.
  • The results of these comparisons are collected in a list, where each element corresponds to a pair of points: [True, True, False].

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
🔒

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

0/0
Run code to see test results.