Lecture 3.1.2 Line Detection
Lecture 3.1.2 Line Detection
2
Line Detection
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
• These masks above are tuned for light lines against a dark background and would
give a big negative response to dark lines against a light background. If you are
only interested in detecting dark lines against a light background, then you should
negate the mask values. Alternatively, you might be interested in either kind of
line, in which case, you could take the absolute value of the convolution output. In
the discussion and examples below, we will use the kernels above without an
absolute value.
• If denotes the response of kernel i, we can apply each of these kernels across an
image, and for any particular point, if for all that point is more likely to contain a
line whose orientation (and width) corresponds to that of kernel i.
Line Detection (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
• One usually thresholds to eliminate weak lines corresponding to edges and other
features with intensity gradients which have a different scale than the desired line
width. In order to find complete lines, one must join together line fragments, e.g.
with an edge tracking operator.
Guidelines for use…..
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
of applying the line detection operator, using the horizontal convolution kernel shown in Figure 1.a, is
(Note that this gradient image has been normalized for display.) There are two points of interest to note here.
1. Notice that, because of the way that the oblique lines (and some `vertical' ends of the horizontal bars) are
represented on a square pixel grid, e.g. shows a zoomed region containing both features, the horizontal line
detector responds to more than high spatial intensity horizontal line-like features, e.g.
On an image such as this one, where the lines to be detected are wider than the kernel (i.e. the image lines
are five pixels wide, while the kernel is tuned for a single width pixel), the line detector acts like an edge
detector: the edges of the lines are found, rather than the lines themselves.
Guidelines(cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
•This latter fact might cause us to naively think that the image which gave rise to
• contained a series of parallel lines rather than single thick ones. However, if we compare this result
to that obtained by applying the line detection kernel to an image containing lines of a single-pixel
width, we find some consistent differences. For example, we can skeletonize the original(so as to
obtain a representation of the original wherein most lines are a single-pixel width), apply the
horizontal line detector and then threshold the result.
• If we then threshold the original line detected image at the same pixel value, we obtain the full
image
• Thus, the values corresponding to the true, single-pixel lines found in the skeletonized version are
stronger than those values corresponding to edges. Also, if we examine a cropped
and zoomed version of the line detected raw image and the skeletonized line detected image.
3. Weblink (cse.unr)
References
• Books and Journals
• Gonzalez and Woods: Digital Image Processing ISDN 0-201-600- 781, Addison Wesley 1992.
• Forsyth and Ponce: Computer Vision A Modern Approach Pearson Education Latest Edition.
• Video Link-
•https://youtu.be/i3ANIRt9qRg
• Weblink -
• (cse.unr)
9
THANK YOU