Contour Tracking

IS THERE A MORE COMPUTATIONALLY
EFFICIENT TECHNIQUE FOR SEGMENTING
THE OBJECTS IN THE IMAGE?
•Contour tracking/border following identify the pixels
that fall on the boundaries of the objects, i.e., pixels
that have a neighbor that belongs to the background
class or region.
•There are two “standard” code definitions used to
represent boundaries: code definitions based on 4connectivity (crack code) and code definitions based
on 8-connectivity (chain code).
BOUNDARY REPRESENTATIONS:
4-CONNECTIVITY (CRACK CODE)
3
0
2
1
CRACK CODE:
10111211222322333300
103300
BOUNDARY REPRESENTATIONS:
8-CONNECTIVITY (CHAIN CODE)
7
6
0
1
5
4
2
3
CHAIN CODE:
12232445466601760
CONTOUR TRACKING ALGORITHM
FOR GENERATING CRACK CODE
•Identify a pixel P that belongs to the class “objects”
and a neighboring pixel (4 neighbor connectivity) Q
that belongs to the class “background”.
•Depending on the relative position of Q relative to P,
identify pixels U and V as follows:
CODE 0
CODE 1
CODE 2
CODE 3
V Q
U P
Q P
V U
P U
Q V
U V
P Q
CONTOUR TRACKING ALGORITHM
•Assume that a pixel has a value of “1” if it belongs to
the class “object” and “0” if it belongs to the class
“background”.
•Pixels U and V are used to determine the next “move”
(i.e., the next element of crack code) as summarized in
the following truth table:
U
V
P’
Q’
TURN
CODE*
X
1
V
Q
RIGHT
CODE-1
1
0
U
V
NONE
CODE
0
0
P
U
LEFT
CODE+1
*Implement
as a modulo 4 counter
CONTOUR TRACKING ALGORITHM
3
0
V Q P
2
U P
Q
V
1
V P
Q
U
CODE 0
CODE 1
CODE 2
CODE 3
V Q
U P
Q P
V U
P U
Q V
U V
P Q
U
V
P’
Q’
TURN
CODE*
X
1
V
Q
RIGHT
CODE-1
1
0
U
V
NONE
CODE
0
0
P
U
LEFT
CODE+1
*Implement
as a modulo 4 counter
V P
Q
U
V U
U
CONTOUR TRACKING ALGORITHM
FOR GENERATING CHAIN CODE
•Identify a pixel P that belongs to the class “objects” and a
neighboring pixel (4 neighbor connectivity) R0 that belongs
to the class “background”. Assume that a pixel has a value
of “1” if it belongs to the class “object” and “0” if it belongs
to the class “background”.
•Assign the 8-connectivity neighbors of P to R0, R1, …, R7
as follows:
R7 R6 R5
R0
P
R4
R1 R2 R3
CONTOUR TRACKING ALGORITHM
FOR GENERATING CHAIN CODE
7
6
5
R7 R6 R5
R7 R
R6 R
P5 R4
0
0
1
4
2
3
ALGORITHM:
i=0
WHILE (Ri==0) { i++ }
•Move P to Ri
•Set i=6 for next search
P6 R
R07 R
R
R245 R3
1
R701 R
P62 R543
R
R01 R
P72 R
R643 R5
R1 R
R02 R
R
P3 R
4
R
7
6 R5
R
R10 R
P2 R
R34
R1 R2 R3
OBJECT RECOGNITION – BLOB ANALYSIS
•Once the image has been segmented into classes
representing the objects in the image, the next step is to
generate a high level description of the various objects.
•A comprehensive set of form parameters describing
each object or region in an image is useful for object
recognition.
•Ideally the form parameters should be independent of
the object’s position and orientation as well as the
distance between the camera and the object (i.e., scale
factor).