|
| |

Chapter 4: Image Pre-processing
Overview:
4.4 Image Restoration

Image Smoothing
Edge detectors
Zero crossings of the second derivative
Scale in image processing
Canny edge detection
Edges in multispectral images
Other local pre-processing operators
Adaptive neighborhood pre-processing
Local pre-processing
 |
Another classification of local pre-processing methods is according to the transformation
properties.
 |
Linear operations calculate the resulting value in the output image pixel
g(i,j) as a linear combination of brightnesses in a local neighborhood of the pixel
f(i,j) in the input image. The contribution of the pixels in the neighborhood is weighted by coefficients h 
The above equation is equivalent to discrete convolution with the kernel h, that is called a
convolution mask.
|
 |
Rectangular neighborhoods O are often used with an odd number of pixels in rows and
columns, enabling the specification of the central pixel of the neighborhood.
|
 |
Local pre-processing methods typically use very little a priori knowledge about the image
contents. It is very difficult to infer this knowledge while an image is processed as the known
neighborhood O of the processed pixel is small.
|
 |
The choice of the local transformation, size, and shape of the neighborhood O depends
strongly on the size of objects in the processed image. If objects are rather large, an image can be enhanced by smoothing of small degradations.
|
|
4.3.1 Image smoothing
 |
Image smoothing is the set of local pre-processing methods which have the aim of
suppressing image noise - it uses redundancy in the image data.
|
 |
Calculation of the new value is based on averaging of brightness values in some
neighborhood O.
|
 |
Smoothing poses the problem of blurring sharp edges in the image, and so we shall
concentrate on smoothing methods which are edge preserving. They are based on the
general idea that the average is computed only from those points in the neighborhood which
have similar properties to the processed point.
|
 |
Local image smoothing can effectively eliminate impulsive noise or degradations appearing as
thin stripes, but does not work if degradations are large blobs or thick stripes.
|
 |
Averaging
 |
Assume that the noise value at each pixel is an independent random variable with zero
mean and standard deviation. The result of smoothing is an average of the same n points in these images
g1,...,g{n} with noise values {1},...,{n} 
The second term here describes the effect of the noise ... a random value with zero
mean. The standard deviation of the noise can be reduced by a
factor of 1 over the square root of n.
|
 |
Thus if n images of the same scene are available, the smoothing can be accomplished without
blurring the image by 
In many cases only one image with noise is available, and averaging is then realized in a local
neighborhood.
|
 |
Results are acceptable if the noise is smaller in size than the smallest objects of interest in the
image, but blurring of edges is a serious disadvantage.

Practical Experiment: Averaging Filters
From Matlab, open the noise demo, nrfiltdemo. Using the flower
image, add Gaussian noise to the image.
Apply the 3x3 averaging mask to the corrupted image. Create 5x5 and 7x7 averaging masks and use them for averaging. Assess their smoothing and edge blurring performance.
Experiment with noise of different severity by changing the standard
deviation and mean of the noise, how does this affect your conclusions?
Try Creating your own noisy images using an image of your choice and the
following command:
>J = imnoise(I,'gaussian',0,.010); % adds in Gaussian Noise with mean
0 and variance 0.10
More examples to work with:
Examples of additive Gaussian noise:
noise_1.tif (mean=0, stdev=0.1)
noise_2.gif (mean=0, stdev=0.3)
noise_3.tif (mean=1, stdev=2.0)
noise_4.tif (mean=1, stdev=1.0)
noise_5.tif (mean=2, stdev=2.0)
Examples of binary shot noise:
noise_6.tif (10% shot noise)
noise_7.tif (2% shot noise)
noise_8.tif (50% shot noise)

 | The significance of the central pixel may be increased to better
reflect properties of Gaussian noise.  |
|
 | Note how the coefficient in front changes so that the mask sum
adds up to one.
|
 | Averaging with limited data validity
Methods that average with limited data validity try to avoid blurring by averaging only those
pixels which satisfy some criterion, the aim being to prevent involving pixels that are part of a
separate feature.
 |
