Sunteți pe pagina 1din 8

IPASJ International Journal of Electronics & Communication (IIJEC)

Web Site: http://www.ipasj.org/IIJEC/IIJEC.htm


A Publisher for Research Motivation ........ Email:editoriijec@ipasj.org
Volume 5, Issue 9, September 2017 ISSN 2321-5984

An Improved Edge Detection algorithm using


Cellular Automata
Parwinder Kaur Dhillon1 , Pooja Dhand2
1
Assistant Professor Dev Samaj College for Women, Sector 45-B, Chandigarh

2
Assistant Professor Apeejay College of Fine Arts, Jalandhar

Abstract
These Edges of an image are considered a type of crucial information that can be extracted by applying detectors with different
methodology. Most of the classical mathematical methods for edge detection based on the derivative of the pixels of the original
image are Gradient operators, Laplacian and Laplacian of Gaussian operators. Gradient based edge detection methods, such as
Roberts, Sobel and Prewitts, have used two 2-D or 3-D linear filters to process vertical edges and horizontal edges separately to
approximate first-order derivative of pixel values of the image. The Laplacian edge detection method has used a 3-D linear
filter to approximate second-order derivative of pixel values of the image. Major drawback of second-order derivative approach
is that the response at and around the isolated pixel is much stronger. In this paper, a novel technique based on Cellular
Automata other than the evaluation of derivates of the image in detecting edges in gray level images has been proposed. The
proposed approach solves this problem at some extent. In the proposed method, we have used a set of rules to detect and locate
the edges in the image. It has been observed that the proposed edge detector works effectively for different gray scale digital
images. The results of this study were quite promising.

Keywords: Edge, Edge detection, Cellular Automata, Gradient operators

1. INTRODUCTION
Vision is the most advanced of our senses and images play the most important role in human perception. Unlike
humans who are limited to the visual band of the electromagnetic (EM) spectrum, imaging machines cover almost the
entire EM spectrum, ranging from gamma to radio waves. They can work on images generated by sources that humans
are not adapted to associating with images. These include ultrasound, electron microscopy, and computer-generated
images. Thus, digital image processing encompasses a wide and varied field of applications.

Edge detection technique has a key role in machine vision and image understanding systems. In machine vision motion
track and measurement system based on discrete feature, the exact feature edge orientation in the image is the
precondition of the successful completion of the vision measurement task [1]. Edge detection is one of the most
commonly used operations in image analysis and digital image processing. Many studies have been conducted to
enhance the edge detection algorithms in various domains.

Edge detection has received much attention during the past two decade because of its significant importance in many
research areas [2]. Since, the edge is a prominent feature of an image; it is the front-end processing stage in object
recognition and image understanding system. The accuracy with which this task can be performed is a crucial factor in
determining overall system performance [3]. The detection results benefit applications such as image enhancement,
recognition, morphing, compression, retrieval, watermarking, hiding, restoration and registration etc [4].

Since computer vision involves the identification and classification of objects in an image, edge detection is an essential
tool. Edge detection is part of a process called segmentation - the identification of regions within an image.
Technically, edge detection is the process of locating the edge pixels, and edge enhancement will increase the contrast
between the edges and the background so that the edges become more visible.

Over the years several edge detection approaches have been proposed. They can be categorized as: Gradient Based and
Zero Crossings Based methods. The gradient based operators include Roberts, Sobel, and Prewitt edge operators and
use the first order directional derivatives of the image to calculate a quantity related to edge contrast for edge detection.

Volume 5, Issue 9, September 2017 Page 7


IPASJ International Journal of Electronics & Communication (IIJEC)
Web Site: http://www.ipasj.org/IIJEC/IIJEC.htm
A Publisher for Research Motivation ........ Email:editoriijec@ipasj.org
Volume 5, Issue 9, September 2017 ISSN 2321-5984

They consist of convolving small kernels of 3x3 sizes with the image. The Zero crossings operators consist of
calculating the second order derivatives to find out the locations of zero crossings.

A number of edge detection techniques are available but there is no single detection method that performs well in every
possible image context. The Canny algorithm uses an optimal edge detector based on a set of criteria which include
finding the most edges by minimizing the error rate, marking edges as closely as possible to the actual edges to
maximize localization, and marking edges only once when a single edge exists for minimal response [5]. However, a
main problem of Cannys work is a trade-off involved amid detection and localization: as the scale constraint increases,
the detection accuracy increases but the localization accuracy decreases. In order to set the appropriate value for the
scale constraint, the noise energy must be well-known. However, it is not an easy task to locally measure the noise
energy because both noise and signal affect the local measure [4].

