Author Topic: Centerline Tracing  (Read 216 times)

Zax

  • T2Laser
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4415
    • View Profile
    • T2Laser
Centerline Tracing
« on: June 26, 2017, 10:04:06 AM »
The original Trace feature works great but is slow as you must select each line to trace.

Auto-Trace is a fast one-click solution but generates double lines.

Soon T2Laser will support Centerline Tracing which attempts to thin these lines.

You can see on the attached mandala that is can be quite effective. The bottom 3 images are zoomed in to show the detail, the first is the original raster, then the result from auto-trace and finally the new centerline trace.

Zax

  • T2Laser
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4415
    • View Profile
    • T2Laser
Re: Centerline Tracing
« Reply #1 on: June 26, 2017, 10:07:38 AM »
The Grbl logo.

ThothLoki

  • Hero Member
  • *****
  • Posts: 1053
  • Tinkerer
    • View Profile
Re: Centerline Tracing
« Reply #2 on: June 26, 2017, 10:19:05 AM »
That is awesome. I can't wait for the release.
Laser: A5 2000mw with L7 Board / A3 2500mw PWM with Mana SE -- All using T2Laser
3D Printer: Monoprice Maker Select v2
Image Resizer Applications (All OS): http://benboxlaser.us/index.php/topic,1434.msg17297.html#msg17297

Zax

  • T2Laser
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4415
    • View Profile
    • T2Laser
Re: Centerline Tracing
« Reply #3 on: June 26, 2017, 11:00:42 AM »
Here's one more... I am really happy with the results now.

nottingham82

  • Hero Member
  • *****
  • Posts: 1127
    • View Profile
Re: Centerline Tracing
« Reply #4 on: June 26, 2017, 11:33:57 AM »
might be particularly useful for eleksegg and eleksdraw users.
Laser: 2500mw A5 eleks maker
OS: Windows 10 all in one pc
Software: T2
http://www.gearbest.com/3d-printers-3d-printer-kits/pp_290386.html Paid $160 in 2016

Zax

  • T2Laser
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4415
    • View Profile
    • T2Laser
Re: Centerline Tracing
« Reply #5 on: June 26, 2017, 12:56:57 PM »
Yes. The EleksDraw was the main reason for adding it, but it can also be useful with raster-to-vector for cutting.

Stonemull

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Re: Centerline Tracing
« Reply #6 on: June 26, 2017, 06:25:01 PM »
Thats really impressive !
Is that an algorithm you came up with ? Are you that genius.
Trying to think of a method to do that, I have nothing simple, probably overthinking it.
A3 Eleksmaker 2500mW
Solidoodle V2 Pro
Hacked Roland DXY-880

bob2299

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Re: Centerline Tracing
« Reply #7 on: June 26, 2017, 06:49:16 PM »
I like your new centerline tracing feature.  I will likely put it to good use too.

When do you expect to release it?

Bob
-EleksMaker - A3 2500 MW Laser with Mana SE board
-Laser Air assist and a modified Hako smoke absorber
-InkScape, Qcad, BCL, & T2, My interest is marquetry/inlay
-I live in London, Ontario, Canada

Zax

  • T2Laser
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4415
    • View Profile
    • T2Laser
Re: Centerline Tracing
« Reply #8 on: June 26, 2017, 07:26:19 PM »
Is that an algorithm you came up with ?

No. I tried using various thinning algorithms before tracing but couldn't get results that were any better than autotrace. I'm using it as an external app under LGPL license. I only preprocess the image and import the result.

It's available in the latest beta if you have 64-bit, just PM me if you need the code.

Stonemull

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Re: Centerline Tracing
« Reply #9 on: June 27, 2017, 03:27:17 AM »
I am on a trusty old phenom hex core 64 bit, but all good, I can wait.
I am out in the shed woodworking atm, taking a break, I reckon I am half sawdust internally with a thin outer layer of glue now.

I was just curious how it did it. I reckon it would need to run a little line across the width of every section of the lines on the image and then keep just the centre point, or something entirely different, thats just a guess lol.
I guess you could also reduce the width of each line until it was no longer contiguous and back off, or it is probably some completely different non iterative math trickery.
Automated image processing sorta fascinates me but probably can't say what we used to work on due to it being rather secret.

A3 Eleksmaker 2500mW
Solidoodle V2 Pro
Hacked Roland DXY-880

Zax

  • T2Laser
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4415
    • View Profile
    • T2Laser
Re: Centerline Tracing
« Reply #10 on: June 27, 2017, 04:35:49 AM »
You described the techniques pretty well, either drawing a perpendicular line across segments and finding the center point or offsetting the lines until they intersect. The algorithms for thinning are well documented, and as with dithering there are plenty to choose from, personally I like the Zhang-Suen method.

Corel is still the best at this, and tracing in general with many options to get the results perfect but what I wanted was a quick option in T2Laser that worked for certain types of line drawings. I am very happy with the results although you can certainly get weird and useless results if the image doesn't fit my intended use, in that case you would need to use another method.

Stonemull

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Re: Centerline Tracing
« Reply #11 on: June 27, 2017, 07:17:49 AM »
Well finished my woodworking and threw a complete boo boo at the end I will pretend is deliberate except for a bunch of americans who will never tell, also strangely relevent to a centre line thread, cause I carefully made a template to drill holes for my drawer handles, drilled all the boards and had 2 fitted before I realised I either centred the handle on the template (which was different length than my drawers) or used it the wrong way around.
Either way, I will leave my handles off centre and if anyone asks, it was done to clear my office chair.

« Last Edit: June 27, 2017, 07:19:57 AM by Stonemull »
A3 Eleksmaker 2500mW
Solidoodle V2 Pro
Hacked Roland DXY-880

nottingham82

  • Hero Member
  • *****
  • Posts: 1127
    • View Profile
Re: Centerline Tracing
« Reply #12 on: June 27, 2017, 07:41:10 PM »
hahah that is funny.
Laser: 2500mw A5 eleks maker
OS: Windows 10 all in one pc
Software: T2
http://www.gearbest.com/3d-printers-3d-printer-kits/pp_290386.html Paid $160 in 2016