Function Index
DiscreteConvolve
DiscreteConvolve[
img
,
h
]
returns the circular convolution of
img
and filter
h
.
The option
Circular→True
(the default) returns a circular convolution result that has the same dimensions as
img
.
The option
Circular→False
returns a linear convolution result. The dimensions of the result are larger than the dimensions of original data. Assuming
img
is of dimensions N
r
× N
c
and
h
is of dimensions M
r
× M
c
, the returned result is of dimensions N
r
+M
r
-1 × N
c
+M
c
-1.
TransientSamples
→
False
returns the steady-state samples only.
The option
Centered
positions the steady-state output values in the output array.
The option
Centered
only takes effect if
Circular
→
True.
The option
Centered
→
False
places all the transient samples at the beginning of the output array. Specifically, element {1,1,...} of the result contains
img
1
,
1
,
...
h
1
,
1
,
...
, and element {-1,-1,...} of the result contains
img
-1
,
-1
,
...
h
1
,
1
,
...
.
The option
Centered
→
True
(default) evenly distributes the transient samples at the beginning and end of the output array. Specifically, element {1,1,...} of the result contains
, and element {-1,-1,...} of the result contains
.
The argument
img
may be a vector, matrix, or
ImageData
expression.
The argument
ker
may be a vector or matrix.
The
TensorRank
of
ker
and the raw image data in
img
must be equal.
See also User's Guide
5.2
.
Examples
This loads the package.
In[1]:=
This defines a 1D signal
sig
and an impulse response
ker
.
In[2]:=
This returns a circular convolution result.
In[3]:=
Out[3]//TableForm=
This returns a linear convolution result.
In[4]:=
Out[4]//TableForm=
This returns the steady-state values only (note that this result is independent of option
Circular
).
In[5]:=
Out[5]//TableForm=
Here we blur a picture by convolving with a moving average filter. First we define the filter and load an example image.
In[6]:=
In[7]:=
Here we display the original and blurred images.
In[8]:=
© 2008 Wolfram Research, Inc.
•
Terms of Use
•
Privacy Policy
Sign up for our newsletter: