Home > freetb4matlab > image > imperspectivewarp.m

imperspectivewarp

PURPOSE ^

% Applies the spatial perspective homogeneous transformation @var{P} to the image @var{im}.

SYNOPSIS ^

function [warped, valid] = imperspectivewarp(im, P, interp = 'bilinear', bbox = 'loose', extrapolation_value = NA)

DESCRIPTION ^

% -*- texinfo -*-
% @deftypefn {Function File} @var{warped} = imperspectivewarp(@var{im}, @var{P}, @var{interp}, @var{bbox}, @var{extrapval})
% @deftypefnx{Function File} [@var{warped}, @var{valid}] = imperspectivewarp(...)
% Applies the spatial perspective homogeneous transformation @var{P} to the image @var{im}.
% The transformation matrix @var{P} must be a 3x3 homogeneous matrix, or 2x2 or 2x3
% affine transformation matrix.
% 
% The resulting image @var{warped} is computed using an interpolation method that
% can be selected through the @var{interp} argument. This must be one
% of the following strings
% @table @code
% @item 'nearest'
% Nearest neighbor interpolation.
% @item 'linear'
% @itemx 'bilinear'
% Bilinear interpolation. This is the default behavior.
% @item 'cubic'
% @itemx 'bicubic'
% Bicubic interpolation.
% @end table
%
% By default the resulting image contains the entire warped image. In some situation
% you only parts of the warped image. The argument @var{bbox} controls this, and can
% be one of the following strings
% @table @code
% @item 'loose'
% The entire warped result is returned. This is the default behavior.
% @item 'crop'
% The central part of the image of the same size as the input image is returned.
% @item 'same'
% The size and coordinate system of the input image is keept.
% @end table
%
% All values of the result that fall outside the original image will
% be set to @var{extrapval}. For images of class @code{double} @var{extrapval}
% defaults to @code{NA} and for other classes it defaults to 0.
%
% The optional output @var{valid} is a matrix of the same size as @var{warped}
% that contains the value 1 in pixels where @var{warped} contains an interpolated
% value, and 0 in pixels where @var{warped} contains an extrapolated value.
% @seealso{imremap, imrotate, imresize, imshear, interp2}
% @end deftypefn

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Fri 22-May-2009 15:13:00 by m2html © 2003