PRODUCTS
Products Overview
Mathematica
Mathematica Student Edition
Mathematica Home Edition
Wolfram
CDF Player
(free download)
Computable Document Format (CDF)
web
Mathematica
grid
Mathematica
Wolfram
Workbench
Wolfram
SystemModeler
Wolfram
Finance Platform
Mathematica
Add-Ons
Wolfram|Alpha Products
SOLUTIONS
Solutions Overview
Engineering
Aerospace Engineering & Defense
Chemical Engineering
Control Systems
Electrical Engineering
Image Processing
Industrial Engineering
Materials Science
Mechanical Engineering
Operations Research
Optics
Petroleum Engineering
Biotechnology & Medicine
Bioinformatics
Medical Imaging
Finance, Statistics & Business Analysis
Actuarial Sciences
Data Analysis & Mining
Econometrics
Economics
Financial Engineering & Mathematics
Financial Risk Management
Statistics
Software Engineering & Content Delivery
Authoring & Publishing
Interface Development
Software Engineering
Web Development
Science
Astronomy
Biological Sciences
Chemistry
Environmental Sciences
Geosciences
Social & Behavioral Sciences
Design, Arts & Entertainment
Game Design, Special Effects & Generative Art
Education
STEM Education Initiative
Higher Education
Community & Technical College Education
Primary & Secondary Education
Students
Technology
Computable Document Format (CDF)
High-Performance & Parallel Computing (HPC)
See Also: Technology Guide
PURCHASE
Online Store
Other Ways to Buy
Volume & Site Licensing
Contact Sales
Software
Service
Upgrades
Training
Books
Merchandise
SUPPORT
Support Overview
Mathematica
Documentation
Knowledge Base
Learning Center
Technical Services
Community & Forums
Training
Does My Site Have a License?
Wolfram User Portal
COMPANY
About Wolfram Research
News
Events
Wolfram Blog
Partnerships
Employment Opportunities
History of
Mathematica
Stephen Wolfram's Home Page
Contact Us
OUR SITES
All Sites
Wolfram|Alpha
Demonstrations Project
MathWorld
Integrator
Wolfram Functions Site
Mathematica Journal
Wolfram Media
Wolfram
Tones
Wolfram Science
Stephen Wolfram
DOCUMENTATION CENTER SEARCH
User's Guide
Area Operations
5.4 Block Processing
In a convolution operation, a finite size filter is scanned over a data array. At each position, a sum of the point-by-point products of the filter samples with the corresponding data samples is calculated. The operator neighborhood is defined by the geometry of the filter. Block processing is a generalization of convolution. The mathematical operators need not be multiplication and addition, and the neighborhoods do not need to overlap. The data operators that lend themselves to this kind of processing are typically called area operators. The processes that can be carried out by area operators include, in addition to convolution and correlation, data resampling, morphological operators, block transforms, noise filtering, and more.
BlockProcessing
[
f
,
img
,
{
n
r
,
n
c
}
]
partitions
img
into non-overlapping blocks of dimensions
{n
r
, n
c
}
and
applies function
f
to each block
BlockProcessing
[
f
,
img
,
{
n
r
,
n
c
}
,
{
d
r
,
d
c
}
]
partitions
img
{n
r
, n
c
}
with offsets
{d
r
, d
c
}
and applies function
f
to each block
BlockProcessing
function.
This loads the package.
In[1]:=
Here we create a small data array.
In[2]:=
Out[2]//MatrixForm=
Here we apply some arbitrary function
f
to each 2×2 non-overlapping block of array
arr
.
In[3]:=
Out[3]=
In practice, the dimensions of the original data array need not be an integer multiple of the block size. Therefore, as in convolution and correlation, padding is used to extend the original data array to ensure that all border samples are processed in exactly the same way as any interior samples. Padding is accomplished with option
PaddingMethod
, the values being the function names of any of the methods described in Section
4.4
.
Option
Default
PaddingMethod
FixedPad
method used to extend the border of the data array
Centered
False
selects one-sided padding of the data array
BlockProcessing
options.
This demonstrates the use of a sliding window and zero-padding.
In[4]:=
Out[4]=
Here we use
BlockProcessing
to return the median pixel value within a 3×3 sliding window using the example
books
image.
In[5]:=
In[6]:=
Out[6]=
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.