This paper proposes a new rule based method for detecting edges using Cellular Automata.

2. CELLULAR AUTOMATA
Cellular Automaton is a dynamical system which is not only discrete in time, but spatially discrete as well. In a Cellular
Automaton, all cells behave identically, and have the same connectivity. The cellular automata strategy was originally
invented by Ulam and Von Neumann to emulate the behavior of natural complex systems [11]. The cellular automaton
is a computer algorithm that is basically discrete in space and time and operates on a grid of cells. It consists of a
regular grid of cells, each of which can have one state from a finite range. The cellular automata models assume
relatively complicated configuration by using neighborhood and iterations [8].
Cellular automata is defined as
CA =(Cells, Cells space, Cells state, Neighborhoods, Rules).
A transition function determines the next state for each cell-state in the automaton by using the values of its
neighborhood cells. According to the application and structure of cellular automata the neighborhood of a cell can be
defined. Von Neumann and Moore neighborhood for cellular automata are shown in Figure 1 and 2, respectively.

Figure 1 Von Neumann neighborhood Figure 2 Moore neighborhood

Over the last 50 years, a variety of researchers have investigated the properties of CA. Particularly, in the 1960s and
1970s, considerable effort was expended in developing special purpose hardware (e.g., CLIP) alongside developing
rules for the application of the CAs to image analysis tasks. More recently, there has been resurgence in interest in the
properties of CAs without focusing on massively parallel hardware implementations, i.e., they are simulated on
standard serial computers. By the 1990s, [12] CAs could be applied to perform a range of computer vision tasks, such
as
calculating properties of binary regions such as area, perimeter, and convexity;
performing medium level processing such as gap filling and template matching;
Performing image enhancement operations such as noise filtering and sharpening;
performing simple object recognition.
One of the advantages of CA is that, although each cell generally only contains a few simple rules, the combination of a
matrix of cells with their local relations leads to more refined evolving global behavior. That is, although each cell has
an extremely limited view of the system, localized information is propagated at each time step, enabling more global
characteristics of the overall CA system [9].
A disadvantage with the CA systems described above is that the rules had to be carefully and laboriously generated by
hand. Not only is this tedious, but it does not scale well to larger problems. More recently, there has been a start to
automating rule generation using evolutionary algorithms [10].

Volume 5, Issue 9, September 2017 Page 8


IPASJ International Journal of Electronics & Communication (IIJEC)
Web Site: http://www.ipasj.org/IIJEC/IIJEC.htm
A Publisher for Research Motivation ........ Email:editoriijec@ipasj.org
Volume 5, Issue 9, September 2017 ISSN 2321-5984

2.1 Basic Algorithm of Cellular Automata


1. Initialize all cells with specified initial conditions.
2. For each cell, determine what it should become in the next time step, based on the states of its neighbors.
3. Update all cells simultaneously.
4. Go to step 2.
2.2 The game of life
The most well known cellular automaton was implemented as Conways game of life. It used a 100 by 100 cellular
automaton, using the rule that if only two or three neighboring cells are alive the cell in question stays alive (state is
equal to 1) otherwise (less than two or more than three) it dies (state is equal to 0). A cell can only come back to life
when surrounded by three alive cells.

3. EDGE DETECTION
Edge detection refers to the process of identifying and locating sharp discontinuities in an image. The discontinuities
are abrupt changes in pixel intensity which characterize boundaries of objects in a scene [12]. Classical methods of
edge detection involve convolving the image with an operator (a 2-D filter), which is constructed to be sensitive to large
gradients in the image while returning values of zero in uniform regions.

Canny [5] proposed a method to counter noise problems and minimize the probability of false edges. In his work image
is convolved with the first order derivatives of Gaussian filter for smoothing in the local gradient direction followed by
edge detection by thresholding [7]. Canny edge detector has major drawbacks of being computational complexity and
do not give a satisfactory results in varying contrast areas. However, improvement in the edge-detection research area
has now resulted in the use of some tools such as neural networks, ant colony and, fuzzy logic by some presented
algorithms [7].

There are an extremely large number of edge detection operators available, each designed to be sensitive to certain
types of edges. An edge is not a physical entity, just like a shadow. It is where the picture ends and the wall starts.

Traditionally, edges have been loosely defined as pixel intensity discontinuities within an image. Edge detection is
usually a subjective task. As a user of an edge detector, one should not expect the software to automatically detect all
the edge he or she wants and nothing more, because a program cannot possibly know what level of details the
experimenter has in mind Edge detectors are based on differentiation can be categorized into two classes:-

(a) Gradient or First Order Based Edge Detector: - The first order derivative searches for the maximum or
minimum value pixel of an image. And the pixel containing this value is considered to be an edge. Sobel operator is an
example of Gradient Edge Detector.

(b) Zero Crossing or Second Order Based Detector: - The second order derivative of a pixel when results to zero, it
is considered to an edge that is why this method is termed as Zero Crossing. Laplacian Operator is an example of Zero
Crossing Edge Detector.

4. EXISTING METHOD
An image data is formed by pixels. A two dimensional image data is represented as a 2-dimensional M x N matrix,
where M is the number of columns, and N the number of rows. The simplest example of an image data is the binary
image where each pixel can have only two values black or white. Assuming black color being represented by 1 and
white color by 0, we form the image data matrix in unit of binary information [6].
In Figure 3 (a) an image data of 100 pixels (size 10 x 10) composed of binary information (0 and 1 bits) is shown.
The monochrome image is visualized in Figure 3 (b).
Next step in cellular automata is to count the number of neighbors of each cell. This is represented in Figure 4(a), and
then different colors are used for each number of neighbors and the new image is plotted in Figure 4(b)
Defining a rule similarly as in Game of Life, for certain number of neighbors a cell will die, born or keep is state. For
the example, assume that all cells with 3 neighbors or less will die of loneliness, and those cells with 7 neighbors or
more will die of over population. Only the cells with 5 neighbors will be born, and furthermore the cells with 4 or 6
neighbors keep its previous state [6].

Volume 5, Issue 9, September 2017 Page 9


IPASJ International Journal of Electronics & Communication (IIJEC)
Web Site: http://www.ipasj.org/IIJEC/IIJEC.htm
A Publisher for Research Motivation ........ Email:editoriijec@ipasj.org
Volume 5, Issue 9, September 2017 ISSN 2321-5984

Taking the color out of those cells which died, we obtain the Figure 5 (a). At last, setting the values of the dead cells to
0, and the values of the alive cells to 1, and then re-plotting the image in monochrome mode, the final result of the
edge detection is shown in Figure 5(b).

Figure 3 Example of a cellular representation of a heart-


shape image

FIGURE 4 Example of a cellular representation of a heart-shape image

FIGURE 5 Heart-shape image after edge detection

4.1 Architecture of the Edge Detector Model


The flowchart for program coding for the proposed method of edge detection based on image processing with cellular
automata as explained above is shown in Figure 6.

Volume 5, Issue 9, September 2017 Page 10


IPASJ International Journal of Electronics & Communication (IIJEC)
Web Site: http://www.ipasj.org/IIJEC/IIJEC.htm
A Publisher for Research Motivation ........ Email:editoriijec@ipasj.org
Volume 5, Issue 9, September 2017 ISSN 2321-5984

FIGURE 6 Architecture of the Edge Detector Model Based on Cellular Automata [6]

Step 1: Read the data information that composes the image, assuming that all image data is formed by a data matrix of
size M x N.
Step 2: Set up the cellular automata map which is where the edge detector operation will be performed. This is done by
separating each pixel of the original image into one cell. As the image information is composed of a data matrix of size
M x N, the cellular automata map will be also in the shape of an M x N matrix, thus with MN cells.
Step 3: If the image is binary then proceed to step 5 otherwise for color images, it is necessary to perform black &
white transformation (go to step 4) before edge detection operation.
Step 4: Convert the color image into a binary image using any image processing method.
Step 5: Count the number of neighbors of each cell, the model used here is the Moore Neighborhood Model.
Step 6: Apply an edge detection rule in order to select the characteristics of processing of the image.
Step 7: The final result is a monochrome edge detected image. The pixel size (number of columns and rows of the
image data matrix) will be exactly the same as that of the original image data.
4.2 Edge Detection Rules
The types of rules employed in this model are "Totalistic" Rules because the state of the next state core cell is only
dependent upon the sum of the states of the neighborhood cells, and its own present state [6].
Each dead cell has state 0 as value, and each alive cell has state 1. The sum of the states of all the adjacent and
diagonal neighbors cells is calculated. The total number of neighborhood a cell has is equal to 9 and therefore the sum
of the alive neighbor cells can be at maximum 9*1=9 (all the neighbor cells are alive), and at the minimum 0*1=0 (all
the neighbor cells are dead).
After the number of alive neighbors for each cell is counted, the decision rule (DR) is applied which will determine if
the cell must become dead or alive [6].
The total number of decision rules represented by NDR is calculated:
Number of states: 2. They are 1 alive, and 0 dead.
Number of neighbors: 10. The number of alive neighbors can be from 0 to 9.
Thus, NDR = 2^10 = 1024. (Total of 1024 patterns).
It is noteworthy to understand that not all the rules are interesting, as for example if we choose a rule that kills all the
cells regardless the number of alive neighbors, or the opposite, a rule that keep all the cells born regardless of the
number of alive neighbors. Hence, it is significant to choose only the rules that present more efficiency for edge
detecting of any kind of image.
The decision rule used in this model is- all the cells with 3 alive neighbors or less will die of loneliness, and those cells
with 7 alive neighbors or more will die of over population. Only the cells with 5 alive neighbors will be born, and
furthermore the cells with 4 or 6 alive neighbors keep its previous state. This rule can be interpreted as:
DR = 0 0 0 0 1 X 1 0 0 0
Here, the X state stands for dont care, in other words keep the previous state. However, for simplification, we
assume that X will also turn out to be 1 for primarily test, so the rule can be redefined as Rule 56:
DR = 0 0 0 0 1 1 1 0 0 0
the above rule as follows can be explained as: For a given cell,
If the total number of alive neighbor is NAC, then the next state of the cell will be NS.
NAC can vary from 0 to 9, and NS is 1 or 0.
If NAC = 0 then NS = 0
If NAC = 1 then NS = 0
If NAC = 2 then NS = 0
If NAC = 3 then NS = 0
If NAC = 4 then NS = 1
Volume 5, Issue 9, September 2017 Page 11
IPASJ International Journal of Electronics & Communication (IIJEC)
Web Site: http://www.ipasj.org/IIJEC/IIJEC.htm
A Publisher for Research Motivation ........ Email:editoriijec@ipasj.org
Volume 5, Issue 9, September 2017 ISSN 2321-5984

If NAC = 5 then NS = 1
If NAC = 6 then NS = 1
If NAC = 7 then NS = 0
If NAC = 8 then NS = 0
If NAC = 9 then NS = 0
4.3 Problems in the Existing Algorithm
The major problem with the above algorithm is that it is not able to track the concavities as shown below-

FIGURE 7 Incorrect Output image

Consider another image and apply the existing method to illustrate the problem more accurately.

FIGURE 8 Example of a cellular representation of a sample


image

Figure 10 Sample image after edge detection

Volume 5, Issue 9, September 2017 Page 12


IPASJ International Journal of Electronics & Communication (IIJEC)
Web Site: http://www.ipasj.org/IIJEC/IIJEC.htm
A Publisher for Research Motivation ........ Email:editoriijec@ipasj.org
Volume 5, Issue 9, September 2017 ISSN 2321-5984

Figure 11 Missed out or false pixels

5. PROPOSED METHOD
The algorithm discussed in the section 4 suffers from the problems like unable to detect the concavities, detects false
edge pixels, and it missed out some edge pixels. The solution to this is to include the following two new rules to the
existing algorithm.

NEW RULE 1: If the number of neighbors of a pixel P is 5 and its initial state is dead, then mark it dead. Then, find a
pixel Q (initially alive) which is one of the four horizontal and vertical neighbors of P, such that the number of
neighbors of Q is greater than 5, Mark Q as alive. This rule will solve the problem of concavity.

NEW RULE 2: If the number of neighbors of a pixel P is less than or equal to 3, and its initial state is alive, then find
a pixel Q which is one of the four horizontal and vertical neighbors of P, having number of neighbors equal to 1. If any
such pixel exists then mark this pixel P as alive and not dead unlike in the existing algorithm. This rule helps from
missing out some edge pixels.
The effect of applying these two new rules to the sample images used in section 3 above is illustrated below.

Volume 5, Issue 9, September 2017 Page 13


