RatheeshTS
RatheeshTS

Reputation: 419

how to create a graph from captured image of maze

enter image description hereHai I am developing a robot for shortest path finding. This system consists of the mobile robot, trajectory planner, motion controller, visual sensor (CCD camera), ZigBee wireless communication device and a maze terrain. The camera is used to capture images of the mobile robot within the maze. Developed image processing and analyzing algorithms determine the robot’s position and orientation based on color markers recognition.I am developing its software part in java.

My aim is to create a graph of conected nodes from captured image.And apply shortest path algorthom (BFS) to find the shortest path.In this black line indicates path and Red indicates conected nodes.

I have written a program to convert image to a matrix. marked white pixels as 0,black 1,red 2. My plan is to estimate the conecting nodes from this matrix. How i will be able to do that .? any alternative idea ? Please help me

enter image description here

Upvotes: 2

Views: 994

Answers (1)

Haroldo_OK
Haroldo_OK

Reputation: 7230

Well, basically, you would have to vectorize the image first; there's another post dicussing how to do this

Once the image is converted to vectors, it should be should be relatively less difficult to convert the vectors to a graph structure.

-- edit --

It just occurred to me that it won't be necessary to convert your matrix to a graph: The A* algorithm could be applied directly to the matrix.

Upvotes: 1

Related Questions