Reputation: 8538
Suppose I have such bitmap from laser scanning with a red line from the laser on it, what would be the right way to find the center of that line? Either to store its coordinates in an array or to just draw a think line over it.
What approach would you suggest? Preferebly with an option to be able to smooth out that line.
(source: gyazo.com)
THanks
Upvotes: 3
Views: 3939
Reputation: 115
My suggestion is:
Upvotes: 1
Reputation: 26408
I would approach this with a worm. Have your worm start on one pixel and allow it to move along the line. Every time you detect a change in direction in any dimension you place a point. Then fit a spline through your points. Add the start and end locations as points too.
Important issues:
For fitting the spline itself have a look at Numerics on NuGet
Upvotes: 1
Reputation: 1420
I'd suggest to
However It is not the only possible approach, there are a lot of them
Upvotes: 4