Function Index
NeighborOffsets
NeighborOffsets[
n
,
k
]
returns a list of relative offsets of a point in a centered neighborhood for given array depth
n
and order
k
(n≥ k).
The option
ConnectivityNumber
may be used to select one of many typical settings including 4- and 8-connectivity in 2D and 6-, 18-, and 26-connectivity in 3D.
The option
NeighborRange
may be used to select
All
,
"Causal"
, or
"AntiCausal"
subsets of the offsets.
See also User's Guide
6.5
.
New in Version 2.
Examples
Here we load the package.
In[1]:=
Here are all the possible offsets for a point on a plane.
In[2]:=
Out[2]=
In[3]:=
Out[3]=
In[4]:=
Out[4]=
The last two results are examples of neighborhoods with so-called 4- and 8-connectivity, respectively.
In[5]:=
Out[5]=
This shows an 8-connected, causal neighborhood of a sample in 2D. A causal neighborhood includes only those samples that had already been visited in a systematic scanning process. Note that we tacitly assume a left-to-right and top-to-bottom scanning order.
In[6]:=
Out[6]//MatrixForm=
© 2009 Wolfram Research, Inc.
•
Terms of Use
•
Privacy Policy
Sign up for our newsletter: