IMPLEMENTATION AND EVALUATION OF IMAGE PROCESSING TECHNIQUES ON A VISION NAVIGATION LINE FOLLOWER ROBOT

In a fast growing industrial world, carriers are required to carry products from one manufacturing plant to another which are usually in different buildings or separate blocks. This study intends to automate this sector using vision controlled mobile robots instead of laying railway tracks which are both expensive and inconvenient. To achieve this purpose an autonomous robot with computer vision as its primary sensor for gaining information about its environment for path following is developed. The proposed Line Follower Robot (LFR) consists of web cam mounted on the vehicle and connected to Matlab platform. A PID control algorithm will be applied to adjust the robot on the line. The proposed LFR is accomplished through the following stages: Firstly, the image is acquired using the web cam. The acquired RGB image is converted to another color coordinates for testing and comparing to choose the best color space. After that, the image contrast is enhanced using histogram equalization and then Wiener, Lee and Kuan filters are implemented to decide the best filter to be implemented. Subsequently, the basic morphological operations are carried out to choose the suitable operation to be utilized. The results are evaluated qualitatively and quantitatively from the points of Peak Signal-to-Noise Ratio (PSNR), entropy and image smoothness. The results show that the closing process is more suitable for the vision enhancement purpose, as well as the wiener filter gives the best result as regards the time and efficiency. Besides, the demonstrated LFR is capable of tracking a pre specified colored line as long as it is different from the surroundings.


INTRODUCTION
Mobile robotics research has been attracting huge interest in the past few years. They are the focus of a great deal of current research and almost every major university has one or more labs that focus on mobile robot research. The main goal of these researches is to establish effective ways for a mobile robot to navigate from one place to another (Ali and Nordin, 2010;AL-Taharwa et al., 2008). Robot navigation means its ability to determine its own position in its frame of reference and then to plan a path towards some goal location.
A LFR is basically a robot designed to follow a line or path. Generally, the path is predefined and can be either visible like a black line on a white surface with a high contrasted color or it can be invisible like a magnetic field. In order to detect these specific markers or lines, various sensing schemes can be employed. These schemes may vary from simple low cost line sensing circuit to expansive vision systems (Hasan et al., 2012;Skaff et al., 2003). A number of techniques are available for LFRs. Most of these techniques are based on equipping the robot with a sensory system, to permit the acquisition of information about the robot's Science Publications JCS surroundings (Pakdaman and Sanaatiyan, 2009;Hasan et al., 2012;2013;Thirumurugan et al., 2010). There are several types of sensors to be considered that is suitable in applying to line following such as Infrared (IR) sensor and led photo cell sensor. Pakdaman and Sanaatiyan (2009) has designed a small line following robot which used IR sensors to detect the line drawn on floor. Thirumurugan et al. (2010) designed a LFR for library inventory management system. Sensor operated motors are used to keep track a predetermined line path for library book shelf planning. The robot holds a barcode reader that collects the barcode data from the books and compares the decoded barcode data with the explored input. Ibrahim (2011) has developed a fuzzy logic controller to guide a hexapod robot movement. Fuzzy logic control as intelligent control is applied to govern the robot follow line and wall. Infrared sensors are used to sense line and distance to the wall as the input variable for the controller. Hasan et al. (2013) designed a LFR that is cabaple of selecting a desired line among multiple lines autonomously, based on the received data from the sensors. These lines have different colors and the LFR can differentiate among various colors and choose a desired one to find its target. Furthermore, the robot has the ability to detect presence of obstacle on its path.
However, these IR sensors have three drawbacks, they can sense only between two contrasting colors, they are easily affected by ambient light and the sensor must be close to the line. Besides, the led photo cell sensor is affected with sun light or ambient light also its error detection is huge (Pakdaman et al., 2010). Thus, there is an urge to use image processing techniques to accomplish this task. Skaff et al. (2003) developed an autonomous sensor-guided behavior for a six-legged dynamical robot (RHex). RHex uses a Sony camera to detect a 3 cm-wide yellow tape lay on the ground. Vision software extracts the line through color segmentation. In (Chakraborty et al., 2009) an algorithm for capturing a red ball from a white platform through a PC-based webcam using Matlab software was designed. Zhao and Jiang (2010) introduced a machine vision system that is capable of navigating an agricultural autonomous robot traveling between crops rows. The vision system consists of a color video camera and a computer. Hough Transform is utilized to extract the real navigation line. Ismail et al. (2009) proposed a vision based line following mobile robot where the image buffers are processed via a customized image segregation method to output necessary information for the robot's controller.
The task is to allow the mobile robot to navigate through a predefined path marked by a white line on a dark green floor surface. Nevertheless, all previous works were color dependent, there was nothing said about detecting different colored lines. Therefore, this study proposes an approach for providing real-time image processing method to support vision guided navigation of a LFR that has the ability to track different colored lines.
The study is organized as follows: Section 2 presents the materials and methods. The experimental results are demonstrated in section 3. Section 4 discuses the obtained results. The concluding remarks are finally presented in section 5.

