This paper describes an algorithm for detecting walls and openings in a maze from an image captured through a camera. The captured image is first transformed from 256 gray levels to a binary one, a procedure which extracts the edges of the walls of the maze. Using the bilinearly distorted image as a guide, a coordinate system is developed so that the pixel value of the critical points within the maze could be retrieved to determine whether the points represented a wall or an opening. The results are output in an array which gives the configuration of the maze as seen by the image algorithm developed. Given a well-thresholded image, the processing time is 38 seconds and the level of accuracy obtained is 86%.