• No results found

3. SPATIAL OPERATIONS AND TRANSFORMATIONS

3.3 Other Window Operations

Templating uses the concept of a window to the image whose size corresponds to the template. Other non-template operations on image windows can be useful.

Median filtering

USE. Noise removal while preserving edges in an image.

OPERATION. This is a popular low-pass filter, attempting to remove noisy pixels while keeping the edge intact. The values of the pixel in the window are stored and the median – the middle value in the sorted list (or average of the middle two if the list has an even number of elements)-is the one plotted into the output image.

Introduction to Image Processing and Computer Vision by LUONG CHI MAI http://www.netnam.vn/unescocourse/computervision/computer.htm

Example. The 6 value (quite possibly noise) in input image is totally eliminated using 3x3 median filter

Modal filtering is an alternative to median filtering, where the most popular from the set of nine is plotted in the centre.

k-closet averaging

USE: To reserve, to some extern, the actual values of the pixels without letting the noise get through the final image.

OPERATION: All the pixels in the window are stored and the k pixels values closest in value to the target pixel – usually the centre of the window – are averaged. The average may or may not include the target pixel, if not included the effect similar to a low-pass filter. The value k is a selected constant value less than the area of the window.

An extension of this is to average of the k value nearest in value to the target, but not including the q values closest to and including the target. This avoids pairs of triples of noisy pixels that are obtained by setting q to 2 or 3.

In both median and k-closest averaging, sorting creates a heavy load on the system. However, with a little sophistication in the programming, it is possible to sort the first window from the image and then delete a column of pixels values from the sorted list and introduce a new column by slotting them into the list thus avoiding a complete re-sort for each window. The k-closest averaging requires differences to be calculated as well as ordering and is, therefore, slower than the median filter.

Introduction to Image Processing and Computer Vision by LUONG CHI MAI http://www.netnam.vn/unescocourse/computervision/computer.htm

Interest point

There is no standard definition of what constitutes an interest point in image processing.

Generally, interest points are identified by algorithms that can be applied first to images containing a known object, and then to images where recognition of the object is required.

Recognition is achieved by comparing the positions of discovered interest points with the known pattern positions. A number of different methods using a variety of different measurements are available to determine whether a point is interesting or not. Some depend on the changes in texture of an image, some on the changes in curvature of an edge, some on the number of edges arriving coincidentally at the same pixel and a lower level interest operator is the Moravec operator.

Moravec operator

USE. To identify a set of points on an image by which the image may be classified or compared.

OPERATION. With a square window, evaluate the sums of the squares of the differences in intensity of the centre pixel from the centre top, centre left, centre bottom and centre right pixels in the window. Let us call this the variance for the centre pixel. Calculate the variance for all the internal pixels in the image as

[ ]

+ +

=

j)inS (i,

2 '(x,y) I(x,y) I(x i,y j I

where

S = {(0, a), (0, −a), (a, 0), (−a, 0)}

Now pass a 3 x 3 window across the variances and save the minimum from the nine variances in the centre pixel. Finally, pass a 3 x 3 window across the result and set to zero the centre pixel when its value is not the biggest in the window.

Correlation

Correlation can be used to determine the existence of a known shape in an image. There is a number of drawbacks with this approach to searching through an image. Rarely is the object orientation or its exact size in the image known. Further, if these are known for one object that is unlikely to be consistent for all objects.

A biscuit manufacturer using a fixed position camera could count the number of well-formed, round biscuits on a tray presented to it by template matching. However, if the task is to search for a sunken ship on a sonar image, correlation is not the best method to use.

Classical correlation takes into account the mean of the template and image area under the template as well as the spread of values in both template and image area. With a constant image, i.e. with lighting broadly constant across the image and the spread of pixel values

Introduction to Image Processing and Computer Vision by LUONG CHI MAI http://www.netnam.vn/unescocourse/computervision/computer.htm

broadly constant  then the correlation can be simplified to convolution as shown in the following technique.

USE. To find where a template matches a window in an image.

THEORY. If N x M image is addressed by I(X,Y) and n x m template is addressed by t(i,j) then

Where A is constant across the image, so can be ignored, B is t convolved with I, C is constant only if average light from image is constant across image (often approximately true) OPERATION. This reduces correlation (subtraction, squaring, and addition), to multiplication and addition convolution. Thus normally if the overall light intensity across the whole image is fairly constant, it is worth to use convolution instead of correlation.