Fondazione Bruno Kessler  Technologies of Vision
contains material from
Template Matching Techniques in Computer Vision: Theory and Practice
Roberto Brunelli © 2009 John Wiley & Sons, Ltd
Many patterns can be profitably represented by means of curves (as opposed to areas). Two new problems arise: how a reliable line based representation of a pattern can be obtained and how such representations can be exploited to efficiently find and compare patterns. In this section we describe a method to derive this kind of representations from a generic image, while the next sections will focus on how such a representation can be exploited to detect patterns in a robust and efficient way.
A basic way to obtain a line drawing from any image is to detect points of significant gradient intensity. The presence of noise makes the task more difficult as noise originates spurious intensity variations. In order to discriminate in a reliable way real gradients from noise originated ones we must have an estimate of the gradient intensity due to noise, and this is related to the amount of noise. In many cases the amount of noise itself is not known and we must estimate it from image data whose structure (distribution) is not necessarily known.
This is a good place where robust scale estimators can be profitably used. As Intermezzo TM:7.1 points out, we can get an estimate of noise standard deviation by computing the L_{2} norm of the convolution with a zero sum, unitary norm high pass filter kernel such as 1∕,1∕:
but the returned value is way too high. The reason is that the image contains structure: it is not just a uniform value plus noise. However, at least in this specific case, we can consider the amount of image structure as a perturbation of a uniform surface as significant detail is restricted to a small percentage of the whole area. We can then use a robust scale estimator such as the mad to automatically get rid of it, obtaining a much more reliable estimate of the noise level:
that results in a much closer value. Function tm.estimateNoiseLevel relies on the above estimator. A simplified version of the method described in Section TM:7 is implemented by function tm.edgeDetection whose inner workings can be controlled by its several parameters.
While thresholding gradient magnitude to get rid of spurious edges is necessary it is not sufficient as illustrated in Figure 7.1:
