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 Science
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
Support Articles
Learning Center
Technical Services
Training
Does My Site Have a License?
Wolfram User Portal
COMMUNITY
COMPANY
About Wolfram Research
News
Events
Wolfram Blog
Careers
Stephen Wolfram's Home Page
Contact Us
OUR SITES
All Sites
Wolfram|Alpha
Connected Devices Project
Demonstrations Project
MathWorld
Integrator
Wolfram Functions Site
Mathematica Journal
Wolfram Media
Wolfram
Tones
Wolfram Science
Stephen Wolfram
DOCUMENTATION CENTER SEARCH
Function Index
RegionProcessing
RegionProcessing[
f
,
img
,
roi
]
applies function
f
to the region of
img
selected by
roi
and returns a result with the same structure and dimensions as
img
.
RegionProcessing[{
f
_{1}
,
f
_{2}
,
...
},
img
,
roi
]
threads functions {f
_{1}
, f
_{2}
,...} over the color channels of
img
in the region selected by
roi
and returns a result with the same structure and dimensions as
img
.
RegionProcessing[
f
,
img
,
roi
,
pad
]
applies function
f
to the region of
img
selected by
roi
with margins given by
pad
and returns a result with the same structure and dimensions as
img
.
The argument
roi
may be defined by graphics primitives
Circle
,
Disk
,
Point
,
Line
,
Rectangle
, and
Polygon
, or by a list of integer coordinate pairs (i.e., vertexes of a polygon).
Padding helps eliminate edge effects when operations such as
DiscreteConvolve
are applied to the region-of-interest. Margins defined by
pad
should be at least one less than the dimensions of the filter used in the filtering operation. The argument
pad
must be a pair of integers.
The argument
img
may be a matrix or
ImageData
expression.
See also User's Guide
5.6
.
Modified in Version 2.1.
Examples
This loads the package.
In[1]:=
This creates a small data array.
In[2]:=
Here we use a pure function (see
pure functions tutorial
in Documentation Center) to change the values of all the elements on a major diagonal of matrix
A
to a constant value
a
.
In[3]:=
Out[3]//MatrixForm=
Here, we change the values in an L-shaped region using
Threshold
.
In[4]:=
Out[4]//MatrixForm=
This loads an example color image.
In[5]:=
Here we apply a different function to each channel of a color image. Specifically, in a small rectangular region of the image, every pixel is set to a new constant value (for a more convenient method of changing pixel values in a region-of-interest see
RegionFill
).
In[6]:=
Out[6]//InputForm=
This loads another example image.
In[7]:=
The following calculation demonstrates the difference when region-of-interest processing is performed with and without padding, respectively. Note, in particular, that when padding is used, the effect is a visual blending at the edges of the region-of-interest.
In[8]:=
Out[8]=
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.