# Adding dots to an empty region of space [closed]

I want to add dots to the maze so far I know only how to get one dot on the maze. I don't know if there is way without using coordinates.

So it would look like this with the dots added

(source: trelford.com)

## closed as unclear what you're asking by Mr.Wizard♦Mar 8 '17 at 13:21

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• This question seems to be too broad or unclear in isolation. Please include the context necessary to make sense of the question. – Mr.Wizard Dec 6 '16 at 1:58

I feel this answer is as sensible as the question.

First, binarise the image:

m = Import["maz1.jpg"]
bin = Opening[ColorNegate@Binarize[m], 6]


Find the biggest white space, and thin it into a skeleton

thin = Thinning[SelectComponents[bin, "Count", -1], Method -> "MedialAxis"]


I used "MedialAxis" here to make it squarer, at the cost of extra bits hanging off. But we'll trim those later.

Turn it into a graph:

g = MorphologicalGraph[thin, VertexSize -> 4, VertexStyle -> Yellow]


Extract the coordinates of the vertices:

vertices = VertexCoordinates /. AbsoluteOptions[g, VertexCoordinates];
vrules = Sort[Rule @@@ Transpose[{VertexList[g], vertices}]];


Pick out the edges that don't have a vertex of degree 1:

bad = Pick[VertexList[g], VertexDegree[g], 1];

dots = Union@Flatten[Module[{a = #1 /. vrules, b = #2 /. vrules, d},