miop.corresponding_points

Classes

CorrespondingPointsFromDisparity([n_points])

Extract corresponding points from disparity maps.

CorrespondingPointsFromMatches(atol)

Identify corresponding points across an image collection using feature matches.

class miop.corresponding_points.CorrespondingPointsFromDisparity(n_points=10000)[source]

Bases: DAGNode

Extract corresponding points from disparity maps.

This class takes disparity maps (representing the horizontal and vertical displacements between images) as input and computes the corresponding points in the second image based on the disparity information.

n_points

Number of points to extract from the disparity maps.

Type:

int

eval(disparity_maps)[source]

Compute updated corresponding points using disparity maps.

This method iterates over the disparity maps and applies the displacement values from the disparity maps to a grid of points in the first image, removing points that lie outside the image border.

Parameters:

disparity_maps (list of list of np.ndarray) – A nested list of disparity maps. Each face (outer list) contains a list of disparity maps. Each disparity map is a (2, H, W) array representing the x and y displacements respectively.

Returns:

Valid corresponding points across all disparity maps.

Return type:

list of list of np.ndarray

class miop.corresponding_points.CorrespondingPointsFromMatches(atol)[source]

Bases: DAGNode

Identify corresponding points across an image collection using feature matches.

This class takes a series of matched points from multiple images (typically, the output of a feature matching algorithm) and finds feature points that have consistent correspondences across image pairs (e.g., a <-> b, b <-> c implies a <-> b <-> c).

atol

Absolute tolerance for coordinates to be considered equivalent (used for rounding).

Type:

float

eval(matches)[source]

Filter and propagate consistent feature matches across an image sequence.

Parameters:

matches (list of tuple of np.ndarray) – A list of match pairs. Each element is a tuple of two (N, 2) numpy arrays (pts_1, pts_2) representing keypoints matched between two consecutive images.

Returns:

A list of keypoints corresponding across all images, one per image in the sequence.

Return type:

list of np.ndarray

find_duplicates(arr)[source]

Find duplicate (non-unique) 2D points in an array.

Parameters:

arr (np.ndarray) – A 2D array of shape (n, 2), where n is the number of keypoints.

Returns:

Indices of duplicate points.

Return type:

np.ndarray

round_to_nearest_multiple(arr, atol)[source]

Round coordinates to the nearest multiple of the given absolute tolerance.

Parameters:
  • arr (np.ndarray) – Input coordinate array.

  • atol (float) – Absolute tolerance for rounding.

Returns:

Array with coordinates rounded to the nearest multiple of atol.

Return type:

np.ndarray