You are on page 1of 5

2015 IEEE Bombay Section Symposium (IBSS)

Maze Solving Robot using Image Processing


Omkar Kathe Apoorv Jagtap
Dept. of Electronics Engineering Dept. of Electronics Engineering
Vidyalankar Institute of Technology Vidyalankar Institute of Technology
Mumbai, India Mumbai, India
omkar.kathe@vit.edu.in apoorv.jagtap@vit.edu.in

Varsha Turkar Girish Gidaye


Dept. of Electronics Engineering
Vidyalankar Institute of Technology Dept. of Electronics Engineering
Mumbai, India Vidyalankar Institute of Technology
varsha.turkar@vit.edu.in Mumbai, India
girish.gidaye@vit.edu.in

Abstract— Maze solving problem involves determining the Traffic control is a real life example of maze solving
path of a mobile robot from its initial position to its destination technology which also helps to find the shortest path for the
while traversing through environment consisting of obstacles. In ambulance or fire fighters. In a country like India, major cities
addition, the robot must follow the best possible path among are plagued with hap-hazard planning leading to daily traffic
various possible paths present in the maze. Applications of such
jams. There are no alternate roads for emergency situations.
autonomous vehicles range from simple tasks like robots
employed in industries to carry goods through factories, office But technologically the country has farthest advancement in
buildings and other workspaces to dangerous or difficult to reach remote sensing satellite technology which can be used for
areas like bomb sniffing, finding humans in wreckage, etc. traffic management and not just for surveying forest, land and
Existing robots employed in labyrinth problems use long process other resources.
of training and are incapable of adjusting to dynamic
environments. The method proposed here involves image Currently two of the most anticipated technologies; Internet
processing and path finding algorithm; which works faster of Things (IoT) and Driverless cars can be integrated with the
because of beforehand acquiring the maze's data rather than methodology described in the papers thus making travelling
going through the maze cell by cell. The entire maze is captured much more hassle free, and robots adaptive and smarter.
to determine the possible paths and using Direction Envelope
Algorithm for finding the best route. This approach gives robot a This paper talks about a similar approach which has been
prognosis and avoids being trapped or falling in loops. devised and tested practically on a model of maze. A maze
made up of 105x105 cm dimension was designed. A micro
Keywords— Maze; Image processing; scaling; Direction mouse of 14x8 cm dimension was used for navigating the
envelop algorithm maze.

I. INTRODUCTION II. LITERATURE REVIEW


The automation technology has grown rapidly in the last There are number of different maze solving algorithms. To
century, influencing every aspect of our lives. The role of find the shortest path between the start and the end is the crux
autonomous mobile robots to this trend has been tremendous. of any algorithm, which the researchers care about while
These mobile robots can be deployed for various tasks. In the developing. Up till now many algorithms have been proposed
manufacturing industry, they can be used to transport items to solve the shortest path finding problem. The paper
and tools from one station to another, accurately and quickly. presented by Mustafa H, Onap [3] highlighted the basic
They have also been deployed for home automation, where a construction of a micromouse and maze. In 2009 Ant Colony
mobile robot is used as vacuum cleaner. This function is Optimization (ACO)[4] was used to solve a mobile robot path
achieved by the mobile robot navigating itself effectively and planning problem. Many maps with varying complexities were
efficiently around an area in the house and cleaning it used to solve this problem. In this, each map was represented
simultaneously. One of the areas where mobile robots are used as grid of equal number of rows and columns having starting
on a large scale is path planning. Path planning is defined as and destination point. The robot found a path to destination by
follows: Given a description of the environment to a robot, avoiding obstacles and walls with shortest possible path.
plan a path between two specific locations. The path must be
collision-free (feasible) and satisfy certain optimization Another approach described in [2] states about camera
criteria. mounted micromouse. The walls and path are identified by

978-1-4673-9542-7/15/$31.00 ©2015 IEEE


