Imp
[using it]
Interface Manipulation Package v4.0 (2008-06-25) a-projector ©copyright Author


imp.ima.util
Class Rectification

java.lang.Object
  extended by imp.ima.util.RgbFilter
      extended by imp.ima.util.Rectification

public class Rectification
extends RgbFilter

Defines the rectification algorithm on RGB or channel buffers.

Computes the sub-image defined by an affine/projective transform. H[3x3]/HA[3x2] is the transformation matrix such that
 . x<-(H[0] x + H[1] y + H[2])/(H[6] x + H[7] y + H[8])
 . y<-(H[3] x + H[4] y + H[5])/(H[6] x + H[7] y + H[8])
If the matrix is of size 3x2 the denominator is omitted.


Constructor Summary
Rectification(double[] H)
          Constructs a rectification function.
 
Method Summary
static double[] points2H(int x, int y, int w, int h, int width, int height)
          Returns the collineation defined by a rectangle.
static double[] points2H(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int width, int height)
          Returns the collineation defined by a quadrilateral.
 
Methods inherited from class imp.ima.util.RgbFilter
filterChannel, getChannel, getChannel, getRGB, getRGB
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Rectification

public Rectification(double[] H)
Constructs a rectification function.

Method Detail

points2H

public static double[] points2H(int x,
                                int y,
                                int w,
                                int h,
                                int width,
                                int height)
Returns the collineation defined by a rectangle.
of center (x,y) and dimension (w,h). These points are mapped to [(0,0),(width-1,0),(width-1,height-1),(0,height-1)].


points2H

public static double[] points2H(int x1,
                                int y1,
                                int x2,
                                int y2,
                                int x3,
                                int y3,
                                int x4,
                                int y4,
                                int width,
                                int height)
Returns the collineation defined by a quadrilateral.
(x1,y1),(x2,y2),(x3,y3),(x4,y4) are the corners defining the quadrilateral. These points are mapped to [(0,0),(width-1,0),(width-1,height-1),(0,height-1)].