I need to separate lines from each other and make an array of coordinates for each graphic. The problem is (see the red circled section on the pic) some graphics overlap, and i don't know how to write a program that will find this overlaps and separate them. (Now we think that lines only touch each other not cross.)
@Rethunk i maked thinning and got this result. after thinning