0% found this document useful (0 votes)
156 views20 pages

Digital Image Edge Linking

This document discusses algorithms for edge linking and boundary detection in images. It describes both local and regional approaches. Local approaches link edge pixels within a neighborhood, while regional approaches approximate boundaries as polygons using all edge points. Two local edge linking algorithms are presented: the first links similar edge pixels based on magnitude and angle, while the second simplifies this by linking in specified directions only. A regional edge linking algorithm is also described, which iteratively adds points to approximate boundaries as polygons.

Uploaded by

Ryan Gono Gini
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
156 views20 pages

Digital Image Edge Linking

This document discusses algorithms for edge linking and boundary detection in images. It describes both local and regional approaches. Local approaches link edge pixels within a neighborhood, while regional approaches approximate boundaries as polygons using all edge points. Two local edge linking algorithms are presented: the first links similar edge pixels based on magnitude and angle, while the second simplifies this by linking in specified directions only. A regional edge linking algorithm is also described, which iteratively adds points to approximate boundaries as polygons.

Uploaded by

Ryan Gono Gini
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 20

ASAM - Image Processing

2008/2009
Lecture 16


Edge linking and boundary detection
Ioannis Ivrissimtzis 05-Mar-2009
Overview
Local processing

Regional processing
Edge linking
Edge linking algorithms assemble edge pixels into meaningful edges
and or region boundaries.


Local approaches only require information about edge points in local
neighbourhoods, typically 3x3 neighbourhoods.


Regional approaches require information about all the points on the
boundary of a region.
Local edge linking algorithm 1
We say that two edge pixels (x,y) and (s,t) are similar in magnitude if
the absolute value of the difference of their gradient magnitudes is less
than a threshold
E t s M y x M s ) , ( ) , (
We say that two edge pixels (x,y) and (s,t) are similar in angle if the
absolute value of the difference of their gradient direction is less than a
threshold
A t s y x s ) , ( ) , ( o o
Local edge linking algorithm 1
We traverse all the pixels of the image. We link each edge pixel (x,y)
with all edge pixels in its neighbourhood that are similar to it in both
magnitude and angle.
A record must be kept of linked points as the centre of the
neighbourhood is moved from pixel to pixel.
Local edge linking algorithm 2
A simplification of the algorithm can be particularly useful, especially
when we are interested on few edge directions only.
1. Compute the gradient magnitude and angle arrays, M(x,y) and
(x,y) of the input image.

We can do this using, for example, the Sobel masks.
2. Form a binary image g, whose value at any pair of coordinates (x,y)
is given by:



where T
M
is a threshold used for edge detection, A is a specified
angle direction, and T
A
defines the band of acceptable directions
about A.
Local edge linking algorithm 2

= >
=
otherwise 0
) , ( AND ) , ( if 1
) , (
A M
T A y x T y x M
y x g
o
3. Scan the rows of g and fill (set to 1) all gaps (sets of 0s) in each row
that do not exceed a specified length K.

By definition, a gap is bounded at both ends by one or more 1s.

Step 3 of the algorithm links edges in the horizontal direction.


4. To link edges in any other direction , we rotate g by and apply
Steps 2-3. We then rotate the result back by -.
Local edge linking algorithm 2
The simplified edge linking algorithm can be used in applications where
we are interested in the horizontal and vertical directions only.

For example, finding rectangular regions in an image that are good
candidates for corresponding to licence plates.
Local edge linking algorithm 2
Local edge linking algorithm 2
Gradient magnitude Horizontal edge linking Vertical edge linking
For the horizontal edge linking, T
M
was set at 30% of the maximum
gradient value, A=90 because the gradient direction is vertical to the
edge, T
A
=45. K=25, that is, we fill gaps of 25 or fewer pixels.
Local edge linking algorithm 2
The logical OR of the
horizontal and vertical
edge linking
The final result after
morphological image
post-processing
Overview
Local processing

Regional processing
The regional edge linking algorithm assumes that the edge points on
the regions boundary are known and ordered, e.g. in a clockwise or
counter-clockwise direction.


The algorithm computes a polygon approximating the boundary. The
polygon is defined by the set of its vertices, which is a subset of the
input edge points.


The algorithm starts with two edge points and iteratively adds new
points until the polygonal approximation is accurate enough.
Regional edge linking algorithm
Example
Starting with two vertices A and B, we measure the distances of the
other points to the line AB.

If the largest distance is above a threshold T than we add the furthest
point C to the set of vertices and obtain the new open polygon ACB.

We continue iteratively, measuring distances to AC and then CB.
Example 1
The algorithm stops when no other points can be added.
Before starting the algorithm we need to know if the input points
represent an open or a closed curve.


A large distance between two consecutive points A, B relative to the
other distances between consecutive points, indicates an open curve
with A, B as end points.
Regional edge linking algorithm
The algorithm can be described as follows

1. Specify two starting points A and B. Specify a threshold T and two
empty stacks, OPEN and CLOSED.

2. If we deal with a closed curve, put A into OPEN and B into OPEN
and into CLOSED. If we deal with a open curve put A into OPEN
and B into CLOSED.

3. Compute the line passing from the last point in CLOSED and the
last point in OPEN.
Regional edge linking algorithm
4. Compute the distance from that line to all the points in P whose
sequence place them between the two points defining the line.
Select the point V
max
with the maximum distance D
max
.

5. If D
max
> T, place V
max
at the end of the OPEN stack. Go to Step 3.

6. Else, remove the last vertex from OPEN and insert it as the last
vertex of CLOSED.

7. If OPEN is not empty, go to Step 3.

8. Exit. The vertices in CLOSED are the vertices of he polygon.
Regional edge linking algorithm
Example 2
Example 2
CLOSED OPEN
Curve segment
processed
Vertex
generated
B B,A - A,B
B B,A (BA) C
B B,A,C (BC) -
B,C B,A (CA) -
B,C,A B (AB) D
B,C,A B,D (AD) -
B,C,A,D B (DB) -
B,C,A,D,B Empty - -

You might also like