thresholding and then the central portion of the image was performed. The algorithm is developed and scripted in
aligned with the forward path and the robot moved forward. Matlab14. As shown in the flow chart (fig 2) after capturing the
Similar steps are repeated during turning points. image through camera, it is converted into gray scale (8
bit).Then histogram equalization is applied to improve the
Behnam Rahnama, Atilla Elçi & Shadi Metani [1] proposed quality of the image. Smoothing filter is applied to remove the
an algorithm based on image processing. This algorithm noise .The image is converted into binary image by selecting
focuses on entire maze instead of a part in which robot is proper threshold value. Skeletalization is performed to find the
currently present. This gives robot preplanning time as entire paths and pruning is applied to remove unwanted parts of the
paths. Overylaying is a done by selecting anyone plane of the
maze map is known to robot. This will avoid mistakes such as
pruned image (in this case, red plane) and then the pixels are
loop or dead ends.
simply replaced in the original image. Figure 3a and Figure 3b
shows the original and final images after preprocessing steps.
For field testing these algorithms the micro mouse
competitions served a better ground. Robotics competitions
have interested the engineering community for many years.
Robots compete on an international scale in events such as the
annual MIT robot competition and the BEAM robotics games.
One of the most popular is the Micromouse competition.
Micro mice are small, autonomous devices designed to solve
mazes quickly, and efficiently. The Micromouse competition
has existed for almost 25 years in the United States, and even
longer in Japan and has changed little since its inception. The
goal of the contest is simple: the robot must navigate from a
corner of a maze to the center and points are rewarded as a
function of total time in maze and the time of the fastest run.
The method proposed in this paper finds the path from source
to destination using image processing.
III. PROPOSED APPROACH

Fig 2: Flow chart for Pre-processing

Fig 1: Block Diagram– Proposed Approach

The block diagram for proposed system is shown in Figure 1.

A. Capturing and Transmitting Image


The top view of the maze is captured using USB camera
and the image is saved in the desired folder in PC for
further processing.
B. Preprocessing of Image
This is the important phase of the system which involves a:Original Image b: Image after pre- Processing
pre-processing to find the path from starting point to Fig 3: Maze 1
destination. This is achieved using MATLAB software Version
14a. First, the captured image from previous step is converted C. Direction Envelope Algorithm(DEA)
into gray scale and then histogram equalization is applied to
Now there is a virtual line (path in the image) which is to be
make it independent of any light variations in the surroundings.
Then operations like blurring, thresholding, cleaning are followed by robot in real world, a case similar to line follower
robot. To accomplish this, the coordinates from the image are coordinates of the path are obtained in desired sequence in a
extracted in a sequence, starting from start point and ending at table.
exit point of the maze. These will then be passed to robot to
complete the goal of traversing. For obtaining coordinates in D. Conversion to machine code
desired sequence the Directional Envelop Algorithm (DEA) The obtained coordinates cannot be directly given to
was proposed. Following are the steps of the algorithm. microcontroller to drive the motors due to hardware –software
• First pixel( starting point ) is selected by scanning incompatibility. Instead, the coordinates are analyzed for
rows and columns for white pixel in pruned image, direction and converted to corresponding chain codes. These
the smallest row coordinate is selected (assumption is chain codes are passed to Arduino IDE and are used to control
that maze starts near left hand corner of the the motors.
image).The pixel coordinates are taken as (x,y).
E. The Micromouse
• Downwards direction is initialized as forward Micromouse comes with different configurations. It varies
direction .Hence , the five pixels (x,y+1),(x+1,y+1), according to main task it is planned to achieve that is faster
(x-1,y+1),(x+1,y),(x-1,y) are compared with (x,y) for navigation (speed) or method of maze solving. The
micromouse used here had minimum hardware consisting
adjacency (Figure 4a), respectively. These pixels of just 2 dc motors, a driver module, Arduino board and a
form an envelope around the pixel(x,y). battery. The motor instructions are programmed into Arduino
using USB and then the robot travels the desired path.
• If ahead pixel (x,y+1) satisfies adjacency then the
coordinates of this point are stored in a table .This IV. RESULTS AND DISCUSSION
pixel( x,y+1) is now referred as (x,y) for finding next The proposed approach demonstrates better results than
adjacent pixel (Figure 4 b). following method [1]. The simple reason is, the capturing
method employed in the process.
• If ahead pixel (x,y+1) does not satisfies adjacency
• The method [1] consist of capturing images of maze
then the (x+1,y+1) pixel is checked for adjacency
from 4 corners of maze and then patching them. In all
(Fig 4b). I it satisfies then coordinates of this point
7 images were taken of maze and then patched and
are stored in the table. The direction of envelop is
proportionally scaled, to form a single image which
changed (Figure 4c) i.e. new set of pixels are
was further process.
compared in preceding direction . The pixel(x+1,
y+1) is referred as (x,y) for finding next adjacent
pixel . • The method in this paper consists of capturing top
view of maze. This gives the direct view of maze and
reduces the pre-processing steps of patching and
reconstructing the image. Thus all the information
about the maze can be extracted in one go instead of
traversing the maze and getting it part by part.
Figure 3 shows simple step of maze solving. Here, only pre-
processing is required.

