>> help makeresampler
MAKERESAMPLER Create resampling structure.
R = MAKERESAMPLER(INTERPOLANT,PADMETHOD) creates a separable
resampler structure for use with TFORMARRAY and IMTRANSFORM.
In its simplest form, INTERPOLANT can be one of these strings:
'nearest', 'linear', or 'cubic'. INTERPOLANT specifies the
interpolating kernel that the separable resampler uses. PADMETHOD
can be one of these strings: 'replicate', 'symmetric', 'circular',
'fill', or 'bound'. PADMETHOD controls how the resampler to
interpolates or assigns values to output elements that map close
to or outside the edge of input array.
PADMETHOD options
-----------------
In the case of 'fill', 'replicate', 'circular', or 'symmetric',
the resampling performed by TFORMARRAY or IMTRANSFORM occurs in
two logical steps: (1) pad A infinitely to fill the entire input
transform space, then (2) evaluate the convolution of the padded
A with the resampling kernel at the output points specified by
the geometric map. Each non-transform dimension is handled
separately. The padding is virtual, (accomplished by remapping
array subscripts) for performance and memory efficiency.
'circular', 'replicate', and 'symmetric' have the same meanings as
in PADARRAY as applied to the transform dimensions of A:
'replicate' -- Repeats the outermost elements
'circular' -- Repeats A circularly
'symmetric' -- Mirrors A repeatedly.
'fill' generates an output array with smooth-looking edges (except
when using nearest neighbor interpolation) because for output points
that map near the edge of the input array (either inside or outside),
it combines input image and fill values .
'bound' is like 'fill', but avoids mixing fill values and input image
values. Points that map outside are assigned values from the fill
value array. Points that map inside are treated as with 'replicate'.
'bound' and 'fill' produce identical results when INTERPOLANT is
'nearest'.
It is up to the user to implement these behaviors in the case of a
custom resampler.
Advanced options for INTERPOLANT
--------------------------------
In general, INTERPOLANT can have one of these forms:
1. One of these strings: 'nearest', 'linear', 'cubic'
2. A cell array: {HALF_WIDTH, POSITIVE_HALF}
HALF_WIDTH is a positive scalar designating the half width of
a symmetric interpolating kernel. POSITIVE_HALF is a vector
of values regularly sampling the kernel on the closed interval
[0 POSITIVE_HALF].
3. A cell array: {HALF_WIDTH, INTERP_FCN}
INTERP_FCN is a function handle that returns interpolating
kernel values given an array of input values in the interval
[0 POSITIVE_HALF].
4. A cell array whose elements are one of the three forms above.
Forms 2 and 3 are used to interpolate with a custom interpolating
kernel. Form 4 is used to specify the interpolation method
independently along each dimension. The number of elements in the
cell array for form 4 must equal the number of transform dimensions.
For example, if INTERPOLANT is {'nearest', 'linear', {2
KERNEL_TABLE}}, then the resampler will use nearest-neighbor
interpolation along the first transform dimension, linear
interpolation along the second, and a custom table-based
interpolation along the third.
Custom resamplers
-----------------
The syntaxes described above construct a resampler structure that
uses the separable resampler function that ships with the Image
Processing Toolbox. It is also possible to create a resampler
structure that uses a user-written resampler by using this syntax:
R = MAKERESAMPLER(PropertyName,PropertyValue,...). PropertyName can
be 'Type', 'PadMethod', 'Interpolant', 'NDims', 'ResampleFcn', or
'CustomData'.
'Type' can be either 'separable' or 'custom' and must always be
supplied. If 'Type' is 'separable', the only other properties that can
be specified are 'Interpolant' and 'PadMethod', and the result is
equivalent to using the MAKERESAMPLER(INTERPOLANT,PADMETHOD) syntax.
If 'Type' is 'custom', then 'NDims' and 'ResampleFcn' are required
properties, and 'CustomData' is optional. 'NDims' is a positive
integer and indicates what dimensionality the custom resampler can
handle. Use a value of Inf to indicate that the custom resampler can
handle any dimension. The value of 'CustomData' is unconstrained.
'ResampleFcn' is a handle to a function that performs the resampling.
The function will be called with the following interface:
B = RESAMPLE_FCN(A,M,TDIMS_A,TDIMS_B,FSIZE_A,FSIZE_B,F,R)
See the help for TFORMARRAY for information on the inputs A, TDIMS_A,
TDIMS_B, and F.
M is an array that maps the transform subscript space of B to the
transform subscript space of A. If A has N transform dimensions (N =
length(TDIMS_A)) and B has P transform dimensions (P = length(TDIMS_B)),
then NDIMS(M) = P + 1 if N > 1 and P if N == 1, and SIZE(M, P + 1) =
N. The first P dimensions of M correspond to the output transform
space, permuted according to the order in which the output transform
dimensions are listed in TDIMS_B. (In general TDIMS_A and TDIMS_B need
not be sorted in ascending order, although such a limitation may be
imposed by specific resamplers.) Thus the first P elements of SIZE(M)
determine the sizes of the transform dimensions of B. The input
transform coordinates to which each point is mapped are arrayed across
the final dimension of M, following the order given in TDIMS_A. M must
be double.
FSIZE_A and FSIZE_B are the full sizes of A and B, padded with 1s as
necessary to be consistent with TDIMS_A, TDIMS_B, and SIZE(A).
Example
-------
Stretch an image in the y-direction using separable resampler that
applies in cubic interpolation in the y-direction and nearest
neighbor interpolation in the x-direction. (This is equivalent to,
but faster than, applying bicubic interpolation.)
A = imread('moon.tif');
resamp = makeresampler({'nearest','cubic'},'fill');
stretch = maketform('affine',[1 0; 0 1.3; 0 0]);
B = imtransform(A,stretch,resamp);
See also imtransform, tformarray.
Reference page in Help browser
doc makeresampler
Saturday, November 24, 2007
A very important function of spatial transformation
>>help findbounds
FINDBOUNDS Find output bounds for spatial transformation.
OUTBOUNDS = FINDBOUNDS(TFORM,INBOUNDS) estimates the output bounds
corresponding to a given spatial transformation and a set of input
bounds. TFORM is a spatial transformation structure as returned by
MAKETFORM or CP2TFORM. INBOUNDS is 2-by-NUM_DIMS matrix. The first row
of INBOUNDS specifies the lower bounds for each dimension, and the
second row specifies the upper bounds. NUM_DIMS has to be consistent
with the ndims_in field of TFORM.
OUTBOUNDS has the same form as INBOUNDS. It is an estimate of the
smallest rectangular region completely containing the transformed
rectangle represented by the input bounds. Since OUTBOUNDS is only an
estimate, it may not completely contain the transformed input rectangle.
Notes
-----
IMTRANSFORM uses FINDBOUNDS to compute the 'OutputBounds' parameter
if the user does not provide it.
If TFORM contains a forward transformation (a nonempty forward_fcn
field), then FINDBOUNDS works by transforming the vertices of the input
bounds rectangle and then taking minimum and maximum values of the
result.
If TFORM does not contain a forward transformation, then FINDBOUNDS
estimates the output bounds using the Nelder-Mead optimization
function FMINSEARCH. If the optimization procedure fails, FINDBOUNDS
issues a warning and returns OUTBOUNDS=INBOUNDS.
Example
-------
inbounds = [0 0; 1 1]
tform = maketform('affine',[2 0 0; .5 3 0; 0 0 1])
outbounds = findbounds(tform, inbounds)
See also cp2tform, imtransform, maketform, tformarray, tformfwd, tforminv.
Reference page in Help browser
doc findbounds
FINDBOUNDS Find output bounds for spatial transformation.
OUTBOUNDS = FINDBOUNDS(TFORM,INBOUNDS) estimates the output bounds
corresponding to a given spatial transformation and a set of input
bounds. TFORM is a spatial transformation structure as returned by
MAKETFORM or CP2TFORM. INBOUNDS is 2-by-NUM_DIMS matrix. The first row
of INBOUNDS specifies the lower bounds for each dimension, and the
second row specifies the upper bounds. NUM_DIMS has to be consistent
with the ndims_in field of TFORM.
OUTBOUNDS has the same form as INBOUNDS. It is an estimate of the
smallest rectangular region completely containing the transformed
rectangle represented by the input bounds. Since OUTBOUNDS is only an
estimate, it may not completely contain the transformed input rectangle.
Notes
-----
IMTRANSFORM uses FINDBOUNDS to compute the 'OutputBounds' parameter
if the user does not provide it.
If TFORM contains a forward transformation (a nonempty forward_fcn
field), then FINDBOUNDS works by transforming the vertices of the input
bounds rectangle and then taking minimum and maximum values of the
result.
If TFORM does not contain a forward transformation, then FINDBOUNDS
estimates the output bounds using the Nelder-Mead optimization
function FMINSEARCH. If the optimization procedure fails, FINDBOUNDS
issues a warning and returns OUTBOUNDS=INBOUNDS.
Example
-------
inbounds = [0 0; 1 1]
tform = maketform('affine',[2 0 0; .5 3 0; 0 0 1])
outbounds = findbounds(tform, inbounds)
See also cp2tform, imtransform, maketform, tformarray, tformfwd, tforminv.
Reference page in Help browser
doc findbounds
Friday, November 23, 2007
2d homography 终于成功
对于同一图景的两张图片,如果摄取的相机的光心发生变化,则对于这两张图片并不存在一个homography去建立两者的变换. 但是,如果所摄取的途径近似在同一个平面上,则这个变换是存在的(情形1).
另外一种情形,如果光心不变,相机在这种情况下对于任何图景拍摄一系列图片,则图片间的homography是存在的,利用这种办法可以建立panorama(情形2).
MVG这本书上面提供了一个例子,通过四个点对,建立一堵墙的两个图像之间的变换关系,这个题目基本跟matlab提供的遥感图像很类似,但是我试了好几次,结果就是不对,其原因现在已经查明,1 四对点精度不够,用18对点效果很好 2 根据四对点计算的2d homography,我自己的解好像是错误的。matlab
另外一种情形,如果光心不变,相机在这种情况下对于任何图景拍摄一系列图片,则图片间的homography是存在的,利用这种办法可以建立panorama(情形2).
MVG这本书上面提供了一个例子,通过四个点对,建立一堵墙的两个图像之间的变换关系,这个题目基本跟matlab提供的遥感图像很类似,但是我试了好几次,结果就是不对,其原因现在已经查明,1 四对点精度不够,用18对点效果很好 2 根据四对点计算的2d homography,我自己的解好像是错误的。matlab
Registering an Aerial Photo to an Orthophoto
http://www.mathworks.com/products/demos/shipping/images/ipexaerial.html?product=IP
Registering an Aerial Photo to an Orthophoto
Two images of the same scene can only be compared directly if they are in the same coordinate system. Image registration is the process of transforming one image into the coordinate system of another image.
=============
Step 1: Read Images
The image westconcordorthophoto.png is an orthophoto that has already been registered to the ground. The image westconcordaerial.png is unregistered as it was taken from an airplane and is distorted relative to the orthophoto.
unregistered = imread('westconcordaerial.png');
figure, imshow(unregistered)
text(size(unregistered,2),size(unregistered,1)+15, ...
'Image courtesy of mPower3/Emerge', ...
'FontSize',7,'HorizontalAlignment','right');
注意:
由于在matlab中有两套坐标系统,所以要注意不要混淆,参见Image Processing Toolbox pp2-37
简单的说,对于pixel coordinate system (r,c) r--向下为增加 c--向右为增加
对于 spatial coordinate system (x,y) x--向右为增加, y--向下为增加
|--------c 第二坐标
|
|
|
|r 第一坐标
|--------x 第一坐标
|
|
|
|y 第二坐标
text(size(unregistered,2),size(unregistered,1)+15, ...
这句话使得pixel coordinate system 转换到spatial coordinate system,即在图片右下角偏下15个坐标单位的地方写上一条注释。由于HorizontalAlignment被选择为right,所以这条注释的最后一个字出现在这个坐标的位置上。为理解它,不妨试试下面的两条命令的效果
>> text(size(unregistered,2),size(unregistered,1)+15, ...
'Image courtesy of mPower3/Emerge', ...
'FontSize',7,'HorizontalAlignment','left');
>> text(size(unregistered,2),size(unregistered,1)+15, ...
'Image courtesy of mPower3/Emerge', ...
'FontSize',7,'HorizontalAlignment','center');
这样一来,我们对这段代码就有了透辟的理解.
registeredOriginal = imread('westconcordorthophoto.png');
figure, imshow(registeredOriginal)
text(size(registeredOriginal,2),size(registeredOriginal,1)+15, ...
'Image courtesy of Massachusetts Executive Office of Environmental Affairs', ...
'FontSize',7,'HorizontalAlignment','right');
这段代码无需解释,是以完全同样的方式打开另外一幅图像.
===========
Step 2: Load and Add Control Points
Four pairs of control points have already been picked. Load these points from a MAT-file. If you want to proceed with these points, go to Step 3: Infer Geometric Transformation.
load westconcordpoints
Optionally, edit or add to the pre-picked points using the Control Point Selection Tool (cpselect). cpselect helps you pick pairs of corresponding control points. Control points are landmarks that you can find in both images, like a road intersection, or a natural feature. The unregistered image is an RGB image but cpselect only takes grayscale images, so you will pass it one plane of the RGB image.
cpselect(unregistered(:,:,1),'westconcordorthophoto.png',...
input_points,base_points)
Save control points by choosing the File menu, then the Save Points to Workspace option. Save the points, overwriting variables input_points and base_points.
利用工具,选择对应点,已经选好四对.
顺便说一句,cpselect中cp的意思是control point.
========
四个非特殊位置的点决定一个projective变换,下面就利用我们选就的四对点来求出这个变换。
Step 3: Infer Geometric Transformation
Because we know that the unregistered image was taken from an airplane, and the topography is relatively flat, it is likely that most of the distortion is projective. cp2tform will find the parameters of the projective distortion that best fits the stray input_points and base_points you picked.
t_concord = cp2tform(input_points,base_points,'projective');
顺便指出,利用
>>t_concord.tdata.T
,可以得到
ans =
0.9109 0.1412 -0.0001
-0.1323 0.8718 0.0001
65.8746 13.5141 0.9955
这就是依赖这四对点,求出的变换关系.
========
Step 4: Transform Unregistered Image
Even though the points were picked on one plane of the unregistered image, you can transform the entire RGB image. imtransform will apply the same transformation to each plane. Note that the choice of 'XData' and 'YData' values ensures the registered image will be aligned with the orthophoto.
info = imfinfo('westconcordorthophoto.png');
registered = imtransform(unregistered,t_concord,...
'XData',[1 info.Width], 'YData',[1 info.Height]);
=============
Step 5: View Registered Image
figure, imshow(registered)
Compare this visually to the orthophoto and to the unregistered image. Try going back to Step 2: Choose Control Points and using more than four pairs of points. Are the results better? What if the points are clumped together?
If you want to experiment with larger images, follow the steps above to register concordaerial.png to concordorthophoto.png.
Registering an Aerial Photo to an Orthophoto
Two images of the same scene can only be compared directly if they are in the same coordinate system. Image registration is the process of transforming one image into the coordinate system of another image.
=============
Step 1: Read Images
The image westconcordorthophoto.png is an orthophoto that has already been registered to the ground. The image westconcordaerial.png is unregistered as it was taken from an airplane and is distorted relative to the orthophoto.
unregistered = imread('westconcordaerial.png');
figure, imshow(unregistered)
text(size(unregistered,2),size(unregistered,1)+15, ...
'Image courtesy of mPower3/Emerge', ...
'FontSize',7,'HorizontalAlignment','right');
注意:
由于在matlab中有两套坐标系统,所以要注意不要混淆,参见Image Processing Toolbox pp2-37
简单的说,对于pixel coordinate system (r,c) r--向下为增加 c--向右为增加
对于 spatial coordinate system (x,y) x--向右为增加, y--向下为增加
|--------c 第二坐标
|
|
|
|r 第一坐标
|--------x 第一坐标
|
|
|
|y 第二坐标
text(size(unregistered,2),size(unregistered,1)+15, ...
这句话使得pixel coordinate system 转换到spatial coordinate system,即在图片右下角偏下15个坐标单位的地方写上一条注释。由于HorizontalAlignment被选择为right,所以这条注释的最后一个字出现在这个坐标的位置上。为理解它,不妨试试下面的两条命令的效果
>> text(size(unregistered,2),size(unregistered,1)+15, ...
'Image courtesy of mPower3/Emerge', ...
'FontSize',7,'HorizontalAlignment','left');
>> text(size(unregistered,2),size(unregistered,1)+15, ...
'Image courtesy of mPower3/Emerge', ...
'FontSize',7,'HorizontalAlignment','center');
这样一来,我们对这段代码就有了透辟的理解.
registeredOriginal = imread('westconcordorthophoto.png');
figure, imshow(registeredOriginal)
text(size(registeredOriginal,2),size(registeredOriginal,1)+15, ...
'Image courtesy of Massachusetts Executive Office of Environmental Affairs', ...
'FontSize',7,'HorizontalAlignment','right');
这段代码无需解释,是以完全同样的方式打开另外一幅图像.
===========
Step 2: Load and Add Control Points
Four pairs of control points have already been picked. Load these points from a MAT-file. If you want to proceed with these points, go to Step 3: Infer Geometric Transformation.
load westconcordpoints
Optionally, edit or add to the pre-picked points using the Control Point Selection Tool (cpselect). cpselect helps you pick pairs of corresponding control points. Control points are landmarks that you can find in both images, like a road intersection, or a natural feature. The unregistered image is an RGB image but cpselect only takes grayscale images, so you will pass it one plane of the RGB image.
cpselect(unregistered(:,:,1),'westconcordorthophoto.png',...
input_points,base_points)
Save control points by choosing the File menu, then the Save Points to Workspace option. Save the points, overwriting variables input_points and base_points.
利用工具,选择对应点,已经选好四对.
顺便说一句,cpselect中cp的意思是control point.
========
四个非特殊位置的点决定一个projective变换,下面就利用我们选就的四对点来求出这个变换。
Step 3: Infer Geometric Transformation
Because we know that the unregistered image was taken from an airplane, and the topography is relatively flat, it is likely that most of the distortion is projective. cp2tform will find the parameters of the projective distortion that best fits the stray input_points and base_points you picked.
t_concord = cp2tform(input_points,base_points,'projective');
顺便指出,利用
>>t_concord.tdata.T
,可以得到
ans =
0.9109 0.1412 -0.0001
-0.1323 0.8718 0.0001
65.8746 13.5141 0.9955
这就是依赖这四对点,求出的变换关系.
========
Step 4: Transform Unregistered Image
Even though the points were picked on one plane of the unregistered image, you can transform the entire RGB image. imtransform will apply the same transformation to each plane. Note that the choice of 'XData' and 'YData' values ensures the registered image will be aligned with the orthophoto.
info = imfinfo('westconcordorthophoto.png');
registered = imtransform(unregistered,t_concord,...
'XData',[1 info.Width], 'YData',[1 info.Height]);
=============
Step 5: View Registered Image
figure, imshow(registered)
Compare this visually to the orthophoto and to the unregistered image. Try going back to Step 2: Choose Control Points and using more than four pairs of points. Are the results better? What if the points are clumped together?
If you want to experiment with larger images, follow the steps above to register concordaerial.png to concordorthophoto.png.
Wednesday, November 21, 2007
Performing General 2-D Spatial Transformations
http://www.mathworks.com/access/helpdesk/help/toolbox/images/index.html?/access/helpdesk/help/toolbox/images/f12-26140.html
不共线三点决定一个affine homography
任意三点不共线四点决定一个projective homography
help maketform
MAKETFORM Create spatial transformation structure (TFORM).
T = MAKETFORM(TRANSFORMTYPE,...) creates a multidimensional spatial
transformation structure (a 'TFORM struct') that can be used with
TFORMFWD, TFORMINV, FLIPTFORM, IMTRANSFORM, or TFORMARRAY.
TRANSFORMTYPE can be 'affine', 'projective', 'custom', 'box', or
'composite'. Spatial transformations are also called geometric
transformations.
T = MAKETFORM('affine',A) builds a TFORM struct for an N-dimensional
affine transformation. A is a nonsingular real (N+1)-by-(N+1) or
(N+1)-by-N matrix. If A is (N+1)-by-(N+1), then the last column
of A must be [zeros(N,1); 1]. Otherwise, A is augmented automatically
such that its last column is [zeros(N,1); 1]. A defines a forward
transformation such that TFORMFWD(U,T), where U is a 1-by-N vector,
returns a 1-by-N vector X such that X = U * A(1:N,1:N) + A(N+1,1:N).
T has both forward and inverse transformations.
T = MAKETFORM('projective',A) builds a TFORM struct for an N-dimensional
projective transformation. A is a nonsingular real (N+1)-by-(N+1)
matrix. A(N+1,N+1) cannot be 0. A defines a forward transformation
such that TFORMFWD(U,T), where U is a 1-by-N vector, returns a 1-by-N
vector X such that X = W(1:N)/W(N+1), where W = [U 1] * A. T has
both forward and inverse transformations.
T = MAKETFORM('affine',U,X) builds a TFORM struct for a
two-dimensional affine transformation that maps each row of U
to the corresponding row of X. U and X are each 3-by-2 and
define the corners of input and output triangles. The corners
may not be collinear.
T = MAKETFORM('projective',U,X) builds a TFORM struct for a
two-dimensional projective transformation that maps each row of U
to the corresponding row of X. U and X are each 4-by-2 and
define the corners of input and output quadrilaterals. No three
corners may be collinear.
T = MAKETFORM('custom',NDIMS_IN,NDIMS_OUT,FORWARD_FCN,INVERSE_FCN,
TDATA) builds a custom TFORM struct based on user-provided function
handles and parameters. NDIMS_IN and NDIMS_OUT are the numbers of
input and output dimensions. FORWARD_FCN and INVERSE_FCN are
function handles to forward and inverse functions. Those functions
must support the syntaxes X = FORWARD_FCN(U,T) and U =
INVERSE_FCN(X,T), where U is a P-by-NDIMS_IN matrix whose rows are
points in the transformation's input space, and X is a
P-by-NDIMS_OUT matrix whose rows are points in the transformation's
output space. TDATA can be any MATLAB array and is typically used to
store parameters of the custom transformation. It is accessible to
FORWARD_FCN and INVERSE_FNC via the "tdata" field of T. Either
FORWARD_FCN or INVERSE_FCN can be empty, although at least
INVERSE_FCN must be defined to use T with TFORMARRAY or IMTRANSFORM.
T = MAKETFORM('composite',T1,T2,...,TL) or T = MAKETFORM('composite',
[T1 T2 ... TL]) builds a TFORM whose forward and inverse functions
are the functional compositions of the forward and inverse functions
of the T1, T2, ..., TL. For example, if L = 3 then TFORMFWD(U,T) is
the same as TFORMFWD(TFORMFWD(TFORMFWD(U,T3),T2),T1). The components
T1 through TL must be compatible in terms of the numbers of input and
output dimensions. T has a defined forward transform function only
if all of the component transforms have defined forward transform
functions. T has a defined inverse transform function only if all of
the component functions have defined inverse transform functions.
T = MAKETFORM('box',TSIZE,LOW,HIGH) or T = MAKETFORM('box',INBOUNDS,
OUTBOUNDS) builds an N-dimensional affine TFORM struct, T. TSIZE is
an N-element vector of positive integers, and LOW and HIGH are also
N-element vectors. The transformation maps an input "box" defined
by the opposite corners ONES(1,N) and TSIZE or, alternatively, by
corners INBOUNDS(1,:) and INBOUND(2,:) to an output box defined by
the opposite corners LOW and HIGH or OUTBOUNDS(1,:) and OUTBOUNDS(2,:).
LOW(K) and HIGH(K) must be different unless TSIZE(K) is 1, in which
case the affine scale factor along the K-th dimension is assumed to be
1.0. Similarly, INBOUNDS(1,K) and INBOUNDS(2,K) must be different
unless OUTBOUNDS(1,K) and OUTBOUNDS(1,K) are the same, and vice versa.
The 'box' TFORM is typically used to register the row and column
subscripts of an image or array to some "world" coordinate system.
Example
-------
Make and apply an affine transformation.
T = maketform('affine',[.5 0 0; .5 2 0; 0 0 1]);
tformfwd([10 20],T);
I = imread('cameraman.tif');
transformedI = imtransform(I,T);
figure, imshow(I), figure, imshow(transformedI)
See also fliptform, imtransform, tformarray, tformfwd, tforminv.
Reference page in Help browser
doc maketform
不共线三点决定一个affine homography
任意三点不共线四点决定一个projective homography
help maketform
MAKETFORM Create spatial transformation structure (TFORM).
T = MAKETFORM(TRANSFORMTYPE,...) creates a multidimensional spatial
transformation structure (a 'TFORM struct') that can be used with
TFORMFWD, TFORMINV, FLIPTFORM, IMTRANSFORM, or TFORMARRAY.
TRANSFORMTYPE can be 'affine', 'projective', 'custom', 'box', or
'composite'. Spatial transformations are also called geometric
transformations.
T = MAKETFORM('affine',A) builds a TFORM struct for an N-dimensional
affine transformation. A is a nonsingular real (N+1)-by-(N+1) or
(N+1)-by-N matrix. If A is (N+1)-by-(N+1), then the last column
of A must be [zeros(N,1); 1]. Otherwise, A is augmented automatically
such that its last column is [zeros(N,1); 1]. A defines a forward
transformation such that TFORMFWD(U,T), where U is a 1-by-N vector,
returns a 1-by-N vector X such that X = U * A(1:N,1:N) + A(N+1,1:N).
T has both forward and inverse transformations.
T = MAKETFORM('projective',A) builds a TFORM struct for an N-dimensional
projective transformation. A is a nonsingular real (N+1)-by-(N+1)
matrix. A(N+1,N+1) cannot be 0. A defines a forward transformation
such that TFORMFWD(U,T), where U is a 1-by-N vector, returns a 1-by-N
vector X such that X = W(1:N)/W(N+1), where W = [U 1] * A. T has
both forward and inverse transformations.
T = MAKETFORM('affine',U,X) builds a TFORM struct for a
two-dimensional affine transformation that maps each row of U
to the corresponding row of X. U and X are each 3-by-2 and
define the corners of input and output triangles. The corners
may not be collinear.
T = MAKETFORM('projective',U,X) builds a TFORM struct for a
two-dimensional projective transformation that maps each row of U
to the corresponding row of X. U and X are each 4-by-2 and
define the corners of input and output quadrilaterals. No three
corners may be collinear.
T = MAKETFORM('custom',NDIMS_IN,NDIMS_OUT,FORWARD_FCN,INVERSE_FCN,
TDATA) builds a custom TFORM struct based on user-provided function
handles and parameters. NDIMS_IN and NDIMS_OUT are the numbers of
input and output dimensions. FORWARD_FCN and INVERSE_FCN are
function handles to forward and inverse functions. Those functions
must support the syntaxes X = FORWARD_FCN(U,T) and U =
INVERSE_FCN(X,T), where U is a P-by-NDIMS_IN matrix whose rows are
points in the transformation's input space, and X is a
P-by-NDIMS_OUT matrix whose rows are points in the transformation's
output space. TDATA can be any MATLAB array and is typically used to
store parameters of the custom transformation. It is accessible to
FORWARD_FCN and INVERSE_FNC via the "tdata" field of T. Either
FORWARD_FCN or INVERSE_FCN can be empty, although at least
INVERSE_FCN must be defined to use T with TFORMARRAY or IMTRANSFORM.
T = MAKETFORM('composite',T1,T2,...,TL) or T = MAKETFORM('composite',
[T1 T2 ... TL]) builds a TFORM whose forward and inverse functions
are the functional compositions of the forward and inverse functions
of the T1, T2, ..., TL. For example, if L = 3 then TFORMFWD(U,T) is
the same as TFORMFWD(TFORMFWD(TFORMFWD(U,T3),T2),T1). The components
T1 through TL must be compatible in terms of the numbers of input and
output dimensions. T has a defined forward transform function only
if all of the component transforms have defined forward transform
functions. T has a defined inverse transform function only if all of
the component functions have defined inverse transform functions.
T = MAKETFORM('box',TSIZE,LOW,HIGH) or T = MAKETFORM('box',INBOUNDS,
OUTBOUNDS) builds an N-dimensional affine TFORM struct, T. TSIZE is
an N-element vector of positive integers, and LOW and HIGH are also
N-element vectors. The transformation maps an input "box" defined
by the opposite corners ONES(1,N) and TSIZE or, alternatively, by
corners INBOUNDS(1,:) and INBOUND(2,:) to an output box defined by
the opposite corners LOW and HIGH or OUTBOUNDS(1,:) and OUTBOUNDS(2,:).
LOW(K) and HIGH(K) must be different unless TSIZE(K) is 1, in which
case the affine scale factor along the K-th dimension is assumed to be
1.0. Similarly, INBOUNDS(1,K) and INBOUNDS(2,K) must be different
unless OUTBOUNDS(1,K) and OUTBOUNDS(1,K) are the same, and vice versa.
The 'box' TFORM is typically used to register the row and column
subscripts of an image or array to some "world" coordinate system.
Example
-------
Make and apply an affine transformation.
T = maketform('affine',[.5 0 0; .5 2 0; 0 0 1]);
tformfwd([10 20],T);
I = imread('cameraman.tif');
transformedI = imtransform(I,T);
figure, imshow(I), figure, imshow(transformedI)
See also fliptform, imtransform, tformarray, tformfwd, tforminv.
Reference page in Help browser
doc maketform
Monday, November 19, 2007
Windows快捷键大全
Windows快捷键大全
一、常见用法:
F1 显示当前程序或者windows的帮助内容。
F2 当你选中一个文件的话,这意味着“重命名”
F3 当你在桌面上的时候是打开“查找:所有文件” 对话框
F10或ALT 激活当前程序的菜单栏
windows键或CTRL+ESC 打开开始菜单
CTRL+ALT+DELETE 在win9x中打开关闭程序对话框
DELETE 删除被选择的选择项目,如果是文件,将被放入回收站
SHIFT+DELETE 删除被选择的选择项目,如果是文件,将被直接删除而不是放入回收站
CTRL+N 新建一个新的文件
CTRL+O 打开“打开文件”对话框
CTRL+P 打开“打印”对话框
CTRL+S 保存当前操作的文件
CTRL+X 剪切被选择的项目到剪贴板
CTRL+INSERT 或 CTRL+C 复制被选择的项目到剪贴板
SHIFT+INSERT 或 CTRL+V 粘贴剪贴板中的内容到当前位置
ALT+BACKSPACE 或 CTRL+Z 撤销上一步的操作
ALT+SHIFT+BACKSPACE 重做上一步怀废牟僮?br>
Windows键+M 最小化所有被打开的窗口。
Windows键+CTRL+M 重新将恢复上一项操作前窗口的大小和位置
Windows键+E 打开资源管理器
Windows键+F 打开“查找:所有文件”对话框
Windows键+R 打开“运行”对话框
Windows键+BREAK 打开“系统属性”对话框
Windows键+CTRL+F 打开“查找:计算机”对话框
SHIFT+F10或鼠标右击 打开当前活动项目的快捷菜单
SHIFT 在放入CD的时候按下不放,可以跳过自动播放CD。在打开word的时候按下不放
,可以跳过自启动的宏
ALT+F4 关闭当前应用程序
ALT+SPACEBAR 打开程序最左上角的菜单
ALT+TAB 切换当前程序
ALT+ESC 切换当前程序
ALT+ENTER 将windows下运行的MSDOS窗口在窗口和全屏幕状态间切换
PRINT SCREEN 将当前屏幕以图象方式拷贝到剪贴板
ALT+PRINT SCREEN 将当前活动程序窗口以图象方式拷贝到剪贴板
CTRL+F4 关闭当前应用程序中的当前文本(如word中)
CTRL+F6 切换到当前应用程序中的下一个文本(加shift 可以跳到前一个窗口)
在IE中:
ALT+RIGHT ARROW 显示前一页(前进键)
ALT+LEFT ARROW 显示后一页(后退键)
CTRL+TAB 在页面上的各框架中切换(加shift反向)
F5 刷新
CTRL+F5 强行刷新 目的快捷键
激活程序中的菜单栏 F10
执行菜单上相应的命令 ALT+菜单上带下划线的字母 关闭多文档界面程序中的当
前窗口 CTRL+ F4
关闭当前窗口或退出程序 ALT+ F4
复制 CTRL+ C
剪切 CTRL+ X
删除 DELETE
显示所选对话框项目的帮助 F1
显示当前窗口的系统菜单 ALT+空格键
显示所选项目的快捷菜单 SHIFT+ F10
显示“开始”菜单 CTRL+ ESC
显示多文档界面程序的系统
菜单 ALT+连字号(-)
粘贴 CTR L+ V
切换到上次使用的窗口或者
按住 ALT然后重复按TAB,
切换到另一个窗口 ALT+ TAB
撤消 CTRL+ Z
二、使用“Windows资源管理器”的快捷键
目的快捷键
如果当前选择展开了,要折
叠或者选择父文件夹左箭头
折叠所选的文件夹 NUM LOCK+负号(-)
如果当前选择折叠了,要展开
或者选择第一个子文件夹右箭头
展开当前选择下的所有文件夹 NUM LOCK+*
展开所选的文件夹 NUM LOCK+加号(+)
在左右窗格间切换 F6
三、使用 WINDOWS键
可使用 Microsoft自然键盘或含有 Windows徽标键的其他任何兼容键盘的以下快捷键。
目的快捷键
在任务栏上的按钮间循环 WINDOWS+ TAB
显示“查找:所有文件” WINDOWS+ F
显示“查找:计算机” CTRL+ WINDOWS+ F
显示“帮助” WINDOWS+ F1
显示“运行”命令 WINDOWS+ R
显示“开始”菜单 WINDOWS
显示“系统属性”对话框 WINDOWS+ BREAK
显示“Windows资源管理器” WINDOWS+ E
最小化或还原所有窗口 WINDOWS+ D
撤消最小化所有窗口 SHIFT+ WINDOWS+ M
四、使用“我的电脑”和“Windows资源管理器”的快捷键
目的快捷键
关闭所选文件夹及其所有父
文件夹按住 SHIFT键再单击“关闭按钮(仅适用于“我的电脑”)
向后移动到上一个视图 ALT+左箭头
向前移动到上一个视图 ALT+右箭头
查看上一级文件夹 BACKSPACE
五、使用对话框中的快捷键
目的快捷键
取消当前任务 ESC
如果当前控件是个按钮,要
单击该按钮或者如果当前控
件是个复选框,要选择或清
除该复选框或者如果当前控
件是个选项按钮,要单击该
选项空格键
单击相应的命令 ALT+带下划线的字母
单击所选按钮 ENTER
在选项上向后移动 SHIFT+ TAB
在选项卡上向后移动 CTRL+ SHIFT+ TAB
在选项上向前移动 TAB
在选项卡上向前移动 CTRL+ TAB
如果在“另存为”或“打开”
对话框中选择了某文件夹,
要打开上一级文件夹 BACKSPACE
在“另存为”或“打开”对
话框中打开“保存到”或
“查阅” F4
刷新“另存为”或“打开”
对话框 F5
六、使用“桌面”、“我的电脑”和“Windows资源管理器”快捷键
选择项目时,可以使用以下快捷键。
目的快捷键
插入光盘时不用“自动播放”
功能按住 SHIFT插入 CD-ROM
复制文件按住 CTRL拖动文件
创建快捷方式按住 CTRL+SHIFT拖动文件
立即删除某项目而不将其放入 SHIFT+DELETE
“回收站”
显示“查找:所有文件” F3
显示项目的快捷菜单 APPLICATION键
刷新窗口的内容 F5
重命名项目 F2
选择所有项目 CTRL+ A
查看项目的属性 ALT+ ENTER或 ALT+双击
可将 APPLICATION键用于 Microsoft自然键盘或含有 APPLICATION键的其他兼容键
七、Microsoft放大程序的快捷键
这里运用Windows徽标键和其他键的组合。
快捷键目的
Windows徽标+PRINT SCREEN将屏幕复制到剪贴板(包括鼠标光标)
Windows徽标+SCROLL LOCK将屏幕复制到剪贴板(不包括鼠标光标)
Windows徽标+ PAGE UP切换反色。
Windows徽标+ PAGE DOWN切换跟随鼠标光标
Windows徽标+向上箭头增加放大率
Windows徽标+向下箭头减小放大率
八、使用辅助选项快捷键
目的快捷键
切换筛选键开关右SHIFT八秒
切换高对比度开关左ALT+左SHIFT+PRINT SCREEN
切换鼠标键开关左ALT+左SHIFT+NUM LOCK
切换粘滞键开关 SHIFT键五次
切换切换键开关 NUM LOCK五秒
一、常见用法:
F1 显示当前程序或者windows的帮助内容。
F2 当你选中一个文件的话,这意味着“重命名”
F3 当你在桌面上的时候是打开“查找:所有文件” 对话框
F10或ALT 激活当前程序的菜单栏
windows键或CTRL+ESC 打开开始菜单
CTRL+ALT+DELETE 在win9x中打开关闭程序对话框
DELETE 删除被选择的选择项目,如果是文件,将被放入回收站
SHIFT+DELETE 删除被选择的选择项目,如果是文件,将被直接删除而不是放入回收站
CTRL+N 新建一个新的文件
CTRL+O 打开“打开文件”对话框
CTRL+P 打开“打印”对话框
CTRL+S 保存当前操作的文件
CTRL+X 剪切被选择的项目到剪贴板
CTRL+INSERT 或 CTRL+C 复制被选择的项目到剪贴板
SHIFT+INSERT 或 CTRL+V 粘贴剪贴板中的内容到当前位置
ALT+BACKSPACE 或 CTRL+Z 撤销上一步的操作
ALT+SHIFT+BACKSPACE 重做上一步怀废牟僮?br>
Windows键+M 最小化所有被打开的窗口。
Windows键+CTRL+M 重新将恢复上一项操作前窗口的大小和位置
Windows键+E 打开资源管理器
Windows键+F 打开“查找:所有文件”对话框
Windows键+R 打开“运行”对话框
Windows键+BREAK 打开“系统属性”对话框
Windows键+CTRL+F 打开“查找:计算机”对话框
SHIFT+F10或鼠标右击 打开当前活动项目的快捷菜单
SHIFT 在放入CD的时候按下不放,可以跳过自动播放CD。在打开word的时候按下不放
,可以跳过自启动的宏
ALT+F4 关闭当前应用程序
ALT+SPACEBAR 打开程序最左上角的菜单
ALT+TAB 切换当前程序
ALT+ESC 切换当前程序
ALT+ENTER 将windows下运行的MSDOS窗口在窗口和全屏幕状态间切换
PRINT SCREEN 将当前屏幕以图象方式拷贝到剪贴板
ALT+PRINT SCREEN 将当前活动程序窗口以图象方式拷贝到剪贴板
CTRL+F4 关闭当前应用程序中的当前文本(如word中)
CTRL+F6 切换到当前应用程序中的下一个文本(加shift 可以跳到前一个窗口)
在IE中:
ALT+RIGHT ARROW 显示前一页(前进键)
ALT+LEFT ARROW 显示后一页(后退键)
CTRL+TAB 在页面上的各框架中切换(加shift反向)
F5 刷新
CTRL+F5 强行刷新 目的快捷键
激活程序中的菜单栏 F10
执行菜单上相应的命令 ALT+菜单上带下划线的字母 关闭多文档界面程序中的当
前窗口 CTRL+ F4
关闭当前窗口或退出程序 ALT+ F4
复制 CTRL+ C
剪切 CTRL+ X
删除 DELETE
显示所选对话框项目的帮助 F1
显示当前窗口的系统菜单 ALT+空格键
显示所选项目的快捷菜单 SHIFT+ F10
显示“开始”菜单 CTRL+ ESC
显示多文档界面程序的系统
菜单 ALT+连字号(-)
粘贴 CTR L+ V
切换到上次使用的窗口或者
按住 ALT然后重复按TAB,
切换到另一个窗口 ALT+ TAB
撤消 CTRL+ Z
二、使用“Windows资源管理器”的快捷键
目的快捷键
如果当前选择展开了,要折
叠或者选择父文件夹左箭头
折叠所选的文件夹 NUM LOCK+负号(-)
如果当前选择折叠了,要展开
或者选择第一个子文件夹右箭头
展开当前选择下的所有文件夹 NUM LOCK+*
展开所选的文件夹 NUM LOCK+加号(+)
在左右窗格间切换 F6
三、使用 WINDOWS键
可使用 Microsoft自然键盘或含有 Windows徽标键的其他任何兼容键盘的以下快捷键。
目的快捷键
在任务栏上的按钮间循环 WINDOWS+ TAB
显示“查找:所有文件” WINDOWS+ F
显示“查找:计算机” CTRL+ WINDOWS+ F
显示“帮助” WINDOWS+ F1
显示“运行”命令 WINDOWS+ R
显示“开始”菜单 WINDOWS
显示“系统属性”对话框 WINDOWS+ BREAK
显示“Windows资源管理器” WINDOWS+ E
最小化或还原所有窗口 WINDOWS+ D
撤消最小化所有窗口 SHIFT+ WINDOWS+ M
四、使用“我的电脑”和“Windows资源管理器”的快捷键
目的快捷键
关闭所选文件夹及其所有父
文件夹按住 SHIFT键再单击“关闭按钮(仅适用于“我的电脑”)
向后移动到上一个视图 ALT+左箭头
向前移动到上一个视图 ALT+右箭头
查看上一级文件夹 BACKSPACE
五、使用对话框中的快捷键
目的快捷键
取消当前任务 ESC
如果当前控件是个按钮,要
单击该按钮或者如果当前控
件是个复选框,要选择或清
除该复选框或者如果当前控
件是个选项按钮,要单击该
选项空格键
单击相应的命令 ALT+带下划线的字母
单击所选按钮 ENTER
在选项上向后移动 SHIFT+ TAB
在选项卡上向后移动 CTRL+ SHIFT+ TAB
在选项上向前移动 TAB
在选项卡上向前移动 CTRL+ TAB
如果在“另存为”或“打开”
对话框中选择了某文件夹,
要打开上一级文件夹 BACKSPACE
在“另存为”或“打开”对
话框中打开“保存到”或
“查阅” F4
刷新“另存为”或“打开”
对话框 F5
六、使用“桌面”、“我的电脑”和“Windows资源管理器”快捷键
选择项目时,可以使用以下快捷键。
目的快捷键
插入光盘时不用“自动播放”
功能按住 SHIFT插入 CD-ROM
复制文件按住 CTRL拖动文件
创建快捷方式按住 CTRL+SHIFT拖动文件
立即删除某项目而不将其放入 SHIFT+DELETE
“回收站”
显示“查找:所有文件” F3
显示项目的快捷菜单 APPLICATION键
刷新窗口的内容 F5
重命名项目 F2
选择所有项目 CTRL+ A
查看项目的属性 ALT+ ENTER或 ALT+双击
可将 APPLICATION键用于 Microsoft自然键盘或含有 APPLICATION键的其他兼容键
七、Microsoft放大程序的快捷键
这里运用Windows徽标键和其他键的组合。
快捷键目的
Windows徽标+PRINT SCREEN将屏幕复制到剪贴板(包括鼠标光标)
Windows徽标+SCROLL LOCK将屏幕复制到剪贴板(不包括鼠标光标)
Windows徽标+ PAGE UP切换反色。
Windows徽标+ PAGE DOWN切换跟随鼠标光标
Windows徽标+向上箭头增加放大率
Windows徽标+向下箭头减小放大率
八、使用辅助选项快捷键
目的快捷键
切换筛选键开关右SHIFT八秒
切换高对比度开关左ALT+左SHIFT+PRINT SCREEN
切换鼠标键开关左ALT+左SHIFT+NUM LOCK
切换粘滞键开关 SHIFT键五次
切换切换键开关 NUM LOCK五秒
Subscribe to:
Posts (Atom)