Beginners Robotics Guide : Image Processing -II

Rate this Entry

Image acquisition nowadays can be done in various ways either by connecting a CCD camera or digital stream input from some other source can be used. These input streams can be interfaced either by VFW( Video for windows) Interface in Microsoft OS platforms or VFL (Video For Linux) interface in Unix based platforms. Every visual programming language nowadays provide
suitable library routines to access these services.


As the input image from these devices may contain and usually does contains noise in various forms such as salt and pepper noise, gaussian noise and impulse noise etc. Computational models are used to remove this noise from the image. Various linear and non linear filters were available for us to use ranging from wiener filters,mean filter, Gaussian filter or median filter.
Amongst them median filter is a good choice as it is a spatially invariant nonlinear filter and its capability of removing impulse noise generally found due to camera electronics.

Mathematical model of this filter may be modeled as :

H[i,j] = 1/M ? f [k,l] { for each M x M size sub window}


Component labelling is performed on a binary image to divide the image into components.

This is done to be able to find the components in the image and decide what to do with them. Often are small components removed from the picture because the often appear because of noise. It is thereby possible to select between the components of different sizes. If the size difference between objects is known, it is possible to select the wanted components. The components, which are given the same label, are connected. There are two different definitions of connectedness; Four connectedness and eight connectedness .Four connectedness means that two pixels are connected only if they have a common border. Eight connectedness means that the pixels are connected if their corners touches.

When it is decided which type of connectedness is going to be used, the components can be labeled. The labeling process is an iterative process in which each pixel is investigated. If it is different from the background color, it is labeled a number. Before this is done the neighbor pixels are investigated and if one of them have a label this is given to the pixel investigated.


Skeletonization is an operation in which the medial axis in the lines or objects in the image are found. This means that a line that is several pixels thick is reduced to a line only one pixel thick. How the pixels are connected in the skeleton depends on which type of connectedness is chosen to skeletonize to. This section consists of a general description of the skeletonization process and a detailed description of thinning and pruning, which is involved in skeletonization.

Skeletonization of a component is a process in which the outer layer of the component is removed in an iterative process. This is called thinning and that is explained further in the following subsection.


Thinning is a process in which the outer layer of a component in an image is removed. The process is done by applying masks to the outer layer of the component. If the mask fits the pixel in the middle is removed and the process continues until all pixels at the surface of the component have been tried with the mask. This means that all the outer pixels have to be identified and thereafter tried with the mask. The masks have three different pixels, white, black and gray. The gray pixel means that the pixel can be either white or black. If pure white/black masks are wanted they can be made but it means that there are four times as many masks.

The thinning process can also be made for eight connectedness A thinned image has often some branches of pixels, which is due to noise in the image. These branches can be removed by pruning, which is described in the next subsection.


Pruning is a process in which the branches of a skeleton in an image are removed. One end pixel of each branch is removed for each iteration in an iterative process. A problem with pruning is that it also removes an end pixel from the object, which
is wanted, unless it is a closed line. This means that the pruning for not closed objects shall be restricted to a few iterations to avoid removing too much of the wanted information.

The pruning process is made by the help of masks that are applied to the image. There can again be two sets of masks one for four connectedness and one for eight connectedness. Common for them is that they enable removal of pixels if they are in the end of a branch.


So , these were some of the primitive processing operations which are applied on the captured Image. Not all the operations are necessary , actually it depends on our need.

After the application of these operations the image contains the required data ( up to 90 % ) and rest is noise.

The operations discussed here are known as spatial operators as they operate on the image pixel value data other category of operators are known to operate on spectral data.
Tags: None Add / Edit Tags