A. Path Detection
The application of proposed algorithm gives single path. All
of the results were excellent and up to the expectation of the
designed concept of the methodology. Some mazes have
diversions and or multipath. The algorithm treated them as
single path mazes and path was detected. Figure 5 shows one
such maze. The subsequent figures show prominent test results
obtained.
The path obtained from preprocessing Figure 6 has 2 v-
shaped branches due to skeletalization. So the robot will enter
and exit from either comer of maze. Pruning eliminates sub-
branches of the path. This will help robot in avoiding the areas
Fig 3: DEA Explanation and corners from where it will return back to same node as
shown in Figure 7.
These two steps keeps on repeating till the end point of the
maze is reached and accordingly the path is traced and all the
then be converted into micro-controller instructions based on
coordinate values. This method is similar to chain coding of
image boundary. An array of sequenced coordinate was
obtained as shown in Figure 8, these coordinates were then
plotted to reconstruct the final path supposed to be followed
by robot. Figure 9a and b shows the perfect resemblance
results of paths of mazes 1 and 2 respectively.

Fig 5: Image of test maze (Maze 2)

Fig 8: Sequenced array of coordinates (Maze 1)

Fig 6: Solution with multiple paths (Maze 2)


a: Maze 1 solution

Fig 7: Maze with single path (Maze 2)

B. Coordinate Sequencing b: Maze 2 solution


Fig 9: Results
Here the obtained path coordinates are arranged into
sequence of their adjacent occurrence using DEA. This will
C. Scaling and robot coding
All the processing is done virtually and then emulated and
verified. To embed it in real life, scaling has been performed.
Scaling helps in deciding how much time the motors of the
robot should be powered on so that it will cover one pixel
proportional distance in reality. Also the degree of turning of
the robot and the method implied into turning the robot played
a vital role.
Since the robot’s power source was lacking in constant
current features, the scaling factor; that is the time delay factor
for motor had to be changed in every run. In the initial runs,
high current was drawn by motor, as a result the scaling factor
was small (around 500ms) and as the current dipped, it
stretched (approx. 2000ms). The robot moved in approximate
shape of the path.
V. CONCLUSION
An approach to solve the maze that eleminates the long
process of training the micromouse was introduced. The
hardware requirement is very feeble decreasing the overall
cost of a micromouse-robot system. From an application point
of view all the hardware is present in today’s world (driverless
cars, remote sensing satellite). The method can be used to
integrate these two technologies to get a real-time navigation
solution by any individual.

Results show that path construction from image depends


upon the preprocessing stages and type of maze on which the
process is applied. Some extra vestiges may stay in the maze
in spite of p r u n i n g , thus the robot may go off-track. And to
scale the robot properly a constant current source is necessary.

REFERENCES
[1] Behnam Rahnama , Atilla Elçi & Shadi Metani,”An image processing
approach to solve Labyrinth Discovery robotics problem” , 36th
International Conference on Computer Software and Applications
Workshops ,2012.
[2] Vincent Onillon, Guido Bugmann & Alan Simpson ,”Artificial vision
for Micro-Mouse”, Research report, University of Plymouth, July 1995,
NRG-95-05
[3] Mustafa H, Onap, “A design and overview of micromouse”, IEEE
Potentials, May 1986.
[4] Yee Zi Cong and S. G. Ponnambalam, “Mobile robot path planning
using Ant Colony Optimization”, IEEE/ASME International Conference
on Advanced Intelligent Mechatronics, 2009.

You might also like