A very simple criterion is to use only pixels in the original image with brightness in a
predefined interval [min,max]. 
Considering the point (m,n) in the image, the convolution mask is calculated in the
neighborhood O from the nonlinear formula. Note that in the equation above, the interval min-max represents valid data.
|
 |
A second method performs the averaging only if the computed brightness change of a pixel is
in some predefined interval. This method permits repair to large-area errors resulting from slowly changing brightness of
the background without affecting the rest of the image. |
 |
A third method uses edge strength (i.e., magnitude of a gradient) as a criterion.
The magnitude of some gradient operator is first computed for the entire image, and only
pixels in the input image with a gradient magnitude smaller than a predefined threshold are
used in averaging.
|
|
 |
Averaging according to inverse gradient
 |
The convolution mask is calculated at each pixel according to the inverse gradient. Brightness change within a region is usually smaller than between neighboring regions.
|
 |
Let (i,j) be the central pixel of a convolution mask with odd size; the inverse gradient at the
point (m,n) with respect to (i,j) is then
If g(m,n) = g(i,j) then we define (i,j,m,n) = 2; the inverse gradient is then in the interval (0,2], and is smaller on the edge than in the
interior of a homogeneous region.
|
 |
Weight coefficients in the convolution mask h are normalized by the inverse gradient, and thewhole term is multiplied by 0.5 to keep brightness values in the original range. The constant 0.5 has the effect of assigning half the weight to the central pixel
(i,j), and the other half to its neighborhood.
The convolution mask coefficient corresponding to the central pixel is defined as
h(i,j) = 0.5. |
 | This method assumes sharp edges. When the convolution mask is close to an edge, pixels from the region have larger
coefficients than pixels near the edge, and it is not blurred. Isolated noise points within
homogeneous regions have small values of the inverse gradient; points from the
neighborhood take part in averaging and the noise is removed.
|
|
 |
Averaging using a rotating mask
 | Avoids edge blurring by searching for the homogeneous part of the current pixel
neighborhood, the resulting image is in fact sharpened |
 |
brightness average is calculated only within the homogeneous region |
 |
a brightness dispersion sigma^2 is used as the region homogeneity measure.
let n be the number of pixels in a region R and g(i,j) be the input image. Dispersion
sigma^2 is calculated as
The computational complexity (number of multiplications) of the dispersion calculation can be
reduced if expressed as follows
|
 |
Rotated masks
|
Median smoothing
 |
In a set of ordered values, the median is the central value. Median filtering reduces blurring of edges. The idea is to replace the current point in the image by the median of the brightness in its
neighborhood.
|
 | The advantages of median filtering are that it is not affected by individual noise spikes ,
eliminates impulsive noise quite well, and it does not blur edges much and can be applied iteratively.
|
 |
The main disadvantage of median filtering in a rectangular neighborhood is its damaging of
thin lines and sharp corners in the image -- this can be avoided if another shape of
neighborhood is used.
|

Practical Experiment:
The original image birds.tif was corrupted with black and white lines can be found
here. Remove the lines from the image using median filtering - you may
need to experiment with the size of the median filter and/or with the number of iterations.
The goal is to remove the lines completely. Compare the median filter behavior if you use larger filter with less repetitions and
smaller filter with more repetitions. Read in the image using
the imread command. Filter the image using the nlfilter
command:
B = nlfilter(A,[3 3],'medfilt2');%this performs a 3 by 3
median filtering of the image.
More examples to work with:
Examples of additive Gaussian noise:
noise_1.tif (mean=0, stdev=0.1)
noise_2.gif (mean=0, stdev=0.3)
noise_3.tif (mean=1, stdev=2.0)
noise_4.tif (mean=1, stdev=1.0)
noise_5.tif (mean=2, stdev=2.0)
Examples of binary shot noise:
noise_6.tif (10% shot noise)
noise_7.tif (2% shot noise)
noise_8.tif (50% shot noise)
|
|
 |
Edge detectors
 | Edges are pixels where brightness changes abruptly.
|
 |
Calculus describes changes of continuous functions using derivatives; an image function
depends on two variables - partial derivatives. A change of the image function can be described by a gradient that points in the direction of
the largest growth of the image function.
|
 |
