⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 awgn.figure.fig

📁 mb-ofdm-uwb经本人修改
💻 FIG
字号:
<html><head><title>makeresampler (Image Processing Toolbox)</title><!-- $Revision: 1.8 $  $Date: 2003/04/10 19:59:54 $ --><!-- DOCNAME: Image Processing Toolbox --><!-- CHUNKNAME: makeresampler --><!-- CHAPNAME: makeresampler --><!-- HEADSTUFF --><link rel=stylesheet href="docstyle1.css" type="text/css"></head><body bgcolor=#ffffff><a name="227683"><!-- NAVBARTOP --><table border=0 width="100%" cellpadding=0 cellspacing=0><tr><td valign=baseline bgcolor="#ffe4b0"><b>Image Processing Toolbox</b></td><td valign=baseline bgcolor="#ffe4b0" align=right><a href="makelut.html"><img src="b_prev.gif" alt="Previous page" border=0></a>&nbsp;&nbsp;&nbsp;<a href="maketform.html"><img src="b_next.gif" alt="Next Page" border=0></a></td></tr></table><font size=+3 color="#990000">makeresampler</font><!-- FNAME:makeresampler --><a name="227683"></a><!-- SYNCHTO: referenc.html --><!-- H2 --><a name="227684"></a><br><p><a name="227685"></a>Create resampling structure</p><a name="syntax"></a><!-- H2 --><a name="227686"></a><p><font size=+1 color="#990000"><b>Syntax</b></font><br><ul class=continued><li class=continued><pre><a name="227687"></a>R = makeresampler(<code>interpolant</code>,<code>padmethod</code>)</pre></li></ul><a name="description"></a><!-- H2 --><a name="227688"></a><p><font size=+1 color="#990000"><b>Description</b></font><br><p><a name="249084"></a><code>R = makeresampler(interpolant</code>,<code>padmethod)</code> creates a separable resampler structure for use with <code>tformarray</code> and <code>imtransform</code>. </p><p><a name="262232"></a>The <code>interpolant</code> argument specifies the interpolating kernel that the separable resampler uses. In its simplest form, <code>interpolant</code> can have any of the following strings as a value. <br><br><table Border="2" cellpadding=4 cellspacing=0><caption></caption><tr valign=top><td><a name="265806"></a><b>Interpolant</b><br></td><td><a name="265808"></a><b>Description</b><br></td><tr valign=top><td><a name="265810"></a>'cubic'<br></td><td><a name="268782"></a> Cubic interpolation<br></td><tr valign=top><td><a name="265814"></a>'linear'<br></td><td><a name="265816"></a> Linear interpolation<br></td><tr valign=top><td><a name="265818"></a>'nearest'<br></td><td><a name="265820"></a> Nearest-neighbor interpolation<br></td></table> <Table><tr valign=top><td></Table> </p><p><a name="265358"></a>If you are using a custom interpolating kernel, you can specify <code>interpolant</code> as a cell array in either of these forms:<br><br><table Border="0" cellpadding=5><caption></caption><tr valign=top><td><a name="268566"></a><code>{half_width, positive_half}</code><br></td><td><a name="268568"></a><code>half_width</code> is a positive scalar designating the half width of a symmetric interpolating kernel. <code>positive_half</code> is a vector of values regularly sampling the kernel on the closed interval <code>[0 positive_half]</code>.<br></td><tr valign=top><td><a name="268570"></a><code>{half_width, interp_fcn}</code><br></td><td><a name="268572"></a><code>interp_fcn</code> is a function handle that returns interpolating kernel values, given an array of input values in the interval <br><code>[0 positive_half]</code>.<br></td></table> <Table><tr valign=top><td></Table> </p><p><a name="268620"></a>To specify the interpolation method independently along each dimension, you can combine both types of interpolant specifications. The number of elements in the cell array must equal the number of transform dimensions. For example, if you specify this value for interpolant</p><ul class=continued><li class=continued><pre><a name="268669"></a>{<code>'nearest', 'linear', {2 KERNEL_TABLE}}</code></pre></li></ul><p><a name="268675"></a>the resampler uses nearest-neighbor interpolation along the first transform dimension, linear interpolation along the second dimension, and a custom table-based interpolation along the third.</p><p><a name="279734"></a>The <code>padmethod</code> argument controls how the resampler interpolates or assigns values to output elements that map close to or outside the edge of the input array. The following table lists all the possible values of <code>padmethod</code>.<br><br><table Border="2" cellpadding=4 cellspacing=0><caption></caption><tr valign=top><td><a name="262859"></a><b>Pad Method</b><br></td><td><a name="262861"></a><b>Description</b><br></td><tr valign=top><td><a name="262864"></a>'bound'<br></td><td><a name="268717"></a>Assigns values from the fill value array to points that map outside the array and repeats border elements of the array for points that map inside the array (same as <code>'replicate'</code>). When <code>interpolant</code> is <code>'nearest'</code>, this pad method produces the same results as <code>'fill'</code>. <code>'bound'</code> is like <code>'fill'</code>, but avoids mixing fill values and input image values. <br></td><tr valign=top><td><a name="262869"></a>'circular'<br></td><td><a name="263048"></a>Pads array with circular repetition of elements within the dimension. Same as <code><a href="../../toolbox/images/padarray.html">padarray</a></code>.<br></td><tr valign=top><td><a name="262874"></a>'fill'<br></td><td><a name="263064"></a>Generates an output array with smooth-looking edges (except when using nearest-neighbor interpolation). For output points that map near the edge of the input array (either inside or outside), it combines input image and fill values. When <code>interpolant</code> is <code>'nearest'</code>, this pad method produces the same results as <code>'bound'</code>.<br></td><tr valign=top><td><a name="262879"></a>'replicate'<br></td><td><a name="263052"></a>Pads array by repeating border elements of array. Same as <code>padarray</code>.<br></td><tr valign=top><td><a name="262884"></a>'symmetric'<br></td><td><a name="263056"></a>Pads array with mirror reflections of itself. Same as <code>padarray</code>.<br></td></table> <Table><tr valign=top><td></Table> </p><p><a name="262289"></a>In the case of <code>'fill'</code>, <code>'replicate'</code>, <code>'circular'</code>, or <code>'symmetric'</code>, the resampling performed by <code>tformarray</code> or <code>imtransform</code> occurs in two logical steps: </p><ol start="1"><li><a name="262827"></a>Pad the array <code>A</code> infinitely to fill the entire input transform space.</li><li><a name="262828"></a>Evaluate the convolution of the padded <code>A</code> with the resampling kernel at the output points specified by the geometric map.</li></ol><p><a name="262829"></a>Each nontransform dimension is handled separately. The padding is virtual, (accomplished by remapping array subscripts) for performance and memory efficiency. If you implement a custom resampler, you can implement these behaviors.</p><a name="custom_resamplers"></a><!-- H2 --><a name="227697"></a><p><font size=+1 color="#990000"><b>Custom Resamplers</b></font><br><p><a name="227698"></a>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:</p><ul class=continued><li class=continued><pre><a name="227699"></a>R = <code>makeresampler</code>(PropertyName,PropertyValue,...) </pre></li></ul><p><a name="268831"></a>The <code>makeresampler</code> function supports the following properties. <br><br><table Border="2" cellpadding=4 cellspacing=0><caption></caption><tr valign=top><td><a name="268808"></a><b>Property</b><br></td><td><a name="268810"></a><b>Description</b><br></td><tr valign=top><td><a name="268812"></a>'Type'<br></td><td><a name="268814"></a>Can have the value <code>'separable'</code> or <code>'custom'</code> and must always be supplied. If <code>'Type'</code> is <code>'separable'</code>, the only other properties that can be specified are <code>'Interpolant'</code> and <code>'PadMethod'</code>, and the result is equivalent to using the <code>makeresampler(interpolant,padmethod)</code> syntax. If <code>'Type'</code> is <code>'custom'</code>, you must specify the <code>'NDims'</code> and <code>'ResampleFcn'</code> properties and, optionally, the <code>'CustomData'</code> property. <br></td><tr valign=top><td><a name="268816"></a>'PadMethod'<br></td><td><a name="268818"></a>See the <a href="makeresampler.html#279734"></a><code>padmethod</code> argument for more information.<br></td><tr valign=top><td><a name="268820"></a>'Interpolant'<br></td><td><a name="268822"></a>See the <code><a href="makeresampler.html#262232">interpolant</a></code> argument for more information. <br></td><tr valign=top><td><a name="268824"></a>'NDims'<br></td><td><a name="268826"></a>Positive integer indicating the dimensionality the custom resampler can handle. Use a value of <code>Inf</code> to indicate that the custom resampler can handle any dimension. If <code>'Type'</code> is <code>'custom'</code>, <code>NDims</code> is required.<br></td><tr valign=top><td><a name="268828"></a>'ResampleFcn'<br></td><td><a name="271544"></a>Handle to a function that performs the resampling. The function is called with the following interface.<br><a name="283981"></a><br><ul class=continued><li class=continued><pre><a name="271545"></a>B = resample_fcn(A,M,TDIMS_A,TDIMS_B,FSIZE_A,FSIZE_B,F,R)</pre></li></ul><a name="268830"></a>See the help for <code><a href="../../toolbox/images/tformarray.html">tformarray</a></code> for information about the inputs <code>A</code>, <code>TDIMS_A</code>, <code>TDIMS_B</code>, and <code>F</code>. The argument <code>M</code> is an array that maps the transform subscript space of <code>B</code> to the transform subscript space of <code>A</code>. If <code>A</code> has <code>N</code> transform dimensions <code>(N = length(TDIMS_A))</code> and <code>B</code> has <code>P</code> transform dimensions <code>(P = length(TDIMS_B))</code>, then <code>ndims(M) = P + 1</code>, if <code>N &gt; 1</code> and <code>P</code> if <code>N == 1</code>, and <code>size(M,P + 1) = N</code>.<br><a name="283982"></a><br><a name="277026"></a>The first <code>P</code> dimensions of <code>M</code> correspond to the output transform space, permuted according to the order in which the output transform dimensions are listed in <code>TDIMS_B</code>. (In general <code>TDIMS_A</code> and <code>TDIMS_B</code> need not be sorted in ascending order, although such a limitation might be imposed by specific resamplers.) Thus, the first <code>P</code> elements of <code>size(M)</code> determine the sizes of the transform dimensions of <code>B</code>. The input transform coordinates to which each point is mapped are arrayed across the final dimension of <code>M</code>, following the order given in <code>TDIMS_A</code>. <code>M</code> must be <code>double</code>. <code>FSIZE_A</code> and <code>FSIZE_B</code> are the full sizes of <code>A</code> and <code>B</code>, padded with <code>1</code>'s as necessary to be consistent with <code>TDIMS_A</code>, <code>TDIMS_B</code>, and <code>size(A)</code>.<br></td><tr valign=top><td><a name="268843"></a>'CustomData'<br></td><td><a name="268845"></a>User-defined.<br></td></table> <Table><tr valign=top><td></Table> </p><a name="example"></a><a name="exmpl_sec"></a><!-- H2 --><a name="227710"></a><p><font size=+1 color="#990000"><b>Example</b></font><br><p><a name="277032"></a>Stretch an image in the <em>y</em>-direction using a separable resampler that applies cubic interpolation in the <em>y</em>-direction and nearest-neighbor interpolation in the <em>x</em>-direction. (This is equivalent to, but faster than, applying bicubic interpolation.)</p><ul class=continued><li class=continued><pre><a name="277037"></a>A = imread('moon.tif');<a name="277038"></a>resamp = makeresampler({'nearest','cubic'},'fill');<a name="277039"></a>stretch = maketform('affine',[1 0; 0 1.3; 0 0]);<a name="227711"></a>B = imtransform(A,stretch,resamp);</pre></li></ul><a name="see_also"></a><a name="seeal_sec"></a><!-- H2 --><a name="227712"></a><p><font size=+1 color="#990000"><b>See Also</b></font><br><p><a name="227713"></a><code><a href="../../toolbox/images/imtransform.html">imtransform</a></code>, <code><a href="../../toolbox/images/tformarray.html">tformarray</a></code></p><br><p><table bgcolor="#ffe4b0" border=0 width="100%" cellpadding=0 cellspacing=0><tr valign=top><td align=left width=20><a href="makelut.html"><img src="b_prev.gif" alt="Previous page" border=0 align=bottom></a>&nbsp;</td><td align=left>&nbsp;makelut</td><td>&nbsp;</td><td align=right>maketform&nbsp;</td><td align=right width=20><a href="maketform.html"><img src="b_next.gif" alt="Next page" border=0 align=bottom></a></td></tr></table><br><!-- Copyright (c) 2003 by The MathWorks, Inc. --><!-- Last updated: Thu Apr 10 13:55:43 2003 --></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -