|
SOLUTIONS
|
Mathematica
>
Data Manipulation
>
Image Processing & Analysis
>
Image Filtering & Neighborhood Processing
>
Structure Matrices & Convolution Kernels
>
ShenCastanMatrix
BUILT-IN MATHEMATICA SYMBOL
ShenCastanMatrix
ShenCastanMatrix[r]
gives a matrix that corresponds to an exponential kernel of radius r.
ShenCastanMatrix[{r,
}]
gives a matrix corresponding to an exponential kernel with radius r and region of support specified by
.
ShenCastanMatrix[r, {n1, n2}]
gives a matrix formed from the ![]()
derivative of the exponential with respect to rows and the ![]()
derivative with respect to columns.
ShenCastanMatrix[r, {{n11, n12}, {n21, n22}, ...}]
gives a matrix formed from the sums of the
and
derivatives.
ShenCastanMatrix[{{r1, r2, ...},
}, ...]
gives an array corresponding to an exponential kernel with radius
in the i
index direction.
Details and OptionsDetails and Options
- ShenCastanMatrix[{r,
}] gives values proportional to
at x index positions from the center, where b is proportional to
, so that a value of
gives approximately 95% of the total area under the exponential. - ShenCastanMatrix[r] uses
. - By default, the elements of ShenCastanMatrix[r] sum to 1.
- ShenCastanMatrix[..., {n1, n2}] constructs derivatives as finite differences.
- ShenCastanMatrix[{Automatic,
, f}, ...] constructs a matrix just large enough to include at least a fraction f of the discrete integral of an exponential in each direction. - ShenCastanMatrix allows any of r,
, and f to be lists, specifying different values for different directions. - For integer r, ShenCastanMatrix[r, ...] yields a
×
matrix. - For noninteger r, the value of r is effectively rounded to an integer.
- Options for ShenCastanMatrix include:
-
WorkingPrecision Automatic the precision with which to compute matrix elements "Standardization" True whether to rescale and shift the matrix to account for truncation - With "Standardization"->True, the elements of ShenCastanMatrix[r] will sum to 1. However, the elements of ShenCastanMatrix[r, {n1, n2, ...}] with at least one nonzero
will sum to 0, and the sum of the elements, weighted in each direction by
times the distance from the origin to the power of
, will be 1.
ExamplesExamplesopen allclose all
Basic Examples (3)Basic Examples (3)
Exponential matrix of radius 20:
| In[1]:= |
| Out[1]= | ![]() |
MatrixPlot of an exponential matrix:
| In[1]:= |
| Out[1]= | ![]() |
| In[1]:= |
| Out[1]= | ![]() |
New in 9
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »



