I am developing an application which aids users to paint effectively. I have a C# code which runs a matlab script and gets the edge detected black and white image of a reference image. Now, I have developed the code which can allow the user to paint over the image. My task is to guide the user to paint over this image. Essentially, when the user is painting, my task is to see that the painting over the black and white edge detected image does not cross the edges. I should be able to detect that when the paint stroke has crossed over an edge, it should be cut off at that edge.
I wish to find out how to store the edges' information and check if the user has hit an edge. If someone could provide some guidelines regarding the same, it would be really helpful.
Thanks
EDITED: I have uploaded one reference image and its edge detected image. The painting is done on the edge detected image.