imboxfilt3
3-D box filtering of 3-D images
Description
filters 3-D image B
= imboxfilt3(A
,filterSize
)A
with a 3-D box filter of
size filterSize
.
uses name-value arguments to control aspects of the
filtering.B
= imboxfilt3(___,Name,Value
)
Examples
Compute Mean Filter in MRI Volume
Load 3-D image data into the workspace.
volData = load('mri');
vol = squeeze(volData.D);
Filter the image with a 3-D box filter.
localMean = imboxfilt3(vol,[5 5 3]);
Input Arguments
A
— Image to be filtered
3-D numeric array
Image to be filtered, specified as a 3-D numeric array.
If A
contains Infs
or NaNs
,
the behavior of imboxfilt3
is undefined. This can
happen when integral image based filtering is used. To restrict the
propagation of Infs
and NaNs
in
the output, consider using imfilter
instead.
Data Types: single
| double
| int8
| int16
| int32
| uint8
| uint16
| uint32
filterSize
— Size of box filter
3
(default) | positive, odd integer | 3-element vector of positive, odd integers
Size of box filter, specified as a positive odd integer or 3-element vector of positive, odd
integers. If filterSize
is
scalar, then the filter is a cube.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: B = imboxfilt3(A,5,'padding','circular');
Padding
— Padding pattern
'replicate'
(default) | 'circular'
| 'symmetric'
| numeric scalar
Padding pattern, specified as one of the following values or a numeric scalar. If you specify a scalar value, input image pixels outside the bounds of the image are implicitly assumed to have the scalar value.
Value | Description |
---|---|
'circular' | Input image values outside the bounds of the image are computed by implicitly assuming the input image is periodic. |
'replicate' | Input image values outside the bounds of the image are assumed equal to the nearest image border value. |
'symmetric' | Input image values outside the bounds of the image are computed by mirror-reflecting the array across the array border. |
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| char
| string
NormalizationFactor
— Normalization factor applied to box filter
1/filterSize.^3
, if scalar,
and 1/prod(filterSize)
, if vector (default) | numeric scalar
Normalization factor applied to box filter, specified as a numeric scalar.
The default 'NormalizationFactor'
has the effect of a mean filter —
the pixels in the output image are the local means
of the image. To get local area sums, set
'NormalizationFactor'
to
1
. To avoid overflow in such
circumstances, consider using double precision
images by converting the input image to class
double
.
Example: 'NormalizationFactor',1
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
Output Arguments
B
— Filtered image
3-D numeric array
Filtered image, returned as a 3-D numeric array.
Algorithms
imboxfilt
performs filtering using either
convolution-based filtering or integral image filtering, using an
internal heuristic to determine which filtering approach to use.
Extended Capabilities
Thread-Based Environment
Run code in the background using MATLAB® backgroundPool
or accelerate code with Parallel Computing Toolbox™ ThreadPool
.
This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
Version History
Introduced in R2015bR2022b: Support for thread-based environments
imboxfilt3
now supports thread-based
environments.
See Also
Beispiel öffnen
Sie haben eine geänderte Version dieses Beispiels. Möchten Sie dieses Beispiel mit Ihren Änderungen öffnen?
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)