WOLFRAM
Products
Wolfram|One
Mathematica
Wolfram Notebook Assistant + LLM Kit
Wolfram|Alpha Notebook Edition
System Modeler
All Products
Consulting & Solutions
Wolfram Consulting
Industry Solutions
Solutions for Education
Learning & Support
Wolfram U Courses
Wolfram Language Resources
Wolfram Community
Support FAQs
Contact Support
Company
About Wolfram
Careers
Events
Educational Programs
All Sites and Resources
Wolfram|Alpha
Wolfram Cloud
Your Account
Your Account
User Portal
Search
Close
Enable JavaScript to interact with content and submit forms on Wolfram websites.
Learn how
Legacy Documentation
Digital Image Processing
(2000)
This is documentation for an obsolete product.
Current products and services
Function Index
ConstantPad
ConstantPad[
img
,
{
b
1
,
e
1
},
v
]
pads
img
by repeating the constant
v
b
1
times at the beginning and e
1
times at end of
img
.
ConstantPad[
img
,
{
b
1
,
e
1
},
{
b
2
,
e
2
},
...
,
v
]
pads
img
by replicating the constant
v
b
i
and e
i
times, respectively, at level
i
of
img
.
ConstantPad
returns an array of dimensions given by
N
i
+ b
i
+ e
i
, for i=1,2,...,
ArrayDepth
[
img
]
where N
i
is the
i
th dimension of
img
.
ArrayDepth
of
img
must match the number of {b
i
, e
i
} arguments.
The argument
img
may be any array or
ImageData
expression.
See also User's Guide
4.4
.
New in Version 2.
Examples
This loads the package.
In[1]:=
Here a list is padded on the tail end only.
In[2]:=
Out[2]=
This pads the list on both ends by repeating the constant value 1.
In[3]:=
Out[3]=
This pads the rows and columns on one side only.
In[4]:=
Out[4]//MatrixForm=