MATERIALS AND METHODS
The proposed LFR is composed of; sensing system which includes Matlab platform connected to a web cam, microcontroller PICI6F877 and DC motors (Elhady, 2012). A photograph and a block diagram of the implemented robot are shown in Fig. 1 and 2, respectively. The camera takes the surrounding environment image which will be processed through the matlab environment to produce an output signal informing the microcontroller the location of the line with respect to the robot, the microcontroller will therefore issue a signal to the motors to adjust the robot to trace the line. The Matlab platform will be mounted on the top of the robot and the web cam will be mounted on the front of the robot and connected to Matlab platform (Elhady, 2012). The aim of our study is to present a concrete foundation for the design of a vision navigation colored LFR system. The proposed vision navigation LFR is accomplished through the following stages: Firstly, the image is acquired using a web cam mounted on the vehicle. The acquired image is converted to another color coordinates for testing and comparing to choose the best color space. After that, the image contrast is enhanced using histogram equalization and then the image is filtered. Wiener, Lee and Kuan filters are tested to decide the best filter to be implemented. Subsequently, morphological operations are carried out. The results are evaluated qualitatively and quantitatively from the points of Peak Signal-to-Noise Ratio (PSNR), entropy and image smoothness. Next, the line position is detected with respect to the robot. Finally, the gathered information is fed to the robot processor to tell the LFR where to go next (Elhady, 2012).

Image Preprocessing
The acquired image is in the form of 2D RGB color image. The RGB color model is the standard design of computer graphics systems, but it is not ideal for all of its applications. Thus, in this section we will investigate the conversion of the acquired image into other color models to choose the appropriate color model to be applied. Furthermore, the implementation of histogram equalization for image enhancement is presented.

Colored Image Conversions
The RGB color components are highly correlated. Many processing techniques, such as histogram equalization, only work on the intensity component of an image. Furthermore, due to the interaction between the color components (R, G and B), it is difficult to discriminate between objects and the background in the color images. Thus we convert the RGB data into another color space. The Hue Saturation Intensity (HSI) space is often a better way to represent color images (Nino et al., 2009). The advantages of HSI model are; the intensity is separated from the color information, as well as the hue and saturation components are closely related to the way in which human beings perceive color.

Contrast Enhancement
Afterward, the image contrast is enhanced using histogram equalization. Histogram equalization is an image enhancement technique; it improves the visual appearance of the image by assigning equal number of pixels to all available intensity values (Ravichandran and Magudeeswaran, 2012). The histogram equalization is applied as follows Equation (1)

