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
Function Index
WatershedTransform
WatershedTransform[
img
]
returns the watershed transform of the grayscale image
img
.
WatershedTransform[
img
,
markers
]
returns the marker-controlled watershed transform of the grayscale image
img
.
The watershed transform is an image segmentation technique that groups pixels around the local minima of the image and the boundaries of adjacent groupings are located on the ridges separating the minima.
The markers are specified as a list of positions in an
n
-dimensional array with the
n
-tuple {x
i,0
,
x
i,1
,...} denoting the position of the
i
th marker. For the typical case of 2D images, the markers are pairs of integers, the row and column position of each marker, respectively.
The option
ConnectivityNumber
may be used to change the default connectivity settings that depend on the depth of the array (see
NeighborOffsets
for more information). The default setting for 2D arrays is
ConnectivityNumber
→ 8.
WatershedTransform
is an implementation of the Vincent and Soille algorithm, extended to arrays of arbitrary depth.
Custom connectivity settings may be defined using a list of offsets.
The argument
img
may be an array or
ImageData
expression.
See also User's Guide
6.5
.
New in Version 2.
Example
This loads the package.
In[1]:=
This defines an example array.
In[2]:=
Out[2]//MatrixForm=
Here is the watershed transform of the example array.
In[3]:=
Out[3]//MatrixForm=
In[4]:=
Out[4]//MatrixForm=
Users may impose minima on the input array using markers. Here is an example of partitioning the example array into three regions.
In[5]:=
Out[5]//MatrixForm=
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.