An edge is a property attached to an individual pixel and is calculated from the image
function behavior in a neighborhood of the pixel. It is a vector variable
with magnitude and direction:
The gradient magnitude and gradient direction are continuous image functions where
arg(x,y)
is the angle (in radians) from the x-axis to the point (x,y). The gradient direction gives the direction of maximal growth of the function, e.g., from black
(f(i,j)=0) to white (f(i,j)=255).
|
 |
This is illustrated below; closed lines are lines of the same brightness. The orientation 0° points East.
|
 |
Edges are often used in image analysis for finding region boundaries.
Boundary and its parts (edges) are perpendicular to the direction of the gradient.
|
 |
Sometimes we are interested only in edge magnitudes without regard to their orientations.
The Laplacian has the same properties in all directions and is therefore invariant to rotation in
the image.

|
 |
Image sharpening makes edges steeper -- the sharpened image is intended to be observed
by a human. |
 | 
C is a positive coefficient which gives the strength of sharpening and
S(i,j) is a measure of the
image function sheerness that is calculated using a gradient operator. The Laplacian is very often used to estimate
S(i,j). |
 | Derivatives are approximated by differences. The first
differences in the vertical and horizontal directions are
|
 | Symmetric differences look like:
They are not usually used since they neglect the impact of the center
pixel at i,j |
 | There are three classes of gradient operators:
 | Operators which approximate derivatives of the image using
differences such as the Laplacian, Roberts or Prewitt operators |
 | Operators based on the zero-crossings of the image function second
derivative such as Marr-Hildreth or Canny edge detectors |
 | Operators which match an image to a parametric model of the edges.
|
|
 |
Laplace operator
The Laplace operator (Eq. 4.37) is a very popular operator approximating the second
derivative which gives the gradient magnitude only. The Laplacian is approximated in digital images by a convolution sum. A 3 x 3 mask for 4-neighborhoods and 8-neighborhood 
|
 |
A Laplacian operator with stressed significance of the central pixel or its neighborhood is
sometimes used. In this approximation it loses invariance to rotation
|
| |
|
2 |
-1 |
2 |
| h |
= |
-1 |
-4 |
-1 |
| |
|
2 |
-1 |
2 |
The Laplacian operator has a disadvantage -- it responds doubly to some edges in the
image.
|

 |
Practical Experiment: Laplacian Operator
Using the above equation, create the convolution mask approximating the
Laplacian.
Use the conv2 routine in Matlab to filter an image. Display the
results.
Use the Laplacian edge image for image sharpening as specified by (Eq. 4.38).
Experiment with the value of the parameter C.
|

Individual gradient operators that examine small local neighborhoods are in fact convolutions
and can be expressed by convolution masks. Operators which are able to detect edge direction as well are represented by a collection of
masks, each corresponding to a certain direction.
Roberts operator
so the magnitude of the edge is computed as
The primary disadvantage of the Roberts operator is its high sensitivity to noise, because
very few pixels are used to approximate the gradient.
Prewitt operator
 |
The Prewitt operator, similarly to the Sobel, Kirsch, Robinson (as discussed later) and some
other operators, approximates the first derivative. Operators approximating first derivative of an image function are sometimes called
compass operators because of the ability to determine gradient direction.
|
 |
The gradient is estimated in eight (for a 3 x 3 convolution mask) possible directions, and the
convolution result of greatest magnitude indicates the gradient direction. Larger masks are
possible. 
The direction of the gradient is given by the mask giving maximal response. This is valid for
all following operators approximating the first derivative.
Sobel operator
Used as a simple detector of horizontality and verticality of edges in which case only masks
h1 and h3 are used. If the h1 response is y and the h3 response x, we might then derive edge strength (magnitude)
as shown below and direction as arctan (y / x).

Robinson operator
Kirsch operator


