Inkscape.org
Beginners' Questions centerline/autotrace from ball-point ink pen drawing
  1. #1
    Blues52 Blues52 @Blues52
    *

    Just starting to experiment with centerline/autotrace as built into the Linux app image beta version. I want to convert hand drawn lines from a ball-point pen into a single line. I expect centerline or autotrace to accomplish this.

     

    I have followed this general workflow :

    *load file - this was either a png or svg, either seemed to work.

    * Object -> Trace Bitmap -> select centerline or autotrace

    then I kind of select the ink drawing, move it out of the way, and delete it. A set of nodes is left behind. I think this is good.

    ... my results with the last step show the drawing, except the lines are on either edge of the main ink line. so it isn't a genuine centerline. I need to learn how to post images here, so in lieu of that, I'll try to use ASCII text to illustrate :

     

    ====== <-- original ball-point ink line

     

    ------------ <--- centerline trace on one side of "==="

    ------------ <-- centerline trace on other side of "==="

    note that "===" from the ink is, successfully, gone - a desired outcome.

    I am still experimenting with the settings, and using a search engine to look for pages/videos/etc. to help obtain the desired outcome - a single trace directly in the midpoint of the ball-point ink line stroke.

    ... in preparing a sample file to illustrate, I discovered that if the ink drawing is cropped small enough in, say, Gimp, the single line I am expecting indeed shows up. This leads to another question about, I suppose, how fine a resolution can be obtained. Perhaps I'll wait for that. In the meantime, I'll try to get a sample file up somehow...

     

    as an aside, but potentially helpful to aid experimentation - another problem is :

    * driving the system into swap (4 GB nominal DDR2 RAM) , sometimes unrecoverable even niced at 10

    Test Ball Point Pen Drawing 04Feb20A
    Test Ball Point Pen Drawing 04Feb20A
  2. #2
    brynn brynn @brynn
    *

    Welcome to the forum!

    Hhmm, when I use it with your attached raster image, it puts the path exactly in the middle.  Except there are a few glitches, where it draws some loops, probably because the quality of the image (is a bit fuzzy, and the edges are jagged).  But it's right down the middle for me.

    I used whatever it looks like the default options are.  Error Threshold 2.  Filter Iterations 4.  To be honest, I'm not sure what filter iterations means.  Or error threshold either, really.

    Can you show or tell what options you used?

    One thing you might try, is changing the stroke color to some contrasting color -- black or red or something.  I found it impossible to see when it made the path the same color blue as the image.  I have had the experience where the nodes look like they aren't centered on the path.  So if you could only see the nodes and not the path, it might not look right.  Or zooming in quite a lot could probably help as well.

    Edit

    Since the raster image has been removed from the SVG file that you attached, I can't really see the problem.

  3. #3
    Blues52 Blues52 @Blues52

    thanks brynn - I am doing my homework on this. I've worked on it in gimp to get rid of the background and keep only the pen line. This is a hasty update : FIrst : I can't use "multiple scans" without driving the system into swap, and fast. so I am using "single scan". so far it looks like my design has sharp angles that get vectorized into things that look like bubbles or droopy spider-webs. So I need to preserve sharp angles.

    "Optimize" will put more nodes in. I don't know if more nodes or less nodes is what I want for sharp angles... I guess more... perhaps there is a tradeoff. the latest settings I used from top to bottom - "Error threshold, ... Optimize"

    3.0, 20, 2, 0.50, 0.05

     

    ... I'll try to check back with interesting results.

  4. #4
    Blues52 Blues52 @Blues52

    I noticed some terminal output when running the trace :

     

    Warning: limit of 200 snap sources reached, some will be ignored

     

    ... also I noticed that I was running the filter iterations at high as it will go (20), smooth corners at the lowest (0.01) and highest Optimize (5.00).

     

    I'll try to get a good test file over here soon.

  5. #5
    brynn brynn @brynn
    *

    There's no centerline trace under Multiple Scans.  So you don't need to test with that.  Only Single Scan has the centerline trace.

    (Yes, I know it's confusing how this dialog calls 3 different things "autotrace".  Not to mention, all of it is autotracing.  I tried to get better language for that dialog, but....well, I tried.)

    Edit

    Maybe it's not too late to try again....

  6. #6
    Blues52 Blues52 @Blues52

    tit appears that the intended outcome - sharp angles in this image - remains challenging :

     

    https://en.wikipedia.org/wiki/Image_tracing

     

    ... if I find anything else hepful, I'll post it. But I think it is as simple as this : if inkscape can do it, it will - by variation of those parameters. and now I know the range to try. ... still I wonder, what explains the apparent limit of the number of nodes? perhaps more nodes will get the desired angles? perhaps a version compiled with a different setting, etc.?

  7. #7
    brynn brynn @brynn
    *

    I can sort of imagine the problem you're having.  But I don't know for sure.  I suspect it might be possible to process the raster signature image in a raster editor, so that it's sharper.  That might solve some of the problems.

    However, it is true that centerline trace often results in knots rather than sharp intersections.  That's kind of a drawback of the technology, as you seem to have realized.

    If the number of knots in the trace can be reduced enough, then you could manually fix them.  At least for a one time job.  If you wanted to do this a lot, then manually fixing the knots is probably not feasible.

    Edit

    I'm not sure about limiting the number of nodes.  I don't think the knots are about the number of nodes.  In a way, it really is 'what Inkscape sees is what you get'.

    Idea - I'm thinking it's more about color.  I might try using a raster editor to make the signature a solid color (if I knew how).

Inkscape Inkscape.org Inkscape Forum Beginners' Questions centerline/autotrace from ball-point ink pen drawing