Main Content

projective2d

2-D projective geometric transformation

Description

Aprojective2dobject encapsulates a 2-D projective geometric transformation.

Creation

You can create aprojective2dobject using the following methods:

  • fitgeotrans— Estimates a geometric transformation that maps pairs of control points between two images

  • Theprojective2dfunction described here

Description

tform= projective2dcreates aprojective2dobject with default property settings that correspond to the identity transformation.

example

tform= projective2d(A)sets the propertyTwith a valid projective transformation defined by nonsingular matrixA.

Properties

expand all

Forward 2-D projective transformation, specified as a nonsingular 3-by-3 numeric matrix.

The matrixTuses the convention:

[x y 1] = [u v1] * T

whereThas the form:

[a b c;... d e f;... g h i];

The default ofTis the identity transformation.

Data Types:double|single

Dimensionality of the geometric transformation for both input and output points, specified as the value 2.

Object Functions

invert 逆几何变换
outputLimits Find output spatial limits given input spatial limits
transformPointsForward Apply forward geometric transformation
transformPointsInverse Apply inverse geometric transformation

Examples

collapse all

This example shows how to apply rotation and tilt to an image, using aprojective2dgeometric transformation object created directly from a transformation matrix.

Read a grayscale image into the workspace.

I = imread('pout.tif');

Combine rotation and tilt into a transformation matrix,tm. Use this transformation matrix to create aprojective2dgeometric transformation object,tform.

theta = 10; tm = [cosd(theta) -sind(theta) 0.001;...信德(θ)cosd(θ)0.01;...0 0 1]; tform = projective2d(tm);

Apply the transformation usingimwarp. View the transformed image.

outputImage = imwarp(I,tform); imshow(outputImage)

Figure contains an axes object. The axes object contains an object of type image.

Extended Capabilities

Version History

Introduced in R2013a