Image Processing Reference
In-Depth Information
a
b
2
3
2
3
0
1
0
1
Fig. 13.4 Example showing how a single stream of energy in a single cell is distributed to
other cells. In this example, the left grid (a) indicates that the energy in cell 0 is pointing in
the direction π/4 with a magnitude of 0.5. The dotted box shows where the “displaced” cell
intersects with its neighbors. The largest intersection of energy stays within the original cell
(cell 0); a tiny amount of energy is pushed into cell 3; and a small amount of energy is pushed
into cells 1 and 2. The right grid (b) shows the distribution of energy from this single cell
moved into its neighbor cells and back into itself.
divided into 10 x 10 cells, then each cell side is
1 in length, and so the magnitude in
a cell is scaled by 1/10th before being displaced. This ensures that a displaced cell
will only ever intersect a cell that is its immediate neighbor (although exceptions to
this constraint may have interesting creative possibilities.) The amount of overlap
between the displaced cell and the cell it intersects with determines how energy is
placed into that cell. An intersection I
.
is simply the amount of overlap be-
tween the displaced cell and another cell (Equation 4). The value of any intersection
can range between 0
(
D
,
C
)
.
0 (no intersection) and 1
.
0 (full overlap).
Area
I
(
D
,
C
)=
(
D
)
Area
(
C
)
/
Area
(
C
)
(13.4)
This value is used to create a “partial” vector
for each
energy stream. This partial is calculated simply by scaling the stream by the amount
it overlaps with the current cell, as defined in Equation 5:
p via a function P
(
N
,
v
,
C
)
P
(
N
,
v
,
C
)=
I
(
D
(
N
,
v
) ,
C
)
v
(13.5)
In Equation 5, N refers to a neighbor cell of a cell C
v refers to one of the
energy vectors ( F , L ,or R ) in that neighbor cell. Figure 13.4 depicts an example of
this displacement and the subsequent generation of partials. For each cell C i , j in G ,
each neighbor is examined to determine how much each of its three streams overlap.
The partials created by any intersection between the neighbor streams are summed
to generate the new energy vector for the cell (Equations 6 through 9). It is important
to note that a cell is considered to be a neighbor of itself. For instance, if a vector
of magnitude 0
G and
5 is pushed upwards at 90 degrees, it would intersect with both the
current cell and the neighbor cell above it. Since the displaced cell would move a
distance of 50% of its height from its current position, it would end up intersecting
the current cell and the neighbor cell equally, and thus a copy of the vector, scaled by
.
Search WWH ::




Custom Search