Digital Signal Processing Reference
In-Depth Information
Fig. 7
Border processing by
pixel mirroring. Each
rectangle corresponds to a
pixel.
Dashed arrows
represent the pixel mirroring
Mirror
axes
x=0
y=1
x=0
x=1
y=0
y=0
o
(
x
,
y
,
t
)
is the pixel at the coordinates
(
x
,
y
)
within the output image at time
t
,
i
(
x
,
y
,
t
)
is the pixel at the coordinates
(
x
,
y
)
within the input image at time
t
.
(
x
,
y
,
t
)=
i
(
x
,
y
,
t
)
and assume for a moment that
β
1
=
β
2
and
α
1
=
α
2
,
then obviously each output pixel
o
(
x
,
y
,
t
)
is computed from
(
2
·
α
1
+
1
)
·
(
2
·
β
1
+
1
)
pixels centered at the input pixel
i
Hence, only a local subset of
the input image is required to compute an output pixel. In more detail, the filter
represents a
sliding window
algorithm, where a window samples the input image
i
(
2
·
x
,
2
·
y
,
t
)
.
is
window moves by two pixels in horizontal and vertical direction.
While this operation is straightforward when the complete window is situated
within the input image
i
(
x
,
y
,
t
)
, and for each window position, a corresponding output pixel
o
(
x
,
y
,
t
)
(
x
,
y
,
t
)
, computation of output pixel
o
(
x
=
0
,
y
=
0
,
t
)
for
instance depends on the input pixels
i
.Pixels
with negative coordinates are situated outside of the input image and are thus not
for instance set all pixels situated outside the image to a constant value. In this case,
(
x
,
y
,
t
)
,
−
α
≤
x
≤
α
,−
β
≤
y
≤
β
i
(
x
,
y
,
t
)
if 0
≤
x
<
w
i
,
0
≤
y
<
h
i
i
(
,
,
)=
x
y
t
ι
=
const
otherwise
Alternatively, often a mirroring of the pixels at the image border is performed as
i
(
,
,
)=
x
y
t
⎛
⎧
⎨
⎧
⎨
⎞
x
if 0
≤
x
<
w
i
y
if 0
≤
y
<
y
i
⎝
⎠
i
,
,
t
−
x
−
1
if
x
<
0
−
y
−
1
if
y
<
0
⎩
⎩
2
·
w
i
−
1
−
x
if
x
≥
w
i
2
·
h
i
−
1
−
y
if
y
≥
h
i