eolearn.coregistration.coregistration_utilities

Utility function for image co-registration

eolearn.coregistration.coregistration_utilities.ransac(npts, model, n, k, t, d)[source]

Fit model parameters to data using the RANSAC algorithm

This implementation is written from pseudo-code found at http://en.wikipedia.org/w/index.php?title=RANSAC&oldid=116358182

Parameters
  • npts – A set of observed data points

  • model – A model that can be fitted to data points

  • n – The minimum number of data values required to fit the model

  • k – The maximum number of iterations allowed in the algorithm

  • t – A threshold value for determining when a data point fits a model

  • d – The number of close data values required to assert that a model fits well to data

Returns

Model parameters which best fit the data (or None if no good model is found)

eolearn.coregistration.coregistration_utilities.random_partition(n, n_data)[source]

return n random rows of data (and also the other len(data)-n rows)

class eolearn.coregistration.coregistration_utilities.EstimateEulerTransformModel(src_pts, trg_pts)[source]

Bases: object

Estimate Euler transform linear system solved using linear least squares

This class estimates an Euler 2D transformation between two cloud of 2D points using SVD decomposition

Initialise target and source cloud points as Nx2 matrices. The transformation aligning source points to target points is estimated.

Parameters
  • src_pts – Array of source points

  • trg_pts – Array of target points

estimate_rigid_transformation(idx)[source]

Estimate rigid transformation given a set of indices

Parameters

idx – Array of indices used to estimate the transformation

Returns

Estimated transformation matrix

fit(idx)[source]

Estimate Euler transform on points listed in idx

Parameters

idx – Indices used to estimate transformation

Returns

Transformation matrix

score(idx, warp_matrix)[source]

Estimate the registration error of estimated transformation matrix

Parameters
  • idx – List of points used to estimate the transformation

  • warp_matrix – Matrix estimating Euler trasnformation

Returns

Square root of Target Registration Error