Class BilinearMapping2D

java.lang.Object
imagingbook.common.geometry.mappings.nonlinear.BilinearMapping2D
All Implemented Interfaces:
Mapping2D, Cloneable

public class BilinearMapping2D extends Object implements Mapping2D

This class represents a bilinear transformation in 2D with 8 parameters a0, ..., a3, b0, ..., b3 of the form

 x' = a0 * x + a1 * y + a2 * x * y + a3
 y' = b0 * x + b1 * y + b2 * x * y + b3

Note that this is a non-linear transformation because of the mixed term x * y. See Secs. 21.1.5 and 21.3.1 of [1] for details.

[1] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022).

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final double
     
    final double
     
    final double
     
    final double
     
    final double
     
    final double
     
    final double
     
    final double
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    BilinearMapping2D(double a0, double a1, double a2, double a3, double b0, double b1, double b2, double b3)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Applies this mapping to a single 2D point.
    fromPoints(Pnt2d[] P, Pnt2d[] Q)
    Calculates and returns the bilinear mapping M between two point sets P, Q, with 4 points each, such that q_i = M(p_i).
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface imagingbook.common.geometry.mappings.Mapping2D

    applyTo
  • Field Details

    • a0

      public final double a0
    • a1

      public final double a1
    • a2

      public final double a2
    • a3

      public final double a3
    • b0

      public final double b0
    • b1

      public final double b1
    • b2

      public final double b2
    • b3

      public final double b3
  • Constructor Details

    • BilinearMapping2D

      public BilinearMapping2D(double a0, double a1, double a2, double a3, double b0, double b1, double b2, double b3)
  • Method Details

    • fromPoints

      public static BilinearMapping2D fromPoints(Pnt2d[] P, Pnt2d[] Q)
      Calculates and returns the bilinear mapping M between two point sets P, Q, with 4 points each, such that q_i = M(p_i). The inverse mapping is obtained by simply swapping the two point sets.
      Parameters:
      P - the first point sequence
      Q - the second point sequence
      Returns:
      a new bilinear mapping
    • applyTo

      public Pnt2d applyTo(Pnt2d pnt)
      Description copied from interface: Mapping2D
      Applies this mapping to a single 2D point.
      Specified by:
      applyTo in interface Mapping2D
      Parameters:
      pnt - the original point
      Returns:
      the transformed point
    • toString

      public String toString()
      Overrides:
      toString in class Object