Friday, March 13, 2009

EDGE DETECTION IN IMAGES : A TOTALISTIC CELLULAR AUTOMATA APPROACH

The vast majority of work in cellular automata emphasizes the representation of images in different forms. One of the immensely used areas is Image Processing. Edge Detection is the part of image processing. They have major advantages in medical image processing, space images, arts and many more.

Cellular Automata in images, as the name suggests that automata are nothing but automatic and cellular automata is automatic update of the cells.

What is cell? Here cell is not the biological cell, in this context ‘cell’ gives the meaning of pixel. Images are made up of pixels and each pixel is considered as cell. Cell forms the basic building block of the cellular automata. Here, cell acts as a memory unit or state that stores only two values either 1 or 0. For example in the image below, the dark region represents ‘1’ and white region represents the ‘0’.

1 – black or dark region

0 – white region



Edge forms the basic feature of image, where the concentration of pixels bring high changes .Where vertical and horizontal surfaces of the object meet.

Here we follow the technique called Totalistic cellular automata to find the edges in the images. Consider the image below.



The center cell of the image(light green) is called as ‘center cell’ or ‘Core Cell’ . And the neighborhood cell(dark green) of the center cell are called ‘neighborhood cells’. These cells are arranged in a uniform grid, containing the appropriate value for different purposes, and then these cells are updated simultaneously at that time stamp based on some simple rules. The rules define the state of the cells for the next time stamp and inturn depends on the neighborhood of the cell. Every cell in the cellular automaton has similar form of neighborhood.

The neighborhood used here is Moore neighborhood which is named after scientist Moore. It has 8 cells. The core cell is surrounded by eight neighborhood cells. In addition they have diagonal cells which are similar to square. Total number of cells is 9. The diagram of Moore neighborhood is shown in Fig. 2 below.



The steps used to find the edges using cellular automata technique is as follows,

1. Give Binary image as input.

The binary image can be any image of black and white or greyscale. For example, we take heart shaped image as shown below, First image is input image, second image is binary form of input image.


2. Count the number of neighborhoods of each cell and apply Moore neighbourhood

Neighborhood can also be called as mask. This mask is added to the input image. And the number of 1's around the mask is found out or counted and accordingly the center cell value (1 or 0) is updated based on the rules(binary rules). This is shown as below, The first image is mask, and other two images are numbered binary images.



3. ___3. Apply Edge detection rules

___Edge detection rules used here are normally binary rules. We use MATLAB to process this rules. The edge detection rules for the above heart shaped input image is as follows,

Cells with (neighbours<=3) => die of loneliness => assign the binary value ‘0’

Cells with (neighbours>=7) => die of overpopulation => assign the binary value ‘0’

Cells with (neighbours =5) => born => assign the binary value ‘1’

Cells with (neighbours 4 & 6) => previous state => '0' or '1'

The rule is = 0 0 0 0 1 1 1 0 0 0

___Convert the result to decimal form, hence the name Rule 56


___4.Obtain processed image data

____The image shown below is the final output of edge detection using cellular automata technique.