Practical Experiment: Edge Detection
Create the convolution masks corresponding to the 3x3 Prewitt edge detector create two masks, one of them corresponding to the South edge direction (angle
phi = 270 deg - look at Fig. 4.16), the second mask corresponding to the North-East direction (phi = 45 deg). Use the Convol node to detect edges in the S and NE directions (see Pract. exp. 4.D for
convolution details).
To do this, place the Convol nodes with the masks you defined in series. To make sure that your edge detection masks give the correct direction, use circle.gif to
test your masks. Apply to image sf.gif and analyze the results. What is the width of the edge responses? Now, add a thresholding node (download here, and use 'Open->UserDefine node' to
open it from the saved location) and display only the significant edges of the edge
image.

Zero crossings of the second derivative
 |
Edge detection techniques like the Kirsch, Sobel, Prewitt operators are based on
convolution in very small neighborhoods and work well for specific images only. The main disadvantage of these edge detectors is their dependence on the size of objects
and sensitivity to noise.
|
 |
An edge detection technique, based on the zero crossings of the second derivative explores
the fact that a step edge corresponds to an abrupt change in the image function.
|
 |
The first derivative of the image function should have an extreme at the position
corresponding to the edge in the image, and so the second derivative should be zero at the
same position.
|
 |
It is easier and more precise to find a zero crossing position than an extreme - see Fig.
4.20 in the book.
|
 |
Robust calculation of the 2nd derivative:
 | Smooth an image first (to reduce noise) and then compute second derivatives.
|
 |
The 2D Gaussian smoothing operator G(x,y)
where x, y are the image co-ordinates and sigma is a standard deviation of the associated
probability distribution.
|
 |
The standard deviation sigma is the only parameter of the Gaussian filter - it is proportional
to the size of neighborhood on which the filter operates. Pixels more distant from the center of the operator have smaller influence, and pixels further
than 3 sigma from the center have negligible influence.
|
 |
Goal is to get second derivative of a smoothed 2D function f(x,y) ... the Laplacian operator
gives the second derivative, and is moreover non-directional (isotropic). Consider then the Laplacian of an image f(x,y) smoothed by a Gaussian ...
LoG
The order of differentiation and convolution can be interchanged due to linearity of the
operations:
|
 |
The derivative of the Gaussian filter is independent of the image under consideration and can
be precomputed analytically reducing the complexity of the composite operation.
|
 |
