Mathematica > Data Manipulation > Image Processing & Analysis > Image Filtering & Neighborhood Processing > Structure Matrices & Convolution Kernels >
Mathematica > Mathematics and Algorithms > Matrices and Linear Algebra > Constructing Matrices > Structure Matrices & Convolution Kernels >

BoxMatrix

BoxMatrix[r]
gives a (2 r+1)×(2 r+1) matrix of 1s.
BoxMatrix[r, w]
gives a (2 r+1)×(2 r+1) block of 1s centered in a w×w matrix of 0s.
BoxMatrix[{r1, r2, ...}, ...]
gives a (2 r_1+1) (2 r_2+1) ... array of 1s.
  • BoxMatrix[r] gives a square pattern of 1s extending r positions from the center.
  • The parameter r need not be an integer; elements are 1 if their chessboard distance from the center is not more than |r+1/2|.
  • BoxMatrix[All, w] gives a w×w matrix containing a box shape that is as large as possible.
  • BoxMatrix[..., {w1, w2, ...}] gives a w1×w2×... array.
  • BoxMatrix[{r1, ..., rn}, w] gives a w×...×w array.
  • BoxMatrix[All, {w1, ..., wn}] gives a w1×...×wn array containing a box-shaped region that is as large as possible.
New in 7
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team