Matrix of pixels to coordinates
<p>I have to convert a given matrix of pixels (coefficients are in a range from 0 to 255, since the matrix corresponds to a black and white image) into two lists. Both of them may be composed of lists, one containing the abscissas of the points, the other the ordinates.</p>

<p>As you can notice on the included picture, the first case corresponds to a single curve, whereas both the others involve multiple ones, crossing one each other. The algorithm should be able to make the difference between the two or three curves (in the two last examples), so in the two mainlists, a given sublist corresponds to a given curve.</p>

<p><a href="https://i.stack.imgur.com/X2zV6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/X2zV6.png" alt="Types of curves"></a></p>

<p>I have absolutely no idea of what to start from...</p>

<p>One last thing : I'm seeking <em>ideas</em> on how to program this algorithm, so this is why I didn't add any specific programming language (if code may help any explanation, feel free to speak any language).</p>

<p>Thanks in advance >^.^&lt;</p>