Using the substitution r2=x2+y2, where r measures distance from the origin ( reasonable as
the Gaussian is circularly symmetric, the 2D Gaussian can be converted into a 1D function
that is easier to differentiate.
The first derivative is
and the second derivative (LoG) is
|
 |
After returning to the original co-ordinates x, y and introducing a normalizing multiplicative
coefficient c (that includes 1/2), we get a convolution mask of a zero crossing detector
where c normalizes the sum of mask elements to zero.
|
 |
Finding second derivatives in this way is very robust. Gaussian smoothing effectively suppresses the influence of the pixels that are up to a distance
3 sigma from the current pixel; then the Laplace operator is an efficient and stable measure of
changes in the image.
|
 |
The location in the LoG image where the zero level is crossed corresponds to the position of
the edges. The advantage of this approach compared to classical edge operators of small size is that a
larger area surrounding the current pixel is taken into account; the influence of more distant
points decreases according to the of the Gaussian. The sigma variation does not affect the location of the zero crossings.
|
 |
Convolution masks become large for larger sigma ; for example, sigma= 4 needs a mask about 40
pixels wide.
|
 |
The practical implication of Gaussian smoothing is that edges are found reliably.
|
 |
If only globally significant edges are required, the standard deviation of the Gaussian
smoothing filter may be increased, having the effect of suppressing less significant evidence.
|
 |
The LoG operator can be very effectively approximated by convolution with a mask that is
the difference of two Gaussian averaging masks with substantially different
sigmas- this method is called the Difference of Gaussians - DoG.
|
 |
Even coarser approximations to LoG are sometimes used - the image is filtered twice by an
averaging operator with smoothing masks of different size and the difference image is
produced.
|
 |
Disadvantages of zero-crossing:
smoothes the shape too much; for example sharp corners are lost ,
tends to create closed loops of edges
|
|

Practical Experiment LoG Zero Crossing
Use the prepared workspaces dog.vip, log.vip, and one_step_log.vip
The dog.vip project applies two Gaussian filters with 2 different values of .
View the DoG image.
Experiment with the smoothing parameters and with the thresholding parameters.
The log.vip project computes the LoG image using the definition.
Again try to experiment with the smoothing parameters and the thresholding parameters.
The one_step_log.vip project pre-computes the derivative of the Gaussian filter and uses
it (see p. 85 in the text).
Apply the same projects to some other square image - e.g., lena.gif - you may need to
modify the smoothing parameters.

|
 |
Scale in image processing
 |
Many image processing techniques work locally. The essential problem in such computation is scale,
what size should a mask be?
|
 |
Edges correspond to the gradient of the image function that is computed as a difference
between pixels in some neighborhood
|
 |
There is seldom a sound reason for choosing a particular size of neighborhood.
The right size depends on the size of the objects under investigation. To know what the objects are assumes that it is clear how to interpret an image. This is not in general known at the pre-processing stage.
|
 |
Processing of planar noisy curves at a range of scales - the segment of curve that
represents the underlying structure of the scene needs to be found.
After smoothing using the Gaussian filter with varying standard deviations, the significant
segments of the original curve can be found.
|
 |
The task can be formulated as an optimization problem in which two criteria are used
simultaneously: the longer the curve segment the better and the change of curvature should be minimal.
|
 |
Scale space filtering describes signals qualitatively with respect to scale.
The original 1D signal f(x) is smoothed by convolution with a 1D Gaussian
If the standard deviation is slowly changed the following function represents a surface on
the (x,) plane that is called the scale--space image. 
Inflection points of the curve F(x, sigma0) for a distinct value sigma0
 |
The positions of inflection points can be drawn as a set of curves in (x,) co-ordinates.
|
 |
Coarse to fine analysis of the curves corresponding to inflection points, i.e., in the direction of
the decreasing value of the , localizes large-scale events.
|
|
 |
The qualitative information contained in the scale--space image can be transformed into a
simple interval tree that expresses the structure of the signal f(x) over all observed scales. The interval tree is built from the root that corresponds to the largest scale. The scale-space image is searched in the direction of decreasing
sigma. The interval tree branches at those points where new curves corresponding to inflection
points appear.
|
 |
The third example of the application of scale - Canny edge detector.
|
|
 |
Canny edge detection
 |
optimal for step edges corrupted by white noise
|
 |
optimality related to three criteria
 |
detection criterion ... important edges should not be missed, there should be no
spurious responses |
 |
localization criterion ... distance between the actual and located position of the edge
should be minimal |
 |
one response criterion ... minimizes multiple responses to a single edge (also partly
covered by the first criterion since when there are two responses to a single edge one
of them should be considered as false)
|
|
 |
Canny's edge detector is based on several ideas:
1) The edge detector was expressed for a 1D signal and the first two optimality criteria. A
closed form solution was found using the calculus of variations.
2) If the third criterion (multiple responses) is added, the best solution may be found by
numerical optimization. The resulting filter can be approximated effectively with error less
than 20% by the first derivative of a Gaussian smoothing filter with standard deviation ; the
reason for doing this is the existence of an effective implementation. There is a strong similarity here to the Marr-Hildreth edge detector (Laplacian of a
Gaussian)
3) The detector is then generalized to two dimensions. A step edge is given by its position,
orientation, and possibly magnitude (strength). It can be shown that convoluting an image with a symmetric 2D Gaussian and then
differentiating in the direction of the gradient (perpendicular to the edge direction)
forms a simple and effective directional operator. Recall that the Marr-Hildreth zero crossing operator does not give information about
edge direction as it uses Laplacian filter.
Suppose G is a 2D Gaussian (equation 4.50) and assume we wish to convolute the image
with an operator Gn which is a first derivative of G in the direction n.
The direction n should be oriented perpendicular to the edge, this direction is not known in advance however, a robust estimate of it based on the smoothed gradient direction is available
if g is the image, the normal to the edge is estimated as
The edge location is then at the local maximum in the direction n of the operator G_n
convoluted with the image g
Substituting in equation 4.62 for G_n from equation 4.60, we get
This equation 4.63 shows how to find local maxima in the direction perpendicular to the
edge; this operation is often referred to as non-maximum suppression.
As the convolution and derivative are associative operations in equation 4.63
first convolute an image g with a symmetric Gaussian G then compute the directional second derivative using an estimate of the direction n
computed according to equation 4.61.
strength of the edge (magnitude of the gradient of the image intensity function g) is
measured as
4) Spurious responses to the single edge caused by noise usually create a so called
'streaking' problem that is very common in edge detection in general. Output of an edge detector is usually thresholded to decide which edges are significant. Streaking means breaking up of the edge contour caused by the operator fluctuating above
and below the threshold.
Streaking can be eliminated by thresholding with hysteresis. If any edge response is above a high threshold, those pixels constitute definite output
of the edge detector for a particular scale.
Individual weak responses usually correspond to noise, but if these points are
connected to any of the pixels with strong responses they are more likely to be actual
edges in the image.
Such connected pixels are treated as edge pixels if their response is above a low
threshold. The low and high thresholds are set according to an estimated signal to noise ratio.
5) Canny proposed a Feature synthesis approach. The correct scale for the operator depends on the objects contained in the image. The solution to this unknown is to use multiple scales and aggregate information from them. Different scale for the Canny detector is represented by different standard deviations of the
Gaussians.
There may be several scales of operators that give significant responses to edges (i.e., signal
to noise ratio above the threshold); in this case the operator with the smallest scale is chosen
as it gives the best localization of the edge. The correct scale for the operator depends on the objects contained in the image.
The solution to this unknown is to use multiple scales and aggregate information from them.
Different scale for the Canny detector is represented by different standard deviations of the
Gaussians. There may be several scales of operators that give significant responses to edges (i.e., signal to noise
ratio above the threshold); in this case the operator with the smallest scale is chosen as it gives the
best localization of the edge. All significant edges from the operator with the smallest scale are marked first. Edges of a hypothetical operator with larger are synthesized from them (i.e., a prediction is made
of how the larger should perform on the evidence gleaned from the smaller ). Then the synthesized edge response is compared with the actual edge response for larger
sigma. Additional edges are marked only if they have significantly stronger response than that predicted
from synthetic output.
Algorithm: Canny edge detector
1. Repeat steps (2) till (6) for ascending values of the standard deviation .
2. Convolve an image g with a Gaussian of scale sigma.
3. Estimate local edge normal directions n using equation (4.61) for each pixel in the image.
4. Find the location of the edges using equation (4.63) (non-maximal suppression).
5. Compute the magnitude of the edge using equation (4.64).
6. Threshold edges in the image with hysteresis to eliminate spurious responses.
7. Aggregate the final information about edges at multiple scale using the `feature synthesis'
approach.
Canny Edge Detector Examples (from Scotland):
http://www.dai.ed.ac.uk/HIPR2/canny.htm#1
Canny's detector represents a complicated but major contribution to edge detection.
Its full implementation is unusual, it being common to find implementations that omit feature
synthesis -- that is, just steps 2--6 of algorithm.
|
|

Parametric edge models
 | Parametric models are based on the idea that the discrete image intensity function can be considered a sampled
and noisy approximation of the underlying continuous or piecewise continuous image intensity function.
|
 | While the continuous image function is not known, it can be estimated from the available discrete image
intensity function and image properties can be determined from this estimate, possibly with sub-pixel precision.
|
 | Piece continuous function estimate called facets are used to represent (a neighborhood) image pixel.
Such image representation is called facet model.
|

 | The simplest one is the flat facet model that uses piecewise constants and each pixel neighborhood is
represented by a flat function of constant intensity.
|
 | The sloped model uses piecewise linear functions forming a sloped plane fitted to the image intensities in the
pixel neighborhood.
|
 | Quadratic and bi-cubic facet models employ correspondingly more complex functions.
|
 | A thorough treatment of facet models and their modifications for peak noise removal, segmentation into
constant-gray-level regions, determination of statistically significant edges, gradient edge detection, directional
second-derivative zero-crossing detection, and line and corner detection is given in
Haralik, R. M. and Shapiro, L. G. (1992). Computer and Robot Vision. Reading: Addision Wesley.
1992.
|

 | An edge detection example is given in the following.
Consider a bi-cubic facet model
(4.105)
The parameters of this model are estimated from a pixel neighborhood (the co-ordinate of the central pixel is
(0,0) ). To determine the model parameters, a least-squares method with singular-value decomposition may be used.
Once the facet model parameters are available for each image pixel, edges can be detected as extrema of the
first directional derivative and/or zero-crossings of the the second directional derivative of the local continuous
facet model functions.
Edge detectors based on parametric models describe edges more precisely than convolution based edge
detectors.
Additionally, they carry the potential for sub-pixel edge localization. |

 | Other local pre-processing operators
 | Several other local operations exists which are used for different
purposes: Line finding, line thinning, line filling and interest point operators are among them.
|
 | Another class of local operators, mathematical morphology, is introduced later.
|
|
 | Line finding operators
 | Line finding operators aim to find very thin curves in the image. E.g., roads in satellite images.
|
 | It is assumed that curves do not bend sharply. Such curves and straight lines are called
lines for the purpose of describing this technique. We assume that the width of the lines is approximately one or two pixels.
|
 | Lines in the image can be detected see [Cervenka, V. and Charvat, K. (1987).
Survey of the image processing research applicable to the thematic mapping based on aerocosmic data. Technical report, Geodetic and Carthographic Institute, Prague,
Czechoslovakia. Technical Report A 12-346-811. ] by a number of local convolution
operators .
The output value of the line finding detector in pixel is given by
(4.108)
where denotes the convolution of the
k-th mask with the neighborhood of a pixel in the input image.
|
 | The following is a set of convolution masks of size . There are 14 possible orientation of the line finding
convolution mask of this size; only the first eight are shown, as the others are obvious by rotation.

The line detector of equation see (4.108) with masks similar to sometimes produces more lines than
needed. |

|
 | Line thinning
 | In the edge detection methods introduced so far, edges are usually found by simple thresholding of the edge magnitude.
Such edge thresholding does not provide ideal contiguous boundaries that are one pixel wide.
|
 | These techniques are based on knowledge of small local neighborhoods and are very similar to other local
pre-processing techniques.
|
 | One line thinning method uses knowledge about orientation and in this case edges are thinned before
thresholding. Edge magnitude and directions provided by some gradient operator are used as input, and the edge magnitude of two
neighboring pixels perpendicular to the edge direction are examined for each pixel in the image.
If at least one of these pixels has edge magnitude higher than the edge magnitude of the examined pixel, then the edge
magnitude of the examined pixel is assigned a zero value.
The technique is called non-maximal suppression and is similar to the idea mentioned in conjunction with the Canny
edge detector.
|
 | A second line thinning method see [Cervenka and Charvat, 1987] does not explore information about edge orientation.
A binary image with edges that have magnitude higher than a specified threshold is used as input; ones denotes edge
pixels and zeros the rest of the image.
Such edges are then thinned by a local operator.
Example 3x3 masks are shown below. 
where the letter x denotes an arbitrary value (0 or 1).
The match of each mask at each position of the image is checked and if the mask matches, the edge is thinned by
replacing the one in the center of the mask by zero. |
|



 |
Adaptive neighboring pre-processing
 | The majority of pre-processing operators work in neighborhoods of fixed sizes in the whole image, of which square
windows (3x3,5x5 or 7x7) are most common.
|
 | Pre-processing operators of variable sizes and shapes exist and bring improved pre-processing results. They are based on detection of the most homogeneous neighborhood of each pixel.
However they are not widely used, mostly because of computational demands and the
lack of a unifying approach.
|
 | A recent approach to image pre-processing introduces the concept of an adaptive neighborhood which is determined
for each image pixel.
|
 | The neighborhood size and shape are depend on the image data and on parameters which define
measures of homogeneity of a pixel neighborhood.
|
 | A significant property of the neighborhood for each pixel is the ability to self tune to contextual details in the image.
|
|

04/02/01 |