# 2
Binary Image Processing
ECE 253a
Pamela Cosman
9/26/11
Binary (Morphological) Image Processing
For the ring of pixels on the left below, it is intuitive to say that all of the black pixels are connected, and they divide
the white pixels into those
interior
to the ring, and those
exterior
to the ring. All of the white interior pixels are
connected to each other. Also, all of the white exterior pixels are connected to each other.
What about the ambiguous ring on the right?
PATH:
A
path
from the pixel at [
i
0
, j
0
] to the pixel at [
i
n
, j
n
] is a sequence of pixel indices [
i
0
, j
0
], [
i
1
, j
1
],
. . .
,
[
i
n
, j
n
] such that the pixel at [
i
k
, j
k
] is a neighbor of the pixel at [
i
k
+1
, j
k
+1
]. If the neighbor relation uses 4-
connection, then the path is a 4-path. For 8-connection, the path is an 8-path.
FOREGROUND:
The set of all 1 pixels in an image is called the
foreground
, and is denoted
S
.
CONNECTED:
A pixel p in the foreground is said to be
connected
to a pixel q in the foreground if there exists a
path from p to q consisting entirely of pixels in the foreground.
Note that connectivity is an equivalence relation. For any 3 pixels
p
,
q
,
r
in
S
, we have the following properties:
1. Pixel
p
is connected to
p
(reflexivity)
2. If
p
is connected to
q
, then
q
is connected to
p
(commutativity)
3. If
p
is connected to
q
, and
q
is connected to
r
, then
p
is connected to
r
(transitivity)
CONNECTED COMPONENT:
A set of pixels in which each pixel is connected to all other pixels is called a
connected component