IPASJ International Journal of Electronics & Communication (IIJEC)
Web Site: http://www.ipasj.org/IIJEC/IIJEC.htm
A Publisher for Research Motivation ........ Email:editoriijec@ipasj.org
Volume 5, Issue 9, September 2017 ISSN 2321-5984

6. CONCLUSION
In this paper simple method of edge detection based on cellular automata is discussed which is based on the Conways
Game of life. The existing method has certain drawbacks like it is unable to work well in concavities, detect false
pixels. A new efficient algorithm is proposed based on the existing method which removes all these drawbacks. It is
possible to formulate a large number of Rules; however in some cases they are not in fact useful for practical edge
detection. Hence, choosing an optimal rule set for a given task is important. The paper showed the efficiency of
Cellular Automata and its probable collaboration in image processing area. The comparison with other edge detection
methods is necessary for future studies.

REFERENCES
[1] Afshin Ghanizadeh, A hybrid approach to edge detection using fuzzy sets and cellular learning automata,
Universiti Teknologi Malaysia
[2] Yuan-Hui Yu and Chin-Chen Chang, 2006. A new edge detection approach based on Image Context Analysis.
Int. J. Image Vision Comput, 24: 1090-1102.
[3] Suchendra, M., B.Z. Yiqing and D.P. Walter, 1993. A Genetic Algorithm-based Edge Detection Technique. In:
IEEE Proceedings of the IJCNN93 Oct 25-29, 3: 2995-2999.
[4] Ziou, D. and S. Tabbone, 1998. Edge detection techniques- an overview. Intl. J. Pattern Recognition and Image
Analysis, 8: 537-559.
[5] Canny, J., A Computational Approach to Edge Detection, IEEE Trans. Pattern Analysis and Machine
Intelligence, 8:679-714, November 1986.
[6] H. T. Goi, An Original Method of Edge Detection Based on Cellular Automata, Department of Electrical
Engineering and Computer Science Korea Advanced Institute of Science and Technology, 2003
[7] Madasu H., John S., and Shantaram V., Fuzzy Edge Detector Using Entropy Optimization Proceedings of the
International Conference on Information Technology: Coding and Computing, 2004.
[8] Wang Hong, Zhang Hong-jie, Wei Hua, Image Segmentation Arithmetic Based on Fuzzy Cellular Automata.
Fuzzy Systems and Mathematics, No.18, pp.309-313, Sep.2004
[9] G. Sahoo, T. Kumar, Theory of Computation: A New Approach of Computation into Cellular Automata. In
Proceedings of the 2nd International Conference on Advanced Computing & Communication Technologies, India,
pp. 608613,2007.
[10] A. Popovici, D. Popovici., Cellular Automata in Image Processing. In Proceedings of the 15th International
Symposium on the Mathematical Theory of Networks and Systems, Romania, pp. 3444, 2000.
[11] Rangel-Mondragon, J. "A Catalog of Cellular Automata." http://library.wolfram.com/infocenter/MathSource/505/.
[12] L.S. Davis, "A Survey of Edge Detection Techniques", Computer Graphics and Image Processing, 12, 1975, 248-
270.
[13] Paul L. Rosin, Training Cellular Automata for Image Processing, SCIA 2005, pp. 195204, 2005.

AUTHOR
Parwinder Dhillon received her M.Tech in Computer Science and Engineering in 2012 from Guru
Nanak Dev University, India. She is pursuing Ph.D in Computer Science & Applications from Guru
Nanak Dev University, Amritsar. She is currently working as Assistant Professor in the Department
of Computer Science and Applications at Dev Samaj College for Women, Chandigarh. She is here
since 2005. Her research interests include fuzzy logic based expert systems, programming
languages, Digital Image Processing, Wireless Communication and database applications. She has
more than 15 research papers to her credit.

Pooja Dhand received her Ph.D degree from Maharishi Markandeshwar University, Mullana,
Ambala. She has done M.Tech. in Computer Science and Engineering from Maharishi
Markandeshwar University, Mullana, Ambala. She is working as the Assistant Professor, Computer
Science in Apeejay College of Fine Arts, Jalandhar. She has published her research works in several
well renowned conferences and journals. Her research interests and contributions are related to field
of Wireless communication. She has more than 15 research papers to her credit.

Volume 5, Issue 9, September 2017 Page 14

S-ar putea să vă placă și