Apply projective or affine transformation to an image
Geometric Transformations
visiongeotforms
The Warp block applies a projective or affine transformation to an image. You can transform the entire image or portions of the image using either a polygonal or rectangular region of interest (ROI).
Port | Input/Output | Description | Supported Data Types |
---|---|---|---|
Image | Input | M-by-N grayscale image or M-by-N-by-3 truecolor image.
|
|
TForm | Input | When you set Transformation matrix source to
When you set Transformation matrix
source to |
|
ROI | Input | When you enable the ROI input port, you can also enable an Err_roi output port to indicate if any part of an ROI is outside the input image. The ROI input port accepts an ROI rectangle, specified as a 4-element vector: [x y width height]. |
|
Image | Output | Transformed image. | Same as input |
Err_roi | Output | Indicates if any part of an ROI is outside the input image. | Boolean |
Input matrix source, specified as either Input port
or
Custom
. If you select
Custom
, you can enter the transformation matrix
parameter in the field that appears with this selection.
Custom transformation matrix, specified as a 3-by-2 or 3-by-3 matrix. This parameters appears
when you set Transformation matrix source to
Custom
.
Interpolation method used to calculate output pixel values, specified as Nearest
neighbor
, Bilinear
, or
Bicubic
. See Nearest Neighbor, Bilinear, and Bicubic Interpolation Methodsfor an
overview of these methods.
Value of the pixels that are outside of the input image, specified as either a scalar value or a 3-element vector.
Source of the output image size, specified as either either Same as input
image
or Custom
. If you select
Custom
, you can specify the bounding box in the field
that appears with this selection.
Position, width, and height of the output image, specified as a 4-element vector:
[x
y
width
height]. This parameter appears when you set Output
image position source to Custom
.
Select this check box to enable the ROI input port. Use this port to specify the rectangular region you want to transform.
Select this check box to enable the Err_roi output port.
[1] Wolberg, George . Digital Image Warping, 3rd edition. IEEE Computer Society Press, 1994.
[2] Hartley, Richard, and Andrew Zisserman. Multiple View Geometry in Computer Vision. 2nd edition. IEEE Computer Society Press, 2003.