A 2D perspective (or projective) transform.
A 2D perspective (or projective) transform.
A perspective transformation is capable of mapping an arbitrary quadrilateral into another arbitrary quadrilateral, while preserving the straightness of lines. Unlike an affine transformation, the parallelism of lines in the source is not necessarily preserved in the output.
Such a coordinate transformation can be represented by a 3x3 matrix which transforms homogeneous source coordinates
(x, y, 1)
into destination coordinates (x', y', w)
.
To convert back into non-homogeneous coordinates (X, Y), x'
and y'
are divided by w
.
[ x'] [ m00 m01 m02 ] [ x ] [ m00x + m01y + m02 ] [ y'] = [ m10 m11 m12 ] [ y ] = [ m10x + m11y + m12 ] [ w ] [ m20 m21 m22 ] [ 1 ] [ m20x + m21y + m22 ] x' = (m00x + m01y + m02) y' = (m10x + m11y + m12) w = (m20x + m21y + m22) X = x' / w Y = y' / w
This implementation was inspired by Java Advanced Imaging.
Internal utilities.
Helper methods for working with ImageJ.
Tools for converting images between AWT and JavaFX.
Factory methods for creating projective transforms.
Clip input value to range suitable for an 8-bit unsigned integer: 0 to 255.
Clip input value to range suitable for an 8-bit unsigned integer: 0 to 255.
Values in the range will be rounded to the closest integer. Values less than 0 will be set to 0. Values greater than 255 will be set to 255.
Clip all elements of the input array to range suitable for an 8-bit unsigned integer: 0 to 255.
Clip all elements of the input array to range suitable for an 8-bit unsigned integer: 0 to 255.
Values in the range will be rounded to the closest integer. Values less than 0 will be set to 0. Values greater than 255 will be set to 255.
Clip input value to the range if an 8-bit unsigned integer: 0 to 255, but do not modify decimal places within the range.
Clip input value to the range if an 8-bit unsigned integer: 0 to 255, but do not modify decimal places within the range.
Values in the range will not be changed. Values less than 0 will be set to 0. Values greater than 255 will be set to 255.
Clip input value to the range if an 8-bit unsigned integer: 0 to 255, but do not modify decimal places within the range.
Clip input value to the range if an 8-bit unsigned integer: 0 to 255, but do not modify decimal places within the range.
Values in the range will not be changed. Values less than 0 will be set to 0. Values greater than 255 will be set to 255.
Distance between points.
Distance between points. For points in CIE L*a*b* color space it is equivalent to delta E 1974.
first point.
second point.
distance
Various utility methods.