You are here : matlabImage Processingmakeresampler

makeresampler() - Image Processing

R = makeresampler(interpolant, padmethod) creates
a separable resampler structure for use with tformarray and imtransform.The interpolant argument specifies
the interpolating kernel that the separable resampler uses. In its
simplest form, interpolant can have any of the
following strings as a value.InterpolantDescription
'cubic' Cubic interpolation
'linear' Linear interpolation
'nearest' Nearest-neighbor interpolation
If you are using a custom interpolating kernel, you can specify interpolant as
a cell array in either of these forms:{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
{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].
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{'nearest', 'linear', {2 KERNEL_TABLE}}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.The padmethod 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 padmethod.Pad MethodDescription
'bound'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 'replicate').
When interpolant is 'nearest',
this pad method produces the same results as 'fill'. 'bound' is
like 'fill', but avoids mixing fill values and
input image values.
'circular'Pads array with circular repetition of elements within
the dimension. Same as padarray.
'fill'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 interpolant is 'nearest',
this pad method produces the same results as 'bound'.
'replicate'Pads array by repeating border elements of array. Same
as padarray.
'symmetric'Pads array with mirror reflections of itself. Same as padarray.
In the case of 'fill', 'replicate', 'circular',
or 'symmetric', the resampling performed by tformarray or imtransform occurs
in two logical steps:Pad the array A infinitely to fill
the entire input transform space.Evaluate the convolution of the padded A with
the resampling kernel at the output points specified by the geometric
map.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.


R = makeresampler(interpolant, padmethod)


{'nearest', 'linear', {2 KERNEL_TABLE}}

Output / Return Value


Alternatives / See Also