Image Filtering
Image filtering is useful for many purposes, including smoothing, sharpening, removing noise and edge detection (Gonzalez et al., 2009). There are different kinds of filters such as Wiener, Lee and Kuan filters. Wiener filter is designed by minimizing the Mean Square Error (MSE) between the filtered image and the original image (Kaawaase et al., 2011). The Wiener filter for an image in frequency domain is expressed as follows Equation (2) Where: S g = The 2D discrete Fourier transform of the image g ω s and k θ = The 2D Fourier transform coordinates σ n = The noise variance The Lee and Kuan filters have the same formation, although the signal model assumptions and the derivations are different. They can both smooth noise and preserve edges efficiently (Wang, 2006;Kluine et al., 2003). They are used in Radar images, Synthetic Aperture Radar (SAR) images and ultrasonic images to remove speckle without destroying important image features (Santosh et al., 2011;Akl et al., 2012).
Essentially, both the Lee and Kuan filters form an output image by computing a linear combination of the center pixel intensity in a filter window with the average intensity of the window. The Lee filter is based on the assumption that the mean and variance of Science Publications JCS the pixel of interest is equal to the local mean and variance of all pixels within the user-selected moving window. While, Kuan filter makes no approximation to the original model. He formula used for the Lee filter is Equation (3) (Kasban et al., 2012): Where: µ im = The mean value of the input image K = Weighting factor ranges from 0 to 1 that defined as Equation (4 and 5): Where: µ win = The mean value σ win = The variance of pixels in the moving window σ im = The variance of the input image Kuan filter has the same form as Lee filter but with a different weighting function k 1 and it is given as Equation (6)

Morphological Operations
Morphology is a mean of structuring and reshaping a binary or a grayscale object. The tool used in reshaping the object is called the morphological structuring element. The structuring element is a simple matrix or a small window that reshapes the object. Morphology have become a popular tool in many image processing applications such as noise removal, image enhancement, edge detection and image segmentation (Maragos and Pessoa, 2000). There are four basic types of morphological operations; erosion, dilation, opening and closing. In erosion, every object pixel that is touching a background pixel is changed into a background pixel. This operation makes the objects smaller and can break a single object into multiple objects. In dilation, every background pixel that is touching an object pixel is changed into an object pixel. This operation makes objects larger and can merge multiple objects into one. Opening is erosion followed by dilation. Opening removes small islands and thin filaments of object pixels. Closing is dilation followed by erosion. Closing removes islands and thin filaments of background pixels.

Line Position Detection
After enhancing the acquired image, the enhanced image is then split into 8 partitions. The LFR position is detected with respect to these partitions via the Matlab program. Using the information sent by the camera to the Matlab program, the location of the pixels that matches the required line color (the RGB components of the line to be followed) is determined. Then, the mean of the pixel positions is calculated to give the center of the color with respect to the picture. A signal is then issued through Matlab to the parallel port indicating in which partition lies the line to be followed, which in turn is connected through an interface card to the microcontroller. The microcontroller will therefore issue a signal to the motors to adjust the robot to trace the line.

