I need to solve the maze by the image below.
Maze:

The walls of the labyrinth are attached by magnets to the holes on the table, located at a fixed distance from each other (50 mm, 100 mm and so on).
Eventually I want to get an array containing information about possible passages inside the maze.
I have a few ideas. The first one is to select the maze by color filtering, split the resulting picture with a fine grid (several times smaller than the width of the wall). The cell will have 1 if it is a passage and 0 if it is a wall.
The second idea is to break the picture with such a grid that each point on the grid is the center of the hole to which the wall is attached. This way you can go around each center and see if there is a wall between it and its neighbors. But I'm not sure I can find out the starting coordinates to plot the grid with enough accuracy.
I want to know if there are simpler and more reliable options to recognize a maze?