I'm finding it difficult to find an adaptive image thresholding technique for mazes that will return either a high or low value to make sure that all the paths are the same color.
So far I have tried a fixed threshold which obviously didn't work and otsu's method which return a value around the middle which meant that some pixels were not converted properly.
original image - https://i.stack.imgur.com/RwQld.jpg
otsu's method - https://i.stack.imgur.com/Q9Jh8.jpg
desired output - https://i.stack.imgur.com/6cmgR.jpg