I have an image with a white background and black pixels which represent walls or boundaries. I want to know if there is a boundary between two points on the image.
The way I approached this was to find all integer points on the line between the two points of interest and check if any of these points were a black pixel. Here is what it looks like when I plot it (the blue circles show the two points of interest and the red dots are all the points passing through the line):
As you can see, it looks like the black line does not pass through one of the integer points that lie on the line between the points of interest. How do I find if a black line passes through a line between two points.
PS: I need to check this for a large number of pair of points and the image has many boundaries, so a time efficient algorithm would help.