artificially intelligent algoritm
note, this might be a slow algoritm, but efficient for it purpose.
IF as you say there are only lines and arcs, start searching for connected pixels, store them for later use as positioned vectors. You can do this with nested loops. next run trough each vector and check if it can be "expanded" in both directions. Adjacent pixels could be included and by that tilting the vector, you should though decide how much tilt is allowed with respect to earlier pixels, take for instance the scalaproduct of an earlier vector and the current and set a reasonable lower rate. Let this run until all pixels are connected, you can clean up later by removing irrelevant vectors that are 2 or 3 pixels, that depends on what thickness of lines you have. For arcs, introduce a experimental eliptical equation instead of a positioned vector with the same kind of "expansion" technique you can build up arcs.