RESULTS
The images are taken by the camera one after one. As soon as the analysis of an image is completed the next image is then requested while the rest of the system responds to the information gathered from the first image. An example for the acquired RGB image from LFR is illustrated in Fig. 3, while Fig. 4 demonstrates the corresponding HSI, H, S and I images. The image contrast is then enhanced using histogram equalization which helps to even out the illumination in the image. Figure 5 shows the effect of histogram equalization in the contrast enhancement of RGB, HSI, H, S and I images.
For quantitative evaluation of the results the PSNR, the entropy and the image smoothness are calculated and compared for the different color coordinates. PSNR is the ratio between the maximum possible power of a signal and the power of corrupting noise that affects the fidelity of its representation. Consider the original image is F (i, j) and the interpolated image is G (i, j) with both of size m x n then the PSNR is defined as Equation (7) Where: MAX = The maximum possible pixel value of the image MSE = Mean square error MSE = Identified as Equation (8): It is known that the lower value for MSE means lesser error and as seen from the inverse relation between the MSE and PSNR, this translates to a higher value of PSNR. Logically, a higher value of PSNR is good because it means that ratio of signal to noise is higher. Here, the signal is the original image and the noise is the error in reconstruction. The entropy is a measure of average information content. If P denotes the probability mass function of F, the entropy is defined by Equation (9): The smoothness measures the relative smoothness of the intensity in a region as follows Equation (10) Table 1 shows the quantitative evaluations of the images enhancement after contrast enhancement using histogram equalization. The results show that the contrast enhancement improved the image quality and the hue component gives the best results. So it can be used to enhance the vision of the LFR. The hue image is then filtered using Wiener, Lee and Kuan filters. Figure 6 demonstrates the effect of the three filters on H image. Figure 6 the effect kuan filter on the H image Table 2 shows the quantitative evaluations of the filtered H image using Wiener, Lee and Kuan filters. The results indicate that the PSNR after using Wiener filter is improved, where it is increased to 31.5633. While the entropy is enhanced to 7.8070 and image smoothness is equal to 0.0411. Furthermore, it can be clearly pointed out from the results that the execution time for the Weiner filter is considerably small (2.1557 sec) regarding the other implemented filters. So we can say that the Wiener filter gives the best result as regards the time and efficiency. Finally, morphological operations are applied. Figure 7 demonstrates the effect of the four basic morphological operations using a rectangular flat disk structure element with size 20×20 on the Weiner filtered image. Table 3 shows the evaluation of implementing the four basic morphological operations. The obtained results demonstrates that the erosion process breaks the blob area into multiple small areas. While, the dilation process merges multiple areas into one large area. So erosion or dilation processes cannot be used alone for improving the enhancement process. Alternatively, closing and opening operations have almost similar evaluation values and processing time, however closing operation outperform opening operation with respect to line localize. Thus, the closing process is more suitable for line localization at a minimum processing time. Afterward, the enhanced image is then split into 8 partitions (Fig. 8). LFR position is detected regarding these partitions. A signal is then issued through Matlab to the parallel port, indicating in which partition lies the line to be followed, which in turn is connected through an interface card to a microcontroller. The microcontroller will therefore issue a signal to the motors to adjust the robot to trace the line.
The proposed LFR outperforms the conventional LFR which uses sensors (Pakdaman and Sanaatiyan, 2009;Thirumurugan et al., 2010;Ibrahim, 2011) such that it is easily obtainable (employs only a common low cost webcam) and the vision system provides more reliable input than sensors, as the input for the motion controller is dependent on the robustness of the image processing on each frame grabbed from the webcam. Furthermore, it has several advantages over existing vision based LFR (Skaff et al., 2003;Chakraborty et al., 2009) in the field of overcoming the variations in the lighting conditions and camera distortion over different color tracking as well as it does not require any changes or addition to the robot's environment to assist with the line following or navigational task.

CONCLUSION
This study proposed a method for vision enhancement of a LFR using digital image processing techniques. The results are evaluated qualitatively and quantitatively from the points of PSNR, entropy and image smoothness. The HSI color coordinates have been contrast enhanced using histogram equalization, the results show that the contrast enhancement improved the image quality. Furthermore, the hue component gives the best results. Then, the H image is filtered using Wiener, Lee and Kuan filters. The results demonstrate that wiener filter improves the PSNR and the entropy of the H image. Furthermore, its execution time is considerably small regarding the other implemented filters. So the wiener filter gives the best result concerning the time and efficiency. Finally, morphological operations have been utilized for object reshaping. The results show that the closing process is more appropriate for the vision enhancement purpose. The proposed LFR is robust against environmental factors such as darkness, lighting, camera distortion as well as line color. The suggested future work is directed for two aims; enhancing the proposed approaches as well as increasing the capabilities and applications of the proposed approaches.
The proposed LFR can be extended to follow any colored objects such as another robot, car. Moreover, for the sake of increasing the speed of processing, the image processing may be designed and implemented via FPGA.